Expand description
GitHub CLI integration for PR operations.
This module provides functions to interact with the GitHub CLI for checking prerequisites and managing pull requests.
§Modules
- [
types] - Core types for PR operations format- PR title and description formatting- [
pr] - PR creation and management - [
detection] - PR detection for branches - [
context] - PR context gathering for reviews - [
branch] - Branch context for PR reviews
Structs§
- Branch
Context - Context about the current branch for PR reviews
- PRComment
- A single comment on a PR
- PRContext
- Full context about a PR for review
- Pull
Request Info - Information about an open pull request
Enums§
- Branch
Context Result - Result of gathering branch context
- PRContext
Result - Result of gathering PR context
- PRDetection
Result - Result of attempting to detect a PR for the current branch
- PRResult
- Result type for PR creation operations
- Template
Agent Result - Result from running the PR template agent.
Functions§
- build_
gh_ command - Builds the
gh pr createorgh pr editcommand string. - create_
pull_ request - Create a pull request for the current branch using the GitHub CLI
- detect_
pr_ for_ current_ branch - Detect the PR for the current branch
- detect_
pr_ template - Detects and returns the content of a PR template if one exists in the repository.
- ensure_
branch_ pushed - Ensure the current branch is pushed to the remote
- extract_
pr_ url - Extracts a PR URL from the agent’s output.
- find_
spec_ for_ branch - Find the spec file for a given branch
- format_
pr_ description - Format a Spec into a well-structured GitHub PR description in Markdown format
- format_
pr_ title - Format a Spec into a concise PR title
- format_
spec_ for_ template - Formats spec data for inclusion in the PR template prompt.
- gather_
branch_ context - Gather context about the current branch for PR review
- gather_
pr_ context - Gather full context for a PR including unresolved comments
- get_
existing_ pr_ number - Get the PR number for an existing pull request for the given branch
- get_
existing_ pr_ url - Get the URL of an existing pull request for the given branch
- get_
pr_ info_ for_ branch - Get PR info for a specific branch
- is_
gh_ authenticated - Check if the user is authenticated with GitHub CLI
- is_
gh_ installed - Check if the GitHub CLI (gh) is installed and available in PATH
- list_
open_ prs - List all open PRs in the repository
- pr_
exists_ for_ branch - Check if a pull request already exists for the given branch
- print_
branch_ context - Print a summary of the branch context
- run_
template_ agent - Run a Claude agent to populate a PR template and execute the gh command.
- update_
pr_ description - Update the description of an existing pull request