Skip to main content

Overview

This reference covers every operation available on the Codika platform. Each page documents the what, when, how (CLI command + all flags), and why for a single capability. Operations are grouped by lifecycle phase. The codika CLI (npm install -g codika) is the primary interface for all operations. Requires Node.js 22+.

Operations by lifecycle phase

Setup

Build

Deploy

Operate

CLI global configuration

Configuration is stored at ~/.config/codika/config.json (XDG-compliant, permissions 0o600). The CLI supports multiple named profiles, each containing:

Resolution chains

The CLI resolves values in a predictable priority order. Higher-priority sources override lower ones.

API key resolution

  1. --api-key flag (highest priority)
  2. CODIKA_API_KEY environment variable
  3. Active profile in config file
  4. Error if none found

Base URL resolution

  1. --api-url flag
  2. CODIKA_API_URL environment variable (or per-endpoint vars like CODIKA_DEPLOY_API_URL)
  3. Active profile base URL
  4. Production default

Project ID resolution

  1. --project-id flag
  2. project.json at --project-file path (if provided)
  3. project.json in use case folder
  4. PROJECT_ID export in config.ts

Organization-aware profile selection

When project.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:
  1. --api-key flag (always wins)
  2. CODIKA_API_KEY environment variable
  3. Profile matching organizationId from project.json
  4. Active profile

Global options

These options work across most commands:

Global exit codes

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

Typical workflow

An agent or human orchestrating a full deployment uses operations in this order:

Command hierarchy