Skip to content

Latest commit

 

History

History
58 lines (38 loc) · 1.7 KB

File metadata and controls

58 lines (38 loc) · 1.7 KB

GitHub CLI (github-cli)

Wraps the official GitHub CLI feature and adds persistent volume mounts for config and state.

Example Usage

"features": {
    "ghcr.io/sliekens/devcontainer-features/github-cli:1": {}
}

Options

This feature does not expose configurable options.

Persistent State

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\""
}

License

This feature is released under the MIT License.

The installed tool is subject to its own license: GitHub CLI license.

Links

Release Notes

1.1.1 - 2026-05-14

  • Add trailing slash to bind mount source paths to mark them explicitly as directories.

1.1.0 - 2026-03-28

  • Use bind mounts from host ~/.config/gh and ~/.local/share/gh instead of Docker volumes for persistent state.

1.0.0 - 2026-03-26

  • Initial release.