Skip to content

feat(cli): add reasonix review subcommand for code review#3518

Merged
esengine merged 2 commits into
esengine:main-v2from
yhemeo613:feature/review-subcommand
Jun 8, 2026
Merged

feat(cli): add reasonix review subcommand for code review#3518
esengine merged 2 commits into
esengine:main-v2from
yhemeo613:feature/review-subcommand

Conversation

@yhemeo613

Copy link
Copy Markdown
Contributor

Summary

Add a reasonix review subcommand — a one-shot, non-interactive code review that runs the built-in review subagent against git changes.

Motivation

Codex has codex review. Reasonix should too. Currently users must open a chat session, manually gather the diff, and invoke the review skill — cumbersome. This command gives them a zero-friction "review this" experience.

Usage

reasonix review                      # review uncommitted working-tree changes
reasonix review --base main          # review current branch vs main
reasonix review --commit abc123      # review a specific commit
reasonix review --model deepseek     # use a specific model
reasonix review --instructions "..." # extra review instructions

Implementation

File Change
internal/cli/review.go New: reviewCommand + getReviewDiff + buildReviewTask (154 lines)
internal/cli/cli.go Register "review" case in Run() (+3 lines)
internal/cli/review_test.go New: TestBuildReviewTask (3 sub-cases)

Architecture: loads config, resolves model, creates a provider via boot.NewProviderWithProxy, scopes a tool registry to review-allowed tools (read_file, ls, glob, grep, bash), and runs the built-in review skill as a subagent via agent.RunSubAgent.

Testing

PASS  TestBuildReviewTask
PASS  go build ./cmd/reasonix
PASS  go test ./internal/cli/...

The review subcommand --help flag displays correctly.

Add a new `reasonix review` subcommand that runs the built-in review skill as
a subagent against git changes and outputs the result. This gives users a
one-shot, non-interactive way to review code without opening a chat session.

Usage:
  reasonix review                      # review uncommitted working-tree changes
  reasonix review --base main          # review current branch vs main
  reasonix review --commit abc123      # review a specific commit
  reasonix review --model deepseek     # use a specific model
  reasonix review --instructions ... # add extra review instructions

Implementation: 3 files, +154 lines
- cli/review.go:    reviewCommand + getReviewDiff + buildReviewTask
- cli/review_test.go:  TestBuildReviewTask (3 sub-cases)
- cli/cli.go:       register review case in Run()
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development tui Terminal UI / CLI (internal/cli, internal/control) labels Jun 8, 2026

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified end-to-end: builds clean (go build ./...), go vet clean, TestBuildReviewTask passes, and a real reasonix review run against a working-tree change produced a correct review. Flag paths (--model unknown, empty diff) behave as expected. Nice zero-friction addition.

@esengine esengine enabled auto-merge (squash) June 8, 2026 09:17
staticcheck QF1012 — keeps the lint job green.
@esengine esengine merged commit f9a7c08 into esengine:main-v2 Jun 8, 2026
9 checks passed
dorokuma pushed a commit to dorokuma/DeepSeek-Reasonix that referenced this pull request Jun 10, 2026
)

* feat(cli): add reasonix review subcommand for code review

Add a new `reasonix review` subcommand that runs the built-in review skill as
a subagent against git changes and outputs the result. This gives users a
one-shot, non-interactive way to review code without opening a chat session.

Usage:
  reasonix review                      # review uncommitted working-tree changes
  reasonix review --base main          # review current branch vs main
  reasonix review --commit abc123      # review a specific commit
  reasonix review --model deepseek     # use a specific model
  reasonix review --instructions ... # add extra review instructions

Implementation: 3 files, +154 lines
- cli/review.go:    reviewCommand + getReviewDiff + buildReviewTask
- cli/review_test.go:  TestBuildReviewTask (3 sub-cases)
- cli/cli.go:       register review case in Run()

* fix(cli): use fmt.Fprint instead of WriteString(fmt.Sprint) in review

staticcheck QF1012 — keeps the lint job green.

---------

Co-authored-by: reasonix <reasonix@deepseek.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tui Terminal UI / CLI (internal/cli, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants