03 · Copilot 的入口地圖
梳理 GitHub Copilot 在 GitHub.com、VS Code、IDE Chat、Windows Terminal、CLI、Mobile 和 Cloud Agent 中的分工。
第一次學 Copilot 最容易亂,是因為入口太多。你以為自己在學一個外掛,實際會碰到 GitHub 網站、VS Code、JetBrains、Windows Terminal、GitHub CLI、Mobile、Cloud Agent、企業後臺和 SDK。先畫入口地圖,後面每個功能才有位置。
本章目標:你會按任務發生的位置選擇 Copilot 入口,並知道每個入口能看到什麼上下文、能做什麼動作、結果應該回到哪裡驗收。
1. 入口決定上下文
flowchart TD
Task["開發任務"] --> Where{"任務發生在哪裡"}
Where -->|儲存庫 / PR / Issue| GitHub["GitHub.com"]
Where -->|原生代碼編輯| IDE["VS Code / IDE Chat"]
Where -->|命令列問題| Terminal["Windows Terminal / Copilot CLI"]
Where -->|非同步分支任務| Cloud["Cloud Agent"]
Where -->|移動端跟進| Mobile["GitHub Mobile"]
GitHub --> GHContext["PR / Issue / Files / Alerts"]
IDE --> IDEContext["Workspace / Selection / Diff / Terminal"]
Terminal --> ShellContext["Shell command / Git / Local repo"]
Cloud --> PRContext["Branch / Commits / Checks / PR"]
Mobile --> LightContext["Chat / Notifications / Lightweight review"]
入口不是 UI 偏好,而是上下文邊界。GitHub.com 看得到 GitHub 物件;IDE 看得到本地檔案和編輯狀態;Terminal 看得到命令;Cloud Agent 看得到遠端儲存庫和分支。
2. GitHub.com:圍繞協作物件提問
GitHub.com 入口適合圍繞這些物件工作:
- repository。
- file。
- issue。
- pull request。
- discussion。
- commit。
- security alert。
- organization dashboard。
適合問題:
- “這個 PR 改了什麼?”
- “這個 issue 的核心需求是什麼?”
- “這個 security alert 影響哪些檔案?”
- “這段儲存庫程式碼的入口在哪裡?”
驗收方式:
- 回到 PR diff。
- 看 checks。
- 看 review comments。
- 看 issue 裡的討論和 acceptance criteria。
- 看 security alert 狀態。
不適合:詢問本地未提交 diff、只存在你電腦裡的日誌、未上傳的截圖、終端當前狀態。
3. VS Code / IDE:圍繞原生代碼改動
VS Code 官方文件當前把 Copilot 描述成能完成“規劃 → 實現 → 驗證”(plan / implement / verify)的跨檔案改動閉環。IDE 入口適合本地真實編碼閉環。
適合任務:
- 解釋當前檔案。
- 生成或修改函式。
- 用 inline suggestions 做區域性補全。
- 用 inline chat 做小範圍編輯。
- 用 Agent mode 處理跨檔案低到中風險任務。
- review code edits。
- 結合 terminal 跑驗證。
IDE 入口的優勢是本地上下文豐富:當前檔案、選區、workspace、diff、terminal、MCP、custom instructions 都能參與。
風險邊界:
- Agent mode 可能改多個檔案。
- terminal command 需要人工批准。
- MCP 可能接觸外部系統。
- 生成結果必須回到 diff 和測試驗收。
4. Windows Terminal:解釋命令,不替你冒險
Windows Terminal Canary 中的 Copilot 適合解釋和建議命令。
適合:
- “這個命令是什麼意思?”
- “如何列出佔用某埠的程序?”
- “這個 Git 報錯怎麼處理?”
- “這段 shell 輸出表示什麼?”
不適合:
- 生產環境直接執行不懂的命令。
- 刪除、部署、遷移、上傳、金鑰處理。
- 把 Copilot 建議當成無需審查的 shell 自動化。
終端入口的驗收是 command output 和 exit code。執行前先判斷副作用。
5. Copilot CLI:終端裡的 Agent 任務
Copilot CLI 是更 agentic(代理式)的終端入口。官方功能頁說明它可以在終端裡委派任務——給專案加功能、修 bug,然後幫你建立 pull request;任務也可以從終端開始,再在 GitHub.com 或 GitHub Mobile 上接著同一個會話(session)往下做。
適合:
- 在本地 repo 裡修一個明確 bug。
- 給小功能開分支和 PR。
- 在 terminal 中繼續一個任務。
- 結合 hooks 和許可權做受控執行。
上線邊界:
- 執行前看 Git status。
- 明確允許改哪些路徑。
- 高風險命令必須人工確認。
- 建立 PR 後仍走 review 和 CI。
6. Cloud Agent:非同步分支和 PR 工作流
官方功能頁把 Copilot cloud agent 描述為:研究儲存庫 → 制定實現計劃 → 在分支裡改程式碼。你可以 review diff、迭代修改,最後再建立 pull request。
適合:
- 明確 issue 的非同步實現。
- 中等規模 refactor。
- 補測試或文件。
- 在分支裡交付可 review 結果。
不適合:
- 本機未提交現場。
- 依賴本地登入態。
- 生產後臺或私有桌面應用。
- 不能寫清驗收標準的模糊任務。
Cloud Agent 的驗收不是自然語言總結,而是 branch、commits、diff、checks、PR review 和必要的產出物(artifacts,例如構建包 / 測試報告)。
7. GitHub Mobile:延續上下文,不做複雜合併
Mobile 適合輕量檢視和延續對話:
- 跟進 issue。
- 看通知。
- 問簡單上下文。
- 繼續 Cloud Agent session。
- 粗看 PR 狀態。
不適合:
- 審大 diff。
- 處理複雜 merge conflict。
- 批准高風險程式碼變更。
- 檢查完整測試輸出。
移動端是協作補充,不是主要 code review 工具。
8. 入口選擇表
| 任務 | 推薦入口 | 驗收證據 |
|---|---|---|
| 解釋 PR 改動 | GitHub.com | PR diff、checks、comments |
| 修本地元件 bug | VS Code Agent mode | local diff、test、browser |
| 補區域性程式碼 | IDE inline suggestions | diff、compile、test |
| 解釋命令 | Windows Terminal | 命令說明、人工判斷 |
| CLI 修 bug 並開 PR | Copilot CLI | branch、PR、CI |
| issue 非同步實現 | Cloud Agent | plan、branch、commits、checks、PR |
| 移動端跟進 | GitHub Mobile | notification、session 狀態 |
9. 團隊上線時怎麼寫規則
團隊 SOP 不應該只寫“使用 Copilot”。應該寫:
- 哪些入口允許使用。
- 哪些入口只能只讀。
- 哪些入口可以改程式碼。
- 哪些入口可以執行命令。
- 哪些入口可以呼叫 MCP。
- 哪些任務必須回到 PR review。
- 哪些高風險路徑停用 Agent 或 Cloud Agent。
這樣開發者才知道什麼時候用哪個入口,而不是把所有問題都丟進同一個 Chat 面板。
官方來源
- What is GitHub Copilot?:官方列出 IDE、Mobile、Windows Terminal、GitHub CLI 和 GitHub website 等入口。
- GitHub Copilot features:官方說明 Copilot CLI、Cloud Agent、IDE Agent mode、Chat 和管理員功能。
- GitHub Copilot Chat:官方 Chat 跨環境入口。
- GitHub Copilot in VS Code:VS Code 官方 agent、edit、review 和 project verification 入口。