Skip to content

feat: add GitHub Copilot CLI agent configuration#353

Open
anxkhn wants to merge 1 commit into
dagger:mainfrom
anxkhn:feat/configure-copilot
Open

feat: add GitHub Copilot CLI agent configuration#353
anxkhn wants to merge 1 commit into
dagger:mainfrom
anxkhn:feat/configure-copilot

Conversation

@anxkhn

@anxkhn anxkhn commented Jun 28, 2026

Copy link
Copy Markdown

What

Adds a first-class copilot agent so container-use config agent copilot (alias cu config agent copilot) configures the GitHub Copilot CLI the same way the existing agents do. Today Copilot is only covered by hand-written MCP docs; this wires it into the same flow as Claude, Cursor, Goose, Codex, and Amazon Q.

How

New ConfigureCopilot implements the existing ConfigurableAgent interface:

  • editMcpConfig() merges the container-use server into ~/.copilot/mcp-config.json (the user-level config the Copilot CLI reads). It merges into the existing mcpServers map so other servers the user already has, including remote ones, are preserved.
  • editRules() writes the container-use guidance into .github/copilot-instructions.md, Copilot's repo-level custom-instructions file, reusing the shared marker-merge helper so it is idempotent and non-destructive.

The agent is registered in the selectAgent factory and the interactive picker. Copilot CLI runs on Linux, macOS, and Windows, so it is offered on all platforms.

Testing (on this machine, copilot v1.0.65)

  • go build ./..., go vet ./..., gofmt, and golangci-lint run are clean.
  • Added TestConfigureCopilotUpdateConfig mirroring the existing Cursor/Amazon Q config tests; go test ./cmd/container-use/agent/ passes.
  • Ran the built binary against a throwaway HOME: it writes a valid ~/.copilot/mcp-config.json that copilot mcp list and copilot mcp get container-use accept, preserves a pre-existing server, and appends the rules block to .github/copilot-instructions.md without clobbering existing content.

Relates to #159 (a step toward native Copilot support across platforms: the agent is registered for all platforms).

DCO: commit is signed off.

Add a `copilot` agent so `container-use config agent copilot` configures
the GitHub Copilot CLI the same way the existing agents do.

The agent implements the ConfigurableAgent interface and:
- merges the container-use MCP server into ~/.copilot/mcp-config.json,
  preserving any other servers already configured there
- writes the container-use guidance into .github/copilot-instructions.md,
  the repo-level custom instructions file Copilot reads

It is registered in the agent selector switch and the interactive picker
alongside Claude, Cursor, Goose, Codex, and Amazon Q. Copilot CLI runs on
Linux, macOS, and Windows, so the agent is offered on all platforms.

Relates to dagger#159

Signed-off-by: anxkhn <anxkhn@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant