Enable GitHub CLI in Claude Code on the Web with a single line in settings.json. Automate GitHub workflows, streamline repository management, and integrate with other tools. Ideal for operations teams managing repositories and CI/CD pipelines.
git clone https://github.com/oikon48/gh-setup-hooks.gitThe gh-setup-hooks skill allows users to enable the `gh` command within the Claude Code on the Web environment by simply adding SessionStartHooks. This automation skill is designed for developers who want to streamline their GitHub interactions directly within Claude Code, enhancing their workflow efficiency. By integrating this skill, users can execute GitHub commands seamlessly, which can significantly improve the development process. One of the key benefits of the gh-setup-hooks skill is its ability to save time by reducing the manual setup required for GitHub commands. While the exact time savings are currently unknown, the efficiency gained through automation can lead to quicker project turnarounds and a more agile development cycle. This skill is particularly useful for developers working on collaborative projects where GitHub is a primary tool for version control and collaboration. Developers, product managers, and AI practitioners who frequently interact with GitHub will find this skill beneficial. It caters to those looking to enhance their AI-first workflows by integrating automation into their daily tasks. The implementation of this skill is rated as intermediate, requiring about 30 minutes to set up. Users should have a basic understanding of Claude Code and GitHub to effectively utilize this skill. In practical terms, the gh-setup-hooks skill can be used in various scenarios, such as automating the process of creating pull requests or managing branches directly from Claude Code. This skill fits seamlessly into AI automation strategies, allowing teams to focus on higher-level tasks while routine commands are executed automatically. By adopting this skill, teams can enhance their productivity and maintain a competitive edge in the fast-paced world of software development.
[{"step":"Add GitHub CLI configuration to settings.json","action":"Open Claude Code settings.json and add the enabled GitHub CLI integration line. Replace [REPOSITORY_NAME] with your actual repository path (e.g., 'acme-corp/finance-api').","tip":"Use the command palette (Ctrl+Shift+P) to open settings.json directly."},{"step":"Authenticate with GitHub CLI","action":"Run `gh auth login` in the terminal and follow the prompts to authenticate using a personal access token with the required scopes (repo, workflow).","tip":"Ensure your token has sufficient permissions for the repository and workflows you intend to automate."},{"step":"Automate a workflow task","action":"Use the GitHub CLI commands (e.g., `gh pr create`, `gh workflow run`) or write a script in Claude Code to automate repetitive tasks like PR creation, issue management, or workflow triggering.","tip":"Start with simple commands and gradually build more complex automation scripts as you become comfortable with the CLI."},{"step":"Integrate with other tools","action":"Combine GitHub CLI with other tools like `jq` for JSON parsing, `sed`/`awk` for text manipulation, or Claude Code's built-in scripting capabilities to create end-to-end automation pipelines.","tip":"Use `gh api` for advanced GitHub API interactions if the CLI commands don't cover your needs."},{"step":"Handle errors and edge cases","action":"Wrap your automation scripts in try-catch blocks and include error handling for common issues like authentication failures, permission errors, or network timeouts.","tip":"Log detailed error messages to help with debugging and troubleshooting."}]
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/oikon48/gh-setup-hooksCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Enable GitHub CLI integration in Claude Code on the web for [REPOSITORY_NAME] by adding the following line to your settings.json: `"github": {"enabled": true, "default_repo": "[REPOSITORY_NAME]"}`. Then, run `gh auth login` to authenticate. After setup, automate [SPECIFIC_TASK] such as creating a PR, checking workflow status, or managing issues. Include error handling for authentication failures or permission issues.After enabling GitHub CLI in Claude Code's settings.json for the repository `acme-corp/finance-api`, I authenticated using `gh auth login` with my personal access token (scopes: repo, workflow). I then automated a routine task by running the following Claude Code command:
```javascript
// Automate PR creation for release v2.1.0
const { execSync } = require('child_process');
try {
// Create a new branch for the release
execSync('git checkout -b release/v2.1.0', { stdio: 'inherit' });
// Update version in package.json
const packageJson = require('./package.json');
packageJson.version = '2.1.0';
require('fs').writeFileSync('./package.json', JSON.stringify(packageJson, null, 2));
// Commit changes
execSync('git add package.json && git commit -m "chore: bump version to v2.1.0"', { stdio: 'inherit' });
// Push branch to remote
execSync('git push -u origin release/v2.1.0', { stdio: 'inherit' });
// Create PR using GitHub CLI
const prUrl = execSync(`gh pr create --title "Release v2.1.0" --body "This PR includes updates for the v2.1.0 release.\n\nChanges:\n- Bump version to 2.1.0\n- [Add other changes here]" --base main --head release/v2.1.0`, { encoding: 'utf-8' }).trim();
console.log(`Successfully created PR: ${prUrl}`);
} catch (error) {
console.error('Failed to automate PR creation:', error.message);
console.log('Manual intervention may be required.');
}
```
The PR was successfully created at https://github.com/acme-corp/finance-api/pull/42, and the workflow automatically triggered a CI check. The entire process took 2 minutes, compared to the usual 15 minutes of manual steps. Authentication was seamless, and no permission issues were encountered.Agents that listen, think and act for you.
AI assistant built for thoughtful, nuanced conversation
IronCalc is a spreadsheet engine and ecosystem
Customer feedback management made simple
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan