CLI
CLI Overview
Complete reference for all 9 Technical Debt Radar CLI commands — scan, fix, gate, and more.
CLI Overview
Technical Debt Radar ships a CLI that scans your codebase for architecture violations, runtime risks, performance issues, and reliability problems. It can run locally during development or in CI pipelines to gate pull requests.
Installation
# Global install
npm i -g @radar/cli
# Or run without installing
npx @radar/cli
After installation, the radar command is available globally.
All Commands
| Command | Description | Plan |
|---|---|---|
radar init | Auto-detect stack and generate radar.yml + rules.yml | Free |
radar scan <path> | Scan a directory for technical debt violations | Free |
radar check <file> | Check a single file against policy | Free |
radar validate | Validate radar.yml + rules.yml syntax and cross-references | Free |
radar run <path> | CI-friendly scan — exits 1 on critical violations | Free |
radar fix <path> | AI-powered fix generation with interactive apply | Solo+ |
radar badge | Generate badge markdown for your README | Free |
radar pack list|info|install | Browse and install pre-configured rule packs | Pro+ |
radar summary | AI-generated executive summary of scan results | Solo+ |
Global Help
$ radar --help
Usage: radar [options] [command]
Technical Debt Radar -- Architecture & Runtime Safety CLI
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
scan <path> Scan a directory for technical debt
check <file> Check a single file against policy
init Generate radar.yml + rules.yml from project structure
fix <path> AI-powered fix: generates code diffs, applies with confirmation
validate Validate radar.yml + rules.yml syntax and cross-references
run <path> CI-friendly scan -- exits 1 on critical violations
badge Generate badge markdown for your README
pack Manage rule packs -- pre-configured rules for specific stacks
help [command] display help for command
Typical Workflow
# 1. Initialize configuration from your project
radar init
# 2. Validate the generated config
radar validate
# 3. Scan for violations
radar scan .
# 4. Fix violations with AI assistance
radar fix .
# 5. Gate check (CI)
radar run .
Configuration Files
All commands except init require a radar.yml file in the project root (or specified via --config). Most commands also read rules.yml for enforcement rules.
# Use custom config paths
radar scan . --config ./config/radar.yml --rules ./config/rules.yml
Exit Codes
| Code | Meaning |
|---|---|
0 | Scan passed, no blocking violations |
1 | Blocking violations found, or config error |
Environment Variables
| Variable | Purpose |
|---|---|
ANTHROPIC_API_KEY | Required for AI features (fix, summary, AI-enhanced scan) |
RADAR_API_KEY | API key for Radar cloud features |
Technical Debt Radar Documentation