CLI Usage
Common Commands
Scan the current directory:
bash
sadrazam .Scan a specific package or app:
bash
sadrazam ./packages/webLimit the scan to one workspace:
bash
sadrazam . --workspace packages/webEmit JSON:
bash
sadrazam . --reporter jsonEmit TOON:
bash
sadrazam . --reporter toonFocus on file and export hygiene:
bash
sadrazam . --include unused-files,unused-exportsMeasure scan performance with cache enabled:
bash
sadrazam . --cache --performanceTrace where a package is used:
bash
sadrazam . --trace commanderTrace where an export is used:
bash
sadrazam . --trace-export src/lib.ts:usedHelperApply safe package.json cleanup and formatting:
bash
sadrazam . --fix --formatScan Modes
Production-only scan:
bash
sadrazam . --productionStrict mode flags devDependencies used by production files:
bash
sadrazam . --strictFinding Filters
Include only selected finding types:
bash
sadrazam . --include missing,unused-dependenciesExclude noisy finding types:
bash
sadrazam . --exclude unused-devDependenciesAuto-fix And Format
Use --fix to remove deterministic unused package declarations from package.json:
bash
sadrazam . --fixUse --fix --format to also normalize the modified package.json file:
bash
sadrazam . --fix --formatAllowlist Flags
bash
sadrazam . --ignore-packages react
sadrazam . --allow-unused-dev-dependencies typescript
sadrazam . --allow-missing-packages eslintFindings
Sadrazam currently reports these main finding groups:
missingunused-dependenciesunused-devDependenciesmisplaced-devDependenciesunused-filesunused-exports
Use --include and --exclude to focus the output on the findings you care about.