CLI authentication

Login via browser OAuth or set an API key directly.

Interactive: jaina login

jaina login

Opens your browser to https://jaina.dev/auth/cli for OAuth. After authorization, the CLI receives a token and stores it at ~/.jaina/config.json.

jaina whoami

Prints the current user.

Non-interactive (CI): JAINA_API_KEY

For CI/CD, skip the OAuth flow:

export JAINA_API_KEY=jn_live_...
jaina projects list

The env var takes precedence over the stored config.

Logout

jaina logout

Removes ~/.jaina/config.json. The token itself stays valid on the server until you revoke it from /settings/tokens.

Revoking a token

If a token is compromised, revoke it at /settings/tokens. Revoked tokens immediately fail with 401 Unauthorized.

Multiple accounts

The CLI supports one logged-in user at a time. To switch:

jaina logout
jaina login   # log in as a different user

Or use env vars to route per-command:

JAINA_API_KEY=jn_live_user_a... jaina projects list
JAINA_API_KEY=jn_live_user_b... jaina projects list