{"id":5776,"library":"kimi-cli","title":"Kimi Code CLI","description":"Kimi Code CLI is an AI agent that runs in the terminal, assisting with software development tasks and terminal operations. It can read and edit code, execute shell commands, search web pages, and autonomously plan and adjust actions. The library is actively maintained with frequent updates, with the current version being 1.33.0.","status":"active","version":"1.33.0","language":"en","source_language":"en","source_url":"https://github.com/MoonshotAI/kimi-cli","tags":["AI agent","CLI","developer tools","code generation","terminal","automation"],"install":[{"cmd":"uv tool install kimi-cli python@3.13","lang":"bash","label":"Recommended installation with uv"},{"cmd":"pip install kimi-cli","lang":"bash","label":"Standard pip installation"}],"dependencies":[{"reason":"Recommended high-performance tool for managing Python environments and installing kimi-cli.","package":"uv","optional":false},{"reason":"Requires Python 3.12 or higher, with 3.13 recommended.","package":"python","optional":false},{"reason":"Core dependency for IDE integrations.","package":"agent-client-protocol"},{"reason":"Asynchronous HTTP client/server framework.","package":"aiohttp"},{"reason":"Fast, high-performance web framework used internally.","package":"fastapi"},{"reason":"Model Context Protocol (MCP) integration.","package":"fastmcp"},{"reason":"LLM abstraction layer.","package":"kosong"},{"reason":"Logging library.","package":"loguru"},{"reason":"Data validation and settings management.","package":"pydantic"},{"reason":"CLI framework built on top of Click.","package":"typer"},{"reason":"ASGI web server.","package":"uvicorn"},{"reason":"WebSocket protocol implementation.","package":"websockets"}],"imports":[{"note":"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.","symbol":"kimi_cli","correct":"kimi"}],"quickstart":{"code":"# Install Kimi CLI (recommended with uv and Python 3.13)\nuv tool install kimi-cli python@3.13\n\n# Verify installation\nkimi --help\n\n# Start Kimi CLI in interactive mode\nkimi\n\n# Inside Kimi CLI, use /setup to configure (e.g., API key)\n# /setup\n\n# Or, use kimi ask for a single question directly from the shell\nexport MOONSHOT_API_KEY=\"$(os.environ.get('MOONSHOT_API_KEY', ''))\" # Ensure API key is set for non-interactive use\nkimi ask \"Generate a Python function to calculate the factorial of a number.\"\n\n# To start an interactive chat session:\nkimi chat","lang":"bash","description":"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."},"warnings":[{"fix":"Exit and restart `kimi` in the desired directory or launch with `kimi --work-dir /path/to/project`.","message":"The `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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Add the terminal application to 'System Settings → Privacy & Security → Developer Tools'.","message":"On 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.","severity":"gotcha","affected_versions":"All versions on macOS"},{"fix":"Verify your API key is correct and valid, and ensure network connectivity to the API service addresses (e.g., api.kimi.com, api.moonshot.cn).","message":"Empty 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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure input is valid JSON, uses UTF-8 encoding, and consistent line endings (`\\n`).","message":"When 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`).","severity":"gotcha","affected_versions":"All versions"},{"fix":"Monitor for official updates addressing performance, consider using `--work-dir` in smaller, relevant subdirectories, or provide more focused prompts to limit context.","message":"Performance 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.","severity":"gotcha","affected_versions":"Potentially all versions, especially with large codebases"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}