gh-setup-hooks
v2.0.1
Published
One-line setup for GitHub CLI auto-installation on Claude Code on the Web
Maintainers
Readme
gh-setup-hooks
Auto-install GitHub CLI on Claude Code on the Web. Just add one line to settings.json.
Setup
1. Add hook to settings.json
Add to .claude/settings.json:
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "bunx -y gh-setup-hooks",
"timeout": 120
}
]
}
]
}
}npx -y gh-setup-hooks is also ok.
2. Set GITHUB_TOKEN in Claude Code on the Web
To use gh commands (e.g., gh pr create), you need to set GH_TOKEN or GITHUB_TOKEN:
- Go to Claude Code on the Web
- Open Settings → Custom Environment
- Add environment variable:
- Name:
GH_TOKENorGITHUB_TOKEN - Value: Your GitHub Personal Access Token
- Name:
Note: The token needs
reposcope for most operations.
Claude Code on the Web network should be Full or Custom. If using Custom, you need to allow release-assets.githubusercontent.com.
How It Works
- Start a session on Claude Code on the Web
- SessionStart hook runs
npx gh-setup-hooks - Installs gh only in remote environment (
CLAUDE_CODE_REMOTE=true) - Installs to
~/.local/binand persists PATH - Does nothing in local environment
Configuration
| Environment Variable | Description | Default |
|---------------------|-------------|---------|
| GH_SETUP_VERSION | gh version to install | 2.83.2 |
License
MIT
