First scan
Run your first code analysis. The simplest command to scan a directory or file is:
bash
rootcause scan <PATH>
For example:
bash
# Scan the current directory
rootcause scan .
# Scan a specific file
rootcause scan file.py
# Scan a specific directory
rootcause scan ./my-project
Main options
Specify custom rules
bash
# Use rules from a specific directory
rootcause scan <PATH> --rules ./my-rules
Output format
bash
# Text format (default)
rootcause scan <PATH> --format text
# JSON format (ideal for integration)
rootcause scan <PATH> --format json
# SARIF format (standard for security tools)
rootcause scan <PATH> --format sarif > report.sarif
Quiet mode
bash
# No logging messages (ideal for CI/CD)
rootcause scan <PATH> --format json --quiet > results.json
Severity control
bash
# Fail only on high-severity issues
rootcause scan <PATH> --fail-on high
# Fail on medium or high severity
rootcause scan <PATH> --fail-on medium
Practical examples
Basic scan with JSON output
bash
rootcause scan ./project --format json --quiet > scan-results.json
Scan with specific rules and SARIF output
bash
rootcause scan ./code --rules ./security-rules --format sarif > security-report.sarif
Scan for CI/CD
bash
rootcause scan . --format json --quiet --fail-on medium
Next steps
- Manage rules: Learn about Rules management
- Use plugins: See Plugin management
- Advanced configuration: See the Full CLI