Home

Awesome

Directus Template CLI

A CLI tool to make applying or extracting Directus "templates" a little easier...well a lot easier.

Notes:

Breaking Changes in v0.4.0

Usage

Using the @latest tag ensures you're receiving the latest version of the packaged templates with the CLI. You can review the specific versions on NPM and use @{version} syntax to apply the templates included with that version.

Applying a Template

  1. Create a Directus instance on Directus Cloud or using self-hosted version.
  2. Login and create a Static Access Token for the admin user.
  3. Copy the static token and your Directus URL.
  4. Run the following command on the terminal and follow the prompts.
$ npx directus-template-cli@latest apply

You can choose from our templates bundled with the CLI or you can also choose a template from a local directory.

Extracting a Template

The CLI can also extract a template from a Directus instance so that it can be applied to other instances.

  1. Make sure you remove any sensitive data from the Directus instance you don't want to include in the template.
  2. Login and create a Static Access Token for the admin user.
  3. Copy the static token and your Directus URL.
  4. Run the following command on the terminal and follow the prompts.
$ npx directus-template-cli@latest extract

License

This tool is licensed under the MIT License.