What this is. A portable, copy-into-your-own-repo skill file that teaches a coding agent (Copilot CLI, Claude Code, Cursor, etc.) how to use the GitHub CLI plus the
gh-toolextension to install and manage CLI tools from a manifest.Where to put it. Drop this file into your repo at one of:
AGENTS.md(or include this content from there).github/copilot-instructions.md.cursor/rules/gh-tool.md- any other location your agent reads instructions from
What it is not. It's not a config file for
gh-toolitself, and it's not a skill specific to one agent platform. It's prose instructions an agent reads.
You (the agent) can provision a reproducible set of CLI tools by:
- Verifying
ghis installed and authenticated. - Installing the
gh-toolextension once. - Reading or authoring a TOML manifest that lists the tools the project needs.
- Running
gh tool installto materialize the binaries onPATH.
gh-tool only fetches assets from GitHub Releases. It does not run arbitrary install scripts.
gh --version # must succeed
gh auth status # must show an authenticated accountIf gh is missing, install it from the OS package manager (apt install gh, dnf install gh, brew install gh) or the official binaries at https://github.com/cli/cli#installation. Do not try to install gh via gh-tool — that's a chicken-and-egg.
If gh auth status fails and you have a token in the environment (e.g., GH_TOKEN), it should work automatically. Otherwise stop and ask the user to authenticate.
gh extension install ascarter/gh-toolIn a sandbox or ephemeral workspace, also set:
export GHTOOL_HOME="$WORKSPACE/.gh-tool"so all gh-tool state lives under the workspace and is cleaned up with it. $WORKSPACE here is whatever your session's writable working directory is.
Then activate the gh-tool bin/ on PATH:
eval "$(gh tool shell --no-completions)"(--no-completions keeps the snippet small and side-effect-free in non-interactive shells.)
The manifest is a TOML file. Default location is ~/.config/gh-tool/config.toml, or $GHTOOL_HOME/config/config.toml when GHTOOL_HOME is set. Minimal example:
[[tool]]
repo = "junegunn/fzf"
pattern = "fzf-*-{{os}}_{{arch}}.tar.gz"
bin = ["fzf"]
[[tool]]
repo = "BurntSushi/ripgrep"
pattern = "ripgrep-*-{{triple}}.tar.gz"
bin = ["rg"]
[[tool]]
repo = "jqlang/jq"
pattern = "jq-{{platform}}-{{arch}}"
bin = ["jq-{{platform}}-{{arch}}:jq"]Template variables: {{os}} (darwin/linux/windows), {{arch}} (arm64/amd64), {{platform}} (macos/linux/windows), {{gnuarch}} (aarch64/x86_64), {{triple}} (Rust target triple, e.g., x86_64-unknown-linux-gnu).
bin accepts a source:link syntax to rename platform-specific filenames to a clean symlink (e.g., jq-macos-arm64:jq).
For full details see manifest.md.
| Goal | Command |
|---|---|
| Install everything in the manifest | gh tool install |
| Install one tool ad-hoc | gh tool install owner/repo --pattern '...' --bin name |
| Add a tool to the manifest interactively | gh tool add owner/repo |
| List installed tools and versions | gh tool list |
| Show outdated tools | gh tool list --outdated |
| Upgrade everything | gh tool upgrade |
| Upgrade one tool | gh tool upgrade owner/repo |
| Remove an installed tool | gh tool remove owner/repo |
| Wipe all installed tools | gh tool reset --yes |
- If the project already has a manifest (look for
config.tomlreferenced in dotfiles, agh-tool.tomlat repo root, or instructions pointing to one), use--fileto point at it:gh tool install --file ./gh-tool.toml. - If the project asks you to add a new tool, prefer
gh tool add owner/repoover hand-editing TOML.addinspects the latest release and produces a working entry. Only fall back to manual edits ifaddcan't determine the right pattern. - Never modify the manifest as a side effect of
install. The manifest is a read-only input.gh tool addis the only command that writes to it. - Do not use
sudo. gh-tool installs into the user's home (or$GHTOOL_HOME), never system-wide. - Do not commit installed binaries or tool state into the repo. Only the manifest belongs in version control.
gh auth statusfails → ask the user to rungh auth loginor setGH_TOKEN.gh tool installreportsno asset matched pattern→ the upstream release asset names changed. Inspect the release page and updatepattern(or set a per-platform override under[tool.patterns]).- Attestation verification warnings are non-fatal — most projects don't publish attestations yet.
- A binary doesn't appear on
PATH→ confirm thegh tool shellsnippet was eval'd in the current shell, or that$GHTOOL_HOME/data/bin(or~/.local/share/gh-tool/bin) is onPATH.