Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.compartment.dev/llms.txt

Use this file to discover all available pages before exploring further.

The compartment CLI is the primary way to interact with a Compartment deployment. You use it to install the platform, authenticate, deploy projects, manage environments, inspect running services, and administer your organization — all from a single binary.

Installation

You can install the CLI in two ways.
# The CLI is installed automatically when you run the platform installer
compartment install
The CLI requires Node.js 20 or later.
If you are setting up a new server, run compartment install first. It installs the platform and the CLI together. Install the CLI separately only when you need it on a machine that already has a running Compartment instance to connect to.

Global options

Every command accepts the following options.
OptionValuesDescription
--outputtext, jsonOutput format. Defaults to text.
--helpPrint help for the command or subcommand.

JSON output mode

Pass --output json to any command to receive machine-readable output. This is useful in CI/CD pipelines, shell scripts, or any tooling that needs to parse command results.
compartment whoami --output json
compartment status --output json
compartment deploy --output json

Command groups

Run compartment --help to see all top-level commands.
Usage: compartment [options] [command]

Options:
  --help           display help for command

Commands:
  activate         Activate a new account using a bootstrap token
  auth             Authentication configuration
  deploy           Deploy the current project
  descriptor       Manage compartment.yml descriptors
  init             Initialize a new project
  inspect          Inspect a running environment
  install          Install the Compartment platform
  logs             Stream logs for a running environment
  login            Log in to a Compartment instance
  logout           Log out and clear the local session
  organization     Manage organizations
  project          Manage projects
  promote          Promote a deployment to another environment
  role             Manage roles and access control
  rollback         Roll back to a previous deployment
  sso              Configure single sign-on
  status           Show deployment status
  system           Manage system-level settings
  user             Manage users
  variable         Manage environment variables
  whoami           Show the current authenticated identity
Subcommands are organized into groups. Run compartment <command> --help to see the subcommands and options available within each group. For example, compartment variable --help lists all variable subcommands.

Command reference

Authentication

Log in, log out, switch organizations, and activate new accounts.

deploy

Build and deploy the current project from your working directory.

status

Check the deployment status of your project’s environments.

logs

Stream or tail logs for a running service environment.

inspect

Inspect the runtime state of a deployed service.

variable

Get, set, and import environment variables for your services.

promote

Promote a deployment from one environment to another.

rollback

Roll back a service to a previous successful deployment.