Unfault CLI
A calm reviewer for thoughtful engineers.
Unfault analyzes your code for clarity, boundaries, and behavior—highlighting places where decisions matter, before reality does. You write the code. Unfault helps you build it right.
Why Unfault?
Production issues don't announce themselves. That missing timeout? The unhandled edge case? The retry logic that isn't there? They surface at 3 AM, pages deep into an incident.
Unfault catches these patterns early—during development, not during outages. It's a linter for production-readiness, focused on:
- Stability — HTTP timeouts, circuit breakers, retry patterns
- Correctness — Error handling, boundary conditions, type safety
- Performance — N+1 queries, missing indexes, blocking calls
- Scalability — Resource limits, connection pooling, caching patterns
Quick Start
# Install
# Authenticate
# Analyze your code
That's it. Unfault scans your codebase, detects frameworks and languages, and reports findings in seconds.
Installation
From Releases (Recommended)
Download the latest binary from Releases and add it to your PATH.
From crates.io
From Source
Commands
unfault login
Authenticate using secure device flow—no API keys in your terminal history.
# Visit https://app.unfault.dev/authorize and enter the displayed code
unfault review
Analyze your codebase for production-readiness issues.
# Basic output (grouped by severity)
# Full details with suggested fixes
# JSON for integration with other tools
# Focus on specific dimensions
Output Modes:
| Mode | Description |
|---|---|
basic |
Grouped by severity, rule counts (default) |
concise |
Summary statistics only |
full |
Detailed findings with diffs |
json |
Machine-readable output |
sarif |
SARIF 2.1.0 for GitHub Code Scanning / IDE integration |
unfault ask
Query your project's health using natural language (requires prior review sessions).
# Ask about your codebase
# Scope to a specific workspace
# Get raw context without AI synthesis
Configure an LLM for AI-powered answers:
# OpenAI
# Anthropic
# Local Ollama
unfault status
Check authentication and connectivity.
unfault config
Manage CLI configuration.
# Show current config
# Configure LLM provider
# View LLM settings
# Remove LLM configuration
CI/CD Integration
Unfault is designed for CI pipelines. Use exit codes to gate deployments:
# GitHub Actions with Code Scanning (SARIF)
- name: Run Unfault Analysis
run: unfault review --output sarif > results.sarif
- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
# GitHub Actions (simple)
- name: Production Readiness Check
run: unfault review
continue-on-error: false
# GitLab CI
production_check:
script:
- unfault review --output json > unfault-report.json
artifacts:
reports:
codequality: unfault-report.json
allow_failure: false
Exit Codes
| Code | Meaning | Action |
|---|---|---|
0 |
Success, no issues | ✅ Proceed |
1 |
General error | 🔍 Check logs |
2 |
Configuration error | Run unfault login |
3 |
Authentication failed | Re-authenticate |
4 |
Network error | Check connectivity |
5 |
Findings detected | 🚨 Review issues |
6 |
Invalid input | Check arguments |
7 |
Service unavailable | Retry later |
8 |
Session error | Retry analysis |
10 |
Subscription required | Upgrade plan |
CI Example: Fail on findings
if [; then
fi
Supported Languages & Frameworks
| Language | Frameworks |
|---|---|
| Python | FastAPI, Flask, Django, httpx, requests |
| Go | net/http, gin, echo |
| Rust | reqwest, hyper, actix-web |
| TypeScript | Express, fetch, axios |
Unfault automatically detects your stack and applies relevant rules.
Configuration
Configuration is stored in ~/.config/unfault/config.json:
Environment Variables
| Variable | Description |
|---|---|
UNFAULT_BASE_URL |
Override API endpoint |
OPENAI_API_KEY |
OpenAI API key (for ask command) |
ANTHROPIC_API_KEY |
Anthropic API key (for ask command) |
What Unfault Finds
Stability Issues
# ❌ Missing timeout
=
# ✅ Suggested fix
=
Error Handling Gaps
// ❌ Ignored error
result, _ := riskyOperation()
// ✅ Suggested fix
result, err := riskyOperation()
if err != nil
Performance Concerns
# ❌ N+1 query pattern
=
# ✅ Suggested fix
=
Philosophy
Unfault is opinionated but not dogmatic. It focuses on patterns that matter in production:
- Fast feedback — Analysis completes in seconds, not minutes
- Actionable fixes — Every finding includes a suggested patch
- Low noise — Rules are tuned to minimize false positives
- Developer-first — Designed for the terminal, not dashboards
Troubleshooting
"Not logged in"
"No source files found"
Ensure you're running unfault review from a directory containing supported source files (.py, .go, .rs, .ts, .js).
Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
# Run tests
# Build release
License
MIT License. See LICENSE for details.