Open github-actions[bot] opened 1 month ago
This issue has been reviewed and marked as 'ready'. The description has been updated with testable acceptance criteria, and relevant library documents ([], 0 in total) have been added as comments.
Implement CLI argument parsing with version and diagnostics support and update tests and docs
Workflow name: transformation-07.1-in-progress-issue-to-ready-issue Workflow run URL: https://github.com/xn-intenton-z2a/repository0/actions/runs/15281617991 Workflow event: schedule Workflow inputs: null HEAD of main URL: https://github.com/xn-intenton-z2a/repository0/commit/bda6a4fe08c3f5d139d9c512eedd67fa775058b1
Overview: The CLI entrypoint currently logs only raw arguments. We need to implement robust argument parsing to support the core flags
--help
,--version
, and--diagnostics
. This will improve usability and ensure users can quickly access usage information, version data, and environment diagnostics.Acceptance Criteria:
version
field from package.json, prints it exactly, and exits with code 0.nodeVersion
(string),platform
(string),cwd
(string), andenv
(object of filtered environment variables), then exits with code 0.--help
→ printUsage,--version
→ printVersion,--diagnostics
→ printDiagnostics, otherwise falls back toconsole.log('Options:', options)
without exiting.npm run start --help
,npm run start --version
, andnpm run diagnostics
.Implementation Steps:
minimist
and import in src/lib/main.js.parseArgs
.printUsage
,printVersion
,printDiagnostics
.main
to call these in the required order.Verification:
npm test
passes all existing and new tests.npm run start --help
outputs usage text and exits 0.npm run start --version
outputs correct package.json version and exits 0.npm run diagnostics
outputs valid JSON diagnostics and exits 0.