github / github/copilot-cli

/agent <name> - Allow direct invocation of agents by name

未關閉
#2,853 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
area:agents
主要語言
Shell
星號
11.2k
分支
1.9k
平均合併
14 小時 16 分鐘
30 天內合併 PR
6

描述

### Describe the feature or problem you'd like to solve

Currently, `/agent` only opens an interactive browser/picker with no way to pass an agent name as an argument. Users who know the agent name they want must scroll through the full list every time. This adds friction, especially with many agents installed.

### Proposed solution

Support /agent to directly invoke a named agent (e.g., `/agent my-agent`). If the name doesn't match, fall back to the interactive picker filtered by the input string. This mirrors how /model and other commands accept optional arguments.

### Example prompts or workflows

1. Quick invoke by name: `/agent my-test-agent` - immediately starts the agent without navigating the picker. Saves time when you know what you want.
2. Fuzzy match with fallback: `/agent test` - filters the agent list to matches containing "test", showing only relevant options. Falls back to filtered picker when no exact match.
3. Chained with context: `/agent my-test-agent generate tests for src/auth/handler.ts` - invoke agent and pass initial prompt in one command, skipping the extra round-trip.
4. Scripting/repeatability: User frequently runs the same agent on different files. `/agent my-agent` lets them hit up-arrow, change the file path, and re-run - not possible with an interactive picker.
5. Discoverability without friction: `/agent --list` to quickly print available agent names (one-line each) without entering the interactive picker, so users can learn names then invoke directly.

### Additional context

_No response_

貢獻指南

開啟貢獻指南

研究方向

從 /agent 命令進入點開始,並將其引數處理與 /model 及其他命令進行比較。測試精確名稱呼叫、篩選後的 fallback、串接的 prompt 文字以及 --list;完成的標準是這些工作流程能夠正常運作,且不會破壞現有的互動式 picker。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
shell
領域
cli
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
52/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。