Skip to main content

prokodo auth

Manage your prokodo API key credentials.

prokodo auth <sub-command> [options]

Sub-commands

auth login

Store an API key in the credentials file at ~/.config/prokodo/credentials.json.

prokodo auth login --key <key>

Options

FlagTypeDescription
--key <key>stringAPI key to store. Omit to enter interactively (TTY only).

Behaviour

  1. Validates the key shape (β‰₯ 8 characters, no < or > placeholders)
  2. Performs a non-destructive health check against the API to confirm the key is accepted
  3. Writes ~/.config/prokodo/credentials.json with 0600 permissions
  4. Prints the masked key hint on success

Examples

prokodo auth login --key pk_live_abc123xyz789
# JSON mode β€” useful for scripted provisioning
prokodo auth login --key pk_live_abc123xyz789 --json
# β†’ { "authenticated": true, "keyHint": "β€’β€’β€’β€’β€’β€’β€’β€’xyz789" }

Exit codes

CodeCause
0Key stored successfully
2No key provided in non-interactive mode
2Key fails shape validation
1API rejected the key
note

When stdin is not a TTY (CI, Docker, pipe), the --key flag is required. The CLI will exit 2 with an explanatory message if it is omitted.


auth logout

Remove the stored credentials file.

prokodo auth logout

Behaviour

  • Deletes ~/.config/prokodo/credentials.json if it exists
  • Exits 0 whether credentials existed or not (idempotent)
  • Reports whether credentials were actually removed

Examples

prokodo auth logout
# Text: βœ“ Credentials removed. OR β„Ή No credentials were stored.
prokodo auth logout --json
# β†’ { "loggedOut": true } OR { "loggedOut": false }

auth whoami

Show the currently active API key (masked β€” last 4 characters visible) and its source.

prokodo auth whoami

Priority chain (highest to lowest):

  1. --api-key CLI flag
  2. PROKODO_API_KEY environment variable
  3. ~/.config/prokodo/credentials.json

If none are found, exits 2 with instructions.

Examples

prokodo auth whoami
# API key: β€’β€’β€’β€’β€’β€’β€’β€’xyz789
# Source: credentials file
PROKODO_API_KEY=pk_live_test prokodo auth whoami --json
# β†’ { "keyHint": "β€’β€’β€’β€’test" }

Credentials file location

PlatformPath
macOS / Linux~/.config/prokodo/credentials.json
Windows%APPDATA%\prokodo\credentials.json

The file is created with 0600 permissions on POSIX systems. A warning is printed on startup if permissions are more permissive.