Skip to content

CLI Commands

Complete reference for all Unfault CLI commands.

CommandPurpose
reviewAnalyze code for production-readiness
lintShow all findings grouped by severity and rule
graphExplore code dependencies and impact
infoLook up SRE glossary entries
configManage CLI settings
lspStart the language server for IDE integration

Analyze code and get recommendations. Runs entirely locally.

Terminal window
unfault review [OPTIONS]
OptionDescriptionDefault
--output <FORMAT>Output format: basic, concise, full, json, sarifbasic
-v, --verboseEnable verbose outputDisabled
--profile <PROFILE>Override the detected profile (e.g., python_fastapi_backend)Auto-detected
-d, --dimension <DIM>Dimensions to analyze (repeatable). Options: stability, correctness, performance, scalabilityAll from profile
--fixAuto-apply all suggested fixesDisabled
--dry-runShow fixes without applying themDisabled
--allShow all findings in full (equivalent to unfault lint)Disabled
--refresh-cacheDiscard enrichment cache and re-fetch SLOs and tracesDisabled
--offlineSkip SLO and trace fetching entirely (useful in CI)Disabled

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.

FormatUse Case
basicDefault. Header, summary, and guidance on next steps.
conciseBrief statistics only. Good for dashboards.
fullDetailed findings with file locations and suggested fixes.
jsonMachine-readable. Use for CI/CD parsing or custom tooling.
sarifGitHub Code Scanning and IDE integration.
Terminal window
# Standard review
unfault review
# Focus on stability issues only
unfault review --dimension stability
# Full details with suggested fixes
unfault review --output full
# JSON for CI parsing
unfault review --output json
# Skip observability enrichment
unfault review --offline
# Preview fixes without applying
unfault review --dry-run

Show all findings grouped by severity and rule, the detailed linter view.

Terminal window
unfault lint [OPTIONS]
OptionDescriptionDefault
--output <FORMAT>Output format: basic, jsonbasic
-v, --verboseEnable verbose outputDisabled
--profile <PROFILE>Override detected profileAuto-detected
-d, --dimension <DIM>Dimensions to analyze (repeatable)All from profile
--fixAuto-apply all suggested fixesDisabled
--dry-runShow fixes without applying themDisabled

Query the code graph for dependencies, impact analysis, and critical files. Runs locally.

Terminal window
unfault graph <SUBCOMMAND>
SubcommandPurpose
impactWhat breaks if I change this file?
function-impactWhat breaks if I change this function?
libraryWhich files use a specific library?
depsWhat does this file depend on?
criticalWhich files are most critical?
statsCode graph statistics
dumpDump graph for debugging

Analyze what depends on a file. Useful before refactoring.

Terminal window
unfault graph impact [OPTIONS] <FILE>
OptionDescriptionDefault
<FILE>File path to analyzeRequired
-w, --workspace <PATH>Workspace pathCurrent directory
--max-depth <N>Transitive analysis depth (1-10)5
--jsonOutput as JSONDisabled
-v, --verboseVerbose outputDisabled
Terminal window
unfault graph impact src/api/auth.py
unfault graph impact --max-depth 3 src/core/models.py

Analyze what depends on a specific function.

Terminal window
unfault graph function-impact [OPTIONS] <FUNCTION>
OptionDescriptionDefault
<FUNCTION>Function in format file:functionRequired
-w, --workspace <PATH>Workspace pathCurrent directory
--max-depth <N>Transitive analysis depth (1-10)5
--jsonOutput as JSONDisabled
Terminal window
unfault graph function-impact src/api/auth.py:validate_token

Find files that use a specific library.

Terminal window
unfault graph library [OPTIONS] <LIBRARY>
OptionDescriptionDefault
<LIBRARY>Library name (e.g., requests, fastapi)Required
-w, --workspace <PATH>Workspace pathCurrent directory
--jsonOutput as JSONDisabled
Terminal window
unfault graph library requests
unfault graph library sqlalchemy --json

Find external dependencies of a file.

Terminal window
unfault graph deps [OPTIONS] <FILE>
OptionDescriptionDefault
<FILE>File path to analyzeRequired
-w, --workspace <PATH>Workspace pathCurrent directory
--jsonOutput as JSONDisabled
Terminal window
unfault graph deps src/api/routes.py

Find the most critical files in the codebase (high connectivity, many dependents).

Terminal window
unfault graph critical [OPTIONS]
OptionDescriptionDefault
-n, --limit <N>Number of files to return (1-50)10
--sort-by <METRIC>Sort metric (see below)in-degree
-w, --workspace <PATH>Workspace pathCurrent directory
--jsonOutput as JSONDisabled

