Skip to content

A CLI tool to fetch and format GitHub Issues and Pull Requests context, ready for use in LLM prompts.

License

Notifications You must be signed in to change notification settings

hdcodedev/gh-context

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gh-context

Crates.io

A CLI tool to fetch and format GitHub Issues and Pull Requests context, ready for use in LLM prompts.

Screenshot 2026-01-18 at 11 23 56

Prerequisites

This tool requires the GitHub CLI (gh) to be installed and authenticated.

# macOS
brew install gh

# Authenticate
gh auth login

Installation

To install from crates.io:

cargo install gh-context

To install from source (locally):

cargo install --path .

Usage

Running Installed Command

Once installed, you can use gh-context directly:

gh-context <input> [OPTIONS]

Running Locally (Development)

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]

Examples

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#123

Bulk fetch open issues for a repo (one file per issue, first page by default):

gh-context https://github.com/openai/codex/issues --bulk

Bulk fetch multiple pages:

gh-context openai/codex --bulk --pages 3 --per-page 50

Fetch context for an issue and copy to clipboard:

gh-context https://github.com/owner/repo/issues/123 --clip

Save as JSON (prints to stdout):

gh-context owner/repo#123 --format json

Using cargo run:

cargo run -- https://github.com/hdcodedev/resume256/issues/48

Options

  • --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)

About

A CLI tool to fetch and format GitHub Issues and Pull Requests context, ready for use in LLM prompts.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published