Files
sherlock/internal/agent/copilot.go
T
Alexandru Macocian 84958c7ef3
Release / release (push) Successful in 17s
Support for local agents
2026-06-15 19:03:56 +02:00

27 lines
1.0 KiB
Go

package agent
func init() { Register(&copilot{}) }
// copilot integrates the GitHub Copilot CLI (npm package `@github/copilot`
// → `copilot` on PATH). MCP config is passed via
// `--additional-mcp-config @<path>` (the `@` prefix tells Copilot to
// treat the argument as a file path, not inline JSON). The file uses
// the canonical `.mcp.json` shape (`{"mcpServers": ...}`) — same as
// Claude Code.
//
// Copilot reads `~/.copilot/mcp-config.json` by default and merges
// any `--additional-mcp-config` files on top. The merge is additive,
// so sherlock-injected MCPs coexist with whatever the operator has
// configured globally.
//
// The per-CLI quirks (flag shape, env scrubbing) live in the shared
// "copilot" backend; this type is just the built-in registration.
type copilot struct{}
func (copilot) Name() string { return "copilot" }
func (copilot) Description() string { return "GitHub Copilot CLI" }
func (c copilot) Spawn(ctx Context, args []string) error {
return backends["copilot"].spawn(c.Name(), "copilot", ctx, args)
}