Sort metrics:

MetricMeaning
in-degreeFiles most imported by others
out-degreeFiles that import the most
total-degreeTotal connectivity
library-usageExternal libraries used
importance-scoreWeighted importance
Terminal window
unfault graph critical
unfault graph critical --limit 20 --sort-by total-degree

Get code graph statistics.

Terminal window
unfault graph stats [OPTIONS]
OptionDescriptionDefault
-w, --workspace <PATH>Workspace pathCurrent directory
--jsonOutput as JSONDisabled

Dump the local code graph for debugging.

Terminal window
unfault graph dump [OPTIONS]
OptionDescriptionDefault
-w, --workspace <PATH>Workspace pathCurrent directory
--calls-onlyOutput only call edgesDisabled
--file <FILE>Dump only specific fileAll files

Look up SRE glossary entries for failure modes.

Terminal window
unfault info <ID>

Available IDs: SLO-001 through SLO-006.

Terminal window
unfault info SLO-001 # Slow Death
unfault info SLO-002 # Retry Storm
unfault info SLO-003 # Zombie Process
unfault info SLO-004 # Thundering Herd
unfault info SLO-005 # Blackhole
unfault info SLO-006 # Cascade

Manage CLI configuration.

Terminal window
unfault config <SUBCOMMAND>
SubcommandPurpose
showDisplay current configuration
llmManage LLM provider configuration
integrationsInspect and verify observability integrations
agentGenerate agent skill files for Claude Code or OpenCode

Display current configuration (secrets masked by default).

Terminal window
unfault config show [--show-secrets]

Configure an LLM provider for AI-powered review summaries.

Terminal window
unfault config llm <PROVIDER>
Terminal window
unfault config llm openai [OPTIONS]
OptionDescriptionDefault
-m, --model <MODEL>Model namegpt-4
-k, --api-key <KEY>API key (prefers OPENAI_API_KEY env var)From env
Terminal window
unfault config llm openai --model gpt-4o
Terminal window
unfault config llm anthropic [OPTIONS]
OptionDescriptionDefault
-m, --model <MODEL>Model nameclaude-3-5-sonnet-latest
-k, --api-key <KEY>API key (prefers ANTHROPIC_API_KEY env var)From env
Terminal window
unfault config llm anthropic --model claude-sonnet-4-5
Terminal window
unfault config llm ollama [OPTIONS]
OptionDescriptionDefault
-e, --endpoint <URL>Ollama API endpointhttp://localhost:11434
-m, --model <MODEL>Model namellama3.2
Terminal window
unfault config llm ollama --model mistral
Terminal window
unfault config llm custom --endpoint <URL> --model <MODEL> [OPTIONS]
OptionDescriptionDefault
-e, --endpoint <URL>API endpointRequired
-m, --model <MODEL>Model nameRequired
-k, --api-key <KEY>API keyNone
Terminal window
unfault config llm show # Show current LLM config
unfault config llm show --show-secrets
unfault config llm remove # Remove LLM config

Inspect and verify observability provider credentials.

Terminal window
unfault config integrations show # Show detected integrations (no network calls)
unfault config integrations verify # Verify by making live API calls

Supported providers: GCP Cloud Monitoring, Datadog, Dynatrace.


Generate agent skill files so Claude Code or OpenCode can use Unfault as a structured tool.

Terminal window
unfault config agent claude [--global] [--dry-run]
unfault config agent opencode [--global] [--dry-run]
OptionDescription
--globalWrite to ~/.claude/skills/ or ~/.config/opencode/skills/ instead of the project directory
--dry-runPrint what would be created without writing files

Start the Language Server Protocol server for IDE integration (stdio transport).

Terminal window
unfault lsp [OPTIONS]
OptionDescriptionDefault
-v, --verboseEnable verbose logging to stderrDisabled

CodeMeaningAction
0Success, no findingsProceed
1General errorCheck error message
2Configuration errorCheck config
4Network errorCheck connectivity
5Findings detectedReview findings
6Invalid inputCheck arguments

VariableDescription
OPENAI_API_KEYOpenAI API key for LLM features
ANTHROPIC_API_KEYAnthropic API key for LLM features
DD_API_KEY / DD_APP_KEYDatadog credentials for SLO enrichment
DT_API_TOKEN / DT_ENVIRONMENT_URLDynatrace credentials for SLO enrichment

The CLI stores configuration at:

PlatformLocation
Linux / macOS~/.config/unfault/config.json
Windows%USERPROFILE%\.config\unfault\config.json