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 acko_key lands in~/.config/codika/config.jsonautomatically. 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 forconfig set.
Options
Behavior
- Prompts for API key (masked input) unless
--api-keyis provided - Validates the key against the Codika platform API (unless
--skip-verify) - Stores profile metadata: org ID, org name, key name, scopes, creation date, expiry date
- 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 aslogin.
login.
config show
Display all stored profiles.Output
config clear
Remove configuration.Options
Examples
Configuration storage
API key resolution priority
--api-key/--api-urlflag on any commandCODIKA_API_KEY/CODIKA_BASE_URLenvironment variable- Active profile in config file
- Production default (base URL only)
Organization-aware profile selection
Whenproject.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.