CLI Usage
The Unfault CLI is the primary interface for analyzing your codebase and getting production-readiness feedback.
Installation
Section titled “Installation”The Unfault CLI is available for macOS, Linux, and Windows as an executable binary. You can install it using one of the following methods.
Download the right release for your platform from GitHub Releases and add it to your PATH.
curl -sSL https://unfault.dev/get | bashcargo install unfaultgit clone https://github.com/unfault/clicd clicargo build --releaseCommands
Section titled “Commands”The unfault cli has a set of commands that you can use to interact with the Unfault platform.
unfault login
Section titled “unfault login”Authenticate using secure device flow. No API keys in your terminal history.
unfault login# Visit https://app.unfault.dev/auth/device/ and enter the displayed codeunfault review
Section titled “unfault review”Analyze your codebase for production-readiness issues.
# Basic output (grouped by severity)unfault review
# Full details with suggested fixesunfault review --output full
# JSON for integration with other toolsunfault review --output json
# Focus on specific dimensionsunfault review --dimension stability --dimension performanceOutput Modes:
| Mode | Description |
|---|---|
basic | Grouped by severity, rule counts (default) |
concise | Summary statistics only |
full | Detailed findings with diffs |
json | Machine-readable output |
unfault ask
Section titled “unfault ask”Query your project’s health using natural language.
# Ask about your codebaseunfault ask "What are my main stability concerns?"
# Scope to a specific workspaceunfault ask "Show recent issues" --workspace wks_abc123
# Get raw context without AI synthesisunfault ask "Performance problems" --no-llmConfigure an LLM for AI-powered answers:
unfault config llm openai --model gpt-5.1unfault config llm anthropic --model claude-sonnet-4-5unfault config llm ollama --model llama3.2unfault status
Section titled “unfault status”Check authentication and connectivity.
unfault statusunfault config
Section titled “unfault config”Manage CLI configuration.
# Show current configunfault config show
# Configure LLM providerunfault config llm openai --model gpt-4o
# View LLM settingsunfault config llm show
# Remove LLM configurationunfault config llm removeExit Codes
Section titled “Exit Codes”The CLI uses standard exit codes for CI/CD integration:
| 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 |
Configuration
Section titled “Configuration”The CLI configuration file location depends on your operating system:
| Platform | Location |
|---|---|
| Linux | ~/.config/unfault/config.json or $XDG_CONFIG_HOME/unfault/config.json |
| macOS | ~/.config/unfault/config.json or $XDG_CONFIG_HOME/unfault/config.json |
| Windows | %USERPROFILE%\.config\unfault\config.json |
Example configuration:
{ "api_key": "uf_live_...", "base_url": "https://api.unfault.dev", "llm": { "provider": "openai", "model": "gpt-4", "api_key": "sk-..." }}Environment Variables
Section titled “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) |
Using with AI Agents
Section titled “Using with AI Agents”# Code Quality
Run `unfault review` before committing to check for production issues.Use `unfault review --output full` to see suggested patches.The CLI returns structured output that AI agents can parse and act on.