gh
agent-ready json output non-interactive
GitHub's official CLI tool for managing repositories, issues, PRs, releases, and workflows from the terminal. Fully scriptable with JSON output.
How to install gh
brew install gh When to use gh
- When an AI agent needs to create or clone a GitHub repository as part of a setup or migration task
- When an AI agent must manage open issues or pull requests, such as adding labels, comments, or merging approved PRs
- When an AI agent needs to trigger or monitor GitHub Actions workflows or create releases for versioning
When not to use gh
- When performing complex multiline interactive Git operations that require a full Git client (gh is a wrapper, not a full Git replacement)
- When interacting with non-GitHub platforms (e.g., GitLab, Bitbucket) or managing repository content at the object/file level without GitHub's API
gh features
- · JSON output flag
- · Issue/PR management
- · Repo creation/cloning
- · Workflow/CI management
- · Release creation
Want your agent to find this automatically?
Add the MCP server to your agent config and it will discover tools like gh on its own.
Set up MCP →