AI agents

Kimi Code CLI

CLI Flags

Launch flags for the kimi terminal command (run kimi --help for the built-in list). These are shell flags, not in-TUI slash commands — see Terminal Commands (kimi) for that distinction.

Session

FlagPurposeExample
--session [id] (-S)Resume a session; with an ID opens it directly, without an ID opens an interactive selectorkimi -S 3fa9…
--continue (-c)Continue the most recent session in the current directorykimi -c
--resume (-r)Hidden alias for --sessionkimi -r

Models

FlagPurposeExample
--model <model> (-m)Model alias for this launch; otherwise default_model from config is usedkimi -m k3

Permissions

FlagPurposeExample
--yolo (-y)Start in Ask When Needed mode: routine operations run automatically, risky actions still askkimi -y
--autoStart in Never Ask mode (fully unattended)kimi --auto
--yes, --auto-approveHidden aliases for --yolokimi --yes

See the safety warnings in Permissions and Approvals before using these.

Context

FlagPurposeExample
--add-dir <dir>Extra workspace directory; repeatable; relative paths resolve against cwdkimi --add-dir ../shared-lib

Output

FlagPurposeExample
--output-format <format>text (default) or stream-json; only valid with --promptkimi -p "…" --output-format stream-json

Debugging

FlagPurposeExample
--version (-V)Print version and exitkimi -V
--help (-h)Show help and exitkimi -h

For deeper diagnostics use kimi doctor and kimi export (Terminal Commands (kimi)) and the KIMI_LOG_LEVEL env var (Configuration).

Automation

FlagPurposeExample
--prompt <prompt> (-p)Non-interactive single prompt; streams assistant output to stdout; no TUIkimi -p "fix the failing test"
--planStart the new session in Plan modekimi --plan

Non-interactive details: assistant text goes to stdout while thinking, tool progress, and resuming notices go to stderr; there is no human approval — the auto permission policy applies and static deny rules still apply; stream-json emits one JSON object per line.

Integrations

FlagPurposeExample
--skills-dir <dir>Replace auto-discovered skill directories for this launch; repeatablekimi --skills-dir ./team-skills
--agent <name>Start a new session with a named agent as the main agentkimi --agent reviewer
--agent-file <path>Load one custom agent from a Markdown file for a new session; not repeatablekimi --agent-file ./agents/reviewer.md

For IDE integration there is the kimi acp subcommand rather than a flag; see Terminal Commands (kimi).

Conflict rules

Rejected at startup:

  • --continue and --session are mutually exclusive.
  • --yolo and --auto are mutually exclusive.
  • --prompt cannot combine with --yolo/--auto/--plan (non-interactive mode already defaults to auto permission).
  • --output-format only works with --prompt.
  • --agent cannot combine with --session/--continue; --agent-file cannot combine with --agent, --session, or --continue.

? Unable to verify: whether --yolo/--plan can combine with --continue/--session when resuming. The kimi command reference says resuming can override the saved mode (e.g. kimi --continue --auto); the overrides page states --yolo and --plan cannot combine with --continue/--session in non-prompt mode. The two official pages conflict.


Last verified: 2026-09-07

Official sources:

AI coding tools evolve quickly. If you find outdated information, please open an issue or pull request.