Skip to content
Raw Markdown

Install and configure the CLI

The CLI is the bridge between a repository checkout and Cassis. Use it to pull context files, keep them consistent, test changes, and publish from CI.

Install

The CLI requires Python 3.10 or newer.

python -m pip install "cassis-cli~=3.1"
cassis version

~=3.1 takes every 3.x release from 3.1 on, but never 4.0: a change that breaks validation or publishing comes with a new major version, so it reaches CI only through a reviewed repository change. To review every upgrade, pin an exact version instead, such as cassis-cli==3.1.0.

Authenticate

On your own machine, sign in through your browser. Pipelines and other automation use an API key.

Sign in with your browser

cassis login
cassis auth status
cassis projects list

cassis login opens your browser and prints a verification URL and a short code. Sign in with your Cassis account, enter the code, and approve CLI access. Approve only a code from a login you started. The CLI then acts with your current role, organization, and domain permissions; signing in grants nothing more. It needs cassis-cli 3.7 or newer.

Remote terminals
In a container, over SSH, or in a coding agent’s terminal, run cassis login --no-browser and open the printed URL on your own computer. A coding agent can start the login and show you the URL and code; you complete the sign-in yourself. Never paste a password or token into the agent chat. A code expires after 10 minutes.
Where the login is saved
In the operating system’s credential store: macOS Keychain, Windows Credential Locker, or an unlocked Linux Secret Service or KWallet session. Never in your repository or in a plain file. An environment without a usable store cannot sign in this way: set one up, or use an API key there.
Check and sign out
cassis auth status shows the account, organization, role, and server in use, and whether the credential is a saved login or an API key. cassis logout revokes the saved login and removes it. See Sign-in commands.

Use an API key for CI and automation

Create an API key from API keys in your Cassis account menu (admins: Settings → API keys), then store it in your shell or CI secret store as CASSIS_API_KEY. Never commit the key. For a pipeline, scope the key to the one project it works on.

export CASSIS_API_KEY="$(python -c 'import getpass; print(getpass.getpass("Cassis API key: "))')"
cassis projects list

Run the CLI in this environment. A coding agent launched elsewhere does not inherit the variable; configure its secret environment separately, without pasting the key into chat.

A key always takes precedence over a saved login: --api-key, then CASSIS_API_KEY, then the saved login. A rejected key never falls back to the saved login. Commands and CI jobs never start a login or open a browser on their own.

Most commands learn the project ID from cassis/project.yml after the first pull. Until then, pass --project <project-id> or set CASSIS_PROJECT_ID.

What you use it for

Pull
cassis context pull puts the current context in your checkout.
Format and validate
cassis context fmt keeps files canonical; cassis context check catches invalid or unsafe changes.
Test
cassis context test tries a question against local changes; cassis eval run runs the project’s regression suite.
Publish
cassis context upload publishes the full tree. Use it from the default-branch pipeline when the GitHub App is not handling imports. From cassis-cli 3.0.0 it runs only from a git checkout with the context files committed, and the published version records that commit.

The modeling guide

cassis context pull and cassis context fmt generate cassis/AGENTS.md. This is the context design guide: the instructions people and coding agents follow to structure the context consistently and make good modeling decisions.

It matters because valid YAML is not necessarily useful context. The guide explains how to write domains, descriptions, metrics, joins, and provenance so agents can answer business questions reliably. Commit it with the context files so everyone works from the same rules.

The file is managed by the CLI. Do not edit it by hand; upgrade the pinned CLI and run cassis context fmt when you want the current guide.

Commands that validate, test, or publish send the context tree to the Cassis API. pull and fmt can change files inside that tree, so review the resulting git diff.

For every flag, output format, and exit code, use the CLI reference.