Add GitHub CLI to devcontainer with persistent auth#47
Merged
Conversation
Install gh via nix profile alongside the other bootstrap tooling, and persist its credentials across rebuilds with a named volume mounted at ~/.config/gh. Add CONTRIBUTOR.md documenting gh auth and how to create a minimal-permission fine-grained token.
Condense the token instructions to the minimal required permissions and add a signing-commits section clarifying that only a signing key (SSH or GPG) belongs in the container -- an SSH authentication key grants full account access and would bypass the fine-grained PAT.
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.
Summary
gh(GitHub CLI) in the devcontainer vianix profile install, alongside the existing bootstrap tooling (direnv, nodejs).ghcredentials across container rebuilds using a named volume (gh-config-${devcontainerId}) mounted at~/.config/gh— the same pattern the.claudeconfig already uses. ThepostCreateCommandchown is extended to cover the new volume sogh(running asvscode) can write to it.CONTRIBUTOR.mddocumentinggh auth login, noting that the token survives rebuilds, and walking through creating a fine-grained personal access token with least-privilege permissions scoped to a single repository.Notes
GH_TOKENenv var is wired up — the token is stored byghin the persisted volume rather than as a plaintext env var on the host.