gh-tool is designed to be portable: a manifest committed to your dotfiles is enough to reproduce a working toolchain anywhere gh is installed and authenticated. This page shows how to use it inside containers, Fedora Toolbox, and ephemeral agent or cloud-IDE sessions.
ghis installed — gh-tool is aghextension. Installghfrom your package manager, the official binaries, or the GitHub apt/dnf repos.ghis authenticated —gh auth statusshould succeed. In a non-interactive environment, setGH_TOKENto a PAT withread:packagesand (optionally)reposcope.gh toolextension is installed —gh extension install ascarter/gh-tool.
In a container or sandbox, point gh-tool at one root directory so everything (manifest, binaries, cache, state) lives in a predictable place:
export GHTOOL_HOME="/opt/gh-tool"This sidesteps XDG path discovery and makes cleanup trivial (rm -rf "$GHTOOL_HOME"). See shell.md for the full layout.
The minimum bootstrap inside any Debian/Fedora-based container:
#!/usr/bin/env bash
set -euo pipefail
export GHTOOL_HOME="${GHTOOL_HOME:-/opt/gh-tool}"
export PATH="$GHTOOL_HOME/data/bin:$PATH"
gh extension install ascarter/gh-tool
mkdir -p "$GHTOOL_HOME/config"
cp /path/to/your/config.toml "$GHTOOL_HOME/config/config.toml"
gh tool installThe examples/ directory in this repo contains:
Dockerfile.ubuntu—ubuntu:24.04base, installsghfrom the GitHub apt repo.Dockerfile.fedora—fedora:latestbase, installsghfromdnf.config.toml— a sample manifest (fzf,ripgrep,jq).install.sh— the bootstrap script above, suitable for any sandbox.
Build and run:
cd examples
docker build -f Dockerfile.ubuntu --build-arg GH_TOKEN="$(gh auth token)" -t gh-tool-demo .
docker run --rm -it gh-tool-demo bash -c 'fzf --version && rg --version && jq --version'If you'd rather mount a manifest from the host than bake one into the image:
docker run --rm -it \
-v "$PWD/my-config.toml:/opt/gh-tool/config/config.toml:ro" \
-e GH_TOKEN="$(gh auth token)" \
gh-tool-demo \
bash -c 'gh tool install && exec bash'Inside a toolbox container, the flow is the same:
toolbox enter
sudo dnf install -y gh
gh auth login # one-time, persists across toolbox sessions
gh extension install ascarter/gh-tool
export GHTOOL_HOME="$HOME/.gh-tool"
echo 'export GHTOOL_HOME="$HOME/.gh-tool"' >> ~/.bashrc
echo 'eval "$(gh tool shell)"' >> ~/.bashrc
# Drop your manifest into place and install
mkdir -p "$GHTOOL_HOME/config"
cp ~/dotfiles/gh-tool.toml "$GHTOOL_HOME/config/config.toml"
gh tool installFor a coding agent operating in an ephemeral workspace:
- Have the agent ensure
ghis installed and authenticated (GH_TOKENfrom the session secrets). - Have it install the extension:
gh extension install ascarter/gh-tool. - Have it set
GHTOOL_HOME=$WORKSPACE/.gh-toolso installs are scoped to the session and disappear when the workspace is torn down. - Have it write or fetch the project's
config.tomland rungh tool install.
A drop-in skill file describes this flow in a form you can copy into your own repo so an agent picks it up automatically.
gh tool reset # wipe data/state/cache, keep manifest
rm -rf "$GHTOOL_HOME" # nuke everything including manifest
gh extension remove ascarter/gh-tool