The Compartment CLI stores a session token locally after you log in. You only need to authenticate once per instance — subsequent commands reuse the saved session automatically. This page covers every authentication command, from first login through account activation and organization switching.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.
Log in
Usecompartment login to authenticate against a Compartment instance. Provide the API URL and your email address as flags; the CLI prompts you for your password interactively and saves the session token to your local config.
Your password is never passed as a flag. The CLI always prompts for it interactively so it does not appear in your shell history.
Login options
| Option | Description |
|---|---|
--api-url <url> | The base URL of your Compartment instance. |
--email <email> | Your account email address. |
--output <format> | Output format: text (default) or json. |
Log out
Usecompartment logout to end your session and remove the saved token from your local config.
Check your identity
Usecompartment whoami to confirm which account and organization your current session belongs to, and which API URL it is authenticated against.
--output json to get a structured response useful for scripting:
Switch organizations
If your account belongs to more than one organization, usecompartment org use to change the active organization context for your local session.
Activate an invited account
When you are invited to a Compartment instance, you receive a bootstrap token. Usecompartment activate to set your password and create your session in one step.
Run the activate command
Provide the API URL, your email, and the bootstrap token. The CLI prompts you to set a new password.
Set your password
The CLI prompts you to enter and confirm a password. This becomes your login credential going forward.
Activate options
| Option | Description |
|---|---|
--api-url <url> | The base URL of your Compartment instance. |
--email <email> | Your account email address. |
--token <token> | The bootstrap token from your invitation. |
--output <format> | Output format: text (default) or json. |
Auth settings
Usecompartment auth settings to view or update the authentication configuration for your current organization. This includes whether password-based login is enabled.
Session storage
The CLI stores your session in a local config file on your machine. No credentials are stored in your project directory or incompartment.yml. If you need to authenticate in a non-interactive environment such as CI, pass all required flags directly and pipe the password using your CI secret management tooling.