promptgarten 🌱

命令参考 · Cursor CLI

agent install-shell-integration

把 CLI 的 Shell 集成安装到 ~/.zshrc 中。

agent install-shell-integration 不是正在运行的聊天会话中的 slash command,而是 Cursor CLI 的一个独立终端子命令。你需要直接在 shell 中调用它,与 cursor-agent 会话无关,而不是在聊天中作为 / 命令使用。 该命令通过在 ~/.zshrc 中添加相应条目来设置 shell 集成。根据官方文档,这里明确针对的是 zsh;对于 bash 等其他 shell,文档中没有单独的集成流程,尽管根据安装说明,CLI 本身的常规安装同时支持 bash 和 zsh。 通常你会在安装完 CLI 后执行一次该命令,让 Cursor Agent 干净地融入你的 shell 环境,例如支持自动补全或上下文功能。如果之后想移除该集成,可以使用对应的命令 agent uninstall-shell-integration

什么时候用?

在安装 CLI 后一次性设置 shell 集成

agent install-shell-integration

在 CLI 更新后检查集成是否仍正常生效

如果 shell 功能不再按预期工作,重新执行 agent install-shell-integration

什么时候不该用?

想要移除 shell 集成

agent install-shell-integration 只负责安装,不会移除任何内容。

更好的选择: 使用 agent uninstall-shell-integration

你使用的不是 zsh

根据文档,该命令明确针对 ~/.zshrc;其他 shell 没有相应的集成流程记录在文档中。

更好的选择: 仍可正常使用 Cursor CLI——shell 集成是可选项,并非运行的前提条件

来源

更多命令 · Cursor CLI

agent uninstall-shell-integrationagent help [command]agent mcp login <identifier>agent mcp listagent mcp list-tools <identifier>agent mcp enable <identifier>agent mcp disable <identifier>agent sandbox enableagent sandbox disableagent sandbox resetagent sandbox run <cmd> [args...]agent sandbox help [command]

全部命令 · Cursor CLI

分享:𝕏in💬