Modzy Enterprise CLI
Modzy's Command Line Interface
Modzy's CLI provides terminal commands for some of our most useful API endpoints. Modzy's CLI is designed primarily for operations teams to monitor instance health, check on inference statuses, or to quickly query important operational information. As a result, not all of Modzy's API endpoints are available via the CLI.
Installation
Homebrew
To install the CLI via Homebrew, first tap the Modzy tap:
brew tap modzy/tap
Afterwards, you can install the CLI using brew:
brew install modzy-cli
Using Go
As a prerequisite for installing the Modzy CLI, you must install have golang installed. Download and install golang here: https://golang.org/doc/install
Once you've successfully installed golang, open your terminal and run the following command
$ go get -u github.com/modzy/cli/modzy
Available Commands
Command | Description |
---|---|
$ modzy alerts | List all alerts |
$ modzy completion | Generate the autocompletion script for the specified shell |
$ modzy help | Help about any command |
$ modzy jobs | Work with inference/prediction jobs |
$ modzy models | Work with models |
$ modzy projects | Work with projects |
$ modzy status | Returns top level dashboard information for your account |
$ modzy whoami | Summarize effective authentication information |
Global Flags
These flags can be used with most modzy cli commands for things like in-line authentication, access to command-specific manuals, etc.
Flag | Type | Description |
---|---|---|
--api-key | string | Modzy API key to use for authentication |
--base-url | string | Modzy API base URL |
-h , --help | Help with Modzy CLI | |
-p , --profile | string | Profile which can be added to $HOME/.modzy/{profile} (default "default") |
--team-id | string | Modzy API team ID to use for team authentication |
--team-token | string | Modzy API team token to use for team authentication |
-v , --verbose | Enable more verbose log output for debugging purposes | |
--verbose-http | Enable log output of http request and response data |
Authentication
You can provide your authentication token through any mixture of command flags,
ENV variables, or configuration files. Precedence is command flag > ENV > configuration file.
In all three examples below, you will need to replace placeholder values with valid inputs.
Replace BASE_URL
with the URL of your instance of Modzy, such as https://trial.app.modzy.com
Replace API_KEY
with a valid API key string Here's how to download an API Key from Modzy
Optionally, replace TEAM_ID
with the ID for the Modzy team you'd like to access
Optionally, replace TEAM_TOKEN
with a valid API key string
Via Command Flags
To authenticate using command flags, you'll need to include --base-url flag
with each command. You'll also need to include either the --api-key
flag, or both the --team-id
and --team-token
flags.
$ modzy [command] --base-url BASE_URL {--api-key API_KEY | --team-id TEAM_ID --team-token TEAM_TOKEN}
Via ENV Variables
Set the following ENV variables
MODZYBASE_URL=**BASE_URL
MODZY_API_KEY=API_KEY
MODZY_TEAM_ID=TEAM_ID
MODZY_TEAM_TOKEN=TEAM_TOKEN
_**
Via Configuration File
To use a configuration file, create a yaml file at any of these locations:
/etc/modzy/{profile}.yaml
$HOME/.modzy/{profile}.yaml
The default profile is called "default".
The yaml file you create should look something like this.
> cat ~/.modzy/default.yaml
base-url: BASE_URL
# use an api key:
api-key: API_KEY
# or use a team key:
team-id: TEAM_ID
team-token: TEAM_TOKEN
Updated about 1 year ago