Skip to content

CLI Usage

The Unfault CLI is the primary interface for analyzing your codebase and getting production-readiness feedback.

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.

Terminal window
curl -sSL https://unfault.dev/get | bash

The unfault cli has a set of commands that you can use to interact with the Unfault platform.

Authenticate using secure device flow. No API keys in your terminal history.

Terminal window
unfault login
# Visit https://app.unfault.dev/auth/device/ and enter the displayed code

Analyze your codebase for production-readiness issues.

Terminal window
# Basic output (grouped by severity)
unfault review
# Full details with suggested fixes
unfault review --output full
# JSON for integration with other tools
unfault review --output json
# Focus on specific dimensions
unfault review --dimension stability --dimension performance

Output Modes:

ModeDescription
basicGrouped by severity, rule counts (default)
conciseSummary statistics only
fullDetailed findings with diffs
jsonMachine-readable output

Query your project’s health using natural language.

Terminal window
# Ask about your codebase
unfault ask "What are my main stability concerns?"
# Scope to a specific workspace
unfault ask "Show recent issues" --workspace wks_abc123
# Get raw context without AI synthesis
unfault ask "Performance problems" --no-llm

Configure an LLM for AI-powered answers:

Terminal window
unfault config llm openai --model gpt-5.1

Check authentication and connectivity.

Terminal window
unfault status

Manage CLI configuration.

Terminal window
# Show current config
unfault config show
# Configure LLM provider
unfault config llm openai --model gpt-4o
# View LLM settings
unfault config llm show
# Remove LLM configuration
unfault config llm remove

The CLI uses standard exit codes for CI/CD integration:

CodeMeaningAction
0Success, no issues✅ Proceed
1General error🔍 Check logs
2Configuration errorRun unfault login
3Authentication failedRe-authenticate
4Network errorCheck connectivity
5Findings detected🚨 Review issues
6Invalid inputCheck arguments
7Service unavailableRetry later
8Session errorRetry analysis
10Subscription requiredUpgrade plan

The CLI configuration file location depends on your operating system:

PlatformLocation
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-..."
}
}
VariableDescription
UNFAULT_BASE_URLOverride API endpoint
OPENAI_API_KEYOpenAI API key (for ask command)
ANTHROPIC_API_KEYAnthropic API key (for ask command)
# 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.