auth Command
The CLI authenticates with API keys. Each key belongs to one organization, so the CLI stores one key per organization in credentials.json in its config directory.
Key selection for every command:
PAKYAS_API_KEY, unless--ignore-envis passed- The stored key for the active organization
- A stored legacy key (not tied to an organization, from older CLI versions)
pakyas login [--api-key <KEY>] [--no-browser]| Flag | Description |
|---|---|
--api-key <KEY> | Store this key instead of opening the browser |
--no-browser | Log in with email and password in the terminal; the CLI creates a read,write key for your first organization |
# Browser login (default): pick an organization in the browserpakyas login
# Existing keypakyas login --api-key pk_live_...
# Email and passwordpakyas login --no-browserAfter login the CLI prints the organization, the default project (the first project of the organization), and the key prefix. login --api-key stores the key under the organization it belongs to; it only changes the active organization if none is set yet.
logout
Section titled “logout”pakyas logoutDeletes credentials.json, which removes all stored keys for every organization. config.toml (active organization, default project) is kept. PAKYAS_API_KEY is not affected, so commands keep working if it is set. To remove the key of a single organization, use auth key rm.
whoami
Section titled “whoami”pakyas whoamiShows the organization, default project, and the API key that commands will actually use, with its source:
Organization: Acme CorpDefault project: ProductionAPI Key: pk_live_a1b2... (stored (organization))The source is PAKYAS_API_KEY, stored (organization), or stored (legacy). If --org points to an organization other than the saved one, the line reads Organization ID: <id>.
With --format json:
{ "api_key_prefix": "pk_live_a1b2...", "api_key_source": "stored (organization)", "default_project_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7", "default_project_name": "Production", "organization_id": "3f2b8c1e-7d4a-4e1b-9c3f-2a6d8e5b1c74", "organization_name": "Acme Corp"}When no API key is available, whoami exits 5 with Not logged in. Run: pakyas login, so scripts can use it as an auth check:
pakyas whoami >/dev/null 2>&1 || echo "pakyas is not authenticated"whoami only reads local state (plus one request to find the key’s organization if none is configured). It doesn’t validate the key; use auth key verify for that.
auth status
Section titled “auth status”pakyas auth statusShows the active organization and its stored key, the default project, all stored keys, and warnings:
Authentication Status=====================
Active Organization: Name: Acme Corp ID: 3f2b8c1e-7d4a-4e1b-9c3f-2a6d8e5b1c74 Key: pk_live_a1b2... (stored) Label: build-box-2026-11-01 Last verified: 2026-11-07 09:12:44 UTC
Default Project: Name: Production ID: 7c9e6679-7425-40de-944b-e07fc1f90ae7
Stored Credentials: 2 organization(s) with stored keys - 3f2b8c1e-7d4a-4e1b-9c3f-2a6d8e5b1c74: pk_live_a1b2... - a8d1e2f3-4b5c-4d6e-8f70-1a2b3c4d5e6f: pk_live_c3d4...If PAKYAS_API_KEY is set, the output starts with a warning that it overrides the stored credentials. If the active organization has no stored key, or a legacy key is present, auth status says so and suggests the command to fix it.
auth key list
Section titled “auth key list”pakyas auth key listLists the keys stored on this machine:
Stored API Keys:
Organization: 3f2b8c1e-7d4a-4e1b-9c3f-2a6d8e5b1c74 Key: pk_live_a1b2... Label: build-box-2026-11-01 Added: 2026-11-01 08:30 Last verified: 2026-11-07 09:12
Organization: a8d1e2f3-4b5c-4d6e-8f70-1a2b3c4d5e6f Key: pk_live_c3d4... Label: build-box-2026-10-15 Added: 2026-10-15 14:02 Last verified: (never)Keys are shown as their first 12 characters. The label is the host name and the date the key was stored.
auth key set
Section titled “auth key set”pakyas auth key set --org <ORG> [--key <KEY>]| Flag | Description |
|---|---|
--org <ORG> | Organization ID or name to store the key for. Required. |
--key <KEY> | API key. Prompted for (hidden input) if omitted. |
The key must start with pk_. The CLI checks it with the server and refuses to store it if it belongs to a different organization. The key is stored under the organization’s ID, even when you pass its name. (Names need CLI 0.1.10 or later.)
pakyas auth key set --org "Acme Corp"pakyas auth key set --org a8d1e2f3-4b5c-4d6e-8f70-1a2b3c4d5e6f --key pk_live_...auth key verify
Section titled “auth key verify”pakyas auth key verify [--org <ORG>]Checks the stored key for the organization (ID or name; the active one by default) against the server and updates its last-verified time. Exits 5 if the server rejects the key, and 1 if no key is stored for the organization.
auth key rm
Section titled “auth key rm”pakyas auth key rm (--org <ORG> | --legacy) [-y]| Flag | Description |
|---|---|
--org <ORG> | Remove the key stored for this organization (ID or name) |
--legacy | Remove the legacy key (not tied to an organization) |
-y, --yes | Skip the confirmation prompt |
--org and --legacy are mutually exclusive; one is required.
pakyas auth key rm --org a8d1e2f3-4b5c-4d6e-8f70-1a2b3c4d5e6f -ypakyas auth key rm --legacySee Also
Section titled “See Also”- api-key - Create, list, and revoke keys on the server
- org - Switch organizations
- CLI Configuration - Config directory and precedence