agent uninstall-shell-integration
把 CLI 的 Shell 集成从 ~/.zshrc 中重新移除。
agent uninstall-shell-integration 和它的对应命令 agent install-shell-integration 一样,都不是聊天中的 slash command,而是一个独立的终端子命令,你需要直接在 shell 中调用,而不是在正在运行的 cursor-agent 会话内。
该命令会撤销 shell 集成的设置,把之前添加到 ~/.zshrc 中的相关条目移除。根据文档,这里同样明确只支持 zsh。
当 shell 集成引发问题时,比如与你 .zshrc 中的其他工具产生冲突,或者你想把 Cursor CLI 从系统中彻底移除、并顺便把 shell 配置也清理干净时,这个命令就很有用。它会彻底移除集成,而不是只是禁用它——如果只是想临时暂停,这个命令并不合适,更适合的做法是手动注释掉相关代码块。
✅ 什么时候用?
在出现问题时彻底重置 shell 集成
agent uninstall-shell-integration
完全卸载 Cursor CLI 并同时清理 shell 配置
在正式卸载 CLI 之前执行 agent uninstall-shell-integration
⛔ 什么时候不该用?
只想短暂暂停 shell 集成,而不是彻底移除
agent uninstall-shell-integration 会彻底删除配置,而不是仅仅禁用它。
更好的选择: 手动注释掉 ~/.zshrc 中相关的代码块
来源
- Cursor 官方文档——CLI 参考:参数(Parameters) ↗ cursor.com
更多命令 · Cursor CLI