# kimi-cli | Moonshot AI | Knowledge Base | Instagit

Kimi Code CLI is your next CLI agent.

GitHub Stars: 9.9k

Repository: https://github.com/MoonshotAI/kimi-cli

---

## Articles

### [How to Troubleshoot Connection Errors with kimi-cli: Complete Diagnostics Guide](/MoonshotAI/kimi-cli/how-to-troubleshoot-connection-errors-with-kimi-cli)

Troubleshoot kimi-cli connection errors like APIConnectionError and APITimeoutError with this complete diagnostics guide. Learn to resolve API issues and ensure smooth operation.

- Tags: how-to-guide
- Published: 2026-07-28

### [Complete Guide to kimi-cli Command-Line Arguments and Options](/MoonshotAI/kimi-cli/what-are-the-command-line-arguments-for-kimi-cli)

Master kimi-cli command-line arguments to control session management, UI modes, agent selection, and logging. Explore over 30 options for efficient CLI interaction with this comprehensive guide.

- Tags: api-reference
- Published: 2026-07-27

### [How to Manage Chat History in Kimi-CLI: Context, Sessions, and Persistence](/MoonshotAI/kimi-cli/how-to-manage-chat-history-in-kimi-cli)

Learn to manage chat history in Kimi-CLI. Explore context, sessions, and persistence for seamless conversation management and automatic summarization.

- Tags: how-to-guide
- Published: 2026-07-27

### [How to Control Max Tokens in Kimi CLI: Environment Variables, Context-Aware Logic, and Per-Request Overrides](/MoonshotAI/kimi-cli/how-to-control-max-tokens-in-kimi-cli)

Control max tokens in Kimi CLI with environment variables, context-aware logic, and per-request overrides. Learn how to manage your token budget effectively for optimal performance.

- Tags: how-to-guide
- Published: 2026-07-27

### [How to Use a System Prompt in Kimi-CLI: Complete Configuration Guide](/MoonshotAI/kimi-cli/how-to-use-a-system-prompt-in-kimi-cli)

Learn to use a system prompt in Kimi-CLI with our complete configuration guide. Customize agent behavior for enhanced LLM interactions. Get started now!

- Tags: how-to-guide
- Published: 2026-07-27

### [How to Configure API Keys for Kimi-CLI: Environment Variables vs Config File](/MoonshotAI/kimi-cli/how-to-configure-api-key-for-kimi-cli)

Learn how to configure your Kimi-CLI API key using environment variables or the config file. Discover the precedence rules for secure and flexible access.

- Tags: how-to-guide
- Published: 2026-07-27

### [10 Benefits of Using kimi-cli for AI Agent Development](/MoonshotAI/kimi-cli/what-are-the-benefits-of-using-kimi-cli)

Discover 10 key benefits of using kimi-cli for AI agent development. Streamline LLM integration, build modular tools, and achieve async performance with this production-ready framework.

- Tags: listicle
- Published: 2026-07-26

### [How to Customize the Output of Kimi-CLI: Complete Guide to Output Formats](/MoonshotAI/kimi-cli/how-to-customize-the-output-of-kimi-cli)

Customize Kimi-CLI output with the output-format flag. Explore built-in text and json formats or add custom renderers for tailored results.

- Tags: how-to-guide
- Published: 2026-07-26

### [Where to Find the Kimi-CLI Community Forum: GitHub Discussions Explained](/MoonshotAI/kimi-cli/is-there-a-community-forum-for-kimi-cli)

Find the Kimi-CLI community forum on GitHub Discussions. Get support, share ideas, and connect with other users of the MoonshotAI/kimi-cli repository. Visit the official forum now.

- Tags: getting-started
- Published: 2026-07-26

### [How to Report a Bug in Kimi-CLI: A Complete Guide](/MoonshotAI/kimi-cli/how-to-report-a-bug-in-kimi-cli)

Learn how to report a bug in Kimi-CLI effectively. Enable debug mode, capture logs, document your environment, and submit a detailed GitHub issue for quick resolution.

- Tags: how-to-guide
- Published: 2026-07-26

### [Known Issues with Kimi-CLI: Critical Bugs and Workarounds](/MoonshotAI/kimi-cli/what-are-the-known-issues-with-kimi-cli)

Discover critical bugs in Kimi-CLI, including Windows path issues, env variable errors, and token leaks. Learn about essential workarounds to keep your CLI running smoothly.

- Tags: known-issues
- Published: 2026-07-26

### [How to Get Help on a Specific kimi-cli Command: Complete Guide](/MoonshotAI/kimi-cli/how-to-get-help-on-a-specific-kimi-cli-command)

Master kimi-cli help. Learn to use the -h or --help flag with any kimi-cli command for usage info, options, and examples. Get the most out of MoonshotAI/kimi-cli.

- Tags: how-to-guide
- Published: 2026-07-26

### [How to Automate Tasks with Kimi-CLI: Scripting, CI Pipelines, and API Integration](/MoonshotAI/kimi-cli/can-i-automate-tasks-with-kimi-cli)

