Install and verify Kimi Code CLI (command kimi). The Agent handles the terminal steps; the customer only completes account login and authorization on the official Kimi page.
Customer-readable instructions
What this skill can do
| Customer wants | Skill will do | Customer can see |
|---|---|---|
| Install Kimi Code | Check existing sources and install using the official stable channel | Version, install method, install and config directories |
| Check or update | Compare versions from official npm release metadata; after explicit authorization, update along the original source | Whether an update is available and the result |
| Log in to Kimi | Launch kimi login or the interactive interface's /login |
Official browser authorization steps |
| Command unavailable | Check PATH, duplicate installs, and config directories | Blocking cause and safe fix |
How the customer uses it
- The customer says "install Kimi Code CLI"; the customer is not asked to copy terminal commands.
- The Agent first performs a read-only check and shows the plan; installing a missing CLI does not authorize updating an existing CLI.
- When only "update Kimi" is said, first show the current and latest versions; only execute the update when "update to the latest version" is explicit.
- Login is initiated by the Agent, and the customer only clicks authorize on the official Moonshot/Kimi page; do not send tokens, passwords, or authorization codes.
- After completion, verify the version, help command, and login status, then output the fixed ten-column list.
First login and real configuration verification
~/.kimi-codeis a candidate data directory; the user config file is~/.kimi-code/config.toml, and the skill must separately check whether the directory and file actually exist.- On first run, Kimi Code can automatically create
config.toml; if the directory or file does not exist, the Agent launcheskimi login(device code flow) or the TUI's/login, and the customer completes authorization on the official Kimi page. - Using the Kimi Code hosted service does not require the customer to manually enter an API key; only if the customer chooses Kimi Platform or another provider should the corresponding provider be written according to the official config file, and the application entry point is subject to the official page. Keys must not be sent into the chat.
- After login or configuration, run
kimi doctor、kimi --versionand a side-effect-free launch; if authorization has not been completed, write "waiting for first login/configuration" as the result, and do not only show the default directory.
Dependencies and installation
| Dependency | Type | What to do if missing |
|---|---|---|
| Officially supported operating systems | Hard dependency | If unsupported, stop and explain |
| Node.js/npm | npm channel dependency | Not needed for the official standalone install; the npm channel requires the Node.js specified by the official documentation, and if missing, call soia-env-node-install |
| Network diagnostics | Optional prerequisite | Call when the official install or login site is unreachable soia-env-network-diagnose |
| Kimi account | Login dependency | The customer authorizes in the official browser; the Agent does not read credentials |
For official sources and operating requirements, see official-sources.md。
Standard procedure
- Run
python3 scripts/inspect_cli.py --json, read-only detection ofkimi, version, source, installation directory, andKIMI_CODE_HOME/default configuration directory and the actual existence status ofconfig.toml. - Run
python3 scripts/check_latest.py --json, read from the official npm metadata the@moonshot-ai/kimi-codelatest version. - When installed and functioning normally, write "Installed"; if there is no explicit authorization for the latest version, stop and do not call product update commands.
- When not installed, prefer the official standalone installation; when the customer chooses npm, use
npm install -g @moonshot-ai/kimi-code, and first verify that Node.js meets the official requirements. Network scripts must first be downloaded to a separate temporary directory and checked, then the local copy executed; do not directly execute network responses. - After explicitly updating to the latest: for standalone sources use
kimi upgradeor thekimi updatesupported by the current version; for npm sources usenpm install -g @moonshot-ai/kimi-code@latest. Do not silently switch sources. - Verify the
--version、--helpof the same absolute path and the login status. When not logged in, launchkimi login, and hand the browser over to the customer. - Recheck the version, source, and directory, and use
scripts/render_status.pyto output one line of customer status.
Product auto-update boundaries
- Kimi Code CLI may check for updates in the background; the skill does not proactively update by default, but the product behavior must be disclosed.
- Read-only checks must not modify
KIMI_CODE_NO_AUTO_UPDATEortui.tomlthe auto-update settings. - When the customer requests adjusting auto-update, first show the impact and confirm separately; do not treat configuration authorization as authorization for this upgrade.
Customer status list (mandatory)
The reply must begin with the following ten-column table, outputting only one row Kimi Code CLI:
| Skill | Current Status | Current Version | Latest Version | Running Status | Installation Method | Installation Directory | Configuration File Directory | Update Time | Handling Result |
|---|---|---|---|---|---|---|---|---|---|
| Kimi Code CLI | <Installed/Not Installed/Blocked> | <Version or Not Obtained> | <Version or Not Obtained> | <Normal/Abnormal/Unverified> | <Official Standalone Installation/npm Global Installation/Not Obtained> | <Directory or Not Obtained> | <Directory or Not Obtained> | <Installed/Already Latest/Updatable, Not Executed/Awaiting Confirmation Whether to Update to Latest/Updated/Awaiting Login/Blocked: Reason> |
- When the user only asks about Kimi Code CLI, do not add rows for Node.js, npm, other AI CLIs, or other skills.
更新时间is the final verification time; for directories use~relative paths to avoid usernames.- After updating,
当前状态is still "Installed"; for multiple copies, report only the one in effect in the login shell and indicate the conflict. - If obtaining the latest version fails, write "Not Obtained"; do not guess.
config_status=未创建orconfig_file_status=未创建, write "Awaiting First Login/Configuration" in the handling result, and providekimi login、/loginand the official page; do not treat candidate paths as already configured.
Intermediate states of installation and update
When actually installing or updating, generate a random run_id, and immediately call at each actual stage scripts/record_install_progress.py, synchronously display inspection, planning, waiting for confirmation, installation/update, verification, and terminal states. Read-only inspection does not create state.
| Phase | Current Status | Update Time | Processing Result |
|---|---|---|---|
| <inspection/planning/waiting for confirmation/installation or update/verification/completed or failed> | <in progress/waiting/completed/failed/blocked> | <redacted result> |
The update execution and verification phases must carry the customer's explicit latest-version authorization marker. Phase events only store fixed codes and timestamps, and do not store accounts, credentials, response bodies, full command text, or private paths.
Permissions and Rollback
- Prefer user-level installation; do not use
sudoby default. Confirm first before modifying PATH/profile, switching sources, or performing system-wide installation. - Before updating, record the old version and source; on failure, keep the original installation and do not automatically uninstall, downgrade, or clean up configuration.
- Temporary installation content is cleaned up after success, failure, or cancellation.
Private Information and Intermediate Data
- Login credentials are managed by the Kimi official login state and the system credential store; do not read or print the credential contents within
~/.kimi-code. - Non-secret configuration is kept in
KIMI_CODE_HOMEor the default directory; SOIA does not create a separate credential file. - Machine-change phase records are written to user-private state; version checks are stateless by default.
- Do not record tokens, cookies, passwords, authorization codes, accounts, response bodies, or customer-private absolute paths.
Logs and Completion Receipt
The final receipt includes the fixed ten-column table, version and help verification, whether the automatic update setting is read-only, and whether the customer still needs to log in via browser. Normal dependencies are not expanded into additional rows.
Forward Testing
Use a temporary fake kimi to cover missing, normal, abnormal, and multiple copies; mock the npm latest-version response; verify ten-column rendering,KIMI_CODE_HOME, path redaction, no update by default, and the authorization gate.
Install the entire domain (Claude Code and Codex share the same domain plugin):
claude plugin marketplace add soia-team/soia-open-skills
claude plugin install soia-env@soia
Install only this one skill:
npx skills add soia-team/soia-open-env-skills -g -a '*' -s soia-env-kimi-cli-install -y
WorkBuddy 's loading unit is role-based experts rather than plugins,npx skills add -a '*' cannot cover it, and it needs to be installed separately, see docs/install/workbuddy.md。