Skip to content

Fix hardcoded CLI version and redundant JSON flag detection#37

Merged
naheel0 merged 2 commits intoindexfrom
copilot/sub-pr-35
Mar 3, 2026
Merged

Fix hardcoded CLI version and redundant JSON flag detection#37
naheel0 merged 2 commits intoindexfrom
copilot/sub-pr-35

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 3, 2026

Two bugs in bin/index.js: the CLI reported a hardcoded version (1.3.1) diverging from package.json, and isJson detection redundantly fell back to process.argv.includes("--json") instead of relying solely on Commander's parsed options.

Changes

  • Version from package.json: Replaced .version("1.3.1") with a dynamic lookup via require("../package.json").version
  • Simplified isJson detection: Removed || process.argv.includes("--json") from both isJson assignments (run command and analyze command) — Commander's options.json is sufficient
// Before
.version("1.3.1")
const isJson = Boolean(options.json || process.argv.includes("--json"));

// After
const { version } = require("../package.json");
.version(version)
const isJson = Boolean(options.json);

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI mentioned this pull request Mar 3, 2026
10 tasks
Co-authored-by: jaseel0 <225665919+jaseel0@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix index issue in system Fix hardcoded CLI version and redundant JSON flag detection Mar 3, 2026
@jaseel0 jaseel0 marked this pull request as ready for review March 3, 2026 06:42
@github-actions github-actions bot added the cli label Mar 3, 2026
@jaseel0 jaseel0 requested a review from naheel0 March 3, 2026 06:42
@naheel0 naheel0 merged commit c3671bb into index Mar 3, 2026
1 check passed
@naheel0 naheel0 deleted the copilot/sub-pr-35 branch March 3, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants