Skip to main content
The CLI uses an API key for authenticated commands. You can save it once with youka login, or provide it through YOUKA_API_KEY in CI and other non-interactive environments. youka login verifies the key against the API before saving it, then caches the resolved account email in ~/.youka/config.json for diagnostics.

login

Save an API key to ~/.youka/config.json.
youka login [token]
token
string
The API key copied from the Youka dashboard. If omitted, the CLI prompts for it on an interactive terminal.

Examples

youka login yk_live_abcd1234
In CI, prefer YOUKA_API_KEY instead of writing a config file.

logout

Remove the saved API key from ~/.youka/config.json.
youka logout
youka logout --json

whoami

Inspect the resolved key source, API URL, and account identity.
youka whoami
youka whoami --json
Example response:
{
  "ok": true,
  "data": {
    "authenticated": true,
    "tokenPresent": true,
    "authStatus": "verified",
    "identitySource": "live",
    "keySource": "config",
    "apiUrl": "https://api.youka.io/api/v1",
    "apiUrlSource": "default",
    "email": "user@example.com",
    "userId": "user_123",
    "apiKeyId": "key_123",
    "org": null,
    "configPath": "/Users/you/.youka/config.json",
    "apiKeyPreview": "yk_l...1234"
  }
}

Resolution order

FieldOrder
API keyYOUKA_API_KEY, then ~/.youka/config.json
API URL--api, then YOUKA_API_BASE_URL, then ~/.youka/config.json, then default
When a saved config key is active, whoami verifies identity with the API and falls back to the cached account email only if the live lookup is unavailable. It does not use cached config identity for YOUKA_API_KEY tokens.

What’s next