Skip to content

Add a --version flag to the CLI #20

Done

Description

@eleven-smg

Problem

bin/codepact.js has no --version/-v option (verified against the current USAGE string and argument switch in bin/codepact.js: only -h/--help, --json, --markdown, --strict, --baseline, --write-baseline, --out, --config are handled). A bug report or baseline mismatch across upgrades currently has no way to say which version of the tool produced a given report.

Scope

Add --version/-v that prints the version from package.json and exits 0, without requiring any path argument.

Acceptance criteria

  • codepact --version prints exactly the package.json version field and exits 0.
  • Works with no other arguments, even though paths is otherwise expected.
  • Covered by a CLI integration test (subprocess, like the existing test/cli.test.js/test/baseline.test.js pattern).

Complexity: small.

Activity

  1. added
    enhancement
    good first issue
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions