Skip to content

Commit 5d07684

Browse files
committed
fix: read CLI version from package.json instead of hardcoding
1 parent 23a497b commit 5d07684

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codebase-intelligence",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Codebase analysis engine with MCP integration for LLM-assisted code understanding",
55
"type": "module",
66
"main": "dist/cli.js",

src/cli.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ process.on("uncaughtException", (err) => {
1212
import fs from "fs";
1313
import path from "path";
1414
import { execSync } from "child_process";
15+
import { createRequire } from "module";
1516
import { Command } from "commander";
17+
18+
const require = createRequire(import.meta.url);
19+
const pkg = require("../package.json") as { version: string };
1620
import { parseCodebase } from "./parser/index.js";
1721
import { buildGraph } from "./graph/index.js";
1822
import { analyzeGraph } from "./analyzer/index.js";
@@ -50,7 +54,7 @@ interface CliOptions {
5054
program
5155
.name("codebase-intelligence")
5256
.description("Codebase analysis engine with MCP integration for LLM-assisted code understanding")
53-
.version("1.1.0")
57+
.version(pkg.version)
5458
.argument("<path>", "Path to the TypeScript codebase to analyze")
5559
.option("--mcp", "Start as MCP stdio server (accepted for backward compatibility)")
5660
.option("--index", "Persist graph index to .code-visualizer/")

0 commit comments

Comments
 (0)