CLI reference
The @kici-dev/compiler package provides the kici CLI for compiling, testing, and managing workflows.
Installation
Section titled “Installation”pnpm add -D @kici-dev/compilerThe examples use pnpm, but npm and yarn work too — npm install -D @kici-dev/compiler or yarn add -D @kici-dev/compiler.
Run commands with npx kici or add scripts to your package.json:
{ "scripts": { "kici:compile": "kici compile", "kici:preview": "kici preview" }}Command reference
Section titled “Command reference”The full command reference is split by area:
- Authoring & local dev —
compile,preview,local,fixture,types,workflows,hook,docs - Runs & approvals —
run,runs,reject,approve - Account & org —
login,logout,init,org,pat,secrets,admin,orchestrators,endpoints - Notifications & diagnostics —
notifications,verify-attestation,diagnostics,doctor
Each area page carries a ## Guide section (worked examples and command-by-command narrative) and a ## Reference section (the always-current generated signature list for that area’s commands).
Workflow discovery
Section titled “Workflow discovery”The CLI discovers workflows by scanning .kici/workflows/*.ts (or .mjs in MJS mode). Each file should export default a single workflow:
import { workflow, job, step, pr } from '@kici-dev/sdk';
export default workflow('ci', { on: pr(), jobs: [/* ... */],});Multiple workflow files are supported — each becomes a separate workflow in kici.lock.json.
Lock file
Section titled “Lock file”The kici compile command produces .kici/kici.lock.json inside the .kici directory. This file:
- Contains all workflow definitions in a portable JSON format
- Is used by the orchestrator to evaluate triggers without code checkout
- Should be committed to version control
- Is regenerated on every
kici compilerun
Use kici compile --check in CI to validate that workflows are correct without writing files. For the full story on drift, pre-commit/CI, and agent-side verification, see Lock file and workflow drift.
Exit codes
Section titled “Exit codes”Most commands follow a two-value convention:
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Failure (see output) |
Two cases add a third code:
kici doctorgrades its checks:0when every check passes,1when any check warns,2when any check fails.- A usage error exits
2— mutually exclusive flags onkici run remote(--pickcombined with a fixture name,--all, or--workflow),--fail-on-driftwithout--checkon the same command, or invoking a retired command such askici run local.
Each area page documents the exit codes of the commands it covers.
Debug output
Section titled “Debug output”Use --debug (on kici run <event> --local, kici run remote, kici preview) or --verbose (on kici compile) for detailed output:
# Shows trigger matching, rule evaluation, decision traceskici run push --local --debug
# Shows detailed compilation stepskici compile --verbose
# Shows trigger matching previewkici preview pr:open --debugSet KICI_DEBUG=true for additional internal debug output across all commands.
Environment variables
Section titled “Environment variables”| Variable | Description |
|---|---|
KICI_DEV | Set to true for development mode |
KICI_DEBUG | Set to true for verbose internal output |
CI | Disables interactive prompts unless it is set to an opt-out value (0 or false, any case) or left empty |
See Environment variables for the full CI-detection convention, including the GITHUB_ACTIONS and GITLAB_CI markers.
See also
Section titled “See also”- Getting started — install the SDK and write your first workflow
- Testing guide — writing fixtures, remote test runs, secret contexts, and repo state transfer
- SDK reference — complete API for the workflow definitions that the CLI compiles
- Workflow patterns — example workflows to compile and test with these commands