Skip to content

New feature: GitHub API tool for repository and pull request information #107

Closed as duplicate

Description

@gadenbuie

Overview

This issue proposes a new tool to interface with the GitHub API, enabling btw to help users interact programmatically with GitHub repositories, issues, and pull requests.

Scope

A new GitHub API tool would support querying repository information, listing and examining issues and pull requests, retrieving commit details, and other read-only operations. This would be useful for:

  • Retrieving context about the current repository for project documentation
  • Gathering information about open issues and PRs for code review or planning
  • Comparing branches to understand what changed

Proposed Endpoints

The planning document identifies three categories of endpoints to implement:

Currently Implemented (Already Working)

  • Issue and PR details, creation, and comments
  • Search functionality

High Confidence - Ready to Implement

  • Repository details, branches, commits
  • PR and issue metadata (reviews, timelines, events)
  • Labels, milestones, checks, and status

Moderate Confidence - Needs Review

  • Branch creation/deletion, reviewer requests, assignees
  • Reactions, releases, workflow runs
  • Code and commit search
  • File operations (create, update, delete)

Not Recommended

  • Repository settings, webhooks, merging, force push, deletion, secrets

Endpoint Summary

Category Method Endpoint Purpose
Repository Info GET /repos/{owner}/{repo} Get repository details
Branches GET /repos/{owner}/{repo}/branches List all branches
Branches GET /repos/{owner}/{repo}/branches/{branch} Get branch details
Contents GET /repos/{owner}/{repo}/contents/{path} Get file/directory contents
Commits GET /repos/{owner}/{repo}/commits List commits
Commits GET /repos/{owner}/{repo}/commits/{ref} Get commit details
Comparison GET /repos/{owner}/{repo}/compare/{base}...{head} Compare branches/commits
PR Reviews GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews Get PR reviews
PR Commits GET /repos/{owner}/{repo}/pulls/{pull_number}/commits Get PR commits
Issue Events GET /repos/{owner}/{repo}/issues/{issue_number}/events Get issue events
Labels GET /repos/{owner}/{repo}/labels List labels
Milestones GET /repos/{owner}/{repo}/milestones List milestones
Status GET /repos/{owner}/{repo}/commits/{ref}/status Get commit status
Checks GET /repos/{owner}/{repo}/commits/{ref}/check-runs Get check runs
Update Issue PATCH /repos/{owner}/{repo}/issues/{issue_number} Update issue
Update PR PATCH /repos/{owner}/{repo}/pulls/{pull_number} Update PR

Next Steps

  • Discuss endpoint selection with team
  • Determine which endpoints to implement first
  • Consider tool grouping and organization
  • Plan integration with existing btw tools

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions