跳轉到主要內容

全域選項

全域選項可搭配任何指令使用:
OptionDescription
-v, --version輸出版本號
-a, --api-key <key>用於驗證的 API 金鑰(也可使用 CURSOR_API_KEY 環境變數)
-p, --print將回應列印到主控台(適用於腳本或非互動式使用)。可使用所有工具,包括 write 與 bash。
--output-format <format>輸出格式(僅在 --print 時有效):textjson,或 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 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 選項,可顯示該指令的詳細說明。
I