kodevu 0.1.39 → 0.1.41

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
@@ -49,6 +49,7 @@ npx kodevu [target] [options]
49
49
  - `--output, -o`: Report output directory (default: `~/.kodevu`).
50
50
  - `--format, -f`: Output formats (e.g., `markdown`, `json`, or `markdown,json`).
51
51
  - `--debug, -d`: Print debug information.
52
+ - `--version, -V`: Print the current version and exit.
52
53
 
53
54
  ### Environment Variables
54
55
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kodevu",
3
- "version": "0.1.39",
3
+ "version": "0.1.41",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Poll SVN revisions or Git commits, send each change diff to a reviewer CLI, and write configurable review reports.",
package/src/config.js CHANGED
@@ -1,8 +1,12 @@
1
1
  import fs from "node:fs/promises";
2
+ import { createRequire } from "node:module";
2
3
  import os from "node:os";
3
4
  import path from "node:path";
4
5
  import { findCommandOnPath } from "./shell.js";
5
6
 
7
+ const require = createRequire(import.meta.url);
8
+ const { version: packageVersion } = require("../package.json");
9
+
6
10
  const defaultStorageDir = path.join(os.homedir(), ".kodevu");
7
11
  const SUPPORTED_REVIEWERS = ["codex", "gemini", "copilot"];
8
12
 
@@ -97,6 +101,7 @@ export function parseCliArgs(argv) {
97
101
  target: "",
98
102
  debug: false,
99
103
  help: false,
104
+ version: false,
100
105
  reviewer: "",
101
106
  lang: "",
102
107
  prompt: "",
@@ -114,6 +119,11 @@ export function parseCliArgs(argv) {
114
119
  continue;
115
120
  }
116
121
 
122
+ if (value === "--version" || value === "-V") {
123
+ args.version = true;
124
+ continue;
125
+ }
126
+
117
127
  if (value === "--debug" || value === "-d") {
118
128
  args.debug = true;
119
129
  continue;
@@ -256,7 +266,7 @@ export async function resolveConfig(cliArgs = {}) {
256
266
  }
257
267
 
258
268
  export function printHelp() {
259
- console.log(`Kodevu
269
+ console.log(`Kodevu v${packageVersion}
260
270
 
261
271
  Usage:
262
272
  npx kodevu [target] [options]
@@ -272,6 +282,7 @@ Options:
272
282
  --format, -f Output formats (markdown, json, comma-separated)
273
283
  --debug, -d Print extra debug information
274
284
  --help, -h Show help
285
+ --version, -V Show version
275
286
 
276
287
  Environment Variables:
277
288
  KODEVU_REVIEWER Default reviewer
@@ -281,3 +292,7 @@ Environment Variables:
281
292
  KODEVU_TIMEOUT Reviewer timeout in ms
282
293
  `);
283
294
  }
295
+
296
+ export function printVersion() {
297
+ console.log(packageVersion);
298
+ }
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { resolveConfig, parseCliArgs, printHelp } from "./config.js";
3
+ import { resolveConfig, parseCliArgs, printHelp, printVersion } from "./config.js";
4
4
  import { runReviewCycle } from "./review-runner.js";
5
5
  import { logger } from "./logger.js";
6
6
 
@@ -19,6 +19,11 @@ if (cliArgs.help) {
19
19
  process.exit(0);
20
20
  }
21
21
 
22
+ if (cliArgs.version) {
23
+ printVersion();
24
+ process.exit(0);
25
+ }
26
+
22
27
  try {
23
28
  const config = await resolveConfig(cliArgs);
24
29
  logger.init(config);