A CLI tool to fetch and format GitHub Issues and Pull Requests context, ready for use in LLM prompts.
This tool requires the GitHub CLI (gh) to be installed and authenticated.
# macOS
brew install gh
# Authenticate
gh auth loginTo install from crates.io:
cargo install gh-contextTo install from source (locally):
cargo install --path .Once installed, you can use gh-context directly:
gh-context <input> [OPTIONS]You can run the tool without installing it using cargo run. Note the -- separator used to pass arguments to the CLI.
cargo run -- <input> [OPTIONS]Fetch context for a PR (creates repo-issue-123/repo-issue-123.md context by default, where repo is the repository name):
gh-context owner/repo#123Bulk fetch open issues for a repo (one file per issue, first page by default):
gh-context https://github.com/openai/codex/issues --bulkBulk fetch multiple pages:
gh-context openai/codex --bulk --pages 3 --per-page 50Fetch context for an issue and copy to clipboard:
gh-context https://github.com/owner/repo/issues/123 --clipSave as JSON (prints to stdout):
gh-context owner/repo#123 --format jsonUsing cargo run:
cargo run -- https://github.com/hdcodedev/resume256/issues/48--format <json|md>: Output format (default: md)--out <path>: Write output to file (single) or directory (bulk)--clip: Copy output to clipboard (macOS only)--issue: Treat input as issue (disambiguate shorthand)--pr: Treat input as PR (disambiguate shorthand)--bulk: Fetch multiple issues for a repo (list mode)--state <open|closed|all>: Issue state filter for bulk mode (default: open)--per-page <n>: Items per page for bulk mode (default: 30)--pages <n>: Number of pages to fetch in bulk mode (default: 1)
