Skip to content

feat: add GitHub Copilot CLI support#20

Open
mduenas wants to merge 1 commit intokevinMEH:mainfrom
mduenas:feat/github-copilot-cli-support
Open

feat: add GitHub Copilot CLI support#20
mduenas wants to merge 1 commit intokevinMEH:mainfrom
mduenas:feat/github-copilot-cli-support

Conversation

@mduenas
Copy link

@mduenas mduenas commented Mar 23, 2026

Summary

Adds GitHub Copilot CLI (gh copilot) as a first-class harness, following the same pattern as Claude Code, Codex, Gemini, and OpenCode.

Changes

  • Dockerfile — Installs gh CLI via official apt repo and the gh-copilot extension at build time
  • src/config.ts — Adds ".gh" to SHARED_DIRS and ~/.config/gh → .gh to CONFIG_SOURCES
  • src/mounts.ts — Mounts configs/.gh into containers at /root/.config/gh
  • src/commands.ts — Updates init message to mention GitHub Copilot CLI
  • Permissions.md — Adds GitHub Copilot CLI auth/setup section
  • internal/ConsumerGuide.md — Adds .gh/ to storage structure and gh copilot to usage examples
  • README.md — Adds ~/.config/gh to manual config copy list and storage structure

How it works

Running container init copies ~/.config/gh (GitHub auth tokens) into ~/.code-container/configs/.gh/. Every container mounts it at /root/.config/gh so gh copilot runs authenticated automatically.

- Install gh CLI via official apt repo and gh-copilot extension in Dockerfile
- Add .gh config dir to SHARED_DIRS and CONFIG_SOURCES in config.ts
- Mount ~/.config/gh into containers via getCoreMounts() in mounts.ts
- Update init message in commands.ts to mention GitHub Copilot CLI
- Add GitHub Copilot CLI section to Permissions.md
- Update storage structure in ConsumerGuide.md and README.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 23, 2026 21:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds GitHub Copilot CLI (gh copilot) as an additional “first-class” harness in the code-container environment by installing the tooling in the image and persisting/mounting host gh configuration into containers.

Changes:

  • Install gh CLI + github/gh-copilot extension in the Docker image.
  • Copy ~/.config/gh into ~/.code-container/configs/.gh and mount it into containers at /root/.config/gh.
  • Update user-facing docs/messages to include gh copilot setup and storage structure.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Dockerfile Adds installation steps for gh and gh-copilot extension.
src/config.ts Adds .gh to shared config dirs and copies ~/.config/gh into container configs.
src/mounts.ts Adds default mount for .gh into /root/.config/gh.
src/commands.ts Updates init prompt text to include GitHub Copilot CLI configs.
Permissions.md Documents gh auth behavior inside the container.
internal/ConsumerGuide.md Updates usage examples and storage structure to include .gh/.
README.md Updates manual config copy list to include ~/.config/gh.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 11 to 13
`${CONFIGS_DIR}/.codex:/root/.codex`,
`${CONFIGS_DIR}/.gh:/root/.config/gh`,
`${CONFIGS_DIR}/.opencode:/root/.config/opencode`,
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ensureMountsFile() returns early when ~/.code-container/MOUNTS.txt already exists, so this new default mount for .gh will only apply to fresh installs. That contradicts the PR description claim that “every container mounts it” and means existing users won’t get authenticated gh copilot unless they manually update MOUNTS.txt and recreate containers. Consider adding a migration path (e.g., append any missing core mounts to an existing MOUNTS.txt, or prompt the user to add the new mount).

Copilot uses AI. Check for mistakes.
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.

2 participants