feat: add GitHub Copilot CLI agent configuration#353
Open
anxkhn wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a first-class
copilotagent socontainer-use config agent copilot(aliascu 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
ConfigureCopilotimplements the existingConfigurableAgentinterface:editMcpConfig()merges the container-use server into~/.copilot/mcp-config.json(the user-level config the Copilot CLI reads). It merges into the existingmcpServersmap 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
selectAgentfactory 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, andgolangci-lint runare clean.TestConfigureCopilotUpdateConfigmirroring the existing Cursor/Amazon Q config tests;go test ./cmd/container-use/agent/passes.HOME: it writes a valid~/.copilot/mcp-config.jsonthatcopilot mcp listandcopilot mcp get container-useaccept, preserves a pre-existing server, and appends the rules block to.github/copilot-instructions.mdwithout 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.