跳轉到主要內容
把 issue 指派給 Cursor,或在留言中提及 @Cursor,就能直接在 Linear 使用 Background Agents

開始使用

安裝

只有 Cursor 管理員才能連接 Linear 整合。其他團隊設定對非管理員成員也可用。
  1. 前往 Cursor integrations
  2. 點擊 Linear 旁的 Connect
  3. 連接你的 Linear 工作區並選擇團隊
  4. 點擊 Authorize
  5. 在 Cursor 中完成剩餘的 Background Agent 設定:
    • 連接 GitHub 並選擇預設儲存庫
    • 啟用依用量計費
    • 確認隱私設定

帳號連結

首次使用會要求把 Cursor 與 Linear 帳號連結。建立 PR 需要先連接 GitHub。

如何使用

把 issue 指派給 Cursor,或在留言中提及 @Cursor。Cursor 會自動分析 issue,並過濾掉與開發無關的工作。

指派 issue

  1. 開啟 Linear 的 issue
  2. 點擊 assignee 欄位
  3. 選擇「Cursor」
在 Linear 中將 issue 指派給 Cursor

提及 Cursor

在留言中提及 @Cursor 來指派新的 agent,或提供額外指示,例如:@Cursor 修正上面描述的驗證(authentication)錯誤

工作流程

Background Agents 會在 Linear 中即時顯示狀態,並在完成後自動建立 PR。到 Cursor dashboard 追蹤進度。
Background Agent 在 Linear 中的狀態更新

後續指示

你可以在 agent 工作階段中回覆,訊息會作為後續內容傳給 agent。只要在 Linear 的留言中標註 @Cursor,就能為正在執行的 Background Agent 提供更多指引。

設定

Dashboard → Background Agents 設定 Background Agent。
設定位置說明
Default RepositoryCursor Dashboard當未設定專案 repository 時使用的預設 repository
Default ModelCursor DashboardBackground Agents 使用的 AI 模型
Base BranchCursor Dashboard建立 PR 的基準分支(通常是 maindevelop

設定選項

可以用多種方式設定 Background Agent 的行為: Issue 描述或留言:使用 [key=value] 語法,例如:
  • @cursor please fix [repo=anysphere/everysphere]
  • @cursor implement feature [model=claude-3.5-sonnet] [branch=feature-branch]
Issue 標籤:使用父子標籤結構,父標籤是設定鍵,子標籤是值。 Project 標籤:和 issue 標籤相同的父子結構,套用在專案層級。 支援的設定鍵:
  • repo:指定目標 repository(例如 owner/repository
  • branch:指定建立 PR 的基準分支
  • model:指定要使用的 AI 模型

Repository 選擇

Cursor 會依照以下優先順序決定要處理的 repository:
  1. Issue 描述/留言:issue 文字或留言中的 [repo=owner/repository] 語法
  2. Issue 標籤:加在特定 Linear issue 上的 repository 標籤
  3. Project 標籤:加在 Linear 專案上的 repository 標籤
  4. Default repository:在 Cursor Dashboard 設定的 repository

設定 repository 標籤

在 Linear 中建立 repository 標籤:
  1. 前往 Linear workspace 的 Settings
  2. 點擊 Labels
  3. 點擊 New group
  4. 將群組命名為 “repo”(不分大小寫——必須是 “repo”,不能是 “Repository” 或其他變體)
  5. 在該群組內,為每個 repository 依 owner/repo 格式建立標籤
之後就能把這些標籤指派給 issues 或 projects,讓 Background Agent 知道要處理哪個 repository。
在 Linear 中設定 repository 標籤
I