Skip to content

docs: fix invalid --output flag and inverted score description#15

Open
dmchaledev wants to merge 1 commit into
mainfrom
claude/amazing-franklin-O1aiB
Open

docs: fix invalid --output flag and inverted score description#15
dmchaledev wants to merge 1 commit into
mainfrom
claude/amazing-franklin-O1aiB

Conversation

@dmchaledev

Copy link
Copy Markdown
Contributor

Problem

Two documentation bugs that directly mislead users:

  1. --output=sarif is not a valid flag. Both the README Quick Start and the dev-to launch post show:

    npx @hailbytes/mcp-security-scanner ./config.json --output=sarif --exit-code

    But the CLI only accepts --format= (src/cli.ts:111). Any unknown ---prefixed flag falls through to the Unknown flag branch and exits with code 2 (src/cli.ts:142). So the headline SARIF example — the integration most relevant for CI/GitHub Code Scanning — fails for anyone who copy-pastes it. Everywhere else in the repo (CHANGELOG.md, SECURITY.md, .github/workflows/ci.yml) already uses --format=.

  2. The risk-score direction was documented backwards. The README programmatic example said:

    console.log(report.score);     // 0–100 risk score (lower = riskier)

    The implementation is the opposite — higher score = more risk (src/scorer.ts:12-18 sums positive severity weights; src/types.ts:75 documents "0 (safest) – 100 (most risk)"). This inversion could lead someone to build a broken CI gate on report.score.

Fix

  • README.md: --output=sarif--format=sarif; correct the score comment to (higher = riskier).
  • dev-to/launch-post.md: --output=sarif--format=sarif.

Docs-only change; no source or test behavior affected.

https://claude.ai/code/session_01EkW3H335dFYPGATfCCKZUR


Generated by Claude Code

The README and dev-to launch post documented `--output=sarif`, but the
CLI only accepts `--format=`. Copy-pasting the documented command hit the
'Unknown flag' branch and exited with code 2, so the Quick Start SARIF
example never worked.

Also corrected the programmatic example comment: the risk score is
'higher = riskier' (see scorer.ts and types.ts), not 'lower = riskier'
as previously documented, which inverted the meaning for CI gating.
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.

2 participants