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. It communicates with the orchestrator’s admin HTTP API using Bearer token authentication.

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

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.

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, and run status. Cannot read secret values.

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_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