Skip to content

feat(providers): add GitHub Copilot CLI provider#480

Open
sykuang wants to merge 3 commits into
covibes:mainfrom
sykuang:feat/copilot-provider
Open

feat(providers): add GitHub Copilot CLI provider#480
sykuang wants to merge 3 commits into
covibes:mainfrom
sykuang:feat/copilot-provider

Conversation

@sykuang
Copy link
Copy Markdown

@sykuang sykuang commented Apr 21, 2026

Summary

Adds a new copilot provider that wraps the official GitHub Copilot CLI (@github/copilot), alongside the existing claude / codex / gemini / opencode providers.

What's included

  • src/providers/copilot/{index,cli-builder,output-parser,models}.js
  • Registered in src/providers/index.js, src/providers/capabilities.js, lib/provider-names.js (aliases: copilot, github)
  • Docs section appended to docs/providers.md
  • 20 new unit tests in tests/unit/copilot-provider.test.js

CLI mapping

copilot -p "<prompt>" --silent [--allow-all] [--model <name>]
  • Auth: copilot then /login (GitHub Copilot subscription)
  • Models exposed: gpt-5-mini (level1), claude-sonnet-4.5 (level2), claude-opus-4.6 (level3); plus gpt-5

Capabilities

dockerIsolation worktreeIsolation mcpServers jsonSchema streamJson thinkingMode reasoningEffort
experimental (prompt-injected)

Caveats

  • Copilot CLI emits plain text with --silent (no structured JSON stream). The parser yields text events per line; completion is signaled by process exit (no synthetic result event with token usage).
  • jsonSchema is enforced by appending an "OUTPUT FORMAT" block to the prompt — same pattern as opencode/gemini.
  • No native MCP server support exposed via the CLI.

Tests

  • 20 new tests pass.
  • No regressions: pre-existing failures (Python 3.9 syntax in hooks/block-dangerous-git.py) unchanged from baseline.

sykuang added 2 commits April 21, 2026 10:12
Copilot CLI loads MCP from ~/.copilot/mcp-config.json and accepts
per-run augmentation via --additional-mcp-config (JSON or @file).

- capabilities.copilot.mcpServers: false → true
- cli-builder: emit --additional-mcp-config per entry (string|object|array)
- cli-builder: add addDirs → repeated --add-dir flags
- index: detect --additional-mcp-config / --add-dir / --config-dir support
- runner: thread providerSettings.mcpConfig + addDirs into buildCommand
- docs: MCP servers section with example providerSettings
- tests: +5 cases (object/string/array/disabled/addDirs), 25/25 green
@sykuang
Copy link
Copy Markdown
Author

sykuang commented Apr 21, 2026

Follow-up: added Copilot CLI MCP support (commit 4d2b192).

Turns out the Copilot CLI does expose MCP via:

  • default config file ~/.copilot/mcp-config.json
  • per-run flag --additional-mcp-config <json|@file> (repeatable; augments user config)
  • built-in GitHub MCP toggles --add-github-mcp-tool / --add-github-mcp-toolset

Changes:

  • capabilities.copilot.mcpServers: falsetrue
  • cli-builder: emit --additional-mcp-config per entry, accepts string / object / @file / array; also added addDirs → repeated --add-dir
  • index.js: feature-detect --additional-mcp-config / --add-dir / --config-dir
  • task-lib/runner.js: thread providerSettings.mcpConfig and providerSettings.addDirs into buildCommand
  • docs: new MCP servers section with a providerSettings.copilot.mcpConfig example
  • tests: +5 cases (string / object / array+@file / disabled / addDirs); 25/25 green

Source: copilot --help lists --additional-mcp-config, --add-github-mcp-tool, --add-github-mcp-toolset, and --config-dir (default ~/.copilot).

…lidator

- cli/index.js: include 'copilot' in --provider option description
- src/preflight.js: add copilot validator + update unknown-provider hint
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