Skip to content

feat: add jam review command#10

Merged
sunilp merged 2 commits into
mainfrom
feat/issue-7-review-command
Feb 22, 2026
Merged

feat: add jam review command#10
sunilp merged 2 commits into
mainfrom
feat/issue-7-review-command

Conversation

@sunilp

@sunilp sunilp commented Feb 22, 2026

Copy link
Copy Markdown
Owner

Summary

Implements #7 — adds a jam review command that uses AI to review a git branch diff or a GitHub PR.

Changes

  • src/commands/review.ts — new command module with getMergeBase, getBranchDiff, getPrDiff, getCurrentBranch, buildReviewPrompt, runReview
  • src/index.ts — registers the review command with --base and --pr options
  • src/commands/review.test.ts — 16 unit tests covering all helpers and the full runReview flow

Usage

jam review                  # review current branch vs main
jam review --base develop   # review against a different base
jam review --pr 42          # review a GitHub PR (requires gh CLI)
jam review --json           # output JSON

Closes #7

- Add `jam review` command to AI-review a branch diff or a PR
- Exports: getMergeBase, getBranchDiff, getPrDiff, getCurrentBranch,
  buildReviewPrompt, runReview
- Options: --base <ref> (default: main), --pr <number>, --json
- Register command in src/index.ts
- Add 16 unit tests in src/commands/review.test.ts

Closes #7
String.repeat() throws when given a negative count. The pad helper was
computing innerWidth - 2 - s.length on strings that already contained
ANSI escape codes, so the invisible bytes inflated s.length past the
box width. Strip ANSI codes via a regex before measuring visible length
and add Math.max(0, …) as a safety guard.
@sunilp
sunilp merged commit d35e065 into main Feb 22, 2026
0 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(commands): Add jam review for PR review workflow

1 participant