Automate tasks with Kimi-CLI using scripting, CI pipelines, and API integration. Unlock powerful automation for your projects.

- Tags: how-to-guide
- Published: 2026-07-26

### [How to Use Bash with Kimi-CLI: Execute Shell Commands via CLI and Interactive Mode](/MoonshotAI/kimi-cli/how-to-use-bash-with-kimi-cli)

Learn to use Bash with Kimi-CLI. Execute shell commands directly or in interactive mode. Empower your workflow with Kimi-CLI's Bash integration.

- Tags: how-to-guide
- Published: 2026-07-26

### [Kimi-CLI Usage Examples: 4 Ways to Run and Extend the Moonshot AI Agent](/MoonshotAI/kimi-cli/are-there-any-examples-of-kimi-cli-usage)

Explore 4 kimi-cli usage examples for running and extending the Moonshot AI agent. Discover streaming JSON I/O, custom tool plugins, runtime customization, and deep extension.

- Tags: getting-started
- Published: 2026-07-26

### [Where to Find Kimi CLI Documentation: Repository Sources and Web Portal](/MoonshotAI/kimi-cli/where-is-the-kimi-cli-documentation)

Find Kimi CLI documentation in the MoonshotAI kimi-cli GitHub repository docs en directory or visit the official web portal for quick access.

- Tags: getting-started
- Published: 2026-07-26

### [How to Troubleshoot Kimi‑CLI Errors: A Complete Debug Guide](/MoonshotAI/kimi-cli/how-to-troubleshoot-kimi-cli-errors)

Troubleshoot kimi-cli errors with our complete debug guide. Enable debug logs, inspect session directories, and run tests to pinpoint issues in the Typer CLI, KimiSoul loop, or wire protocol.

- Tags: how-to-guide
- Published: 2026-07-26

### [How to Configure kimi-cli Settings: Complete Guide to TOML Config and Environment Variables](/MoonshotAI/kimi-cli/how-to-configure-kimi-cli-settings)

Learn to configure kimi-cli settings easily with our complete guide. Master TOML config files and environment variables for optimal customization. Get started now.

- Tags: how-to-guide
- Published: 2026-07-26

### [How to Integrate kimi-cli with Your IDE Using the ACP Protocol](/MoonshotAI/kimi-cli/can-kimi-cli-integrate-with-my-ide)

Integrate kimi-cli with your IDE using ACP. Enable bidirectional communication between your editor and the MoonshotAI CLI for a seamless development workflow.

- Tags: how-to-guide
- Published: 2026-07-26

### [Essential kimi-cli Commands: A Complete Guide to MoonshotAI's CLI](/MoonshotAI/kimi-cli/what-are-the-basic-commands-for-kimi-cli)

Master essential kimi-cli commands with our complete guide. Learn configuration, session management, authentication, and server operations for MoonshotAI's powerful CLI tool.

- Tags: getting-started
- Published: 2026-07-26

### [How to Run kimi-cli Commands: A Complete Guide to the Kimi CLI Interface](/MoonshotAI/kimi-cli/how-to-run-kimi-cli-commands)

Master kimi-cli commands with this comprehensive guide. Learn to launch the Kimi Code agent for interactive shell sessions, get non-interactive output, and explore server modes.

- Tags: how-to-guide
- Published: 2026-07-26

### [Prerequisites for kimi-cli: Complete Installation Guide](/MoonshotAI/kimi-cli/what-are-the-prerequisites-for-kimi-cli)

Install kimi-cli with ease! Learn the essential prerequisites including Python 3.12, uv, Git, and Make needed for a smooth setup. Get started with our complete guide.

- Tags: how-to-guide
- Published: 2026-07-26

### [How to Use kimi-cli for Text Summarization: A Complete Guide](/MoonshotAI/kimi-cli/how-to-use-kimi-cli-for-text-summarization)

Summarize text using kimi-cli with the /compact command or piping text. Learn how to leverage this AI tool for concise LLM-powered summaries in our complete guide.

- Tags: how-to-guide
- Published: 2026-07-25

### [How to Generate Code Snippets with kimi-cli: Interactive and Scripted Methods](/MoonshotAI/kimi-cli/how-to-generate-code-snippets-with-kimi-cli)

Learn to generate code snippets with kimi-cli using interactive or scripted methods. Generate syntax-highlighted code directly in your terminal.

- Tags: how-to-guide
- Published: 2026-07-25

### [License for Kimi-CLI: Apache 2.0 Terms and Usage Rights](/MoonshotAI/kimi-cli/what-is-the-license-for-kimi-cli)

Discover the Apache 2.0 license for Kimi-CLI. Understand your rights to use, modify, and distribute the code under this permissive open-source license.

- Tags: api-reference
- Published: 2026-07-25

### [Where to Find Example Usage of kimi-cli: A Complete Guide to the Examples Directory](/MoonshotAI/kimi-cli/where-to-find-example-usage-of-kimi-cli)

Explore kimi-cli example usage in the examples directory. Learn to run agents, use tools, and build custom plugins with this comprehensive guide.

