# Advanced Features of Kimi-CLI: A Deep Dive into the MoonshotAI Terminal Assistant

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

- Repository: [Moonshot AI/kimi-cli](https://github.com/MoonshotAI/kimi-cli)
- Tags: deep-dive
- Published: 2026-07-25

---

**Kimi-CLI provides advanced features including shell command mode, MCP/ACP protocol support, a modular skill system, and pluggable UI back-ends that transform it from a simple chat interface into a comprehensive development environment.**

The MoonshotAI/kimi-cli repository delivers more than a basic code-generation assistant. Its architecture enables deep system integration, allowing developers to execute shell commands, manage external AI tools, and extend functionality through custom skills—all within an asynchronous runtime that supports multiple interface protocols.

## Shell Command Mode and Zsh Integration

Kimi-CLI blurs the line between conversational AI and terminal emulation by embedding a true interactive shell environment directly into the interface.

### Interactive Shell Toggle (Ctrl-X)

Pressing **Ctrl-X** switches the interface into shell command mode, where any command typed is executed by the underlying operating system. This "agent-as-shell" experience, documented in the README at lines 22-25, allows developers to run `ls -la`, `git status`, or any system binary without leaving the Kimi session context.

```bash

# Switch to shell command mode with Ctrl-X, then execute:

^X ls -la          # Shows directory listing via OS execution

^X git status      # Runs git inside the same Kimi session

```

### Zsh Plugin Support

For users preferring native terminal workflows, the `zsh-kimi-cli` plugin integrates the same Ctrl-X toggle functionality into standard Zsh sessions. As described in README lines 64-84, this plugin adds Kimi to your Zsh plugin list, making the AI assistant available in your regular shell environment without launching a separate application.

## IDE Integration and Protocol Support

Kimi-CLI functions as a language server and client simultaneously, supporting both proprietary extensions and open protocols.

### VS Code Extension

The **Kimi Code** extension enables running Kimi inside VS Code, displaying output in a dedicated side panel and allowing prompt submission directly from the editor. This integration, referenced in README lines 31-35, bridges the gap between terminal-based AI and graphical IDE workflows.

### ACP Server Mode

Kimi-CLI implements the **Agent Client Protocol (ACP)**, allowing it to act as a server that accepts connections from ACP-compatible clients. Running `kimi acp` starts a server that handles `/login` requests from editors like Zed or JetBrains IDEs (README lines 37-44). Once authenticated, these clients forward user messages to Kimi and receive streamed responses, effectively turning any ACP-aware editor into a Kimi front-end.

```bash

# Start the ACP server

$ kimi acp

# In your IDE (Zed or JetBrains), send /login to connect

# Subsequent prompts are handled by Kimi via the protocol

```

## MCP Tool Integration and Orchestration

Beyond basic command execution, Kimi-CLI manages sophisticated tool ecosystems through the Model Context Protocol.

### Managing Remote MCP Servers

The built-in `kimi mcp` subcommands provide granular control over external AI-powered tools. As documented in README lines 86-112, you can add, list, remove, and authorize remote MCP servers using various transports including HTTP, stdio, and OAuth. This enables Kimi to call external specialized tools dynamically during conversation flows.

```bash

# Add a remote MCP server with HTTP transport

$ kimi mcp add --transport http \
    context7 https://mcp.context7.com/mcp \
    --header "CONTEXT7_API_KEY: your-key"

```

### Asynchronous Tool Orchestration

At the architecture level, the `kosong` LLM abstraction layer in `packages/kosong` handles asynchronous tool execution. Tool calls are awaited, results are streamed back to the agent, and `KimiSoul`—implemented in [`src/kimi_cli/soul/kimisoul.py`](https://github.com/MoonshotAI/kimi-cli/blob/main/src/kimi_cli/soul/kimisoul.py)—dynamically decides the next step, whether running a shell command, fetching a URL, or invoking an MCP tool.

## Extensibility Architecture

Kimi-CLI's design prioritizes modularity through its skill system and protocol-based UI architecture.

### The Skill System

Skills in Kimi-CLI are modular extensions that package custom workflows, scripts, reference documentation, and assets. According to [`src/kimi_cli/skills/skill-creator/SKILL.md`](https://github.com/MoonshotAI/kimi-cli/blob/main/src/kimi_cli/skills/skill-creator/SKILL.md), skills are discovered automatically from built-in, user, and project directories, and can be distributed as `.skill` archives. This system allows teams to standardize repetitive development tasks and share domain-specific knowledge.

```bash

# Load a custom skill containing a PDF-rotate script

$ kimi skill add my-pdf-rotate.skill

# Trigger the skill through natural language

$ kimi ask "Please rotate my file to portrait"

```

### Pluggable UI Back-Ends and Wire Protocol

The core `KimiSoul` loop communicates via the **Wire** protocol, streaming events that UI layers consume to render interfaces. Located in `src/kimi_cli/ui/`, these front-end implementations support TUI, web UI, or ACP streams without modifying the core runtime. The protocol definitions in [`src/kimi_cli/wire/protocol.py`](https://github.com/MoonshotAI/kimi-cli/blob/main/src/kimi_cli/wire/protocol.py) and JSON-RPC implementation in [`src/kimi_cli/wire/jsonrpc.py`](https://github.com/MoonshotAI/kimi-cli/blob/main/src/kimi_cli/wire/jsonrpc.py) enable third-party developers to build alternative interfaces.

```python

# Interact with Kimi via Wire RPC from Python

from kimi_cli.wire.jsonrpc import JSONRPCClient

client = JSONRPCClient("http://localhost:8000")
response = client.call("run", {"prompt": "Explain async vs sync in Python"})
print(response.result)

```

## Enhanced Output and Rendering

Kimi-CLI includes sophisticated output formatting capabilities that improve readability of generated content.

### Rich Markdown Support

The internal Markdown renderer supports **task lists**, **definition lists**, tables, code blocks, and blockquotes. As shown in [`src/kimi_cli/utils/rich/markdown_sample.md`](https://github.com/MoonshotAI/kimi-cli/blob/main/src/kimi_cli/utils/rich/markdown_sample.md) (lines 89-96), this formatting engine produces polished output suitable for technical documentation, structured reports, and todo-lists directly in the terminal.

## Summary

- **Shell Command Mode** provides OS-level execution via Ctrl-X toggle, available both natively and through Zsh plugin integration.
- **Protocol Support** includes ACP server capabilities for IDE integration and MCP tool management for external AI services.
- **Skill System** enables modular extension through `.skill` archives containing workflows, scripts, and documentation.
- **Pluggable Architecture** separates core logic in `KimiSoul` from UI implementations via the Wire protocol, supporting TUI, web, and JSON-RPC interfaces.
- **Rich Rendering** delivers formatted Markdown output including tables and task lists for improved readability.

## Frequently Asked Questions

### How do I enable shell command mode in Kimi-CLI?

Press **Ctrl-X** while in a Kimi session to toggle shell command mode. In this state, any text you type is executed as a system command by the underlying OS rather than sent as a chat message. This feature is also available in standard Zsh terminals through the `zsh-kimi-cli` plugin.

### What is the difference between ACP and MCP in Kimi-CLI?

**ACP (Agent Client Protocol)** allows Kimi-CLI to run as a server (`kimi acp`) that accepts connections from compatible IDEs like Zed or JetBrains, effectively turning the editor into a client. **MCP (Model Context Protocol)** refers to the tool integration layer (`kimi mcp` commands) that enables Kimi to call external AI-powered tools and services during conversations.

### How does the Skill system work in Kimi-CLI?

Skills are modular packages containing custom workflows, scripts, and documentation that extend Kimi's capabilities. They are automatically discovered from built-in, user, and project directories, and can be packaged as `.skill` archives for distribution. The system is documented in [`src/kimi_cli/skills/skill-creator/SKILL.md`](https://github.com/MoonshotAI/kimi-cli/blob/main/src/kimi_cli/skills/skill-creator/SKILL.md) and allows organizations to standardize domain-specific development tasks.

### Can I use Kimi-CLI with JetBrains IDEs?

Yes. Kimi-CLI supports the Agent Client Protocol (ACP), which allows JetBrains IDEs (and other ACP-compatible clients) to connect to a running Kimi server. Start the server with `kimi acp`, then use `/login` from your IDE to establish the connection and stream prompts and responses between the editor and Kimi.