Request
Add install and configuration support for Kimi Code CLI, Moonshot AI's terminal coding agent.
Split out of the original three-Agent request. ZCode is a desktop application and is tracked separately; Trae is a uv install-from-source agent and is also tracked separately. See the linked issues.
What it is
MoonshotAI/kimi-code, MIT-licensed. Reads and edits code, runs shell commands, searches files, fetches web pages. Model-agnostic: the README states it works with Moonshot's models out of the box and can be configured for other compatible providers, which is the property OneAgent needs.
Confirmed facts
Config file is TOML at ~/.kimi-code/config.toml. Per the getting started guide, ~/.kimi-code/ holds config, session records, logs and update cache. This is the single most useful finding: we already have a TOML adapter (go-toml/v2, used by the codex reader and writer), so the config plumbing is a known shape rather than a new one.
KIMI_CODE_HOME relocates that directory. Config discovery must respect it rather than hardcoding ~/.kimi-code.
Custom providers are configured by editing that file. The docs say that to connect Anthropic, OpenAI, Google or other providers you edit ~/.kimi-code/config.toml directly. That is exactly the kind of write OneAgent does. First-party base URLs, for reference:
| Platform |
Base URL |
| Kimi Code (OpenAI compatible) |
https://api.kimi.com/coding/v1 |
| Kimi Code (Anthropic compatible) |
https://api.kimi.com/coding/ |
| Kimi Open Platform |
https://api.moonshot.cn/v1 |
Note for whoever tests this: api.kimi.com and api.moonshot.cn are independent account systems and their keys are not interchangeable. An auth failure during development is likely this, not a bug in our writer.
Two install channels, and they disagree about Node.js.
The README documents an installer script and describes single-binary distribution needing no Node.js:
macOS/Linux: curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash
Windows: irm https://code.kimi.com/kimi-code/install.ps1 | iex
The getting-started guide instead says the CLI is written in TypeScript, distributed via npm, and needs Node.js 22.19.0 or later. Both are probably true — the script installs a bundled binary, npm installs the package — but the npm package name is not stated in either source. The page's code blocks render empty. The repo is referenced as MoonshotAI/kimi-cli, which hints at the name but does not confirm it.
Do not install @jacksontian/kimi or @jacksontian/kimi-cli. Those are unrelated third-party wrappers for the Kimi chat API, not this agent.
Recommended install path
Prefer npm once the package name is confirmed, not official-script. An npm package is pinnable to an exact version and auditable; a piped installer is neither, and internal/install/install.go already supports exact-version npm installs with registry selection and mirror support. official-script exists for hermes because Hermes has no published package — Kimi does, so it should not need the weaker contract.
Falling back to official-script is acceptable if the package name cannot be confirmed. That path is already implemented (internal/catalog/manifest.go:146,155, internal/app/install.go:339,612) with hermes as the working precedent. Note install.go:178 refuses an exact version request for official-script Agents, which is the tradeoff.
Remaining unknown
One item blocks a complete manifest entry: the npm package name. Resolve by checking the repo README's install section directly, or by running the installer in a scratch container and reading what it fetches.
Everything else needed for an auto entry is now known.
Implementation checklist
Per CLAUDE.md, the order is manifest metadata → config adapter → Go tests.
- Manifest entry in
manifests/agents.lock.json: command: "kimi", config_path: ".kimi-code/config.toml", version_args: ["--version"], rank: 8, platforms: [macos, linux, windows], and a package block with the resolved manager.
- Windows prerequisites. Git for Windows is required — the CLI runs on bundled Git Bash.
KIMI_SHELL_PATH overrides the bash.exe location when it is not in the default place. Both belong in windows_prerequisites and windows_note.
- Config discovery must honour
KIMI_CODE_HOME. configPath() in internal/app/status.go derives paths from Home plus a manifest-declared relative path, so an env-var override needs handling similar to how ReadClaudeConfig takes envVars (internal/config/discovery.go:42).
- Reader in
internal/config/discovery.go plus a case in readerFor. The TOML parse can follow ReadCodexConfig (:24-40), including its ManagedByOneAgent detection pattern — report managed only when the provider entry we write is actually present.
- Writer in
internal/config/write.go plus a case in internal/app/agent.go. Must preserve unrelated sections and be a true no-op when nothing changes.
- Protocol mapping in
internal/catalog/public.go:adapterProtocols. The two first-party base URLs suggest it can speak both OpenAI and Anthropic shapes; pick based on what the config schema actually selects, and remember docs/ policy is that /v1/models cannot stand in for a real protocol check.
- Golden fixtures for the config format, matching the existing
internal/config test layout.
internal/catalog/catalog_test.go:30 asserts the automatic Agent count is exactly 6. It will fail deliberately. Update the number as part of this change — that tripwire exists because a previous commit silently removed entries.
- Regenerate
internal/app/testdata/status-empty-linux-arm64.json. Edit it surgically; decoding through a plain map reorders every key and produces a useless diff.
- Icon in
frontend/src/components/icons/agents.tsx with rights recorded in asset-rights.json, and a NOTICE update. docs/distribution-compliance-policy.md makes this a release precondition, and the licence generator does not check NOTICE prose — it has drifted before.
agents.lock.json is vendored by MaimoryLab/OneAgent-site from release tags, so the public site will not list Kimi until a release ships.
Priority
P2. Actionable once the package name is confirmed; the config format being TOML means it reuses machinery we already have.
Request
Add install and configuration support for Kimi Code CLI, Moonshot AI's terminal coding agent.
Split out of the original three-Agent request. ZCode is a desktop application and is tracked separately; Trae is a
uvinstall-from-source agent and is also tracked separately. See the linked issues.What it is
MoonshotAI/kimi-code, MIT-licensed. Reads and edits code, runs shell commands, searches files, fetches web pages. Model-agnostic: the README states it works with Moonshot's models out of the box and can be configured for other compatible providers, which is the property OneAgent needs.
Confirmed facts
Config file is TOML at
~/.kimi-code/config.toml. Per the getting started guide,~/.kimi-code/holds config, session records, logs and update cache. This is the single most useful finding: we already have a TOML adapter (go-toml/v2, used by thecodexreader and writer), so the config plumbing is a known shape rather than a new one.KIMI_CODE_HOMErelocates that directory. Config discovery must respect it rather than hardcoding~/.kimi-code.Custom providers are configured by editing that file. The docs say that to connect Anthropic, OpenAI, Google or other providers you edit
~/.kimi-code/config.tomldirectly. That is exactly the kind of write OneAgent does. First-party base URLs, for reference:https://api.kimi.com/coding/v1https://api.kimi.com/coding/https://api.moonshot.cn/v1Note for whoever tests this:
api.kimi.comandapi.moonshot.cnare independent account systems and their keys are not interchangeable. An auth failure during development is likely this, not a bug in our writer.Two install channels, and they disagree about Node.js.
The README documents an installer script and describes single-binary distribution needing no Node.js:
The getting-started guide instead says the CLI is written in TypeScript, distributed via npm, and needs Node.js 22.19.0 or later. Both are probably true — the script installs a bundled binary, npm installs the package — but the npm package name is not stated in either source. The page's code blocks render empty. The repo is referenced as
MoonshotAI/kimi-cli, which hints at the name but does not confirm it.Do not install
@jacksontian/kimior@jacksontian/kimi-cli. Those are unrelated third-party wrappers for the Kimi chat API, not this agent.Recommended install path
Prefer
npmonce the package name is confirmed, notofficial-script. An npm package is pinnable to an exact version and auditable; a piped installer is neither, andinternal/install/install.goalready supports exact-version npm installs with registry selection and mirror support.official-scriptexists forhermesbecause Hermes has no published package — Kimi does, so it should not need the weaker contract.Falling back to
official-scriptis acceptable if the package name cannot be confirmed. That path is already implemented (internal/catalog/manifest.go:146,155,internal/app/install.go:339,612) withhermesas the working precedent. Noteinstall.go:178refuses an exact version request forofficial-scriptAgents, which is the tradeoff.Remaining unknown
One item blocks a complete manifest entry: the npm package name. Resolve by checking the repo README's install section directly, or by running the installer in a scratch container and reading what it fetches.
Everything else needed for an
autoentry is now known.Implementation checklist
Per
CLAUDE.md, the order is manifest metadata → config adapter → Go tests.manifests/agents.lock.json:command: "kimi",config_path: ".kimi-code/config.toml",version_args: ["--version"],rank: 8,platforms: [macos, linux, windows], and apackageblock with the resolved manager.KIMI_SHELL_PATHoverrides thebash.exelocation when it is not in the default place. Both belong inwindows_prerequisitesandwindows_note.KIMI_CODE_HOME.configPath()ininternal/app/status.goderives paths fromHomeplus a manifest-declared relative path, so an env-var override needs handling similar to howReadClaudeConfigtakesenvVars(internal/config/discovery.go:42).internal/config/discovery.goplus a case inreaderFor. The TOML parse can followReadCodexConfig(:24-40), including itsManagedByOneAgentdetection pattern — report managed only when the provider entry we write is actually present.internal/config/write.goplus a case ininternal/app/agent.go. Must preserve unrelated sections and be a true no-op when nothing changes.internal/catalog/public.go:adapterProtocols. The two first-party base URLs suggest it can speak both OpenAI and Anthropic shapes; pick based on what the config schema actually selects, and rememberdocs/policy is that/v1/modelscannot stand in for a real protocol check.internal/configtest layout.internal/catalog/catalog_test.go:30asserts the automatic Agent count is exactly 6. It will fail deliberately. Update the number as part of this change — that tripwire exists because a previous commit silently removed entries.internal/app/testdata/status-empty-linux-arm64.json. Edit it surgically; decoding through a plain map reorders every key and produces a useless diff.frontend/src/components/icons/agents.tsxwith rights recorded inasset-rights.json, and aNOTICEupdate.docs/distribution-compliance-policy.mdmakes this a release precondition, and the licence generator does not checkNOTICEprose — it has drifted before.agents.lock.jsonis vendored by MaimoryLab/OneAgent-site from release tags, so the public site will not list Kimi until a release ships.Priority
P2. Actionable once the package name is confirmed; the config format being TOML means it reuses machinery we already have.