Skip to content

Kimi

Kimi Code CLI is Moonshot AI’s terminal coding agent (kimi). Use varlock to inject KIMI_API_KEY at runtime so the key never sits in a plain text .env or shell history.

For install, schema setup, and shared patterns, see the AI Tools overview.

Launch command: kimi

Authentication: You can sign in interactively with /login (Kimi Code OAuth or a platform API key), or inject a key via the environment. See environment variables.

Environment variable: KIMI_API_KEY (optional: KIMI_BASE_URL if you use a custom endpoint)

Add to .env.schema:

# @sensitive @required
KIMI_API_KEY=op(op://api-local/kimi/api-key)
Terminal window
varlock run -- kimi

Personal schema at ~/.env.kimi:

~/.env.kimi
# @sensitive @required
KIMI_API_KEY=op(op://api-local/kimi/api-key)
Terminal window
varlock run -p ~/.env.kimi -- kimi
Terminal window
alias vkimi='varlock run -p ~/.env.kimi --no-redact-stdout -- kimi'

--no-redact-stdout keeps Kimi’s own terminal output unredacted while secrets stay out of your shell history.

See the Kimi Code getting started guide for install options and login flows.