When to use
- First-time environment setup
- 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
Prerequisites
- Node.js 22+ installed
- npm available
Commands
Install CLI
Login (interactive)
Login (non-interactive)
Check identity
List profiles
Switch profile
Remove profile
View all configuration
Clear configuration
Configuration storage
| Item | Location |
|---|---|
| Config file | ~/.config/codika-helper/config.json |
| Permissions | 0o600 (owner read/write only) |
| Format | Multi-profile JSON with active profile pointer |
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.
Common errors
| Error | Cause | Fix |
|---|---|---|
| ”API key is required” | No key provided or found | Run codika-helper login |
| ”Invalid API key” | Key is wrong or expired | Check with codika-helper whoami, re-login |
| ”EACCES” on npm install | Permission denied | Use sudo npm install -g or fix npm permissions |
| Wrong org on deploy | Active profile doesn’t match project | Use codika-helper use <correct-profile> |