Cursor Agent CLI 完整指令參考
選項 | 說明 |
---|---|
-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] |
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> |
-h, --help
以取得該指令的說明。
prompt
— 代理程式的初始提示-h, --help
選項來顯示該指令的說明資訊。