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)"
Use this section to keep the next step practical before you touch accounts, files, infrastructure, or hardware.
| Check | Look for | Why it matters |
|---|---|---|
| Keep first | Identify sessions, config, plugins, logs, and credentials before removing an app or command. | Cleanup is safer when data deletion stays separate from uninstalling. |
| Confirm install source | Check whether the tool came from npm, pnpm, Homebrew, an app bundle, or a manual download. | The right removal path depends on the original channel. |
| Protect credentials | Do not display raw tokens or OAuth files while checking paths. | The goal is to remove risk, not expose secrets. |
| Verify after cleanup | Reopen a terminal and confirm PATH, config folders, and app entries behave as expected. | A clean uninstall needs evidence, not just a deleted file. |
| 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.