Kimix Quick Start

September 1, 2026 ยท View on GitHub

This guide covers environment setup, installation, and basic CLI usage.


Install

From the project root (the directory containing pyproject.toml), run:

python install.py

install.py handles the full setup: dependency sync, native runtime download, and command-line tool registration. Once finished, the kimix command is ready to use.


Environment Variables

Configure API keys before running. Priority: JSON config api_key field > KIMI_API_KEY > KIMIX_API_KEY.

VariableDescription
KIMI_API_KEYKimi API key
KIMIX_API_KEYFallback API key

Linux / macOS:

export KIMI_API_KEY=your-api-key

Windows PowerShell:

$env:KIMI_API_KEY="your-api-key"

CLI Usage

Subcommands

SubcommandDescriptionCommon Options
serveStart HTTP server (OpenCode style)--host (default 127.0.0.1), --port (default 4096)
ssecliSSE CLI debugger for kimix serve. Supports /new, /abort, /status, /sessions, /messages, /clear, /compact[:N], /export[:path], /help; press Ctrl+C or send EOF (Ctrl+D / Ctrl+Z) to exit--host, --port, --debug (saves raw event log as sse_log_<YYYYMMDD_HHMMSS>.txt)

Examples:

# Start HTTP server
kimix serve --port 4096

# Use SSE CLI debugger
kimix ssecli --host 127.0.0.1 --port 4096 --debug

LLM Config Initialization

If no --config is provided, the built-in default (src/kimix/default_config.json) is used.

Run /init in the interactive terminal to create the default config interactively:

/init

Config fields:

FieldRequiredDescription
typeYesProvider type โ€” see Supported Providers below
modelYesModel name for API requests
urlYesAPI base URL
max_context_sizeYesMax context length (128k, 200k, 256k, 512k, 1M)
capabilitiesNoModel capabilities: thinking, always_thinking, image_in, video_in
api_keyNoAPI key (falls back to env vars)
custom_headersNoCustom HTTP headers
oauthNoOAuth config, e.g. {"storage": "file", "key": "my-key"}
loop_controlNoLoop params: max_steps_per_turn, max_retries_per_step, max_ralph_iterations, reserved_context_size, compaction_trigger_ratio
max_tokensNoMax tokens per request
show_thinking_streamNoStream thinking process
thinking_effortNooff, low, medium, high, xhigh, max
temperatureNoSampling temperature [0.0, 2.0]
backgroundNoBackground task settings
notificationsNoNotification settings
mcpNoMCP (Model Context Protocol) config
envNoExtra env vars (dict)

Supported Providers

type accepts the provider identifiers grouped below (mirroring kimi_cli/llm.py):

Core providers

typeNotes
kimiMoonshot / Kimi
xaixAI (Grok)
openai_legacyOpenAI Chat Completions
openai_responsesOpenAI Responses API
anthropicAnthropic Claude
google_genaiGoogle GenAI (legacy alias for gemini)
geminiGoogle Gemini (Google AI Studio)
vertexaiGoogle Vertex AI (legacy alias for vertex)
vertexGoogle Vertex AI

OpenAI-compatible providers (Hermes-ported)

ai-gateway, alibaba, alibaba-coding-plan, arcee, azure-foundry, copilot, custom, deepinfra, deepseek, fireworks, gmi, huggingface, kilocode, kimi-coding, nous, novita, nvidia, ollama-cloud, opencode-zen, openrouter, qwen-oauth, stepfun, upstage, xiaomi, zai

Special-mode providers

typeNotes
actualActual Computer (Codex-style API)
bedrockAWS Bedrock (Converse API)
minimaxMiniMax (Anthropic-compatible)
openai-codexOpenAI Codex (ChatGPT backend)
copilot-acpGitHub Copilot ACP subprocess (external agent; no in-process LLM)

