kimi-lite

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2026 License: MIT

README

kimi-lite

CI

Go port of the original Python AI coding client.

A single-terminal AI assistant with no Node, Python runtime, or Electron dependencies.

Features

  • Streaming TUI chat — native Bubble Tea interface with multi-line input, history, and sidebar file browser.
  • Built-in toolsread_file, write_file, str_replace_file, edit, glob, grep, shell, fetch_url, list_directory, web_search, and read_video (ffmpeg/ffprobe) with sandboxed file access.
  • Subagents — delegate focused work to coder, explore, and plan subagents via dispatch_subagent.
  • Lifecycle hooks — run local commands at session_start, turn_start, turn_end, tool_call, tool_result, approval_request, and approval_decision.
  • ACP serverkimi-lite acp speaks JSON-RPC 2.0 over stdio for external agent integration.
  • Risk-aware approvals — every tool call is scored low/medium/high; destructive or sandbox-escaping operations require approval.
  • Context compression/compact summarizes older history using a language-aware token estimator.
  • Observability--pprof runtime profiling and internal metrics collection.
  • MCP support — connect to Model Context Protocol servers via stdio or HTTP.

Installation

go install github.com/ekhodzitsky/kimi-lite/cmd/kimi-lite@latest

Or build from source:

git clone https://github.com/ekhodzitsky/kimi-lite.git
cd kimi-lite
make build

Configuration

Create ~/.config/kimi-lite/config.toml:

[llm]
provider = "moonshot"
api_key = "YOUR_API_KEY"
model = "kimi-k2.5"
base_url = "https://api.moonshot.cn/v1"
timeout = "60s"

[permission]
risk_threshold = "medium"

[[permission.risk_rules]]
tool = "shell"
level = "high"
message = "shell commands always require approval"

[behavior]
# Load specific skills by name, or leave empty to load every .md file in ~/.config/kimi-lite/skills/.
skills = ["go", "python"]

Drop skill files into ~/.config/kimi-lite/skills/ (e.g. go.md, python.md); their contents are appended to the system prompt.

Usage

kimi-lite                        # start a new session
kimi-lite --continue             # resume the last session
kimi-lite --session <id>         # resume a specific session
kimi-lite --pprof localhost:6060 # expose runtime profiling endpoints
kimi-lite acp                    # start an ACP server over stdio

Inside the chat:

Command Description
/compact Summarize conversation history
/clear Clear current conversation
/sessions List available sessions

The agent can also dispatch focused subagents (coder, explore, plan) via the dispatch_subagent tool for parallel, isolated work, and run local lifecycle hooks at key events such as tool calls and approvals. Context compression (/compact) uses a language-aware token estimator to keep long conversations within the model's context window.

Quality

  • Tests run with -race on Ubuntu and macOS.
  • Fuzz tests cover hot paths such as token estimation, path validation, and HTTP chunk parsing.
  • goleak verifies no goroutine leaks after long-running smoke tests.
  • make coverage-gate enforces 70% statement coverage.
  • make lint runs golangci-lint with a strict v2 configuration.
  • Reproducible static binaries via make build and cross-compilation via make cross-compile.

Development

make test    # run tests with race detector
make lint    # run golangci-lint
make build   # build binary
make fuzz    # run fuzz smoke tests
make bench   # run benchmarks

Status

This is a Go reimplementation of the original Python client, rewritten with dependency injection, context cancellation, and zero global state. The core feature set is implemented and the API is stabilizing; see CHANGELOG.md for recent additions.

License

MIT — see LICENSE for details.

Directories

Path Synopsis
cmd
kimi-lite command
Command kimi-lite is the AI coding CLI application.
Command kimi-lite is the AI coding CLI application.
internal
acp
Package acp implements an Agent Client Protocol (ACP) server speaking JSON-RPC 2.0 over stdio.
Package acp implements an Agent Client Protocol (ACP) server speaking JSON-RPC 2.0 over stdio.
app
Package app provides the application layer and DI container for kimi-lite.
Package app provides the application layer and DI container for kimi-lite.
config
Package config provides configuration types and loading for kimi-lite.
Package config provides configuration types and loading for kimi-lite.
core/hooks
Package hooks implements lifecycle hook execution for the core agent.
Package hooks implements lifecycle hook execution for the core agent.
core/subagents
Package subagents implements ephemeral, non-persistent subagent runners.
Package subagents implements ephemeral, non-persistent subagent runners.
git
Package git provides an api.GitProvider implementation that shells out to git.
Package git provides an api.GitProvider implementation that shells out to git.
idgen
Package idgen provides a shared ID generation utility.
Package idgen provides a shared ID generation utility.
llm
Package llm provides an OpenAI-compatible LLM client with SSE streaming support.
Package llm provides an OpenAI-compatible LLM client with SSE streaming support.
mcp
Package mcp provides an MCP client implementation using JSON-RPC over stdio.
Package mcp provides an MCP client implementation using JSON-RPC over stdio.
netutil
Package netutil provides network utilities with SSRF-hardening.
Package netutil provides network utilities with SSRF-hardening.
observability
Package observability provides lightweight metrics collection and runtime profiling helpers using only the Go standard library.
Package observability provides lightweight metrics collection and runtime profiling helpers using only the Go standard library.
store
Package store provides SQLite persistence for kimi-lite sessions.
Package store provides SQLite persistence for kimi-lite sessions.
tui
Package tui provides the Terminal UI layer for kimi-lite using Bubble Tea.
Package tui provides the Terminal UI layer for kimi-lite using Bubble Tea.
tui/input
Package input provides a multi-line input component for the kimi-lite TUI.
Package input provides a multi-line input component for the kimi-lite TUI.
tui/messages
Package messages provides chat message rendering for the kimi-lite TUI.
Package messages provides chat message rendering for the kimi-lite TUI.
tui/sidebar
Package sidebar provides a file browser sidebar for the kimi-lite TUI.
Package sidebar provides a file browser sidebar for the kimi-lite TUI.
tui/styles
Package styles provides Lipgloss styles for the kimi-lite TUI.
Package styles provides Lipgloss styles for the kimi-lite TUI.
tui/viewport
Package viewport provides a scrollable output area for the kimi-lite TUI.
Package viewport provides a scrollable output area for the kimi-lite TUI.
pkg
api
Package api provides public types for kimi-lite.
Package api provides public types for kimi-lite.
scripts
benchregression command
Command benchregression parses Go benchmark output and compares it against a baseline.
Command benchregression parses Go benchmark output and compares it against a baseline.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL