Skip to main content

Introduction

The Phobos CLI is a command-line tool for interacting with Phobos. It allows you to create and manage pipelines, projects, releases, and much more.

For installation instructions, see the CLI setup guide.

Have a question?

Check the FAQ to see if there's already an answer.

Authentication

The CLI supports two authentication methods:

  1. Single Sign-On (SSO) — for human users
  2. Environment variables — for CI/CD and automation

Single Sign-On (SSO)

SSO authentication is meant to be used by human users. When using SSO, the CLI:

  1. Temporarily opens a web browser session.
  2. Gets a token from the configured sign-in provider via a callback server.
  3. Stores the token in a credentials file.
  4. Uses the token to authenticate against the Phobos API for every request.
phobos sso login
note

The token must be periodically renewed via the SSO process. If a token expires mid-run, you can run phobos sso login in another terminal and the CLI will automatically pick up the new token.

Environment Variables

Environment variables are meant to be used for CI/CD pipelines and other automated processes. They take precedence over SSO authentication.

Service Account

Service accounts are used for Machine to Machine (M2M) authentication like CI/CD pipelines.

NameDescription
PHOBOS_SERVICE_ACCOUNT_IDThe ID of the service account within Phobos.
PHOBOS_SERVICE_ACCOUNT_TOKENThe token to be used for authentication.

Static Token

A static token is a user or service account token that will be used to directly authenticate with the API.

NameDescription
PHOBOS_STATIC_TOKENThe token to be used for authentication.

Profiles

The CLI includes a profile system making it possible to easily switch between different Phobos instances. Each profile stores an endpoint URL and optional settings like TLS skip verify.

Profiles are stored under ~/.phobos/settings.json. Credentials are stored separately in ~/.phobos/credentials.json so they can have stricter permissions.

The profile can be specified using the -p global flag or the PHOBOS_PROFILE environment variable. For example:

phobos -p staging organization list

Frequently Asked Questions (FAQ)

How do I get JSON output from commands?

Most commands support a -json flag that outputs results in JSON format, useful for scripting and automation.

How do I use the CLI in a CI/CD pipeline?

Set the PHOBOS_SERVICE_ACCOUNT_ID and PHOBOS_SERVICE_ACCOUNT_TOKEN environment variables. The CLI will automatically use these credentials instead of SSO. See environment variables for details.

Where are my settings and credentials stored?

Settings are stored in ~/.phobos/settings.json and credentials in ~/.phobos/credentials.json. The credentials file is kept separate so it can have stricter file permissions.

How do I check which user or service account I'm authenticated as?

phobos caller-identity