Skip to main content
The CLI supports two authentication methods. Browser login (default) opens your browser for a secure OAuth sign-in. API tokens are available for headless environments like CI/CD pipelines.

Browser Login (Default)

royaltyport login
This opens your browser where you sign in to Royaltyport and approve access. The CLI receives tokens automatically and stores them locally. No token to copy or paste. Tokens are refreshed automatically — you stay logged in until you explicitly log out.

API Token Login

For CI/CD, automation, or environments without a browser, pass an API token directly:
royaltyport login --token rp_your_token_here
Tokens are created in Organizations > Settings > Tokens. See Authentication for details.
OptionShortDescription
--token <token>-tAPI token (skips browser login)

Piped / Non-Interactive Login

When stdin is not a terminal (e.g., inside a Docker container or piped from another command), the CLI cannot open a browser. It will prompt for an API token via stdin instead:
echo "rp_your_token_here" | royaltyport login
This is useful in containerized environments or scripts where neither --token nor environment variables are practical.

Custom API URL

Point the CLI at a different API endpoint:
royaltyport login --api-url https://your-api-url.com
OptionDescription
--api-url <url>Custom API base URL (default: https://api.royaltyport.com)

Environment Variables

For CI/CD pipelines and automation, set environment variables instead of running login:
VariableDescription
ROYALTYPORT_TOKENAPI token — overrides stored credentials
ROYALTYPORT_API_URLCustom API base URL (default: https://api.royaltyport.com)
Environment variables always take priority over stored configuration.

Example

export ROYALTYPORT_TOKEN=rp_your_token_here
royaltyport projects

Auth Resolution Order

The CLI resolves credentials in this order:
  1. ROYALTYPORT_TOKEN environment variable (highest priority)
  2. OAuth access token (from browser login, auto-refreshed)
  3. Stored API token in ~/.config/royaltyport/config.json
The API URL is resolved similarly:
  1. ROYALTYPORT_API_URL environment variable
  2. Stored apiUrl in config
  3. Default: https://api.royaltyport.com

Logout

Clear all stored credentials and configuration:
royaltyport logout
This removes the config file at ~/.config/royaltyport/config.json. Environment variables are not affected.