Skip to main content

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​

shell
brew install massdriver
Installing a specific version
  1. Find the version in the homebrew-core history for the formula.
  2. Copy the hash of the massdriver: update x.y.z bottle commit.
  3. Uninstall any installed version with brew uninstall massdriver, then install from that commit:
shell
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:

shell
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.

note

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​

  1. Open Access tokens in your account settings.
  2. Click New token.
  3. Choose the Organization, then enter a name and expiration. The expiration defaults to 60 minutes and can be at most one year.
  4. 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.

  1. Open Service accounts in your organization settings.
  2. Click New service account.
  3. Enter a name, then click Create.
  4. Copy the secret. It is shown once.

Add the service account to a group to give it access.

Environment variables​

VariableDescription
MASSDRIVER_ORGANIZATION_IDOrganization ID. MASSDRIVER_ORG_ID is also accepted.
MASSDRIVER_API_KEYAPI key
MASSDRIVER_URLAPI endpoint, for self-hosted installs
MASSDRIVER_PROFILEProfile to use from the config file
MASSDRIVER_TEMPLATES_PATHDirectory 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.

yaml
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:

CommandAction
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 listList 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 pathPrint the config file location

Resolution order​

The active profile is the first of:

  1. The --profile flag
  2. MASSDRIVER_PROFILE
  3. current_profile in the config file
  4. The default profile

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.