cub pr¶
Create and manage pull requests for epics or branches.
Synopsis¶
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.
| Argument | Description |
|---|---|
<target> | Epic ID, branch name, PR number, or omit for current branch |
Examples¶
Create PR for Current Branch¶
Create PR for an Epic¶
Draft PR with Custom Title¶
Push and Create PR¶
Preview Changes¶
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
--pushflag) - 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
CI Integration¶
By default, cub pr creates the PR and then invokes Claude to:
- Wait for CI checks to complete
- Address failing checks if possible
- Respond to review comments
- 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:
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¶
Troubleshooting¶
"gh: command not found"¶
Install the GitHub CLI:
"Not authenticated"¶
Run GitHub authentication:
"Branch not pushed to origin"¶
Push manually or use --push:
"PR already exists"¶
Check existing PR:
"No branch binding found"¶
For epic-based PRs, create a binding first:
Or create PR from branch directly:
Related Commands¶
cub branch- Create and bind branchescub branches- List branch bindingscub merge- Merge completed PRscub run- Execute tasks