- Tags: how-to-guide
- Published: 2026-07-25

### [How to Debug Kimi-CLI Issues: A Complete Troubleshooting Guide](/MoonshotAI/kimi-cli/how-to-debug-kimi-cli-issues)

Debug Kimi-CLI issues effectively with our complete troubleshooting guide. Learn to capture essential logs and trace wire events to quickly resolve failures in the MoonshotAI/kimi-cli tool. Get your CLI running smoothly now.

- Tags: how-to-guide
- Published: 2026-07-25

### [Advanced Features of Kimi-CLI: A Deep Dive into the MoonshotAI Terminal Assistant](/MoonshotAI/kimi-cli/what-are-the-advanced-features-of-kimi-cli)

Explore advanced Kimi-CLI features like shell mode and modular skills. Transform your development with MoonshotAI's comprehensive terminal assistant. Learn more today.

- Tags: deep-dive
- Published: 2026-07-25

### [How to Use System Prompts in Kimi-CLI: Configuration and Templating Guide](/MoonshotAI/kimi-cli/how-to-use-system-prompts-in-kimi-cli)

Master system prompts in Kimi-CLI. Learn configuration and templating to inject environment variables and ensure consistent LLM behavior across sessions with this essential guide.

- Tags: how-to-guide
- Published: 2026-07-25

### [How to Customize Kimi-CLI's Output Format: A Complete Guide](/MoonshotAI/kimi-cli/how-to-customize-kimi-cli-s-output-format)

Easily customize Kimi-CLI's output format using the --output-format flag or programmatically. Control response rendering with text, JSON, or custom formats.

- Tags: how-to-guide
- Published: 2026-07-25

### [How to Integrate Kimi CLI with Other Tools: MCP Servers, Custom Python Tools, and Sub-Agents](/MoonshotAI/kimi-cli/can-i-integrate-kimi-cli-with-other-tools)

Integrate Kimi CLI with MCP servers, custom Python tools, and sub-agents. Discover how to extend Kimi CLI's capabilities for seamless workflow automation.

- Tags: how-to-guide
- Published: 2026-07-25

### [How to Manage Conversation History in Kimi-CLI: A Complete Guide](/MoonshotAI/kimi-cli/how-to-manage-conversation-history-in-kimi-cli)

Learn to manage Kimi-CLI conversation history efficiently. Discover how messages are stored and automatically compacted to optimize token usage in this comprehensive guide.

- Tags: how-to-guide
- Published: 2026-07-25

### [How to Stream Responses in Kimi CLI: A Complete Guide to Real-Time Output](/MoonshotAI/kimi-cli/how-to-stream-responses-in-kimi-cli)

Learn how to stream responses in Kimi CLI for real-time LLM output. This guide explains the stream parameter and configuration options for seamless interaction with the MoonshotAI kimi-cli.

- Tags: how-to-guide
- Published: 2026-07-25

### [How to Use the Completion Command in Kimi-CLI: Shell Setup Guide](/MoonshotAI/kimi-cli/how-to-use-the-completion-command-in-kimi-cli)

Master Kimi-CLI's completion command to generate and install shell tab-completion scripts. Streamline your workflow with effortless command auto-completion. Setup guide included.

- Tags: how-to-guide
- Published: 2026-07-25

### [How to Use the Chat Command in Kimi CLI: Interactive and Print Modes Explained](/MoonshotAI/kimi-cli/how-to-use-the-chat-command-in-kimi-cli)

Master the Kimi CLI's chat functionality. Learn to launch interactive sessions or execute one-off queries using the --print and --prompt flags for efficient AI communication.

- Tags: how-to-guide
- Published: 2026-07-25

### [Complete kimi-cli Command Reference: Options, Subcommands, and Usage Examples](/MoonshotAI/kimi-cli/what-commands-are-available-in-kimi-cli)

Explore the comprehensive kimi-cli command reference. Discover over 30 global options and subcommands for authentication, session management, and agent configuration with clear usage examples.

- Tags: api-reference
- Published: 2026-07-25

### [How to Set Up a Custom Model with kimi-cli: Complete Configuration Guide](/MoonshotAI/kimi-cli/how-to-set-up-a-custom-model-with-kimi-cli)

Learn how to set up a custom model with kimi-cli. Configure your provider and model in config.toml for seamless integration and flexible model selection.

- Tags: how-to-guide
- Published: 2026-07-25

### [How to Configure API Keys for Kimi-CLI: Environment Variables and Config Files](/MoonshotAI/kimi-cli/how-to-configure-api-keys-for-kimi-cli)

Easily configure API keys for Kimi-CLI using environment variables or config files. Learn the precedence rules for secure and flexible credential management with MoonshotAI kimi-cli.

- Tags: how-to-guide
- Published: 2026-07-25

### [How to Install Kimi CLI on Linux: A Complete Guide Using uv](/MoonshotAI/kimi-cli/how-to-install-kimi-cli-on-linux)

Easily install Kimi CLI on Linux using the official one line installer for Python 3.13. Get the fastest setup with uv package manager today.

