Background
The CLI entry (bin/agentxray.js) currently understands --port, --host and --help. There is no way to ask which version is installed — which matters once the package is on npm and people report bugs against npx agent-xray: "what version are you on?" is the first triage question and right now the only answer is digging through npm ls.
Motivation
- Standard CLI convention; every bug report template will ask for it.
- Trivial to implement, no dependencies: the version is already in
package.json and the CLI already has a flag-parsing loop to extend.
What to do
- In
bin/agentxray.js, handle --version / -v: print the version field from ../package.json (plain require is fine) and process.exit(0).
- Mention the flag in the
--help output line.
- Add a small test in
test/ following the existing style (Node built-in test runner) that spawns the bin with --version and asserts the output matches package.json.
Acceptance criteria
node bin/agentxray.js --version prints the current version (e.g. 1.12.0) and exits 0.
--help output documents the new flag.
npm test passes with the new test included.
Background
The CLI entry (
bin/agentxray.js) currently understands--port,--hostand--help. There is no way to ask which version is installed — which matters once the package is on npm and people report bugs againstnpx agent-xray: "what version are you on?" is the first triage question and right now the only answer is digging throughnpm ls.Motivation
package.jsonand the CLI already has a flag-parsing loop to extend.What to do
bin/agentxray.js, handle--version/-v: print theversionfield from../package.json(plainrequireis fine) andprocess.exit(0).--helpoutput line.test/following the existing style (Node built-in test runner) that spawns the bin with--versionand asserts the output matchespackage.json.Acceptance criteria
node bin/agentxray.js --versionprints the current version (e.g.1.12.0) and exits 0.--helpoutput documents the new flag.npm testpasses with the new test included.