Reference
CLI Reference
Complete reference for all OpenAudit AI commands and flags.
Global options
# Show all available commands
$openaudit-ai --help
Usage: openaudit-ai [command] [options]
Options:
-h, --help Show help
-V, --version Show version number
openaudit-ai analyze <path>
Analyze all Solidity files in the specified path.
Flags
| Flag | Description |
|---|---|
| --json | Output findings as JSON instead of text |
| --severity <level> | Only report findings at this level or above (critical|high|medium|low|info) |
| --rule <id> | Only run a specific rule by ID |
| --ignore <pattern> | Ignore files matching glob pattern |
| --output <file> | Write output to file instead of stdout |
| --no-color | Disable colored output (useful in CI) |
| --verbose | Enable verbose logging |
Examples
Basic analysis
$openaudit-ai analyze ./contracts
JSON output
$openaudit-ai analyze ./contracts --json
High+ severity only
$openaudit-ai analyze ./contracts --severity high
Save to file
$openaudit-ai analyze ./contracts --json --output findings.json
Ignore test files
$openaudit-ai analyze ./contracts --ignore "**/*.test.sol"
openaudit-ai explain <path>
Run analysis and generate AI explanations for each finding.
Flags
| Flag | Description |
|---|---|
| --json | Output with AI explanations as JSON |
| --model <name> | Specify the AI model to use (default: gpt-4o-mini) |
Examples
Explain findings
$openaudit-ai explain ./contracts
Explain with JSON output
$openaudit-ai explain ./contracts --json
openaudit-ai rules list
List all available rules with their IDs, severities, and descriptions.
Flags
| Flag | Description |
|---|---|
| --severity <level> | Filter by severity level |
| --json | Output as JSON |
Examples
List all rules
$openaudit-ai rules list
List critical rules only
$openaudit-ai rules list --severity critical
openaudit-ai rules show <id>
Show detailed documentation for a specific rule.
Examples
Show rule details
$openaudit-ai rules show reentrancy-guard
openaudit-ai version
Print the current version of OpenAudit AI.
Examples
Check version
$openaudit-ai version
OpenAudit AI v0.1.0
Exit codes
| Code | Meaning |
|---|---|
| 0 | Analysis completed, no findings |
| 1 | Findings were emitted (default behavior) |
| 2 | Fatal error (bad path, parse error, etc.) |
Tip: Use
--severity high to only exit non-zero on high/critical findings, avoiding false-positive CI failures from informational notes.Environment variables
| Variable | Description |
|---|---|
| OPENAI_API_KEY | API key for the AI explanation layer |
| OPENAUDIT_NO_COLOR | Disable colored output when set to 1 |
| OPENAUDIT_CONFIG | Path to a custom config file |