Reference
Output formats.
--format flag. The default is console, which prints colored results to the terminal.At a glance
--format consoledefaultColored terminal output with severity badges and indexed failure cards. Supports --compact for ESLint-style single-line output.
--format htmlSelf-contained interactive HTML report with charts, per-file drill-down, search, and filters.
--format jsonMachine-readable JSON to stdout. Pipe to a file or a custom pipeline script.
--format sarifSARIF 2.1.0 to stdout. Upload to GitHub Code Scanning for inline PR annotations.
console (default)
Prints append-only progress rows while files are analyzed, followed by severity badges, indexed failure cards, recommendations, and source context. This is the default when no --format flag is provided.
01npx ngcompass analyzeUse --compact for ESLint-style single-line output — useful in CI logs where you want minimal noise:
01npx ngcompass analyze --format console --compactExample compact output:
src\cases\component-no-manual-detect-changes\invalid-detect-changes.component.ts
src\cases\component-no-manual-detect-changes\invalid-mark-for-check-default-cd.component.ts
html — interactive HTML report
Generates a self-contained HTML file with severity charts, per-file drill-down, search, and filters. Open it in any browser; no server required.
01# Write report to default location (ngcompass-report.html)02npx ngcompass analyze --format html03
04# Write report to a custom path05npx ngcompass analyze --format html --output ./reports/analysis.htmljson — machine-readable
Emits a structured JSON object to stdout. Pipe it to a file or a custom pipeline script.
01npx ngcompass analyze --format json > results.jsonExample output shape:
01[02 {03 "filePath": "src/cases/component-no-manual-detect-changes/invalid-detect-changes.component.ts",04 "messages": [05 {06 "ruleId": "prefer-inject-over-constructor-di",07 "severity": 2,08 "message": "Constructor dependency injection makes class setup less composable than inject(). Offending params: cdr: ChangeDetectorRef.",09 "line": 15,10 "column": 311 },12 {13 "ruleId": "component-no-manual-detect-changes",14 "severity": 2,15 "message": "Manual change detection in an OnPush component couples rendering to imperative calls.",16 "line": 19,17 "column": 518 }19 ],20 "errorCount": 2,21 "warningCount": 022 },23 {24 "filePath": "src/cases/component-no-manual-detect-changes/invalid-mark-for-check-default-cd.component.ts",25 "messages": [26 {27 "ruleId": "prefer-inject-over-constructor-di",28 "severity": 2,29 "message": "Constructor dependency injection makes class setup less composable than inject(). Offending params: cdr: ChangeDetectorRef.",30 "line": 11,31 "column": 332 }33 ],34 "errorCount": 1,35 "warningCount": 036 }37]sarif — GitHub Code Scanning
Emits SARIF 2.1.0 to stdout. Upload the file to GitHub Code Scanning for inline annotations on pull requests.
01# Emit SARIF and upload to GitHub Code Scanning02npx ngcompass analyze --format sarif > results.sarifSee the CI Integration guide for the full GitHub Actions workflow.