Getting started
Quick start.
ng add setup so the CLI and config schema stay pinned together.- 01
Go to your Angular project
bash01cd my-angular-app - 02
Install and initialize
bash01ng add ngcompassThis installs ngcompass in your Angular project and creates
ngcompass.config.tsin the project root using thengcompass:recommendedpreset. You can edit it later to add rule overrides or change the preset.ngcompass.config.ts01import { defineConfig } from '@ngcompass/config';0203export default defineConfig({04 extends: 'ngcompass:recommended',0506 include: [07 'src/**/*.ts',08 'src/**/*.html',09 ],1011 exclude: [12 'node_modules/**',13 'dist/**',14 'build/**',15 'coverage/**',16 '**/*.d.ts',17 '**/*.spec.ts',18 '**/*.test.ts',19 ],2021 profiles: {22 ci: {23 outputFormat: 'json',24 maxWarnings: 0,25 },26 },27});If your workspace cannot run schematics, use manual local install and then run
npx ngcompass init --forceto overwrite an existing config. - 03
Run analysis
bash01npx ngcompass analyzengcompass scans your TypeScript files, component templates, and Angular metadata. Results are printed to the terminal grouped by severity. The process exits with a non-zero code if any
error-severity violations are found. - 04
Open the interactive report (optional)
bash01npx ngcompass analyze --format htmlThis writes
ngcompass-report.htmlto the current directory. Open it in your browser to review severity charts, per-file drill-down, and search + filter. Use--output <path>to change the output location.
Explore your codebase visually
Beyond static analysis, ngcompass ships two graph commands that generate JSON files you can load into interactive browser-based viewers — no upload, no server, everything runs locally.
Dependency graph
See every import relationship in your project. Explore what each file depends on, what depends on it, and which modules are the heaviest.
01npx ngcompass graph --output graph.jsonThen load graph.json at ngcompass.dev/graph.
Circular dependencies
Find every import cycle in your codebase — the exact files and the order they close the loop.
01npx ngcompass circular --format json --output cycles.jsonThen load cycles.json at ngcompass.dev/cycles.
Next steps
Continue from here: