github / github/copilot-cli

Persistent default custom agent setting for Copilot CLI startup

未关闭
#2,212 1 条评论 11 个 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

Copilot CLI supports changing agents during a session via `/agent`, and plugin examples/documentation show launching with a specific agent via `--agent`. However, I have not found a documented way to persist a preferred custom or plugin agent as the default startup agent at user scope.

For users who already have a stable primary custom agent, repeatedly re-selecting that agent at startup adds unnecessary friction. In my case, I want Copilot CLI to start with a custom agent such as `oh-my-copilot:atlas` every time, without relying on shell aliases or wrapper scripts.

### Proposed solution

Please add a persistent user-level setting for the default startup agent, including support for built-in agents and installed custom/plugin agents.

One possible shape (proposal only, not existing functionality):

```yaml
defaultAgent: oh-my-copilot:atlas
```

Or an equivalent persisted preference managed by Copilot CLI itself.

This would help by:
- reducing repeated startup steps
- making custom-agent workflows feel first-class
- supporting users who intentionally refine one stable "home" agent for most sessions
- avoiding fragile shell aliases/wrappers as the main workaround

It would also be helpful if the docs explained precedence clearly, for example:
`explicit --agent override > saved default agent > standard built-in default`

### Example prompts or workflows

- I use a custom plugin agent like `oh-my-copilot:atlas` for most sessions and want `copilot` to start with it automatically.
- I want to keep a saved default custom agent for daily work, but still override it for a single launch with `copilot --agent general-purpose`.
- I want a team-standard built-in or custom agent to be the default on startup without asking every user to create shell aliases.

### Additional context

Suggested acceptance criteria:
- users can persist a preferred default agent at user scope
- the setting accepts built-in agents and installed custom/plugin agents
- when no explicit `--agent` is supplied, Copilot CLI starts with the saved default agent
- when `--agent` is supplied, it overrides the saved default for that launch only
- the chosen default is visible somewhere discoverable, such as config output or startup diagnostics
- if the saved agent is missing, renamed, or unavailable, Copilot CLI fails gracefully and falls back to standard default behavior
- the documentation explicitly covers this behavior with a custom/plugin agent example
- optional but useful: a simple command to set or clear the default without manually editing config

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。