Skip to main content

When to use

  • An AI agent (or a user in a fresh terminal) needs a working Codika cko_ API key and can receive email — but can’t open a browser, run OAuth, or visit the dashboard.
  • The user wants to sign up for Codika and start deploying workflows in a single shell session.
  • A CI/CD job needs a short-lived key scoped to one organization, minted without leaving the terminal.
The classic dashboard-paste path (codika login --api-key cko_…) still works — see authentication. This page documents the alternative: OTP-based self-provisioning.

How it works

Two commands per flow. The backend sends a 6-digit code to the email; the CLI sends the code back; the backend mints a cko_ key and returns the raw key exactly once. The CLI saves it as a new profile in ~/.config/codika/config.json and activates it.
OTP security constants:

codika auth signup-request

Request an OTP for a brand-new signup.

Options

Response (--json)

Errors


codika auth signup-complete

Verify the OTP and, in one atomic flow, create the Firebase Auth user, create the organization (with n8n error workflow + webhook auth credential seeded), and mint a cko_ API key with the 10 default scopes.

Options

Response (--json)

The raw key is saved to ~/.config/codika/config.json and does not appear in the JSON output (other than masked) after save. It is only available inside the CLI’s profile.

Errors


codika auth login-request

Same shape as signup-request, but for existing accounts.

Errors specific to login


codika auth login-complete

Verify the OTP and mint a fresh cko_ key for one of the user’s organizations.
Each login-complete mints a new key. Previous keys remain valid until revoked from the dashboard.

Multi-org handling

Codika users can belong to multiple organizations. If the user has more than one and --organization-id is not provided, the backend returns:
The agent should surface the list, let the user pick, then re-run with --organization-id <id>.

Other login-specific errors


Agent recipe — optimistic signup, fallback to login

See also