全域選項

全域選項可搭配任何指令使用:
選項說明
-v, --version輸出版本號
-a, --api-key <key>驗證用的 API 金鑰(也可使用 CURSOR_API_KEY 環境變數)
-p, --print將回應輸出到主控台(適用於腳本或非互動式使用)。可使用所有工具,包括 write 與 bash。
--output-format <format>輸出格式(僅搭配 --print 時有效):textjsonstream-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 updatecursor-agent upgrade
ls恢復某個聊天工作階段cursor-agent ls
resume恢復最新的聊天工作階段cursor-agent resume
help [command]顯示指令說明cursor-agent help [command]
未指定指令時,Cursor Agent 會預設以互動式聊天模式啟動。

MCP

管理為 Cursor Agent 設定的 MCP 伺服器。
SubcommandDescriptionUsage
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 以取得該指令的說明。

參數

在聊天模式下啟動時(預設行為),你可以提供一個初始提示: 參數:
  • prompt — 代理程式的初始提示

取得協助

所有指令都支援全域 -h, --help 選項來顯示該指令的說明資訊。