- Tags: how-to-guide
- Published: 2026-07-25

### [How to Install Kimi CLI on macOS: Step-by-Step Guide](/MoonshotAI/kimi-cli/how-to-install-kimi-cli-on-macos)

Install Kimi CLI on macOS quickly with our step-by-step guide. Run a single command to bootstrap uv and install the tool for Python 3.13.

- Tags: how-to-guide
- Published: 2026-07-25

### [How to Install Kimi CLI on Windows: PowerShell and UV Methods](/MoonshotAI/kimi-cli/how-to-install-kimi-cli-on-windows)

Install Kimi CLI on Windows with PowerShell or UV. Follow our easy guide to get the Kimi CLI for Python 3.13 running quickly on your Windows system.

- Tags: how-to-guide
- Published: 2026-07-25

### [How to Integrate Kimi CLI with VS Code and Other Editors](/MoonshotAI/kimi-cli/integrate-kimi-cli-vs-code-editors)

Integrate Kimi CLI with VS Code and other editors using ACP. Learn how Kimi's HTTP server enables seamless file operations, code execution, and chat within your IDE for enhanced productivity.

- Tags: how-to-guide
- Published: 2026-07-24

### [How Runtime and Agent Classes Interact in Kimi-CLI: Dependency Injection and Multi-Agent Architecture](/MoonshotAI/kimi-cli/runtime-agent-class-interaction)

Explore how the Runtime class serves as a service container for the Agent class in Kimi-CLI. Learn about dependency injection and multi-agent architecture in this technical deep dive.

- Tags: internals
- Published: 2026-07-24

### [How the Kimi CLI Approval System Manages Tool Execution Permissions](/MoonshotAI/kimi-cli/approval-system-tool-execution-permissions)

Discover how the Kimi CLI approval system manages tool execution permissions by evaluating modes, routing requests, and caching decisions. Ensure secure and controlled tool access.

- Tags: internals
- Published: 2026-07-24

### [How Session Management and Resumption Work in Kimi CLI](/MoonshotAI/kimi-cli/kimi-cli-session-management-resumption)

Discover how Kimi CLI’s session management and resumption works. Learn how chat history and local state are saved and restored for seamless continuity with WorkDirMeta and SessionState.

- Tags: internals
- Published: 2026-07-24

### [ACP Integration with Zed and JetBrains: How Kimi CLI Connects to Your IDE](/MoonshotAI/kimi-cli/acp-integration-zed-jetbrains)

Discover how Kimi CLI integrates ACP with Zed and JetBrains IDEs. Enable persistent agent sessions tool execution and context-aware conversations directly in your editor.

- Tags: how-to-guide
- Published: 2026-07-24

### [What Is Kimi CLI’s AFK Mode and How Does It Differ From Regular Execution?](/MoonshotAI/kimi-cli/kimi-cli-afk-mode-vs-regular-execution)

Discover Kimi CLI's AFK mode for unattended execution. Learn how it auto-dismisses questions and approves tool calls, ensuring seamless background operation.

- Tags: deep-dive
- Published: 2026-07-23

### [Kimi-CLI Agent YAML Specifications: Understanding `extend`, `tools`, and `subagents` Structure](/MoonshotAI/kimi-cli/structure-agent-yaml-specs-extend-tools-subagents)

Master Kimi-CLI agent YAML specs with extend tools and subagents. Learn about inheritance capability management and nested agent delegation for powerful AI configurations.

- Tags: internals
- Published: 2026-07-22

### [How ApprovalRuntime Manages Pending Approvals and Streams Them Over the Wire in Kimi CLI](/MoonshotAI/kimi-cli/approvalruntime-manage-pending-approvals-wire-stream)

Discover how ApprovalRuntime manages pending approvals using a UUID-keyed dictionary and streams them as JSON-RPC events via RootWireHub for real-time Kimi CLI display. Learn about asynchronous coordination.

- Tags: internals
- Published: 2026-07-22

### [How to Configure Different LLM Providers Other Than the Default in Kimi CLI config.toml](/MoonshotAI/kimi-cli/configure-different-llm-providers-config-toml)

Easily configure alternative LLM providers in Kimi CLI by editing config.toml. Learn how to set up and use different AI models beyond the default for your commands.

- Tags: how-to-guide
- Published: 2026-07-22

### [Context Compaction System in Kimi CLI: How and When It Summarizes History](/MoonshotAI/kimi-cli/context-compaction-system-history-summarization-trigger)

Understand Kimi CLI's context compaction system. Learn how and when it automatically summarizes older messages to optimize token usage for efficient conversation history management.

- Tags: internals
- Published: 2026-07-22

### [How Subagents Function with the LaborMarket Registry and SubagentStore Persistence in Kimi CLI](/MoonshotAI/kimi-cli/how-do-subagents-work-labormarket-subagentstore)

Explore how Kimi CLI subagents interact with the LaborMarket registry for on-demand instantiation and SubagentStore for persistent state management. Learn how this enables seamless recovery.

- Tags: internals
- Published: 2026-07-22

