PluginWorld
Gh

gh-setup-hooks

Claude Code✓ SPEC VERIFIED

One-line setup for GitHub CLI auto-installation on Claude Code on the Web

@oikon48 · v2.1.0 · MIT · updated 5mo ago

SECURITY

A

SCORE

66

INSTALLS

14.3K

PLUG IN

/plugin marketplace add oikon48/gh-setup-hooks
/plugin install gh-setup-hooks

README

gh-setup-hooks

npm version License: MIT

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": "bun x gh-setup-hooks",
            "timeout": 120
          }
        ]
      }
    ]
  }
}

npx -y gh-setup-hooks is also ok.

2. Set up Claude Code on the Web

To use gh commands (e.g., gh pr create), you need to set GH_TOKEN or GITHUB_TOKEN:

  1. Go to Claude Code on the Web
  2. Open SettingsCustom Environment
  3. Add environment variable:

Note: The token needs repo scope 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.

Cloud Environment Settings

How It Works

  1. Start a session on Claude Code on the Web
  2. SessionStart hook runs npx gh-setup-hooks
  3. Installs gh only in remote environment (CLAUDE_CODE_REMOTE=true)
  4. Installs to ~/.local/bin and persists PATH
  5. Auto-detects GH_REPO from git remote for gh CLI compatibility
  6. Does nothing in local environment

Configuration

Environment Variable Description Default
GH_SETUP_VERSION gh version to install 2.88.1

License

MIT

References

SIMILAR PLUGINS