Overview
Thewit pr command provides a complete pull request workflow from the CLI, including creating PRs, viewing details, managing reviews, and merging.
Commands
create
Create a new pull request from the current branch.Options
| Option | Description |
|---|---|
-b, --base <branch> | Target branch (default: main) |
-t, --title <text> | PR title (default: last commit message) |
-m, --body <text> | PR description/body |
Examples
list
List pull requests in the repository.Options
| Option | Description |
|---|---|
--state <state> | Filter by state: open, closed, merged, or all |
Examples
Example Output
view
View details of a specific pull request.Examples
Example Output
checkout
Fetch and checkout a pull request locally for testing or review.pr-<number> pointing to the PR’s head commit.
Examples
merge
Merge a pull request.Options
| Option | Description |
|---|---|
--method <method> | Merge method: merge, squash, or rebase |
Examples
close
Close a pull request without merging.reopen
Reopen a previously closed pull request.review
Review a pull request using AI-powered code review (CodeRabbit).Options
| Option | Description |
|---|---|
--json | Output review results as JSON |
--verbose | Show detailed review output |
--configure | Configure CodeRabbit API key |
Examples
review-status
Check CodeRabbit configuration and installation status.Example Output
Workflow Example
A typical PR workflow from the command line:Integration with wit serve
The PR commands require a running wit server for full functionality. Start the server with:CodeRabbit Integration
wit integrates with CodeRabbit for AI-powered code reviews. To set up:- Get an API key from https://coderabbit.ai
- Configure it:
wit pr review --configure - Or set the environment variable:
export CODERABBIT_API_KEY=your-key