agent-review-cli 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +133 -0
- package/bin/agent-review.js +18 -0
- package/dist/index.js +2596 -0
- package/package.json +67 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Open-Document-Alliance
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Agent Review CLI
|
|
2
|
+
|
|
3
|
+
Orchestrate parallel AI agents to review, fix, and integrate code changes across your codebase — all from a single command.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
agent-review 4 -b claude-code -t "the authentication module"
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
┌──────────────────────────────────────────────────────────────────┐
|
|
11
|
+
│ AGENT REVIEW via Claude Code elapsed 2m 34s │
|
|
12
|
+
│ run a1b2c3d4 phase FIXING │
|
|
13
|
+
│ main → src/auth, src/middleware │
|
|
14
|
+
└──────────────────────────────────────────────────────────────────┘
|
|
15
|
+
○ INIT ━━ ○ PLAN ━━ ● DISCOVER ━━ ◉ FIX ━━ ○ INTEGRATE ━━ ...
|
|
16
|
+
|
|
17
|
+
┌─ Issues ─────┐ ┌─ Agents ─────┐ ┌─ Tokens ─────┐
|
|
18
|
+
│ Found 12 │ │ Running 4 │ │ Input 240K │
|
|
19
|
+
│ Fixed 7 │ │ Done 2 │ │ Cached 89K │
|
|
20
|
+
│ Open 5 │ │ Failed 0 │ │ Output 45K │
|
|
21
|
+
└──────────────┘ └──────────────┘ └──────────────┘
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Features
|
|
25
|
+
|
|
26
|
+
- **Multi-agent parallelism** — spawn N agents that work simultaneously in isolated git worktrees
|
|
27
|
+
- **Full pipeline** — plan, discover, fix, integrate, verify, and publish a PR
|
|
28
|
+
- **Backend-agnostic** — swap between [Codex](https://github.com/openai/codex), [Claude Code](https://github.com/anthropics/claude-code), [OpenCode](https://github.com/sst/opencode), or mix them all
|
|
29
|
+
- **Live terminal dashboard** — real-time Ink-powered TUI with phase tracking, token usage, and per-agent status
|
|
30
|
+
- **Smart file partitioning** — directory-aware splitting keeps related files together for coherent reviews
|
|
31
|
+
- **Automatic integration** — merges agent branches, resolves conflicts, runs verification, opens a PR
|
|
32
|
+
- **Zero config** — point it at a repo and describe what to review in natural language
|
|
33
|
+
|
|
34
|
+
## Prerequisites
|
|
35
|
+
|
|
36
|
+
You need **Node.js 20+** and at least one supported AI coding agent installed:
|
|
37
|
+
|
|
38
|
+
| Backend | CLI | Install |
|
|
39
|
+
|---------|-----|---------|
|
|
40
|
+
| Codex | `codex` | `npm i -g @openai/codex` |
|
|
41
|
+
| Claude Code | `claude` | `npm i -g @anthropic-ai/claude-code` |
|
|
42
|
+
| OpenCode | `opencode` | `npm i -g opencode` |
|
|
43
|
+
|
|
44
|
+
You also need [`gh`](https://cli.github.com/) (GitHub CLI) if you want automatic PR creation.
|
|
45
|
+
|
|
46
|
+
## Install
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm install -g agent-review-cli
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Or run directly with npx:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx agent-review-cli 3 -b claude-code -t "the payments module"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Usage
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
agent-review [instances] [options]
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Arguments
|
|
65
|
+
|
|
66
|
+
| Argument | Description |
|
|
67
|
+
|----------|-------------|
|
|
68
|
+
| `instances` | Number of parallel agents (default: 2) |
|
|
69
|
+
|
|
70
|
+
### Options
|
|
71
|
+
|
|
72
|
+
| Flag | Description |
|
|
73
|
+
|------|-------------|
|
|
74
|
+
| `-i, --instances <n>` | Number of parallel agents |
|
|
75
|
+
| `-t, --target <prompt>` | What to review — natural language or path |
|
|
76
|
+
| `-b, --backend <name>` | Backend: `codex`, `claude-code`, `opencode`, `mixed` (default: `codex`) |
|
|
77
|
+
| `-m, --model <name>` | Model override for the backend |
|
|
78
|
+
| `--no-cleanup` | Keep generated worktrees after the run |
|
|
79
|
+
| `--timeout <ms>` | Overall timeout per agent in ms (default: 300000) |
|
|
80
|
+
| `--inactivity-timeout <ms>` | Inactivity timeout per agent in ms (default: 120000) |
|
|
81
|
+
|
|
82
|
+
If `-t` is not provided, you'll be prompted interactively.
|
|
83
|
+
|
|
84
|
+
### Examples
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Review the whole repo with 4 Codex agents
|
|
88
|
+
agent-review 4
|
|
89
|
+
|
|
90
|
+
# Review a specific area with Claude Code
|
|
91
|
+
agent-review 3 -b claude-code -t "the API routes in src/api"
|
|
92
|
+
|
|
93
|
+
# Mix backends for variety
|
|
94
|
+
agent-review 6 -b mixed -t "error handling across the app"
|
|
95
|
+
|
|
96
|
+
# Keep worktrees for inspection
|
|
97
|
+
agent-review 2 -b opencode -t "database queries" --no-cleanup
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## How It Works
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
INIT → PLAN → DISCOVER → FIX → INTEGRATE → VERIFY → PUBLISH → DONE
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
1. **Init** — resolves git root, current branch, creates a shared worktree
|
|
107
|
+
2. **Plan** — identifies target directories from your natural language prompt
|
|
108
|
+
3. **Discover** — N agents scan the codebase in parallel (read-only), finding bugs and issues with severity scores
|
|
109
|
+
4. **Fix** — N agents fix discovered issues in parallel, each in its own isolated git worktree
|
|
110
|
+
5. **Integrate** — merges all fix branches into a single integration branch with conflict resolution
|
|
111
|
+
6. **Verify** — a final agent runs type-checks, builds, and tests on the merged result
|
|
112
|
+
7. **Publish** — rebases onto the default branch, pushes, and creates a PR via `gh`
|
|
113
|
+
|
|
114
|
+
All temporary worktrees and branches are cleaned up automatically when the run finishes.
|
|
115
|
+
|
|
116
|
+
## Output
|
|
117
|
+
|
|
118
|
+
Run data is saved to `.agent-review/runs/<run-id>/`:
|
|
119
|
+
|
|
120
|
+
| File | Contents |
|
|
121
|
+
|------|----------|
|
|
122
|
+
| `issues.json` | All discovered issues with status, severity, and fix details |
|
|
123
|
+
| `final-report.md` | Verification summary and unresolved risks |
|
|
124
|
+
|
|
125
|
+
The CLI also prints the PR URL, branch name, and report path when the run completes.
|
|
126
|
+
|
|
127
|
+
## Contributing
|
|
128
|
+
|
|
129
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, project structure, and how to add new backend drivers.
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
|
|
133
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
6
|
+
|
|
7
|
+
const filePath = fileURLToPath(import.meta.url);
|
|
8
|
+
const packageDir = path.resolve(path.dirname(filePath), '..');
|
|
9
|
+
const distEntry = path.join(packageDir, 'dist', 'index.js');
|
|
10
|
+
|
|
11
|
+
if (!fs.existsSync(distEntry)) {
|
|
12
|
+
process.stderr.write(
|
|
13
|
+
'agent-review CLI is not built yet. Run: npm run build\n',
|
|
14
|
+
);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
await import(pathToFileURL(distEntry).href);
|