Skip to content

Environment variables

The KiCI CLI reads the following environment variables to customize its behavior. OAuth login (kici login without --token) defaults KICI_PLATFORM_URL, KICI_OIDC_ISSUER, and KICI_OIDC_CLIENT_ID to the hosted KiCI Platform, so kici login works with no configuration. Set them only to target a self-hosted Platform or a testing environment.

VariableDescriptionDefault
KICI_OIDC_ISSUEROIDC issuer URL for authenticationhttps://auth.kici.dev/realms/kici-internal
KICI_OIDC_CLIENT_IDOIDC client ID for the CLI applicationkici-cli
KICI_PLATFORM_URLPlatform API base URLhttps://api.kici.dev
KICI_CONFIG_DIROverride the KiCI config directory~/.kici
VariableDescriptionDefault
KICI_BROWSER_CMDCustom browser command for OAuth login. Supports {url} placeholder. Set to none to suppress browser opening and print the URL to stdout instead.Uses the system default browser via the open package
KICI_CALLBACK_PORTFixed port for the OAuth PKCE callback server. Useful when firewall rules require a known port.Random available port
VariableDescriptionDefault
KICI_DEVEnable development mode. When true, uses prerelease-compatible version ranges (>=0.0.1-0) for dev dependencies and skips npm version resolution.unset
KICI_DEBUGEnable debug logging. When true, prints verbose diagnostics (SDK alias resolution, step-level debug logs, stack traces on errors). Equivalent to the --debug CLI flag.unset

Authenticate with a pre-existing API key (no browser needed):

Terminal window
kici login --token <<< "$KICI_API_KEY"

Self-hosted Platform or custom OIDC provider

Section titled “Self-hosted Platform or custom OIDC provider”

kici login targets the hosted KiCI Platform by default. To point the CLI at a self-hosted Platform or a testing OIDC provider, override the defaults:

Terminal window
export KICI_OIDC_ISSUER=https://your-idp.example.com
export KICI_OIDC_CLIENT_ID=your-client-id
export KICI_PLATFORM_URL=https://your-platform.example.com
kici login

The CLI auto-detects headless environments and uses the device flow. To force PKCE with URL output instead:

Terminal window
export KICI_BROWSER_CMD=none
kici login

This prints the authorization URL to stdout as KICI_AUTH_URL=<url>. Open the URL in any browser to complete authentication.

When behind a firewall or using port forwarding:

Terminal window
export KICI_CALLBACK_PORT=19876
kici login

Store the KiCI config in a non-default location:

Terminal window
export KICI_CONFIG_DIR=/tmp/kici-test
kici login