Mass CLI Overview
mass is the Massdriver command line interface. Use it to build and publish bundles, manage projects, environments, and instances, and run deployments.
Installation​
Homebrew​
brew install massdriver
Installing a specific version
- Find the version in the homebrew-core history for the formula.
- Copy the hash of the
massdriver: update x.y.z bottlecommit. - Uninstall any installed version with
brew uninstall massdriver, then install from that commit:
curl -L https://raw.githubusercontent.com/Homebrew/homebrew-core/<commit-hash>/Formula/m/massdriver.rb > massdriver.rb && brew install massdriver.rb
To keep Homebrew from upgrading it:
brew pin massdriver
Manual installation​
Download the archive for your OS and architecture from the releases page, for example mass-<version>-darwin-arm64.tar.gz. Extract mass and move it to a directory on your $PATH, such as /usr/local/bin.
On macOS, the first run of a downloaded binary is blocked. Allow it under System Settings → Privacy & Security with Open Anyway, then run mass again.
Configuration​
mass needs:
- Organization ID: the short identifier of your organization (for example
acme, not a UUID). - API key: a personal access token or a service account token.
- URL (self-hosted only): your Massdriver API endpoint. Defaults to
https://api.massdriver.cloud.
Find your organization ID​
The organization ID is the path segment after /orgs/ in any Massdriver URL. https://app.massdriver.cloud/orgs/sandbox/projects belongs to the sandbox organization.
Create a personal access token​
- Open Access tokens in your account settings.
- Click New token.
- Choose the Organization, then enter a name and expiration. The expiration defaults to 60 minutes and can be at most one year.
- Click Create token and copy the token. It is shown once.
Create a service account​
Use a service account for automation that should not act as a person.
- Open Service accounts in your organization settings.
- Click New service account.
- Enter a name, then click Create.
- Copy the secret. It is shown once.
Add the service account to a group to give it access.
Environment variables​
| Variable | Description |
|---|---|
MASSDRIVER_ORGANIZATION_ID | Organization ID. MASSDRIVER_ORG_ID is also accepted. |
MASSDRIVER_API_KEY | API key |
MASSDRIVER_URL | API endpoint, for self-hosted installs |
MASSDRIVER_PROFILE | Profile to use from the config file |
MASSDRIVER_TEMPLATES_PATH | Directory of bundle templates for mass bundle new |
Config file​
The config file is $XDG_CONFIG_HOME/massdriver/config.yaml, or ~/.config/massdriver/config.yaml when XDG_CONFIG_HOME is not set. mass config path prints the location.
version: 1
current_profile: default
profiles:
default:
organization_id: acme
api_key: your-api-key
sandbox:
organization_id: acme-sandbox
api_key: sandbox-api-key
self-hosted:
organization_id: internal
api_key: internal-api-key
url: https://api.massdriver.yourdomain.com
templates_path: ./massdriver-catalog/templates
templates_path points mass bundle new at a directory of bundle templates, such as the templates in the Massdriver Catalog.
Manage profiles with mass config:
| Command | Action |
|---|---|
mass config add <profile> --org <id> --api-key <key> [--url <url>] [--templates-path <dir>] [--use] | Add a profile. The credentials are checked against the API unless you pass --no-verify. |
mass config set <profile> [--org] [--api-key] [--url] [--templates-path] | Change settings on a profile |
mass config use <profile> | Set current_profile |
mass config list | List profiles, with API keys masked |
mass config get [profile] | Show one profile. Defaults to the active profile. |
mass config remove <profile> | Delete a profile |
mass config path | Print the config file location |
Resolution order​
The active profile is the first of:
- The
--profileflag MASSDRIVER_PROFILEcurrent_profilein the config file- The
defaultprofile
A profile named by any of the first three must exist, or the command fails.
Each value comes from its environment variable when set, otherwise from the active profile.
Commands​
See mass for every command.