prcmd

package
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyReviewToBody

func ApplyReviewToBody(body, review string) string

ApplyReviewToBody merges a review report into the PR Test plan section.

func New

func New() *redant.Command

New creates the pr command group.

Types

type Draft

type Draft struct {
	Title string
	Body  string
	Base  string
	Head  string
}

Draft holds generated PR metadata before submission.

func BuildDraft

func BuildDraft(ctx context.Context, rc RepoContext) (Draft, error)

BuildDraft assembles a PR title and body from git history (rule-based, no AI).

func EnhanceDraft

func EnhanceDraft(ctx context.Context, provider aiprovider.Provider, draft Draft) (Draft, bool, error)

EnhanceDraft optionally refines a rule-based PR draft using AI.

type GhClient

type GhClient struct {
	// contains filtered or unexported fields
}

GhClient wraps the GitHub CLI.

func NewGhClient

func NewGhClient(repoRoot string) *GhClient

NewGhClient creates a gh client scoped to a repository directory.

func (*GhClient) CreatePR

func (g *GhClient) CreatePR(ctx context.Context, draft Draft) (string, error)

CreatePR opens a pull request on GitHub.

func (*GhClient) EditPR

func (g *GhClient) EditPR(ctx context.Context, draft Draft) error

EditPR updates the current branch pull request title and body.

func (*GhClient) EnsureAvailable

func (g *GhClient) EnsureAvailable(ctx context.Context) error

EnsureAvailable verifies gh is installed and authenticated enough to run.

func (*GhClient) MergePR

func (g *GhClient) MergePR(ctx context.Context, method string, dryRun bool) (string, error)

MergePR merges the current branch PR.

func (*GhClient) SyncPR

func (g *GhClient) SyncPR(ctx context.Context, rc RepoContext, dryRun bool) error

SyncPR rebases onto base and force-pushes with lease (when not dry-run).

func (*GhClient) ViewPR

func (g *GhClient) ViewPR(ctx context.Context) (string, error)

ViewPR returns gh pr view output for the current branch.

type RepoContext

type RepoContext struct {
	RepoRoot string
	Branch   string
	Upstream string
	BaseRef  string
}

RepoContext holds git metadata needed for PR operations.

func LoadRepoContext

func LoadRepoContext(ctx context.Context, repoRoot string) (RepoContext, error)

LoadRepoContext resolves branch, upstream, and base ref for the current repo.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL