Persist Copilot CLI credentials across dev container rebuilds#1
Draft
CodeAlanDebug with Copilot wants to merge 2 commits into
Draft
Persist Copilot CLI credentials across dev container rebuilds#1CodeAlanDebug with Copilot wants to merge 2 commits into
CodeAlanDebug with Copilot wants to merge 2 commits into
Conversation
Agent-Logs-Url: https://github.com/CodeAlanDebug/copilot-cli-for-beginners/sessions/db1603a8-032a-4254-947f-833e116c31e1 Co-authored-by: CodeAlanDebug <106265297+CodeAlanDebug@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add instructions for persisting Copilot CLI credentials in dev container
Persist Copilot CLI credentials across dev container rebuilds
Apr 28, 2026
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.
Copilot CLI stores its OAuth token in
~/.config/github-copilot/inside the container. Without persistence, every container rebuild forces a full/logindevice-flow re-authentication.Changes
.devcontainer/devcontainer.json— Adds a named Docker volume (copilot-cli-credentials) mounted at/home/vscode/.config/github-copilot. Named volume chosen over bind mount for cross-platform compatibility (works on Windows, macOS, Linux, and Codespaces). DelegatespostStartCommandto a script..devcontainer/startup.sh— New executable script that prints the ready message and checks for existing credential files, emitting a clear 🔑 status line: either "already signed in" or the exact command needed to authenticate.00-quick-start/README.md— Adds a Persisting Credentials in Dev Containers subsection under Authentication covering: a comparison table (local install / Codespace / local dev container), how the named volume works, first-time vs. rebuild vs. reset workflows, and how to re-authenticate when needed.Original prompt
Created from VS Code.