Skip to content

Add gh pr command for generating and creating pull requests#4

Merged
csvenke merged 1 commit intomainfrom
feature/add-gh-pr-command
Mar 5, 2026
Merged

Add gh pr command for generating and creating pull requests#4
csvenke merged 1 commit intomainfrom
feature/add-gh-pr-command

Conversation

@csvenke
Copy link
Copy Markdown
Owner

@csvenke csvenke commented Mar 5, 2026

Summary

Adds a new gh pr subcommand that generates pull request metadata using an LLM and creates the PR via GitHub CLI.

Key Changes

  • New command structure: Refactored command routing into a flexible registry system (internal/cmd/cmd.go) that supports nested subcommands
  • GitHub PR generation: Added internal/gh/ package with:
    • gh.Run() - generates PR title and body from git diff using LLM
    • gh.CreatePullRequest() - creates PR via gh CLI
    • Git client for retrieving branch info, merge bases, and diffs
  • Command wiring: New command packages:
    • internal/cmd/ask/ - ask command wrapper
    • internal/cmd/commit/ - commit command wrapper
    • internal/cmd/gh/ - gh command (parent)
    • internal/cmd/gh/pr/ - pr subcommand
  • Main refactoring: Updated main.go to use centralized command dispatcher
  • Comprehensive testing: Added unit tests for command routing, PR generation, and creation workflow

Usage

llm gh pr

Generates PR metadata from current branch changes and creates a pull request.

- Create cmd package with registry-based command routing
- Add ask and commit command adapters
- Add gh command group with pr subcommand
- Add GitHub client for interacting with git/gh CLI
- Implement gh pr generation with AI-powered pull request creation
- Add comprehensive tests for command routing and PR generation
- Refactor main to use new command system
@csvenke csvenke force-pushed the feature/add-gh-pr-command branch from ce74f2a to d75bb6d Compare March 5, 2026 22:41
@csvenke csvenke merged commit 2bc5ba9 into main Mar 5, 2026
@csvenke csvenke deleted the feature/add-gh-pr-command branch March 5, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant