CLI Authentication
Authenticate the RevKeen CLI with OAuth login or an API key, and target staging
The RevKeen CLI supports two authentication modes — an interactive OAuth login
for humans, and API keys for scripts and CI. Credentials are stored in
~/.revkeen/config.toml.
Credential precedence
The CLI resolves a key in this order:
--api-keyflag (for a single invocation)REVKEEN_API_KEYenvironment variable- API key stored in
~/.revkeen/config.toml - OAuth access token from
revkeen auth login
Option 1 — OAuth login (recommended for humans)
revkeen auth loginThis runs an OAuth device flow: the CLI prints a verification URL and code, you
approve it in the browser, and the resulting tokens are saved to
~/.revkeen/config.toml. Check status anytime:
revkeen auth status
revkeen auth logout # clears stored credentialsOption 2 — API key (recommended for scripts & CI)
API keys start with rk_live_ (production) or rk_sandbox_ (staging). Store one
in the config file, or pass it via environment variable.
revkeen config set api-key rk_live_your_api_key
revkeen customers listexport REVKEEN_API_KEY=rk_live_your_api_key
revkeen customers listrevkeen customers list --api-key rk_live_your_api_keyOn Windows PowerShell, set the environment variable with:
$env:REVKEEN_API_KEY = "rk_live_your_api_key"Targeting staging
The CLI defaults to production (https://api.revkeen.com). Point it at another
environment via config:
# Convenience: switch to the staging base URL
revkeen config set environment staging
# Or set an explicit base URL
revkeen config set base-url https://staging-api.revkeen.comUse a rk_sandbox_* key with staging:
revkeen config set environment staging
revkeen config set api-key rk_sandbox_your_api_key
revkeen invoices listCI usage
Provide the API key as a secret-backed environment variable:
- name: List invoices
env:
REVKEEN_API_KEY: ${{ secrets.REVKEEN_API_KEY }}
run: revkeen invoices list --jsonSecurity guidance
- Use sandbox keys for development; reserve live keys for production operations.
- Prefer environment variables or a secret manager over copy-paste on shared machines.
~/.revkeen/config.tomlis written with owner-only permissions — keep it that way.- Rotate keys regularly from the RevKeen dashboard and avoid echoing them into logs or shell history.