nero-review 0.1.4 → 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/README.md CHANGED
@@ -170,3 +170,14 @@ File → Analyze → Prompt → AI → Validate → Format → Output
170
170
  - No keys are logged or printed
171
171
  - No data is stored or cached
172
172
  - Requests are sent only for the file under review
173
+
174
+ <br />
175
+
176
+ ## Contributing
177
+
178
+ Contributions are welcome! 🎉
179
+
180
+ If you'd like to improve the project (documentation, fixes, or small enhancements),
181
+ please follow the steps outlined in [CONTRIBUTING.md](./CONTRIBUTING.md).
182
+
183
+ This project is beginner-friendly, and small improvements are always appreciated.
@@ -1,4 +1,4 @@
1
- import { detectLanguage } from "./detectLanguage.js";
1
+ import { detectLanguage } from "file-lang";
2
2
  import { detectRole } from "./detectRole.js";
3
3
  import { detectStyle } from "./detectStyle.js";
4
4
  import { collectNotes } from "./detectNotes.js";
@@ -6,45 +6,39 @@ export function options() {
6
6
  const program = new Command();
7
7
  program
8
8
  .name(CLI_NAME)
9
- .description("Review code directly from your terminal")
10
- .version(CLI_VERSION, "-v, --version", "Print the current version")
11
- .helpOption("-h, --help", "Show help and usage information")
12
- .argument("<file>", "Path to the file to review (single file only)")
9
+ .description("Analyze and review a single source code file using AI, directly from your terminal.")
10
+ .version(CLI_VERSION, "-v, --version", "Print the CLI version")
11
+ .helpOption("-h, --help", "Show help information")
12
+ .argument("<file>", "Path to the source code file to review (only one file is supported)")
13
13
  .addHelpText("after", `
14
- Environment:
15
-
14
+ Environment Variables:
16
15
  NERO_API_KEY API key for the AI provider (required)
17
16
  NERO_MODEL Model name to use (required)
18
17
 
19
- nero-reivew currently supports OpenRouter as its AI provider
20
- You must configure and OpenRouter API key and model before running the CLI.
18
+ Notes:
19
+ nero-review currently supports OpenRouter as its AI provider.
20
+ • Make sure the required environment variables are set before running the CLI.
21
21
 
22
22
  Setup (Linux/macOS):
23
+ Create a secrets file:
24
+ ~/.config/nero/secrets.sh
23
25
 
24
- Create a secrets file:
25
-
26
- ~/.config/nero/secrets.sh
27
-
28
- Add your configuration:
29
-
30
- export NERO_API_KEY="your_api_key_here"
31
- export NERO_MODEL="your_model_name"
26
+ Add your configuration:
27
+ export NERO_API_KEY="your_api_key_here"
28
+ export NERO_MODEL="your_model_name"
32
29
 
33
- Then source it in your shell config (.zshrc, .bashrc, etc.):
34
-
35
- [ -f "$HOME/.config/nero/secrets.sh" ] && source "$HOME/.config/nero/secrets.sh"
30
+ Source it in your shell config (.zshrc, .bashrc, etc.):
31
+ [ -f "$HOME/.config/nero/secrets.sh" ] && source "$HOME/.config/nero/secrets.sh"
36
32
 
37
33
  Setup (Windows PowerShell):
38
-
39
34
  setx NERO_API_KEY "your_api_key_here"
40
35
  setx NERO_MODEL "your_model_name"
41
36
 
42
- Restart your terminal or VS Code after setting them.
37
+ Restart your terminal or VS Code after setting them.
43
38
 
44
39
  Examples:
45
- $ nero-review src/index.ts
46
- $ nero-review ./api/login/route.ts
47
-
40
+ nero-review src/index.ts
41
+ nero-review ./api/login/route.ts
48
42
  `)
49
43
  .parse(process.argv);
50
44
  const [file] = program.args;
package/dist/index.js CHANGED
@@ -1,24 +1,31 @@
1
1
  #!/usr/bin/env node
2
2
  import "dotenv/config";
3
3
  import { runCommand } from "./cli/runCommand.js";
4
- import { checkForUpdate } from "./update.js";
4
+ import { checkForCliUpdate } from "cli-update-check";
5
5
  import { options } from "./cli/options.js";
6
6
  import { CLI_NAME, CLI_VERSION } from "./meta.js";
7
7
  import { theme } from "./helper/ui/theme.js";
8
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`;
9
+ try {
10
+ await runCommand(opts.filePath);
11
+ setTimeout(async () => {
12
+ const msg = await checkForCliUpdate({
13
+ name: CLI_NAME,
14
+ version: CLI_VERSION,
15
+ });
16
+ if (msg) {
17
+ console.log("\n" +
18
+ theme.muted("──────────────────────────") +
19
+ "\n" +
20
+ theme.muted("Update available") +
21
+ "\n" +
22
+ theme.muted(msg.replace("Update available:", "").trim()) +
23
+ "\n" +
24
+ theme.muted("──────────────────────────"));
16
25
  }
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));
26
+ }, 0);
27
+ }
28
+ catch (err) {
29
+ console.error("Unexpected error:", err);
30
+ process.exit(1);
24
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nero-review",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "Review code directly from your terminal",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -44,20 +44,24 @@
44
44
  "linting",
45
45
  "automation"
46
46
  ],
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "https://github.com/alcanivorax/nero-review"
50
+ },
47
51
  "author": "alcanivorax",
48
52
  "license": "MIT",
49
53
  "dependencies": {
50
54
  "@openrouter/sdk": "^0.3.11",
51
55
  "chalk": "^5.6.2",
56
+ "cli-update-check": "^1.0.1",
52
57
  "commander": "^14.0.2",
53
58
  "dotenv": "^17.2.3",
54
- "ora": "^9.0.0",
55
- "semver": "^7.7.3"
59
+ "file-lang": "^0.1.0",
60
+ "ora": "^9.0.0"
56
61
  },
57
62
  "devDependencies": {
58
63
  "@types/node": "^25.0.3",
59
64
  "@types/semver": "^7.7.1",
60
- "@types/update-notifier": "^6.0.8",
61
65
  "tsx": "^4.21.0",
62
66
  "typescript": "^5.9.3"
63
67
  }