When api_key / url are omitted, the provider registry falls back to each provider's standard environment variables (e.g. DEEPSEEK_API_KEY, OPENROUTER_API_KEY, XIAOMI_API_KEY, GLM_API_KEY/ZAI_API_KEY, MINIMAX_API_KEY). See kimi-cli/packages/kosong/src/kosong/providers/__init__.py for the full per-provider list.

Load custom config:

kimix --config=<path>

Launch Options

FlagDescription
-c, --cleanAuto-delete cache on exit
--no_thinkDisable thinking mode
--no_yoloDisable YOLO mode
--no_colorDisable colored output
--manually-cotEnable manual CoT (may use multiple sessions)
--ralphEnable Ralph mode (optional iteration count)
-s, --skill-dirCustom skill directory (repeatable)
--configJSON config path. Searches: cwd parents, package parents, PATH

Auto-loading skill directories: On startup, Kimix also reads .kimix/skill.json in the current directory. If it contains a skill_dir field (string or array of strings) and the directories exist, they are automatically appended to the default skill search paths.

Interactive Commands

CommandDescription
<path>Load file. .py files are executed directly (__file__ points to the file); other files are read entirely as a single prompt
/file:<path>Read entire file as a single prompt
/todo:<path>Scan code files for TODO comments and prompt the agent to implement them. Supports .py, C/C++ family (.c/.cpp/.h/.java/.js/.ts/.go/.rs, etc.), Shell (.sh/.bash/.zsh), HTML/XML, Pascal, Lisp, SQL, and more
/clearClear current context
/summarizeSummarize context to memory
/exitExit
/helpShow help
/contextPrint context usage
/fix:<command>Run command, auto-retry on error
/txtMulti-line text mode (end with /end, cancel with /cancel)
/initInteractive LLM config initialization (resets session)
/compactCompact the current session's conversation context
/export:<path>Export the current session's messages to the specified file
/resume:<id>Close current session and resume a session by ID
/store:<id>Copy the current session to a new named session
/load:<id>Copy a named session into a new anonymous session
/ralph:on/off/<num>Set Ralph mode
/reflectionReflect on the current conversation context, find misunderstandings caused by the current agent design, and change the source code to improve the project (requires a non-empty context; writes a change report to docs/reflection_report_*.md)
/supervisorEnter multi-line input mode to create a session with the Supervisor role and execute one task (end with /end, cancel with /cancel)
/plan / /plan:<file>Use the TodoMaker Agent to generate a task plan. Task requirements are provided via multi-line input (end with /end); <file> specifies the plan output file path, and will be overwritten if it already exists. After generation, you can review and modify the plan, then confirm to execute; a review prompt is appended after execution
/cmd:<command>Execute system command
/code:<path> [args...]Run a script file (.py or other executables) with optional arguments

MCP (Model Context Protocol)

Kimix can act as both an MCP client and an MCP server.

Using MCP Servers

Add an MCP server to Kimix so that its tools, resources, and prompts are available to the agent:

# stdio server
kimix mcp add --transport stdio my-server -- npx -y @example/mcp-server

# streamable HTTP server
kimix mcp add --transport http my-server https://api.example.com/mcp

# list configured servers
kimix mcp list

# test a connection
kimix mcp test my-server

Project-level servers can also be committed to version control in .kimix/mcp.json. Kimix automatically merges global (~/.kimi/mcp.json), project (.kimix/mcp.json), and explicitly supplied configs, with explicit configs taking highest priority.

Serving Kimix as an MCP Server

Expose the current Kimix runtime to external MCP clients such as Claude Desktop or Cursor:

# stdio (for clients that spawn a subprocess)
kimix mcp serve --transport stdio

# streamable HTTP
kimix mcp serve --transport http --host 127.0.0.1 --port 4097

By default the server exposes:

  • tools: every tool in the active agent toolset
  • resources: AGENTS.md, README.md, and project files under the work directory
  • prompts: the agent's system prompt

Use --no-resource or --no-prompt to disable resources or prompts. Use --agent-file to load a specific agent specification.