Installation
@codika-io/helper-sdk. The binary is codika-helper.
Requirements: Node.js 22 or higher (uses experimental strip-types).
Command hierarchy
Configuration
Configuration is stored at~/.config/codika-helper/config.json (XDG-compliant) with permissions 0o600.
The CLI supports multiple named profiles, each containing:
| Field | Description |
|---|---|
apiKey | The Codika API key (prefix cko_) |
baseUrl | Platform API URL |
orgId | Organization ID |
orgName | Organization display name |
keyName | API key display name |
scopes | Permission scopes (e.g., deploy:use-case, workflows:trigger) |
createdAt | When the key was created |
expiresAt | When the key expires |
Resolution chains
The CLI resolves values in a predictable priority order. Higher-priority sources override lower ones.API key resolution
--api-keyflag (highest priority)CODIKA_API_KEYenvironment variable- Active profile in config file
- Error if none found
Base URL resolution
--api-urlflagCODIKA_API_URLenvironment variable (or per-endpoint vars likeCODIKA_DEPLOY_API_URL)- Active profile base URL
- Production default
Project ID resolution
--project-idflagproject.jsonin use case folderPROJECT_IDexport inconfig.ts
Organization-aware profile selection
Whenproject.json contains an organizationId, the CLI automatically selects the profile that matches that organization — even if a different profile is currently active. This is especially important for deployment commands.
The selection order:
--api-keyflag (always wins)CODIKA_API_KEYenvironment variable- Profile matching
organizationIdfromproject.json - Active profile
Global options
These options work across most commands:| Option | Description |
|---|---|
--json | Output as machine-readable JSON |
--api-key <key> | Override API key |
--api-url <url> | Override API base URL |
Exit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Runtime error (API failure, missing files, etc.) |
2 | CLI validation error (invalid arguments, missing required options) |
Profile expiry warnings
On every command, the CLI checks the active profile’s key expiry:- < 7 days until expiry: Displays a warning
- Expired: Displays an error
- No expiry data: No warning