### [How to Customize the Kimi CLI Shell UI: Themes and Keyboard Shortcuts](/MoonshotAI/kimi-cli/customize-shell-ui-themes-keyboard-shortcuts)

Customize Kimi CLI shell UI themes and keyboard shortcuts. Modify config.toml for themes and prompt.py slash.py for key bindings to personalize your experience.

- Tags: how-to-guide
- Published: 2026-07-22

### [KimiSoul Agent Loop Architecture: Inside MoonshotAI's Kimi CLI Agent Runtime](/MoonshotAI/kimi-cli/internal-architecture-kimisoul-agent-loop)

Explore the KimiSoul agent loop architecture in MoonshotAI's Kimi CLI. Understand its async step-based generator for LLM inference, tool execution, and context management.

- Tags: internals
- Published: 2026-07-22

### [How Kimi Toolset Loads and Executes Tools Imported by Their Path](/MoonshotAI/kimi-cli/kimi-toolset-load-execute-tools-import-path)

Discover how Kimi Toolset loads and executes tools via path. Explore dynamic imports, dependency injection, and asynchronous execution for efficient tool management.

- Tags: internals
- Published: 2026-07-22

### [How to Debug Kimi-CLI Session Issues Using the Wire File and Session State Files](/MoonshotAI/kimi-cli/debug-session-issues-wire-file-session-state)

Debug Kimi-CLI session issues by inspecting state.json and wire.jsonl. Trace errors, analyze tool calls, and replay conversations for deterministic debugging.

- Tags: how-to-guide
- Published: 2026-07-22

### [How to Organize Custom Skills Directories in Kimi-CLI: Best Practices and Layout Guidelines](/MoonshotAI/kimi-cli/best-practices-organizing-skills-custom-directories)

Organize Kimi-CLI custom skills effectively with best practices. Learn directory structure, SKILL.md requirements, and placement for optimal skill management.

- Tags: best-practices
- Published: 2026-07-22

### [How Yolo Mode Automatically Approves All Tool Calls in Kimi CLI](/MoonshotAI/kimi-cli/explain-yolo-mode-auto-approve-tool-calls)

Discover Kimi CLI's YOLO mode and how it bypasses approval prompts by automatically approving all tool calls. Streamline your workflow with instant confirmations.

- Tags: deep-dive
- Published: 2026-07-22

### [How to Write Custom Hooks to Trigger on SessionStart and SessionEnd Events in Kimi CLI](/MoonshotAI/kimi-cli/write-custom-hooks-sessionstart-sessionend-events)

Learn to write custom hooks for SessionStart and SessionEnd events in Kimi CLI. Add custom Python logic to your CLI workflow seamlessly. Integrate event-driven actions easily.

- Tags: how-to-guide
- Published: 2026-07-22

### [How to Configure MCP Servers for OAuth Authorization Using `kimi mcp`](/MoonshotAI/kimi-cli/configure-mcp-servers-oauth-authorization-kimi-mcp)

Configure MCP servers for OAuth authorization with the Kimi CLI. Easily register servers and complete the browser-based authorization flow using the kimi mcp command.

- Tags: how-to-guide
- Published: 2026-07-22

### [Kimi CLI Session Management Architecture: How `Session.create` and `Session.resume` Operate](/MoonshotAI/kimi-cli/session-management-architecture-session-create-resume)

Explore Kimi CLI session management architecture. Learn how Session create initializes new sessions and Session resume reloads existing conversations from disk, persisting your chat state.

- Tags: architecture
- Published: 2026-07-22

### [How the ACP Server Facilitates IDE Integration with Zed and JetBrains](/MoonshotAI/kimi-cli/how-acp-server-ide-integration-zed-jetbrains)

Learn how the ACP server bridges Zed and JetBrains IDEs to the Kimi CLI agent. Explore session management, auth, model selection, and file sync via a standardized protocol.

- Tags: how-to-guide
- Published: 2026-07-22

### [Kimi CLI Print Mode Architecture: How Non-Interactive Output Works](/MoonshotAI/kimi-cli/kimi-cli-print-mode-non-interactive-output-architecture)

Explore Kimi CLI's print mode architecture. Learn how structured events stream to printer classes for plain text or JSON output, enabling pipe-friendly automation for non-interactive tasks.

- Tags: architecture
- Published: 2026-07-21

### [How the Kimi CLI Handles Switching Between Models and Refreshing Provider Information](/MoonshotAI/kimi-cli/kimi-cli-model-refresh-provider-switching-handling)

Discover how the Kimi CLI manages switching models and refreshing provider data. Learn about its efficient LLM instance rebuilding and asynchronous metadata updates via shell commands.

- Tags: internals
- Published: 2026-07-21

### [Trace Tool Approval Requests in Kimi CLI: From Execution to User Prompt](/MoonshotAI/kimi-cli/kimi-cli-tool-approval-request-flow-execution-prompt)

Trace tool approval requests in Kimi CLI from execution to user prompt. Understand the flow through approval runtime, wire protocol, and UI with async resolution.

