全局选项
选项 | 说明 |
---|---|
-v, --version | 输出版本号 |
-a, --api-key <key> | 用于身份验证的 API 密钥(也可使用 CURSOR_API_KEY 环境变量) |
-p, --print | 将响应打印到控制台(适用于脚本或非交互式使用)。可使用所有工具,包括 write 和 bash。 |
--output-format <format> | 输出格式(仅在使用 --print 时生效):text 、json 或 stream-json (默认:stream-json ) |
-b, --background | 以后台模式启动(启动时打开 composer 选择器) |
--fullscreen | 启用全屏模式 |
--resume [chatId] | 恢复聊天会话 |
-m, --model <model> | 使用的模型 |
-f, --force | 强制允许命令(除非被明确拒绝) |
-h, --help | 显示命令帮助 |
命令
命令 | 描述 | 用法 |
---|---|---|
login | 通过 Cursor 进行身份验证 | cursor-agent login |
logout | 登出并清除已保存的身份验证信息 | cursor-agent logout |
status | 查看身份验证状态 | cursor-agent status |
mcp | 管理 MCP 服务器 | cursor-agent mcp |
update|upgrade | 将 Cursor Agent 更新至最新版本 | cursor-agent update 或 cursor-agent upgrade |
ls | 列出并恢复聊天会话 | cursor-agent ls |
resume | 恢复最新的聊天会话 | cursor-agent resume |
help [command] | 显示命令的帮助信息 | cursor-agent help [command] |
未指定命令时,Cursor Agent 默认以交互式聊天模式启动。
MCP
子命令 | 说明 | 用法 |
---|---|---|
login <identifier> | 使用在 .cursor/mcp.json 中配置的 MCP 服务器进行认证 | cursor-agent mcp login <identifier> |
list | 列出已配置的 MCP 服务器及其状态 | cursor-agent mcp list |
list-tools <identifier> | 列出指定 MCP 的可用工具及其参数名称 | cursor-agent mcp list-tools <identifier> |
-h, --help
查看命令专属帮助。
参数
prompt
— 代理的初始提示
获取帮助
-h, --help
选项来显示该命令的专属帮助信息。