Wraps the official GitHub CLI feature and adds persistent volume mounts for config and state.
"features": {
"ghcr.io/sliekens/devcontainer-features/github-cli:1": {}
}This feature does not expose configurable options.
| Host path | Container path | Purpose |
|---|---|---|
~/.config/gh |
/var/lib/github-cli/config |
Configuration |
~/.local/share/gh |
/var/lib/github-cli/state |
State |
These directories are bind-mounted from the host so that auth and configuration are preserved across container rebuilds.
Because Docker cannot bind-mount a directory that does not yet exist, consuming devcontainer.json files should add an initializeCommand to pre-create these directories on the host before the container starts:
{
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/sliekens/devcontainer-features/github-cli:1": {}
},
"initializeCommand": "mkdir -p \"$HOME/.config/gh\" \"$HOME/.local/share/gh\""
}This feature is released under the MIT License.
The installed tool is subject to its own license: GitHub CLI license.
- Add trailing slash to bind mount source paths to mark them explicitly as directories.
- Use bind mounts from host
~/.config/ghand~/.local/share/ghinstead of Docker volumes for persistent state.
- Initial release.