AI Agents Guide
Full integration patterns. Read more
No explanation needed. Just copy, paste, and run.
# Review only what you changedunfault review --uncommitted
# Same thing, detailed outputunfault review --uncommitted --output full
# JSON for scriptsunfault review --uncommitted --output jsonOptimized output for Claude, Cursor, Copilot, and other AI assistants.
# LLM-optimized JSON — compact, actionable, no noiseunfault review --llm
# Focus on your changes onlyunfault review --uncommitted --llm
# Specific files with full contextunfault review --llm --file src/api/routes.py --file src/api/handlers.py
# Limit to top 20 most severe findingsunfault review --llm --top 20
# The full combo: uncommitted, LLM format, top issuesunfault review --uncommitted --llm --top 10Add this to your AGENTS.md or system prompt:
Before committing, run:\`\`\`bashunfault review --uncommitted --llm\`\`\`
If findings are reported, fix high-severity issues before committing.Use the `files_allowed_to_change` field to scope your edits.# SARIF for GitHub Code Scanningunfault review --output sarif > results.sarif- name: Run Unfault run: unfault review --output sarif > results.sarif
- name: Upload SARIF uses: github/codeql-action/upload-sarif@v3 with: sarif_file: results.sarif# Fail if findings detected (exit 5)unfault review && echo "Clean!" || echo "Findings found"
# Explicit checkunfault review --output jsonif [ $? -eq 5 ]; then echo "Review the findings above" exit 1fi# Pipe to jq for filteringunfault review --output json | jq '.findings | map(select(.severity == "High"))'
# Count findingsunfault review --output json | jq '.findings | length'# Full detailed output with suggested fixesunfault review --output full
# Focus on one dimensionunfault review --dimension stability --output fullunfault review --dimension performance --output fullunfault review --dimension correctness --output full
# Include test files (excluded by default)unfault review --include-tests --output full
# Preview fixes without applyingunfault review --dry-run# What breaks if I change this file?unfault graph impact src/core/auth.py
# Find the most connected filesunfault graph critical --limit 10
# What uses this library?unfault graph library requestsunfault graph library httpx
# External dependencies of a fileunfault graph deps src/api/client.py
# Graph statisticsunfault graph stats# Quick semantic searchunfault ask "functions without error handling"unfault ask "routes without authentication"unfault ask "database queries without timeouts"
# With LLM-powered synthesisunfault ask "how do we handle retries?" --llmunfault ask "what happens if the database goes down?" --llm# Check auth statusunfault status
# Configure LLM for `ask --llm`unfault config llm openai --model gpt-4ounfault config llm anthropic --model claude-3-5-sonnet-latestunfault config llm ollama --model llama3.2
# View current configunfault config showunfault config llm show| Flag | What it does |
|---|---|
--uncommitted | Only findings for uncommitted files |
--file PATH | Only findings for specific files (repeatable) |
--llm | Compact JSON optimized for AI agents |
--top N | Limit findings (default 50, max 200) |
--output full | Detailed output with fix suggestions |
--output json | Machine-readable JSON |
--output sarif | SARIF 2.1.0 for GitHub/IDE integration |
--dimension X | Focus on one dimension |
--include-tests | Include test files in analysis |
--dry-run | Preview fixes without applying |
| Code | Meaning |
|---|---|
| 0 | Success, no findings |
| 5 | Success, findings detected |
| 1 | General error |
| 2 | Config error |
| 3 | Auth failed |
| 4 | Network error |