CLI
Demeter provides multiple ways to manage and interact with your projects. One of
those is dmtrctl
, a command-line utility that lets you
interact with the Demeter platform from your local terminal.
Installation
You can use Homebrew to install the latest version of Demeter CLI in Mac (both x86 / ARM64)
brew install demeter-run/tap/dmtrctl
If everything worked correctly, you'll be able to run dmtrctl
in your terminal.
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:
dmtrctl init
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 dmtrctl <SUBCOMMAND> --help
)
Advanced Configuration
dmtrctl
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.