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

CommandDescriptionPlan
radar initAuto-detect stack and generate radar.yml + rules.ymlFree
radar scan <path>Scan a directory for technical debt violationsFree
radar check <file>Check a single file against policyFree
radar validateValidate radar.yml + rules.yml syntax and cross-referencesFree
radar run <path>CI-friendly scan — exits 1 on critical violationsFree
radar fix <path>AI-powered fix generation with interactive applySolo+
radar badgeGenerate badge markdown for your READMEFree
radar pack list|info|installBrowse and install pre-configured rule packsPro+
radar summaryAI-generated executive summary of scan resultsSolo+

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

CodeMeaning
0Scan passed, no blocking violations
1Blocking violations found, or config error

Environment Variables

VariablePurpose
ANTHROPIC_API_KEYRequired for AI features (fix, summary, AI-enhanced scan)
RADAR_API_KEYAPI key for Radar cloud features
Technical Debt Radar Documentation