Skip to content

fix(cli): read version from package.json instead of hardcoding - #50

Merged
royalpinto007 merged 2 commits into
AgentPostmortem:mainfrom
sharadvc:fix/version-from-package-json
Sep 17, 2026
Merged

royalpinto007 merged 2 commits into
AgentPostmortem:mainfrom
sharadvc:fix/version-from-package-json

Conversation

@sharadvc

Copy link
Copy Markdown
Contributor

What & why

Closes #5. The CLI version was hardcoded as 0.1.0 in src/cli.ts and drifted from the actual package.json version (0.1.1). --version now always reports the real package version.

Changes

  • src/cli.ts: replace const VERSION = "0.1.0" with createRequire(import.meta.url) reading ../package.json.version, with a "0.0.0" fallback on read failure. Path works from both src/cli.ts and dist/cli.js.
  • test/cli.test.ts: regression test asserting --version prints the exact package.json version (fails on the old hardcode).

Checklist

Notes

Built and verified: node dist/cli.js --version0.1.1. Authored with AI assistance (Claude/Codex-class model); reviewed and verified locally before opening.

@sharadvc
sharadvc force-pushed the fix/version-from-package-json branch from 295fcbe to 309f66b Compare September 17, 2026 02:56
@royalpinto007
royalpinto007 merged commit 2a63032 into AgentPostmortem:main Sep 17, 2026
4 checks passed
@github-actions

Copy link
Copy Markdown

Merged. Thanks a lot, @sharadvc.

Good, focused change. Exactly the kind of thing MCP-audit needs.

If MCP-audit is useful to you, a star goes a long way.

Happy to see more from you whenever you have the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI version is hardcoded in src/cli.ts and has drifted from package.json

2 participants