What is ghx?
ghx is a caching proxy for the GitHub CLI, designed to reduce repeated GitHub API requests and make recurring commands faster. It routes commands through a local daemon, which serves valid cached results or runs the command with the real GitHub CLI when needed. Developers can use it directly in place of gh, while AI coding agents can benefit through a command shim or an agent plugin.
ghx Features:
Read-Only Command Cache: ghx caches allowlisted read-only commands, including pull request, issue, repository, workflow, release, search, and GET API requests.
Concurrent Request Sharing: Singleflight coalescing lets concurrent requests for the same command share one execution and receive its result.
Context-Aware Keys: Cache keys account for repository, branch, host, authentication context, and command arguments to avoid collisions across contexts.
Mutation Handling: Commands that change data pass through directly, and supported pull request or issue mutations invalidate related cache entries.
Configurable Cache: Cached output includes stdout, stderr, and exit code, with a configurable time-to-live and a default duration of 30 seconds.
Local Monitoring: A localhost dashboard displays cache hit rates, per-command statistics, and a live request log, with dashboard data also available as JSON.
Agent Setup: A gh shim can route agent commands through ghx, and plugins for Claude Code and GitHub Copilot CLI teach agents to call ghx directly.
ghx Benefits:
Faster Repeat Work: Frequently repeated read requests can return from the cache instead of waiting for another GitHub API call.
Fewer API Calls: Sharing one execution among simultaneous identical requests reduces duplicate calls from parallel agents or processes.
Lower Rate-Limit Pressure: Reusing cached results helps limit redundant requests that could contribute to GitHub API rate limiting.
Safer Automation: Read-only allowlisting keeps mutations on the direct command path rather than serving them as cached responses.
Clearer Cache Tuning: Request logs and command-level hit statistics help users see where caching is useful and adjust the time-to-live.
Use Cases:
Agent Pull Request Reviews: Use ghx when several coding agents repeatedly list or inspect pull requests in the same repository.
Issue Triage: Cache recurring issue lists and views while an agent or developer reviews open work and status details.
CI Status Checks: Use cached workflow, run, or pull request status queries in scripts that check GitHub state repeatedly.
Repository Research: Reduce repeated requests while searching repositories, issues, pull requests, commits, or code through the GitHub CLI.
Local CLI Workflows: Route routine read-only gh commands through ghx when working across repositories or building scripts that revisit the same data.

