Skip to content

kici-admin CLI reference

The kici-admin CLI manages the KiCI orchestrator: configuration, secrets, tokens, sources, database migrations, diagnostics, clustering, and service lifecycle. Most commands reach the orchestrator over its admin HTTP API using Bearer token authentication.

Some command groups deliberately bypass that API, because they must work while the orchestrator is down (or before it exists):

  • Direct database (--database-url, or KICI_DATABASE_URL): peer, check-run, cluster, signing-key, dashboard-encryption-key, remote-source. host also goes straight to the database, but it reads KICI_DATABASE_URL only — it carries no --database-url flag. Several API-backed commands offer a direct-DB mode through the same flag — each one says so in its guide entry.
  • Local host only (no orchestrator, no database): firecracker, scaler, inspect-bundle, and the agent / orchestrator service-lifecycle verbs (install, uninstall, start, stop, restart, status, logs, upgrade, plus agent package; orchestrator drain / resume are API-backed).
  • Own transport: join connects straight to the Platform relay or a peer orchestrator.

The kici-admin binary is provided by the kici-admin npm package, which re-exports the CLI from @kici-dev/orchestrator:

Terminal window
npm install -g kici-admin

The same package also installs a second binary, kici-agent, which runs the KiCI agent. That is what puts an agent on PATH for a bare-metal scaler’s binaryPath: — see the bare-metal quickstart.

For standalone (single-executable) deployments, see Packaging guide.

All API-backed commands require a Bearer token. Provide it via:

  • Environment variable (recommended): export KICI_ADMIN_TOKEN=<token>
  • CLI flag: --token <token> or -t <token>

The token is validated against the admin_tokens table in the orchestrator database. Tokens are stored as SHA-256 hashes and never persisted in plaintext.

On first startup, the orchestrator generates a bootstrap token with owner role and prints it to the logs:

KICI Admin Token: <token-value>

Save this token immediately — it is only shown once. To use a fixed token for automation, set KICI_BOOTSTRAP_ADMIN_TOKEN before starting the orchestrator:

Terminal window
export KICI_BOOTSTRAP_ADMIN_TOKEN=my-fixed-admin-token

The bootstrap token creation is idempotent: if one already exists, it is reused.

Use kici-admin token create to issue tokens with specific roles:

Terminal window
kici-admin token create ci-operator --role admin
kici-admin token create compliance-bot --role auditor

These options apply to every command:

OptionEnvironment variableDefaultDescription
--url <url>, -uKICI_ADMIN_URLhttp://localhost:8080Orchestrator HTTP URL
--token <token>, -tKICI_ADMIN_TOKEN(required)Admin API Bearer token
-V, --cli-versionShow CLI version

Running --help on any command works without a token.

The kici-admin binary routes every diagnostic log line to stderr. Only command output — a table, or the payload of a --json / --format json run — goes to stdout. So you can pipe stdout straight into a parser:

Terminal window
kici-admin runs list --json | jq -r '.runs[].runId'

The CLI sets KICI_LOG_STDERR=1 for you when it starts. Set it yourself only if you invoke the orchestrator CLI module through some other entry point and want the same split.

Tokens are assigned one of three roles. The role determines which admin API operations are permitted:

Permissionowneradminauditor
context.createyesyes
context.readyesyesyes
context.updateyesyes
context.deleteyesyes
secret.readyesyes
secret.writeyesyes
secret.deleteyesyes
secret.revealyesyes
audit.readyesyesyes
run.readyesyesyes
run.cancelyesyes
event_log.readyesyesyes
event_log.read_payloadyesyes
access_log.readyesyesyes
scheduled_job.triggeryesyes
event_dlq.readyesyesyes
event_dlq.manageyesyes
attestation.retryyesyes
orchestrator.drainyesyes
ci_trust.readyesyes
ci_trust.adminyesyes
token.manageyes
key.rotateyes

secret.reveal is the additional gate for kici-admin runs secret-outputs --reveal: decrypting stored secret-output values and returning plaintext is strictly narrower than generic “read a secret”, so owner + admin roles carry it explicitly and auditor tokens are rejected with 403.

  • owner — full access. Use for bootstrap and token management.
  • admin — day-to-day operations (secrets, sources, config). Cannot manage tokens or rotate keys.
  • auditor — read-only access to contexts, audit logs, run status, the event log (metadata only), the access log, and the event dead-letter queue. Cannot read secret values, event-log payloads, or mutate anything.

Note: These roles govern the orchestrator admin API only. They are entirely separate from the SaaS dashboard RBAC system (org member roles, custom roles, permission matrices) which is managed through the dashboard UI and applies to OIDC-authenticated users.

The full command reference is split by area:

Each area page carries a ## Guide section (per-namespace concepts and worked examples) and a ## Reference section (the always-current generated signature list for that area’s commands).

VariableScopeDescription
KICI_ADMIN_URLCLIOrchestrator URL (default: http://localhost:8080)
KICI_ADMIN_TOKENCLIAdmin API Bearer token (required)
KICI_DATABASE_URLCLIPostgres URL for direct-DB commands (or --database-url)
KICI_BOOTSTRAP_ADMIN_TOKENOrchestratorFixed bootstrap token (idempotent)
KICI_SECRET_KEYOrchestrator64-char hex AES-256 master key
KICI_SECRET_KEY_FILEOrchestratorPath to master key file
KICI_SECRET_KEY_OLDOrchestratorPrevious key for dual-key rotation
KICI_AUTO_MIGRATEOrchestratorSet false to disable auto-migration
KICI_AGENT_TOKENAgentAgent authentication token
KICI_BACKEND_VAULT_URLCLIVault/OpenBao URL for backend commands
KICI_BACKEND_ROLE_IDCLIVault AppRole role ID for backend commands
KICI_BACKEND_SECRET_IDCLIVault AppRole secret ID for backend commands
KICI_BACKEND_TOKENCLIVault token for backend commands
KICI_BACKEND_PG_URLCLIPG connection string for backend commands