GH#

GitHub integration tool.

Use native handlers only when they help the assistant succeed more reliably than a raw gh command in the shell tool. The native path is worth it when it collapses several API calls into one response, keeps CI state structured and actionable, or adds merge safety guards that are easy to miss in ad-hoc CLI use.

Native operations that materially help:

  • issue view — combines issue body and comments in one call

  • pr view — combines PR body, comments, review-thread resolution, CI,

    and mergeability in one call

  • pr status — structured check-run summary with actionable run IDs

  • pr checks — polls CI until completion with live progress updates

  • pr merge — squash default, --match-head-commit guard, auto-merge

  • run view — extracts and structures failed log sections from CI runs

Adding a new native wrapper#

Before wrapping a gh subcommand, ask: “Will this help the assistant do better than a single gh command in the shell tool?” If not, don’t add it — the pass-through already covers it without bloating instructions.

Good candidates combine multiple API calls into one response, add safety guards, or poll/wait for completion.

gptme.tools.gh.execute_gh(code: str | None, args: list[str] | None, kwargs: dict[str, str] | None) Generator[Message, None, None]

Execute GitHub operations.

Native handlers for high-value operations (issue view, pr view/status/checks/merge, run view). Everything else passes through to the gh CLI unchanged.