Install & Compatibility
Where this runs
tested against v1.49.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.10
✕ build_error
✕ build_error
py 3.11
✕ build_error
✕ build_error
py 3.9
✕ build_error
✕ build_error
312MB installed
● package 312MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
kimi_cli
✓ kimi
kimi-cli is primarily a command-line interface tool and is not typically imported as a Python library for direct programmatic use. For programmatic interaction, the 'kimi-agent-sdk' should be used.
This quickstart demonstrates how to install Kimi Code CLI using `uv` and then interact with it directly from the terminal. It covers verifying the installation, launching the interactive agent, and asking a single question using `kimi ask`. Ensure your `MOONSHOT_API_KEY` is set as an environment variable for direct commands or use `/setup` within the interactive CLI.
# Install Kimi CLI (recommended with uv and Python 3.13)
uv tool install kimi-cli python@3.13
# Verify installation
kimi --help
# Start Kimi CLI in interactive mode
kimi
# Inside Kimi CLI, use /setup to configure (e.g., API key)
# /setup
# Or, use kimi ask for a single question directly from the shell
export MOONSHOT_API_KEY="$(os.environ.get('MOONSHOT_API_KEY', ''))" # Ensure API key is set for non-interactive use
kimi ask "Generate a Python function to calculate the factorial of a number."
# To start an interactive chat session:
kimi chat
kimi --version
Debug
Known issues
gotchaThe `cd` command does not change the working directory of Kimi Code CLI in shell mode. Each shell command runs in an independent subprocess, so directory changes are local to that process. To change the working directory, restart `kimi` in the target directory or use the `--work-dir` flag.fixExit and restart `kimi` in the desired directory or launch with `kimi --work-dir /path/to/project`.
affects: All versions
gotchaOn macOS, the first run of the `kimi` command may experience a delay due to security checks. Adding your terminal application to 'System Settings → Privacy & Security → Developer Tools' can speed up subsequent launches.fixAdd the terminal application to 'System Settings → Privacy & Security → Developer Tools'.
affects: All versions on macOS
gotchaEmpty model list during `/login` or `Invalid API key` errors often indicate an incorrect or expired API key, or network connection issues to the API service.fixVerify your API key is correct and valid, and ensure network connectivity to the API service addresses (e.g., api.kimi.com, api.moonshot.cn).
affects: All versions
gotchaWhen providing input in print/wire mode, common issues include JSON format errors, encoding problems (ensure UTF-8), and line ending inconsistencies (Windows users should use `\n` not `\r\n`).fixEnsure input is valid JSON, uses UTF-8 encoding, and consistent line endings (`\n`).
affects: All versions
gotchaPerformance bottlenecks have been observed with large repositories, where tool calls might take multiple seconds due to overheads like full file reads, total cache invalidation, and multiple large operations on every step.fixMonitor for official updates addressing performance, consider using `--work-dir` in smaller, relevant subdirectories, or provide more focused prompts to limit context.
affects: Potentially all versions, especially with large codebases
Upgrade
Version history
1.49.0latest on PyPI · released Jul 16, 2026
Audit
Dependencies
uvrequiredRecommended high-performance tool for managing Python environments and installing kimi-cli.
pythonrequiredRequires Python 3.12 or higher, with 3.13 recommended.
agent-client-protocolrequiredCore dependency for IDE integrations.
aiohttprequiredAsynchronous HTTP client/server framework.
fastapirequiredFast, high-performance web framework used internally.
fastmcprequiredModel Context Protocol (MCP) integration.
kosongrequiredLLM abstraction layer.
logururequiredLogging library.
pydanticrequiredData validation and settings management.
typerrequiredCLI framework built on top of Click.
uvicornrequiredASGI web server.
websocketsrequiredWebSocket protocol implementation.