Skip to content

CLI Authentication

The Roster CLI supports two authentication modes:

  • OAuth browser login for humans
  • API-key bearer auth for automation, CI, and agents

The CLI is MCP-first. Both auth modes authenticate requests to the Roster MCP endpoint.

Use browser login for human terminal sessions:

Terminal window
roster login https://roster.example.com/mcp --name prod
roster auth status
roster resolve "Who should approve the Helios renewal?"

roster login starts a loopback OAuth callback listener, opens the browser unless --no-open is set, uses PKCE, exchanges the authorization code, stores the OAuth profile, and selects it as the current profile.

An OAuth profile stores:

  • MCP endpoint URL
  • OAuth client information
  • granted scopes
  • access token and refresh token
  • optional profile alias

API keys are not stored in OAuth profiles.

Profile storage defaults to:

~/.roster/config.json

Override it with either ROSTER_HOME or --config-dir:

Terminal window
ROSTER_HOME=/secure/roster-home roster auth profiles
roster --config-dir /secure/roster-home auth profiles

Use --profile when you want a specific saved OAuth profile for one command:

Terminal window
roster --profile prod projects list --limit 3

Use roster auth use when you want to make a profile the default:

Terminal window
roster auth use prod
roster projects list --limit 3
roster resolve "Who should approve the Helios renewal?"

Profile selectors can be aliases, MCP URLs, or profile keys.

The CLI resolves the MCP endpoint and credentials separately.

MCP endpoint selection precedence is:

  1. --mcp-url
  2. ROSTER_MCP_URL
  3. The MCP URL stored on the --profile profile or selected OAuth profile

Credential selection precedence is:

  1. --api-key
  2. ROSTER_API_KEY
  3. OAuth tokens from the matching saved profile

If --api-key or ROSTER_API_KEY is present, the CLI uses bearer auth instead of OAuth profile tokens.

Use --profile to select a saved OAuth profile. When no explicit MCP URL is provided, that profile also supplies the MCP endpoint URL.

roster login uses --scope-preset resolve by default.

PresetScopes
resolveopenid profile email offline_access mcp:resolve mcp:resolve-requests:read mcp:projects:read mcp:participants:read
readresolve plus mcp:labels:read mcp:delegations:read
manageall supported MCP read and write scopes

Add custom scopes with --scope:

Terminal window
roster login https://roster.example.com/mcp \
--scope-preset read \
--scope mcp:custom:read

Use read when you need list and get commands across read-only Roster MCP tools. Use manage only when the profile should create, update, or delete Roster resources.

Check the current auth source:

Terminal window
roster auth status
roster --profile prod auth status

List saved OAuth profiles:

Terminal window
roster auth profiles

Remove only OAuth tokens from a profile:

Terminal window
roster auth logout
roster auth logout prod

Delete the whole profile and any aliases that point to it:

Terminal window
roster auth logout prod --remove

Manage aliases:

Terminal window
roster auth alias set production prod
roster auth alias rm production

Aliases must start with a letter or number and may contain letters, numbers, dots, underscores, or dashes. They cannot be URLs.

Use API keys for CI, automation scripts, and agents that should not launch a browser:

Terminal window
ROSTER_API_KEY=rst_... roster --mcp-url https://roster.example.com/mcp \
resolve "Who should approve the Helios renewal?"

Or pass the key explicitly:

Terminal window
roster --mcp-url https://roster.example.com/mcp \
--api-key rst_... \
projects list --json

API keys are never persisted by the CLI.

Agents should prefer API-key auth, --non-interactive, and --json:

Terminal window
ROSTER_API_KEY=rst_... roster \
--mcp-url https://roster.example.com/mcp \
--non-interactive \
--json \
call list_projects limit=10

All JSON emitted by the CLI uses snake_case keys, including wrapper keys such as mcp_url, structured_content, error_code, and request_id.