CLI
Demeter provides multiple ways to manage and interact with your projects. One of
those is dmtrctl
(or dmtr
for short), a command-line utility that lets you
interact with the Demeter platform from your local terminal.
Installation
You'll want to install the version that's appropriate for your operating system. If you're using Mac or Linux, the easiest way to get started is our automated install script that can be triggered using the following snippet:
curl -L https://demeter.run/install/dmtrctl.sh | sh
If everything worked correctly, you'll be able to run dmtr
in your terminal.
You might need to restart your terminal in order for the command to appear in PATH.
The official name for the CLI is dmtrctl
but to avoid typing so many
characters, the installation creates an alias called dmtr
. Throughout the
docs will be using the alias as the default way of accessing the CLI.
You can also download the precompmiled binaries from ourg Github release (opens in a new tab) page.
Configuration
The CLI needs to know which project to use when executing a command. It also requires an API-Key as authentication method. We call this information the "context".
To configure a new context, run the init
command and follow the steps provided
by the CLI to store the required values in the local configuration. Alternatively, required
values can be retrieved from the Console (Web UI).
Command Hierarchy
The CLI is organized by a hierarchy of sub-commands. Each commands might also
contains nested sub-commands. Each command provides quick usage instructions by
using the --help
flag (such as dmtr <SUBCOMMAND> --help
)
Advanced Configuration
dmtrcl
uses a configuration file located within the root dir of the
installation to store the context information. The default location for Mac and
Linux users is ~/.dmtr/config.toml
but this can be changed by specifying a
different root dir.
To know in which context to execute a command, dmtrctl
uses decision steps in
the following order:
- if the
--context
option was specified, use this value - if
DMTR_CONTEXT
env variables was specified, use this value - if there's a default context defined in the configuration, use that value
The location of the root dir can be changed by using the --root-dir
option
or the DMTR_ROOT_DIR
env var.