ccpr

module
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT

README

ccpr

CI Go Report Card Go Reference Release

Review AWS CodeCommit pull requests from the CLI — optimized for humans and AI.

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 ..."
}

Overview

ccpr is a CLI tool that bridges AWS CodeCommit and AI review tools like Claude Code.

It takes a CodeCommit PR URL, fetches metadata, comments, and diffs, and outputs structured data that AI tools can use for code review.

Why

AWS CodeCommit's UI and CLI make it hard to:

  • Quickly explore pull requests
  • Understand comment threads
  • Integrate with AI tools for code review

ccpr provides a simple CLI to:

  • List and review PRs efficiently
  • Preserve comment thread structure
  • Output clean, structured data for AI

Install

go install github.com/hidetzu/ccpr/cmd/ccpr@latest

Setup

Create ~/.config/ccpr/config.yaml:

profile: your-aws-profile
region: ap-northeast-1
repoMappings:
  your-repo: /path/to/local/clone

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
Version
ccpr --version
Flags
--format     Output format: summary (default), json, patch (review only)
--profile    AWS profile name
--region     AWS region
--config     Path to configuration file
--repo       Repository name
--pr-id      Pull request ID (review only)
--status     PR status filter: open, closed, all (list only)
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

Use Cases

  • AI-assisted code review: ccpr review <url> --format json → Claude Code
  • CLI-based PR browsing: ccpr list + ccpr review without opening the console
  • Quick PR access: ccpr open <url> to jump to the PR in browser

Using with Claude Code

For AWS CodeCommit repositories, you can use ccpr to provide PR data to Claude Code.

See docs/claude-integration.md for setup instructions.

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