Skip to main content
Agents / terminal-only setups: if you have email access but no browser, use the CLI OTP auth flow — two commands per signup or login, and a cko_ key lands in ~/.config/codika/config.json automatically. This page covers dashboard-paste login and profile management.

When to use

  • First-time environment setup (with a key already minted from the dashboard)
  • When deploy or project commands fail with “API key is required”
  • To check current identity or switch between organizations
  • When the user needs to authenticate with a different org
  • For OTP-based self-provisioning from an AI agent, see CLI OTP auth first

Prerequisites

  • Node.js 22+ installed
  • npm available

Install the CLI


login

Save an API key and create a named profile. Alias for config set.

Options

Behavior

  1. Prompts for API key (masked input) unless --api-key is provided
  2. Validates the key against the Codika platform API (unless --skip-verify)
  3. Stores profile metadata: org ID, org name, key name, scopes, creation date, expiry date
  4. Sets the new profile as active

Examples


whoami

Show the current authenticated identity.

Options

Behavior

Validates against the platform API for fresh data. Falls back to cached profile data if the network call fails.

Output


use

Switch the active profile or list all profiles.

Arguments

Options

Behavior

  • No argument: Lists all profiles with an active marker (bullet)
  • With argument: Switches the active profile

Output (list mode)

JSON output

When called with --json, outputs an array of profile objects — useful for agents to match project.json organizationId to the correct profile:

Examples


logout

Remove a profile.

Arguments

Behavior

Removes the specified profile. If it was the active profile, switches to the next available profile.

config set

Save API key and base URL. Same as login.
Options are identical to login.

config show

Display all stored profiles.

Output

Exit code 0 if profiles exist, 1 if none.

config clear

Remove configuration.

Options

Examples


Configuration storage

API key resolution priority

  1. --api-key / --api-url flag on any command
  2. CODIKA_API_KEY / CODIKA_BASE_URL environment variable
  3. Active profile in config file
  4. Production default (base URL only)

Organization-aware profile selection

When project.json in a use case folder contains an organizationId, the CLI automatically selects the matching profile for deployment commands — even if a different profile is currently active.

Error reference