Find the active Kimi command
This tells you which package manager or installer probably owns the executable.
command -v kimi
kimi --version
npm list -g --depth=0 | grep -i kimi
pnpm list -g --depth=0 | grep -i kimi
yarn global list | grep -i kimi
Kimi Code cleanup
Remove Kimi Code from npm, pnpm, yarn, native installs, IDE extensions, and local login state without deleting the wrong data.
First identify how Kimi Code was installed. Removing a global npm package is different from removing a native app, VS Code extension, plugin, or the local data directory that stores sessions and credentials.
If you only want to stop the CLI, uninstall the package or app. If you want a clean account state, sign out and remove the documented credential or data folders after exporting anything you still need.
Use the same install channel that originally added Kimi Code. Move data aside before deleting anything permanently.
This tells you which package manager or installer probably owns the executable.
command -v kimi
kimi --version
npm list -g --depth=0 | grep -i kimi
pnpm list -g --depth=0 | grep -i kimi
yarn global list | grep -i kimi
Keep a session archive before touching credentials, plugins, or the data root.
mkdir -p "$HOME/kimi-code-backup"
kimi export -y -o "$HOME/kimi-code-backup/latest-session.zip"
Run only the line that matches how Kimi Code was installed.
npm uninstall -g <package-name>
pnpm remove -g <package-name>
yarn global remove <package-name>
This preserves a rollback copy instead of deleting local state immediately.
KIMI_CODE_HOME="${KIMI_CODE_HOME:-$HOME/.kimi-code}"
mkdir -p "$HOME/kimi-code-backup"
test -d "$KIMI_CODE_HOME" && mv "$KIMI_CODE_HOME" "$HOME/kimi-code-backup/kimi-code-home-$(date +%Y%m%d-%H%M%S)"
Copy this prompt into Kimi Code, K3Nova, or another AI agent. Keep approval manual for file writes, shell commands, account actions, and secrets.
Use this to give the agent the task and safety boundary in one message.
You are my AI agent for this task: uninstall Kimi Code safely while preserving sessions, config, credentials, and plugin data until I approve removal.
Start by restating the goal and the permissions you need.
Use official docs or the files I provide before making claims.
Give me a direct answer first, then a short table or checklist.
If commands are needed, show exact copyable commands without a shell prompt.
Ask before writing files, running shell commands, deleting or moving data, logging in, spending money, changing account settings, or handling API keys.
Stop and ask me when a step requires secrets, payment, account access, destructive cleanup, or a permission broader than the task.
| Permission | Give AI | Why |
|---|---|---|
| Inspection | Allow Read, Grep, Glob, and package-list commands. | The agent needs to find how Kimi Code was installed. |
| Backups | Ask before creating or moving backups. | Backup location and size should be visible. |
| Uninstall or move | Ask before npm, pnpm, yarn, mv, rm, rmdir, or credential cleanup. | Removal can be hard to undo. |
| Credentials | Deny reading or printing OAuth files, API keys, and MCP credentials. | The agent can describe paths without exposing secrets. |
| Goal | Action | Avoid |
|---|---|---|
| Remove the command | Uninstall with the original package manager or app installer | Deleting sessions when the executable is the only problem |
| Reset configuration | Remove config.toml or set a fresh KIMI_CODE_HOME | Overwriting a working config without a backup |
| Clear login state | Use logout or remove the matching credential file | Deleting unrelated MCP or provider credentials |
| Remove all local Kimi Code data | Delete the data root only after export | Assuming this can be undone |
Run which kimi, kimi --version, and your package manager list command. In VS Code, check installed extensions separately.
Use the same package manager that installed it, such as npm uninstall -g, pnpm remove -g, yarn global remove, or the native uninstaller.
Use the Kimi Code logout path when available, then remove only the credential files you intend to clear.
If the sessions contain work you may need later, export or copy the relevant session before clearing the data directory.
A full data-root delete removes config, sessions, credentials, plugin records, logs, and local history. That is fine for a clean reset, but heavy-handed for a normal uninstall.
A plugin removal can leave managed copies or original source files behind. If a plugin caused the problem, remove or disable it before uninstalling the whole CLI.
Provider OAuth and MCP OAuth files live under the data root. Delete only what you intend to clear, especially on a shared development machine.
Not always. Package removal and data removal are separate. Sessions live under the Kimi Code data root.
Uninstall the executable, move or remove the data root, install again, then sign in and configure providers from scratch.
Yes. Export or keep the sessions directory before clearing local data.