CLI Commands
Complete reference for all Unfault CLI commands.
Commands
Section titled “Commands”| Command | Purpose |
|---|---|
review | Analyze code for production-readiness |
lint | Show all findings grouped by severity and rule |
graph | Explore code dependencies and impact |
info | Look up SRE glossary entries |
config | Manage CLI settings |
lsp | Start the language server for IDE integration |
review
Section titled “review”Analyze code and get recommendations. Runs entirely locally.
unfault review [OPTIONS]Options
Section titled “Options”| Option | Description | Default |
|---|---|---|
--output <FORMAT> | Output format: basic, concise, full, json, sarif | basic |
-v, --verbose | Enable verbose output | Disabled |
--profile <PROFILE> | Override the detected profile (e.g., python_fastapi_backend) | Auto-detected |
-d, --dimension <DIM> | Dimensions to analyze (repeatable). Options: stability, correctness, performance, scalability | All from profile |
--fix | Auto-apply all suggested fixes | Disabled |
--dry-run | Show fixes without applying them | Disabled |
--all | Show all findings in full (equivalent to unfault lint) | Disabled |
--refresh-cache | Discard enrichment cache and re-fetch SLOs and traces | Disabled |
--offline | Skip SLO and trace fetching entirely (useful in CI) | Disabled |
File Discovery and Ignores
Section titled “File Discovery and Ignores”Unfault respects common ignore conventions:
.gitignore(including global gitignore and.git/info/exclude).ignore.dockerignore
It also skips common dependency/build directories (node_modules, target, dist, build, .venv) even if they are not explicitly ignored.
Output Formats
Section titled “Output Formats”| Format | Use Case |
|---|---|
basic | Default. Header, summary, and guidance on next steps. |
concise | Brief statistics only. Good for dashboards. |
full | Detailed findings with file locations and suggested fixes. |
json | Machine-readable. Use for CI/CD parsing or custom tooling. |
sarif | GitHub Code Scanning and IDE integration. |
Examples
Section titled “Examples”# Standard reviewunfault review
# Focus on stability issues onlyunfault review --dimension stability
# Full details with suggested fixesunfault review --output full
# JSON for CI parsingunfault review --output json
# Skip observability enrichmentunfault review --offline
# Preview fixes without applyingunfault review --dry-runShow all findings grouped by severity and rule, the detailed linter view.
unfault lint [OPTIONS]Options
Section titled “Options”| Option | Description | Default |
|---|---|---|
--output <FORMAT> | Output format: basic, json | basic |
-v, --verbose | Enable verbose output | Disabled |
--profile <PROFILE> | Override detected profile | Auto-detected |
-d, --dimension <DIM> | Dimensions to analyze (repeatable) | All from profile |
--fix | Auto-apply all suggested fixes | Disabled |
--dry-run | Show fixes without applying them | Disabled |
Query the code graph for dependencies, impact analysis, and critical files. Runs locally.
unfault graph <SUBCOMMAND>Subcommands
Section titled “Subcommands”| Subcommand | Purpose |
|---|---|
impact | What breaks if I change this file? |
function-impact | What breaks if I change this function? |
library | Which files use a specific library? |
deps | What does this file depend on? |
critical | Which files are most critical? |
stats | Code graph statistics |
dump | Dump graph for debugging |
graph impact
Section titled “graph impact”Analyze what depends on a file. Useful before refactoring.
unfault graph impact [OPTIONS] <FILE>| Option | Description | Default |
|---|---|---|
<FILE> | File path to analyze | Required |
-w, --workspace <PATH> | Workspace path | Current directory |
--max-depth <N> | Transitive analysis depth (1-10) | 5 |
--json | Output as JSON | Disabled |
-v, --verbose | Verbose output | Disabled |
unfault graph impact src/api/auth.pyunfault graph impact --max-depth 3 src/core/models.pygraph function-impact
Section titled “graph function-impact”Analyze what depends on a specific function.
unfault graph function-impact [OPTIONS] <FUNCTION>| Option | Description | Default |
|---|---|---|
<FUNCTION> | Function in format file:function | Required |
-w, --workspace <PATH> | Workspace path | Current directory |
--max-depth <N> | Transitive analysis depth (1-10) | 5 |
--json | Output as JSON | Disabled |
unfault graph function-impact src/api/auth.py:validate_tokengraph library
Section titled “graph library”Find files that use a specific library.
unfault graph library [OPTIONS] <LIBRARY>| Option | Description | Default |
|---|---|---|
<LIBRARY> | Library name (e.g., requests, fastapi) | Required |
-w, --workspace <PATH> | Workspace path | Current directory |
--json | Output as JSON | Disabled |
unfault graph library requestsunfault graph library sqlalchemy --jsongraph deps
Section titled “graph deps”Find external dependencies of a file.
unfault graph deps [OPTIONS] <FILE>| Option | Description | Default |
|---|---|---|
<FILE> | File path to analyze | Required |
-w, --workspace <PATH> | Workspace path | Current directory |
--json | Output as JSON | Disabled |
unfault graph deps src/api/routes.pygraph critical
Section titled “graph critical”Find the most critical files in the codebase (high connectivity, many dependents).
unfault graph critical [OPTIONS]| Option | Description | Default |
|---|---|---|
-n, --limit <N> | Number of files to return (1-50) | 10 |
--sort-by <METRIC> | Sort metric (see below) | in-degree |
-w, --workspace <PATH> | Workspace path | Current directory |
--json | Output as JSON | Disabled |
Sort metrics:
| Metric | Meaning |
|---|---|
in-degree | Files most imported by others |
out-degree | Files that import the most |
total-degree | Total connectivity |
library-usage | External libraries used |
importance-score | Weighted importance |
unfault graph criticalunfault graph critical --limit 20 --sort-by total-degreegraph stats
Section titled “graph stats”Get code graph statistics.
unfault graph stats [OPTIONS]| Option | Description | Default |
|---|---|---|
-w, --workspace <PATH> | Workspace path | Current directory |
--json | Output as JSON | Disabled |
graph dump
Section titled “graph dump”Dump the local code graph for debugging.
unfault graph dump [OPTIONS]| Option | Description | Default |
|---|---|---|
-w, --workspace <PATH> | Workspace path | Current directory |
--calls-only | Output only call edges | Disabled |
--file <FILE> | Dump only specific file | All files |
Look up SRE glossary entries for failure modes.
unfault info <ID>Available IDs: SLO-001 through SLO-006.
unfault info SLO-001 # Slow Deathunfault info SLO-002 # Retry Stormunfault info SLO-003 # Zombie Processunfault info SLO-004 # Thundering Herdunfault info SLO-005 # Blackholeunfault info SLO-006 # Cascadeconfig
Section titled “config”Manage CLI configuration.
unfault config <SUBCOMMAND>Subcommands
Section titled “Subcommands”| Subcommand | Purpose |
|---|---|
show | Display current configuration |
llm | Manage LLM provider configuration |
integrations | Inspect and verify observability integrations |
agent | Generate agent skill files for Claude Code or OpenCode |
config show
Section titled “config show”Display current configuration (secrets masked by default).
unfault config show [--show-secrets]config llm
Section titled “config llm”Configure an LLM provider for AI-powered review summaries.
unfault config llm <PROVIDER>OpenAI
Section titled “OpenAI”unfault config llm openai [OPTIONS]| Option | Description | Default |
|---|---|---|
-m, --model <MODEL> | Model name | gpt-4 |
-k, --api-key <KEY> | API key (prefers OPENAI_API_KEY env var) | From env |
unfault config llm openai --model gpt-4oAnthropic
Section titled “Anthropic”unfault config llm anthropic [OPTIONS]| Option | Description | Default |
|---|---|---|
-m, --model <MODEL> | Model name | claude-3-5-sonnet-latest |
-k, --api-key <KEY> | API key (prefers ANTHROPIC_API_KEY env var) | From env |
unfault config llm anthropic --model claude-sonnet-4-5Ollama
Section titled “Ollama”unfault config llm ollama [OPTIONS]| Option | Description | Default |
|---|---|---|
-e, --endpoint <URL> | Ollama API endpoint | http://localhost:11434 |
-m, --model <MODEL> | Model name | llama3.2 |
unfault config llm ollama --model mistralCustom (OpenAI-compatible)
Section titled “Custom (OpenAI-compatible)”unfault config llm custom --endpoint <URL> --model <MODEL> [OPTIONS]| Option | Description | Default |
|---|---|---|
-e, --endpoint <URL> | API endpoint | Required |
-m, --model <MODEL> | Model name | Required |
-k, --api-key <KEY> | API key | None |
Other LLM commands
Section titled “Other LLM commands”unfault config llm show # Show current LLM configunfault config llm show --show-secretsunfault config llm remove # Remove LLM configconfig integrations
Section titled “config integrations”Inspect and verify observability provider credentials.
unfault config integrations show # Show detected integrations (no network calls)unfault config integrations verify # Verify by making live API callsSupported providers: GCP Cloud Monitoring, Datadog, Dynatrace.
config agent
Section titled “config agent”Generate agent skill files so Claude Code or OpenCode can use Unfault as a structured tool.
unfault config agent claude [--global] [--dry-run]unfault config agent opencode [--global] [--dry-run]| Option | Description |
|---|---|
--global | Write to ~/.claude/skills/ or ~/.config/opencode/skills/ instead of the project directory |
--dry-run | Print what would be created without writing files |
Start the Language Server Protocol server for IDE integration (stdio transport).
unfault lsp [OPTIONS]| Option | Description | Default |
|---|---|---|
-v, --verbose | Enable verbose logging to stderr | Disabled |
Exit Codes
Section titled “Exit Codes”| Code | Meaning | Action |
|---|---|---|
| 0 | Success, no findings | Proceed |
| 1 | General error | Check error message |
| 2 | Configuration error | Check config |
| 4 | Network error | Check connectivity |
| 5 | Findings detected | Review findings |
| 6 | Invalid input | Check arguments |
Environment Variables
Section titled “Environment Variables”| Variable | Description |
|---|---|
OPENAI_API_KEY | OpenAI API key for LLM features |
ANTHROPIC_API_KEY | Anthropic API key for LLM features |
DD_API_KEY / DD_APP_KEY | Datadog credentials for SLO enrichment |
DT_API_TOKEN / DT_ENVIRONMENT_URL | Dynatrace credentials for SLO enrichment |
Configuration File
Section titled “Configuration File”The CLI stores configuration at:
| Platform | Location |
|---|---|
| Linux / macOS | ~/.config/unfault/config.json |
| Windows | %USERPROFILE%\.config\unfault\config.json |