Skip to content

fix(cli): translate Commander --no-stats into noStats option (#704)#1059

Closed
jonasvanderhaegen-xve wants to merge 1 commit into
abhigyanpatwari:mainfrom
jonasvanderhaegen-xve:fix/no-stats-commander-mapping
Closed

fix(cli): translate Commander --no-stats into noStats option (#704)#1059
jonasvanderhaegen-xve wants to merge 1 commit into
abhigyanpatwari:mainfrom
jonasvanderhaegen-xve:fix/no-stats-commander-mapping

Conversation

@jonasvanderhaegen-xve

Copy link
Copy Markdown
Contributor

Problem

Commander's negatable-boolean convention sets options.stats = false when --no-stats is passed — not options.noStats = true. The three call sites that forward CLI options into runFullAnalysis / generateAIContextFiles all read options.noStats, so the flag was silently ignored and volatile symbol/file counts always got written into AGENTS.md / CLAUDE.md.

Confirmed broken on 1.6.1 and 1.6.2.

Fix

Add ?? (options?.stats === false) fallback at all three call sites:

  • gitnexus/src/cli/analyze.ts:231runFullAnalysis options
  • gitnexus/src/cli/analyze.ts:301generateAIContextFiles in skills path
  • gitnexus/src/core/run-analyze.ts:382generateAIContextFiles in core path

No new API surface, no behaviour change when --no-stats is not passed (options.stats is undefined in that case, so undefined === false is false and the fallback doesn't fire).

Closes #704

Commander's negatable-boolean convention sets options.stats = false when
--no-stats is passed, not options.noStats = true. The three call sites
that forward CLI options into runFullAnalysis / generateAIContextFiles
read options.noStats, so the flag was silently ignored and symbol counts
always got written into AGENTS.md / CLAUDE.md.

Fix: add ?? (options?.stats === false) fallback at all three call sites.
@vercel

vercel Bot commented Apr 24, 2026

Copy link
Copy Markdown

@jonasvanderhaegen is attempting to deploy a commit to the NexusCore Team on Vercel.

A member of the Team first needs to authorize it.

@magyargergo

Copy link
Copy Markdown
Collaborator

Can you please ensure that the CI is healthy? 🙏

@xkonjin xkonjin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review:

This is a clean and straightforward fix for the Commander --no-stats flag translation.

Feedback:

  • The logic options?.noStats ?? (options?.stats === false) correctly maps the parsed Commander inverted boolean (stats: false) back to the internal noStats parameter.
  • It covers both the direct CLI invocation and programmatic options correctly by keeping options?.noStats as the primary fallback.

Looks solid. No bugs or security issues detected.

@xkonjin xkonjin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! This fixes the commander arg translation correctly across all entry points. Clean code, no security or performance issues spotted.

@xkonjin xkonjin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! This fixes the --no-stats commander arg translation correctly across all entry points. Clean code, no security or performance issues spotted.

@magyargergo

Copy link
Copy Markdown
Collaborator

Superseded by #1478

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.

Option to disable the amount of indexed files in CLAUDE.md and AGENTS.md

4 participants