- Tags: deep-dive
- Published: 2026-07-21

### [How an Approval Request Is Projected Onto the Wire Stream in Kimi CLI](/MoonshotAI/kimi-cli/kimi-cli-approval-request-projection-wire-stream)

Discover how Kimi CLI projects approval requests onto the Wire stream using JSON-RPC messages. Learn how to display permission prompts without blocking agent turns for a seamless UI experience.

- Tags: internals
- Published: 2026-07-21

### [How Kimi CLI Skills Register and Load Custom Prompts: From SKILL.md to System Prompt](/MoonshotAI/kimi-cli/kimi-cli-skills-custom-prompt-registration-loading)

Discover how Kimi CLI skills automatically register and load custom prompts from SKILL.md directly into the LLM system prompt for enhanced functionality. Learn the process now.

- Tags: internals
- Published: 2026-07-21

### [Kimi CLI OAuth Authentication Flow: Device-Code Login, Keyring Migration, and Token Refresh](/MoonshotAI/kimi-cli/kimi-cli-authentication-oauth-keyring-flow)

Learn the Kimi CLI OAuth authentication flow using device-code login. Discover how it securely stores tokens, migrates keyrings, and manages token refresh for seamless access.

- Tags: how-to-guide
- Published: 2026-07-21

### [Kimi CLI Wire Message Types in `src/kimi_cli/wire/types.py`: Events, Requests, and Envelope Protocol](/MoonshotAI/kimi-cli/kimi-cli-wire-message-types-definition)

Explore Kimi CLI wire message types in src/kimi_cli/wire/types.py. Understand Event, Request, and Envelope protocol for core runtime and UI communication.

- Tags: api-reference
- Published: 2026-07-21

### [How Slash Commands Work in Kimi CLI at the Soul and Shell Levels](/MoonshotAI/kimi-cli/kimi-cli-slash-command-functionality-soul-shell)

Explore how Kimi CLI's slash commands function at soul and shell levels. Discover the unified interface for agent runtime and interactive UI control, leveraging a shared parser for seamless command execution.

- Tags: internals
- Published: 2026-07-21

### [Kimi CLI Context Compaction Mechanism: Summarizing History in `src/kimi_cli/soul/compaction.py`](/MoonshotAI/kimi-cli/kimi-cli-soul-context-compaction-mechanism)

Discover the Kimi CLI context compaction mechanism in src/kimi_cli/soul/compaction.py. Learn how it summarizes history to respect model limits while retaining key exchanges.

- Tags: internals
- Published: 2026-07-21

### [Session Management Architecture in Kimi CLI: How `src/kimi_cli/session.py` Orchestrates Conversation State](/MoonshotAI/kimi-cli/kimi-cli-session-management-architecture)

Explore the session management architecture in Kimi CLI's srckimi_cli_session.py. Learn how it orchestrates conversation state using immutable identifiers, mutable state, JSONL logs, and async filesystem helpers.

- Tags: architecture
- Published: 2026-07-21

### [How Kimi Toolset Discovers, Loads, and Executes Tools via Import Paths in kimi-cli](/MoonshotAI/kimi-cli/kimi-cli-toolset-loading-tool-execution)

Learn how Kimi Toolset discovers and loads tools via import paths. Explore dynamic import, dependency injection, and asynchronous LLM-driven execution within kimi-cli.

- Tags: internals
- Published: 2026-07-21

### [How the `kimi mcp` Command Integrates and Manages External MCP Servers](/MoonshotAI/kimi-cli/kimi-cli-mcp-integration-external-server-management)

Learn how the `kimi mcp` command integrates and manages external MCP servers by persisting definitions, negotiating tokens, and dynamically loading tools via an async client.

- Tags: how-to-guide
- Published: 2026-07-21

### [KimiSoul Architecture and Main Agent Loop: Inside MoonshotAI/kimi-cli](/MoonshotAI/kimi-cli/kimi-cli-kimisoul-architecture-agent-loop-execution)

Explore KimiSoul architecture, the orchestrator at MoonshotAI/kimi-cli, driving the main agent loop with Agents, Runtime, Context, Tools, and Hooks.

- Tags: architecture
- Published: 2026-07-21

### [How Kimi CLI's Wire Protocol Facilitates Communication Between Agent Loops and UI Frontends](/MoonshotAI/kimi-cli/kimi-cli-wire-protocol-agent-ui-communication)

Explore how Kimi CLI's Wire protocol enables seamless communication between agent loops and UI frontends using Pydantic-typed messages and dual queues for flexible data streaming.

- Tags: internals
- Published: 2026-07-21

### [How Kimi CLI Implements Skill Loading and Execution for Workflow Automation](/MoonshotAI/kimi-cli/kimi-cli-skill-loading-execution-workflow-automation)

Discover how Kimi CLI loads and executes automation skills. Learn about skill discovery, slash command registration, and LLM context injection or flowchart parsing for efficient workflow automation.

- Tags: internals
- Published: 2026-07-20

### [How the Kimi CLI Approval Runtime Works: Structure, Lifecycle, and Request Projection](/MoonshotAI/kimi-cli/kimi-cli-approval-runtime-structure-request-projection)

Understand the Kimi CLI approval runtime structure and request projection. Explore the ApprovalRuntime class for in memory ledgers, async waiters, and UI rendering.

- Tags: internals
- Published: 2026-07-20

### [How Kimi CLI Handles DMail (Delayed Mail) for Checkpointed Replies](/MoonshotAI/kimi-cli/kimi-cli-dmail-delayed-mail-checkpointed-replies)

Learn how Kimi CLI processes DMail delayed mail for checkpointed replies. Explore the DenwaRenji manager that validates and stores pending DMail for later attachment to checkpoints.

- Tags: internals
- Published: 2026-07-20

### [How the Kimi CLI Subagent System Works and How SubagentStore Persists Data](/MoonshotAI/kimi-cli/kimi-cli-subagent-system-subagentstore-persistence)

Explore the Kimi CLI subagent system. Learn how SubagentStore persists LLM worker state using atomic JSON writes for complete resumability across sessions.

- Tags: internals
- Published: 2026-07-20

### [Kimi CLI Configuration Loading Precedence: Environment Variables, Config Files, and CLI Overrides](/MoonshotAI/kimi-cli/kimi-cli-configuration-loading-precedence)

Understand Kimi CLI configuration loading precedence. Discover how CLI flags, environment variables, and config files override default settings for seamless customization.

- Tags: internals
- Published: 2026-07-20

### [OAuth Authentication Flow in Kimi CLI: Technical Implementation and Platform Integration](/MoonshotAI/kimi-cli/kimi-cli-oauth-authentication-flow-kimi-platform-integration)

Explore the Kimi CLI OAuth authentication flow. Learn how it uses Authorization Code flow for secure platform integration and token exchange with auth.kimi.ai.

- Tags: deep-dive
- Published: 2026-07-20

### [How the Kimi CLI Approval System Controls Tool Execution Authorization](/MoonshotAI/kimi-cli/kimi-cli-approval-system-tool-execution-authorization)

Discover how the Kimi CLI approval system controls tool execution authorization. Learn about its validation, auto-approval, and user consent mechanisms for safe operations.

- Tags: internals
- Published: 2026-07-20

### [Performance Considerations for Kimi-CLI: 6 Critical Optimizations for Async Tool Execution](/MoonshotAI/kimi-cli/what-are-the-performance-considerations-for-kimi-cli)

Explore 6 critical performance optimizations for Kimi-CLI. Learn how its async-first architecture with asyncio ensures efficient parallel tool execution and a responsive user experience.

- Tags: performance
- Published: 2026-07-19

### [How to Use Kimi-CLI with Different IDEs: Zed, JetBrains, and VS Code Setup](/MoonshotAI/kimi-cli/how-to-use-kimi-cli-with-different-ides)

Integrate Kimi-CLI with Zed, JetBrains, and VS Code using the Agent Client Protocol. Learn how to set up your IDE for seamless Kimi-CLI interaction. Follow our guide for easy ACP server configuration.

- Tags: getting-started
- Published: 2026-07-19

### [How to Set Up API Keys for Kimi-CLI: Environment Variables vs. Config File](/MoonshotAI/kimi-cli/how-to-set-up-api-keys-for-kimi-cli)

Learn how to set up API keys for Kimi-CLI using environment variables or a config file. Discover which method takes precedence and get started quickly.

- Tags: how-to-guide
- Published: 2026-07-19

### [Which AI Models Are Compatible with Kimi‑CLI? A Complete Provider Guide](/MoonshotAI/kimi-cli/what-ai-models-are-compatible-with-kimi-cli)

Discover which AI models are compatible with Kimi-CLI. Explore support for Kimi, OpenAI, Anthropic, Google Gemini, Vertex AI, and more in this comprehensive provider guide.

- Tags: api-reference
- Published: 2026-07-19

### [How to Contribute to the Kimi-CLI Project: A Complete Developer's Guide](/MoonshotAI/kimi-cli/how-to-contribute-to-the-kimi-cli-project)

Learn how to contribute to the Kimi-CLI project. Follow our guide to fork, set up, format commits, and submit pull requests to the MoonshotAI/kimi-cli repository.

- Tags: how-to-guide
- Published: 2026-07-19

### [How to Extend kimi-cli with Custom Plugins: A Complete Guide](/MoonshotAI/kimi-cli/can-kimi-cli-be-extended-with-custom-plugins)

Extend kimi-cli with custom plugins using its dynamic YAML-based architecture. Learn to build and integrate your own Python tools for enhanced AI agent capabilities.

- Tags: how-to-guide
- Published: 2026-07-19

### [Kimi-CLI Project Structure: A Complete Guide to the MoonshotAI Repository Architecture](/MoonshotAI/kimi-cli/what-is-the-project-structure-of-kimi-cli)

Explore the MoonshotAI kimi-cli project structure. Understand the repository architecture including src kimi-cli, packages, web, and test directories for efficient development.

- Tags: architecture
- Published: 2026-07-19

### [How to Debug Code Generated by kimi-cli: Interactive Shell Commands and CLI Flags](/MoonshotAI/kimi-cli/how-to-debug-code-generated-by-kimi-cli)

Debug kimi-cli generated code effectively. Learn to use the interactive /debug command, --debug flag for verbose logging, and rollback features to find and fix issues fast.

- Tags: how-to-guide
- Published: 2026-07-19

### [How to Use kimi-cli for Code Review: Complete Workflow Guide](/MoonshotAI/kimi-cli/how-to-use-kimi-cli-for-code-review)

Learn to use kimi-cli for code review with this complete guide. Trigger automated reviews, preview diffs, and get structured LLM reports to streamline your workflow.

- Tags: how-to-guide
- Published: 2026-07-19

### [How to Troubleshoot Kimi-CLI Installation Issues: A Complete Guide](/MoonshotAI/kimi-cli/how-to-troubleshoot-kimi-cli-installation-issues)

Troubleshoot Kimi-CLI installation issues with our comprehensive guide. Learn to fix uv prerequisites, Python version conflicts, and Git-Bash path errors for MoonshotAI kimi-cli.

- Tags: how-to-guide
- Published: 2026-07-19

### [How to Update Kimi-CLI to the Latest Version: 4 Methods Explained](/MoonshotAI/kimi-cli/how-to-update-kimi-cli-to-the-latest-version)

Easily update kimi-cli to the latest version with four simple methods. Learn how to upgrade using pip or uv for the most recent stable release from PyPI.

- Tags: how-to-guide
- Published: 2026-07-19

### [Complete Guide to kimi-cli Command-Line Options: Flags, Configs, and Run Modes](/MoonshotAI/kimi-cli/what-are-the-command-line-options-for-kimi-cli)

Explore kimi-cli command-line options. Discover flags, configurations, and run modes to master this powerful AI tool. Enhance your workflow today.

- Tags: api-reference
- Published: 2026-07-19

### [How to Manage Multiple AI Models with kimi-cli: A Complete Configuration Guide](/MoonshotAI/kimi-cli/how-to-manage-multiple-ai-models-with-kimi-cli)

Learn to manage multiple AI models effortlessly with kimi-cli. This guide covers declarative configurations, CLI flags, and environment variables for seamless LLM integration.

- Tags: how-to-guide
- Published: 2026-07-19

### [How to Create Custom Prompts for kimi-cli: A Complete Guide to Agent Specifications](/MoonshotAI/kimi-cli/how-to-create-custom-prompts-for-kimi-cli)

Learn how to create custom prompts for kimi-cli by crafting YAML agent specifications and referencing custom system prompt files. Follow our guide for effective agent customization.

- Tags: how-to-guide
- Published: 2026-07-19

### [What Programming Languages Does Kimi CLI Support?](/MoonshotAI/kimi-cli/what-programming-languages-does-kimi-cli-support)

Discover the programming languages Kimi CLI supports. This versatile tool reads, edits, and generates code in any language with a native Python SDK for integration.

- Tags: api-reference
- Published: 2026-07-19

### [How to Integrate kimi-cli with Existing Projects: A Complete Guide](/MoonshotAI/kimi-cli/can-kimi-cli-integrate-with-existing-projects)

Learn how to integrate kimi-cli into your existing Python projects. Import KimiCLI and call create() to programmatically spawn an agent runtime without the command line. Get started today.

- Tags: how-to-guide
- Published: 2026-07-19

### [How to Use kimi-cli for Code Generation: A Complete Guide to AI-Assisted Programming](/MoonshotAI/kimi-cli/how-to-use-kimi-cli-for-code-generation)

Master code generation with kimi-cli a Python AI agent. Learn to stream requests to LLMs via CLI for REPL sessions and file persistence. Boost your programming workflow today.

- Tags: how-to-guide
- Published: 2026-07-19

### [Default Settings for Kimi-CLI: A Complete Guide to Configuration Values](/MoonshotAI/kimi-cli/what-are-the-default-settings-for-kimi-cli)

Discover the default settings for kimi-cli including web server port, output limits, LLM context budgeting, and telemetry. Learn how to override these configurations easily.

- Tags: how-to-guide
- Published: 2026-07-19

### [Prerequisites for Using kimi-cli: Complete Setup Guide](/MoonshotAI/kimi-cli/what-are-the-prerequisites-for-using-kimi-cli)

Discover the essential prerequisites for using kimi-cli: Python 3.12+, uv, Git, and Make. Learn what you need to start your CLI setup for the MoonshotAI/kimi-cli repository.

- Tags: how-to-guide
- Published: 2026-07-19

### [How to Install Kimi CLI: One-Line Installer and Manual uv Setup](/MoonshotAI/kimi-cli/how-to-install-kimi-cli)

Install Kimi CLI quickly with the one-line installer. This guide covers the automatic uv setup and manual installation for Python 3.13. Get started fast!

- Tags: how-to-guide
- Published: 2026-07-19

