Quickstart
Run your first smart contract analysis in under five minutes.
Step 1 — Install OpenAudit AI
Clone the repository and build locally. This is the recommended setup while the npm package is pending release.
npm install -g openaudit-ai instead.Step 2 — Analyze a contracts directory
Point the analyzer at any directory containing .sol files. OpenAudit AI will recursively scan all Solidity files it finds.
Each finding shows the rule ID, severity level, file location, and a short description. Severity levels are: CRITICAL, HIGH, MEDIUM, LOW, and INFO.
Step 3 — Export JSON output
Use the --json flag to get machine-readable output. This is ideal for CI/CD integration or custom tooling.
The exported JSON looks like this:
{
"meta": {
"version": "0.1.0",
"scannedAt": "2024-11-15T14:23:01Z",
"files": 12,
"findings": 3
},
"findings": [
{
"ruleId": "reentrancy-guard",
"severity": "CRITICAL",
"file": "contracts/Token.sol",
"line": 147,
"column": 12,
"message": "External call precedes state update",
"suggestion": "Move state updates before external calls or use a reentrancy guard.",
"explanation": null
}
]
}Step 4 — Enable AI explanations (optional)
The AI explanation layer is completely optional. It translates structured findings into developer-readable plain language. The AI does not make security decisions — it only explains what the rule engine found.
OPENAI_API_KEY environment variable or a config file.Step 5 — List available rules
See all rules in the engine, including their IDs, descriptions, and severity levels.
Next steps
- Read the CLI Reference for all available commands and flags.
- Learn about the Output Format for CI/CD integration.
- Explore the CI/CD Usage guide for GitHub Actions setup.