Getting Started with the CLI
The Rafter CLI provides a simple command-line interface for running security scans on your repositories. This guide covers the essential concepts and basic workflows.Core Concepts
How Do I get My API Key?
To use the Rafter CLI or API, you need an API key. Sign up and get your API key from your account page.What Does the CLI Do?
The Rafter CLI allows you to:- Run security audits of your remote repositories (
rafter runorrafter scan) - Choose scan depth with scan modes —
fastfor rapid analysis,plusfor deeper coverage with additional agent passes - Retrieve results from completed scans
- Check usage and quota information
- Automate security workflows in scripts and CI/CD
- Protect AI agents with local secret scanning and command interception
How Does Scanning Work?
The CLI scans remote repositories (e.g., on GitHub), not your local files. It can use your local Git configuration to determine which repository and branch to scan.
- The CLI detects your repository and branch from Git
- It uploads your code securely to Rafter’s scanning engine
- The engine analyzes your code for vulnerabilities and security issues
- It deletes your code from Rafter’s scanning engine
- Results are returned and displayed in your terminal
Scan Modes
Rafter supports two scan modes, selected with the--mode (or -m) flag:
| Mode | Flag | Description |
|---|---|---|
| Fast | --mode fast (default) | Rapid security scan using industry-standard tooling and Rafter’s proprietary analysis for SAST, secret detection, and dependency checks. |
| Plus | --mode plus | Everything in fast, plus additional agent-driven analysis passes for deeper coverage. Takes longer but produces more detailed findings. |
Basic Commands
Start a Scan with rafter run
The most common command for running security scans are below. They auto-detect the repo and branch and require an environment variable RAFTER_API_KEY:
Retrieve Results with rafter get
Get results from a completed scan:
Check Quota with rafter usage
Check your API usage and remaining scans:
Basic Workflow
Here’s a typical workflow for running your first scan:1. Install the CLI
Python 3.10+ required for pip installs. Verify your version:On Ubuntu/Debian, Python and pip may not be installed by default:On Fedora/RHEL:
sudo dnf install python3 python3-pip.
macOS: brew install python. Windows: install from python.org — pip is included.2. Set Your API Key
3. Run a Scan
4. Check Results
The CLI will display scan results directly in your terminal, showing:- Vulnerabilities found with severity levels
- File locations where issues were detected
- Recommendations for fixing the issues
Output Formats
The CLI supports multiple output formats for different use cases:JSON Format (Default)
- Automation and scripting
- Integration with other tools
- Parsing with tools like
jq
Markdown Format
- Human-readable reports
- Documentation and sharing
- GitHub issues and pull requests
- LLM-assisted remediation — the report includes role-priming, step-by-step instructions, and structured issue metadata

