全域選項可搭配任何指令使用:
| Option | Description |
|---|
-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 會預設進入互動式聊天模式。
管理為 Cursor Agent 設定的 MCP 伺服器。
| Subcommand | Description | Usage |
|---|
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> |
所有 MCP 指令都支援 -h, --help 查看該指令的說明。
在以聊天模式啟動時(預設行為),可以提供初始提示:
參數:
所有指令都支援全域 -h, --help 選項,可顯示該指令的詳細說明。