ccpr

module
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT

README

ccpr

CI Go Report Card Go Reference Release

Turn a CodeCommit pull request into AI-ready review input in one command.

ccpr review <PR_URL> --format json | claude -p "Review this PR"

What ccpr does

  • Fetch PR metadata, comments, and diffs from CodeCommit in one shot
  • Output as JSON / Patch — ready to pipe into AI tools
  • Automate code review with Claude Code

Before / After

Without ccpr: CodeCommit's CLI is fragmented — gathering PR metadata, comments, and diffs requires multiple API calls and manual assembly. Feeding that to AI tools means even more glue work.

With ccpr: One command gives you everything. JSON output plugs directly into Claude Code or any AI tool for instant review.

Quick Start

go install github.com/hidetzu/ccpr/cmd/ccpr@latest
ccpr init
ccpr review <codecommit-pr-url>

AI Integration

Pipe to Claude
ccpr review <PR_URL> --format json | claude -p "Review this PR"

ccpr provides a Claude Code skill for direct PR review integration.

mkdir -p .claude/skills/ccpr-review
cp /path/to/ccpr/examples/claude/ccpr-review/SKILL.md .claude/skills/ccpr-review/

Then in Claude Code:

/ccpr-review <codecommit-pr-url>

See docs/claude-integration.md for more options.

Use Cases

  • AI code reviewccpr review <url> --format json + Claude Code
  • Create a PRccpr create --repo <repo> --title "Add feature" --dest main
  • Post review commentsccpr comment <url> --body-file review.md
  • Quick PR summaryccpr review <url> for a human-readable overview
  • CI integration — pipe JSON/patch output to automated pipelines
  • CLI-based PR browsingccpr list + ccpr review without opening the console

Output Examples

Summary (default)
$ ccpr review <codecommit-pr-url>
PR #883: Fix login bug
Author:   example-user
Status:   OPEN
Branch:   feature/login → main
Created:  2026-03-25

Comments: 3 (2 threads)
Files:    7 changed

## Description

Fix session timeout on login page
JSON (for AI tools)
$ ccpr review <codecommit-pr-url> --format json
{
  "metadata": {
    "prId": "883",
    "title": "Fix login bug",
    "author": "example-user",
    "authorArn": "arn:aws:iam::123456789012:user/example-user",
    "sourceBranch": "feature/login",
    "destinationBranch": "main",
    "status": "OPEN",
    "creationDate": "2026-03-25T10:30:00Z"
  },
  "comments": [...],
  "diff": "diff --git a/src/login.go ..."
}

Usage

Review a PR
ccpr review <codecommit-pr-url>                 # Summary (default)
ccpr review <codecommit-pr-url> --format json   # JSON for AI tools
ccpr review <codecommit-pr-url> --format patch  # Diff only
List PRs
ccpr list --repo <repo>                         # OPEN PRs (default)
ccpr list --repo <repo> --status closed         # CLOSED PRs
ccpr list --repo <repo> --status all            # All PRs
ccpr list --repo <repo> --format json           # JSON output
Create a PR
ccpr create --repo <repo> --title "Add feature X" --dest main
ccpr create --repo <repo> --title "Add feature X" --dest main --source feature/x
ccpr create --repo <repo> --title "Add feature X" --dest main --description-file desc.md
ccpr create --repo <repo> --title "Add feature X" --dest main --format json
Post a comment
ccpr comment <codecommit-pr-url> --body "LGTM"
ccpr comment <codecommit-pr-url> --body-file review.md
echo "Looks good" | ccpr comment <codecommit-pr-url> --body -
Setup and diagnostics
ccpr init                   # Generate config file
ccpr doctor                 # Validate environment and config
Flags
--format           Output format: summary (default), json, patch (review only)
--title            PR title (create only, required)
--dest             Destination branch (create only, required)
--source           Source branch (create only, defaults to current branch)
--description      PR description; use - for stdin (create only)
--description-file Path to PR description file (create only)
--body             Comment body; use - for stdin (comment only)
--body-file        Path to comment body file (comment only)
--profile          AWS profile name
--region           AWS region
--config           Path to configuration file
--repo             Repository name
--pr-id            Pull request ID (review/comment only)
--status           PR status filter: open, closed, all (list only)

Configuration

~/.config/ccpr/config.yaml

profile: your-aws-profile
region: ap-northeast-1
repoMappings:
  your-repo: /path/to/local/clone
AWS Profile Resolution
  1. --profile flag
  2. profile in config file
  3. AWS_PROFILE environment variable
  4. default
AWS Region Resolution
  1. PR URL (extracted automatically)
  2. --region flag
  3. region in config file

Development

make build    # Build binary to bin/ccpr
make test     # Run all tests with -v -race
make lint     # golangci-lint
make vet      # go vet
make clean    # Remove bin/

License

MIT

Directories

Path Synopsis
cmd
ccpr command
internal

Jump to

Keyboard shortcuts

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