Skip to content

cub pr

Create and manage pull requests for epics or branches.

Synopsis

cub pr [<target>] [OPTIONS]
cub pr status [<target>]

Description

The cub pr command creates pull requests for completed work. By default, it creates the PR and then invokes Claude to monitor CI status, address review comments, and report when ready to merge.

The command supports:

  • Creating PRs from the current branch or for a specific epic
  • Auto-generated PR descriptions from completed tasks
  • Draft PRs for work in progress
  • CI monitoring and review handling (can be skipped with --no-ci)

Options

Option Description
<target> Epic ID, branch name, or omit for current branch
-t, --title <text> Custom PR title (default: from epic or branch)
-b, --base <branch> Target branch (default: from binding or main)
--draft Create as draft PR
--push Push branch to remote before creating PR
--no-ci Just create PR, skip CI/review handling
-n, --dry-run Preview without creating

Subcommands

cub pr status

Show PR status including CI checks and reviews.

cub pr status [<target>]
Argument Description
<target> Epic ID, branch name, PR number, or omit for current branch

Examples

Create PR for Current Branch

# Create PR and wait for CI
cub pr

# Just create PR, return immediately
cub pr --no-ci

Create PR for an Epic

cub pr cub-vd6

Draft PR with Custom Title

cub pr --draft --title "WIP: New feature implementation"

Push and Create PR

# Push branch first, then create PR
cub pr --push

Preview Changes

cub pr --dry-run

Output:

Would create PR:
  Title: task(cub-vd6): Implement authentication
  Base: main
  Head: feature/cub-vd6
  Draft: false

Body:
  ## Summary
  ...

Check PR Status

# Status for current branch
cub pr status

# Status for specific epic
cub pr status cub-vd6

# Status for PR number
cub pr status 123

Output:

PR #45: Implement user authentication

  State: open
  feature/cub-vd6 -> main
  URL: https://github.com/user/repo/pull/45

CI Checks:
  [green] tests: success
  [green] lint: success
  [dim] deploy-preview: in_progress

Prerequisites

GitHub CLI

The cub pr command requires the GitHub CLI (gh):

# Install
brew install gh                    # macOS
sudo apt install gh               # Ubuntu/Debian
winget install GitHub.cli         # Windows

# Authenticate
gh auth login

# Verify
gh auth status

Repository Requirements

  • Repository must have a GitHub remote configured
  • Branch must be pushed to remote (or use --push flag)
  • For epic-based PRs, the epic must have a branch binding

Auto-Generated PR Body

When creating a PR, cub generates a comprehensive description:

For Epic-Based PRs

## Summary

Implemented [Epic Title]

## Completed Tasks

- [x] cub-001: Add login form
- [x] cub-002: Create auth endpoints
- [x] cub-003: Add tests

## Test Plan

Verify the following acceptance criteria:

- [ ] Login form renders correctly
- [ ] Authentication flow works
- [ ] Tests pass

For Branch-Based PRs

## Summary

Automated changes from cub session.

- Implemented user authentication system
- Added login form component
- Created API endpoints for auth flow

## Commits
abc1234 task(cub-001): Add login form def5678 task(cub-002): Create auth endpoints ghi9012 task(cub-003): Add tests
---
Generated by cub

CI Integration

By default, cub pr creates the PR and then invokes Claude to:

  1. Wait for CI checks to complete
  2. Address failing checks if possible
  3. Respond to review comments
  4. Report when ready to merge

CI Workflow

cub pr
   |
   +-> Create PR
   |
   +-> Invoke Claude to:
       |
       +-> Monitor CI status
       |
       +-> Address failing checks
       |
       +-> Respond to review comments
       |
       +-> Report when ready

Skipping CI Handling

Use --no-ci to just create the PR and exit immediately:

cub pr --no-ci

This is useful when you want to handle CI and reviews manually.

Workflow Examples

Standard Workflow

# Complete tasks for an epic
cub run --epic cub-vd6

# Push and create PR
cub pr cub-vd6 --push

# View result
# PR #45 created: https://github.com/user/repo/pull/45

Draft Workflow

# Create draft while still working
cub pr --draft --title "WIP: New feature"

# Later, mark ready for review
gh pr ready 45

Quick PR Without CI Wait

# Create PR and move on
cub pr --no-ci

# Check status later
cub pr status

Troubleshooting

"gh: command not found"

Install the GitHub CLI:

brew install gh    # macOS

"Not authenticated"

Run GitHub authentication:

gh auth login

"Branch not pushed to origin"

Push manually or use --push:

cub pr --push

"PR already exists"

Check existing PR:

cub pr status
gh pr view

"No branch binding found"

For epic-based PRs, create a binding first:

cub branch cub-vd6 --bind-only
cub pr cub-vd6

Or create PR from branch directly:

cub pr --base main