nero-review 0.1.2 → 0.1.4
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/README.md +54 -3
- package/dist/cli/options.js +3 -0
- package/dist/cli/runCommand.js +2 -0
- package/dist/helper/ui/assertEnvironment.js +8 -0
- package/dist/index.js +20 -4
- package/dist/update.js +15 -13
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
6
|
<img src="https://img.shields.io/npm/v/nero-review?color=6366f1" alt="npm version" />
|
|
7
|
-
|
|
7
|
+
<img src="https://img.shields.io/npm/dw/nero-review?color=0f172a" alt="npm downloads" />
|
|
8
8
|
<img src="https://img.shields.io/github/license/alcanivorax/nero-review?color=22c55e" alt="license" />
|
|
9
9
|
</p>
|
|
10
10
|
|
|
@@ -63,9 +63,13 @@ nero-review ./api/login/route.ts
|
|
|
63
63
|
## Environment Variable Setup
|
|
64
64
|
|
|
65
65
|
<!-- Full configuration details are available in the docs:
|
|
66
|
-
👉 **[Read documentation](link)**
|
|
66
|
+
👉 **[Read documentation](link)** -->
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
`nero-reivew` currently supports **OpenRouter** as its AI provider
|
|
69
|
+
|
|
70
|
+
You must configure and OpenRouter API key and model before running the CLI.
|
|
71
|
+
|
|
72
|
+
---
|
|
69
73
|
|
|
70
74
|
<br />
|
|
71
75
|
|
|
@@ -105,6 +109,53 @@ Restart your terminal or VS Code after setting them.
|
|
|
105
109
|
|
|
106
110
|
<br />
|
|
107
111
|
|
|
112
|
+
## Recommended OpenRouter Models
|
|
113
|
+
|
|
114
|
+
`nero-review` performance depends heavily on the selected model.
|
|
115
|
+
|
|
116
|
+
For the best experince, use one of the following OpenRouter models:
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
<br />
|
|
121
|
+
|
|
122
|
+
### Fast & Balanced (Recommended)
|
|
123
|
+
|
|
124
|
+
Best choice for everyday use. Good speed with reliable reasoning.
|
|
125
|
+
|
|
126
|
+
**Free**
|
|
127
|
+
|
|
128
|
+
```text
|
|
129
|
+
mistralai/devstral-2512:free
|
|
130
|
+
google/gemma-3-27b-it:free
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Paid**
|
|
134
|
+
|
|
135
|
+
```text
|
|
136
|
+
anthropic/claude-3.5-sonnet
|
|
137
|
+
openai/gpt-4o-mini
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
<br />
|
|
141
|
+
|
|
142
|
+
### High Quality (Slower)
|
|
143
|
+
|
|
144
|
+
**Free**
|
|
145
|
+
|
|
146
|
+
```text
|
|
147
|
+
qwen/qwen3-coder:free
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Paid**
|
|
151
|
+
|
|
152
|
+
```text
|
|
153
|
+
anthropic/claude-3-opus
|
|
154
|
+
openai/gpt-4o
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
<br />
|
|
158
|
+
|
|
108
159
|
## How nero-review works
|
|
109
160
|
|
|
110
161
|
```bash
|
package/dist/cli/options.js
CHANGED
|
@@ -16,6 +16,9 @@ Environment:
|
|
|
16
16
|
NERO_API_KEY API key for the AI provider (required)
|
|
17
17
|
NERO_MODEL Model name to use (required)
|
|
18
18
|
|
|
19
|
+
nero-reivew currently supports OpenRouter as its AI provider
|
|
20
|
+
You must configure and OpenRouter API key and model before running the CLI.
|
|
21
|
+
|
|
19
22
|
Setup (Linux/macOS):
|
|
20
23
|
|
|
21
24
|
Create a secrets file:
|
package/dist/cli/runCommand.js
CHANGED
|
@@ -9,9 +9,11 @@ import { formatReview } from "../printer/formatReview.js";
|
|
|
9
9
|
import { PrettyPrinter } from "../printer/PrettyPrinter.js";
|
|
10
10
|
import { step } from "./loader.js";
|
|
11
11
|
import { theme } from "../helper/ui/theme.js";
|
|
12
|
+
import { assertEnvironment } from "../helper/ui/assertEnvironment.js";
|
|
12
13
|
export async function runCommand(args) {
|
|
13
14
|
const filePath = args;
|
|
14
15
|
try {
|
|
16
|
+
await assertEnvironment();
|
|
15
17
|
await assertFile(filePath);
|
|
16
18
|
const readStep = step(theme.muted(" Reading file")).start();
|
|
17
19
|
const fileMetadata = await readFileContent(filePath);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function assertEnvironment() {
|
|
2
|
+
if (!process.env.NERO_API_KEY) {
|
|
3
|
+
throw new Error("NERO_API_KEY is not set.\nRun `nero-review --help` for setup instructions.");
|
|
4
|
+
}
|
|
5
|
+
if (!process.env.NERO_MODEL) {
|
|
6
|
+
throw new Error("NERO_MODEL is not set.\nRun `nero-review --help` for setup instructions.");
|
|
7
|
+
}
|
|
8
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import "dotenv/config";
|
|
3
3
|
import { runCommand } from "./cli/runCommand.js";
|
|
4
|
-
import {
|
|
4
|
+
import { checkForUpdate } from "./update.js";
|
|
5
5
|
import { options } from "./cli/options.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { CLI_NAME, CLI_VERSION } from "./meta.js";
|
|
7
|
+
import { theme } from "./helper/ui/theme.js";
|
|
8
|
+
const opts = options(); // { filePath: string }
|
|
9
|
+
// Fire-and-forget update check
|
|
10
|
+
let updateMessage = null;
|
|
11
|
+
setTimeout(() => {
|
|
12
|
+
try {
|
|
13
|
+
const latest = checkForUpdate(CLI_NAME, CLI_VERSION);
|
|
14
|
+
if (latest) {
|
|
15
|
+
updateMessage = `Update available: ${CLI_VERSION} → ${latest}\nRun npm i -g nero-review`;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
catch { }
|
|
19
|
+
}, 0);
|
|
20
|
+
// Main execution (never blocked)
|
|
21
|
+
await runCommand(opts.filePath);
|
|
22
|
+
if (updateMessage) {
|
|
23
|
+
console.log("\n" + theme.muted(updateMessage));
|
|
24
|
+
}
|
package/dist/update.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
export function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { execSync } from "node:child_process";
|
|
2
|
+
import semver from "semver";
|
|
3
|
+
export function checkForUpdate(pkgName, currentVersion) {
|
|
4
|
+
try {
|
|
5
|
+
const latest = execSync(`npm view ${pkgName} version`, {
|
|
6
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
7
|
+
encoding: "utf8",
|
|
8
|
+
}).trim();
|
|
9
|
+
if (semver.lt(currentVersion, latest)) {
|
|
10
|
+
return latest;
|
|
11
|
+
}
|
|
12
|
+
return latest ?? null;
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return null;
|
|
14
16
|
}
|
|
15
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nero-review",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Review code directly from your terminal",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -52,10 +52,11 @@
|
|
|
52
52
|
"commander": "^14.0.2",
|
|
53
53
|
"dotenv": "^17.2.3",
|
|
54
54
|
"ora": "^9.0.0",
|
|
55
|
-
"
|
|
55
|
+
"semver": "^7.7.3"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/node": "^25.0.3",
|
|
59
|
+
"@types/semver": "^7.7.1",
|
|
59
60
|
"@types/update-notifier": "^6.0.8",
|
|
60
61
|
"tsx": "^4.21.0",
|
|
61
62
|
"typescript": "^5.9.3"
|