CLI Commands Overview
Complete reference for all Alprina CLI commands. Based on the actual implementation in alprina-cli.
All Commands at a Glance
alprina --help # Show help and version
alprina version # Show CLI version
alprina scan <target> # Scan files, URLs, or IPs
alprina recon <target> # Perform reconnaissance
alprina mitigate [finding_id] # Get AI-powered fix suggestions
alprina fix <target> # AI-powered vulnerability fixes
alprina quickstart # Interactive tutorial for new users
alprina history # View scan history and results
alprina chat # Interactive AI security assistant
alprina auth login # Authenticate with Alprina
alprina auth logout # Remove authentication
alprina auth status # Check authentication status
alprina policy init # Initialize policy configuration
alprina policy test <target> # Test if target is allowed
alprina config --init # Initialize default configuration
alprina report --format <type> # Generate security reports
alprina billing status # Check billing and usageCore Scanning Commands
alprina scan
Run AI-powered security scan on code, APIs, or infrastructure.
alprina scan <target> [OPTIONS]Arguments:
<target>- File path, directory, URL, or IP address to scan
Options:
--profile, -p- Scan profile (default:default)default- Standard security scancode-audit- Deep code analysisweb-recon- Web application scanningapi-security- API endpoint testing
--safe-only- Only run non-intrusive scans (default:true)--output, -o- Save results to file
Examples:
# Scan local directory
alprina scan ./src
# Scan with specific profile
alprina scan ./src --profile code-audit
# Scan remote API
alprina scan https://api.example.com --profile api-security
# Scan IP address
alprina scan 192.168.1.1 --safe-only
# Save results to file
alprina scan ./src --output results.json→ Complete scan command reference
alprina recon
Perform reconnaissance on a target (passive or active).
alprina recon <target> [OPTIONS]Arguments:
<target>- Domain, URL, or IP to reconnaissance
Options:
--passive- Use only passive techniques (default:true)
Examples:
# Passive reconnaissance
alprina recon example.com
# Active reconnaissance (requires confirmation)
alprina recon example.com --passive=falsealprina mitigate
Get AI-powered mitigation suggestions for security findings.
alprina mitigate [finding_id] [OPTIONS]
alprina fix <target> # AI-powered vulnerability fixes
alprina quickstart # Interactive tutorial for new users
alprina history # View scan history and results
alprina chat # Interactive AI security assistantArguments:
[finding_id]- Specific finding ID (optional)
Options:
--report, -r- Process findings from report file
Examples:
# Get suggestions for all findings
alprina mitigate
# Get suggestion for specific finding
alprina mitigate VULN-2024-001
# Process from report file
alprina mitigate --report ~/.alprina/out/latest-report.jsonAuthentication Commands
alprina auth login
Authenticate with Alprina platform.
alprina auth login [OPTIONS]Options:
--api-key- Provide API key directly--provider- OAuth provider (github,google)
Examples:
# Interactive login
alprina auth login
# Login with API key
alprina auth login --api-key YOUR_API_KEY
# OAuth login
alprina auth login --provider githubNote: Authentication is optional for local scans but required for remote targets.
alprina auth logout
Remove authentication credentials.
alprina auth logoutalprina auth status
Check current authentication status.
alprina auth statusShows:
- Authentication state (logged in/out)
- User information
- API key status
- Subscription tier
Policy Commands
alprina policy init
Initialize a new policy configuration file.
alprina policy initCreates alprina-policy.yaml with default security policies.
Example output:
version: "1.0"
allowed_targets:
- localhost
- 127.0.0.1
- "*.internal.com"
blocked_targets:
- "*.gov"
- "*.mil"
scan_options:
safe_only: true
max_depth: 3alprina policy test
Test if a target is allowed by current policy.
alprina policy test <target>Arguments:
<target>- Target to test against policy
Examples:
# Test if target is allowed
alprina policy test api.example.com
# Test IP address
alprina policy test 192.168.1.1Configuration Commands
alprina config
Manage Alprina configuration.
alprina config [OPTIONS]Options:
--init- Initialize default configuration
Examples:
# Initialize config
alprina config --init
# View current config location
alprina configConfiguration file location: ~/.alprina/config.yaml
Reporting Commands
alprina report
Generate security reports from scan results.
alprina report [OPTIONS]Options:
--format, -f- Report format (default:html)html- Interactive HTML reportpdf- PDF documentjson- Machine-readable JSON
--output, -o- Output file path
Examples:
# Generate HTML report
alprina report --format html
# Generate PDF report
alprina report --format pdf --output security-report.pdf
# Generate JSON for CI/CD
alprina report --format jsonReports are saved to: ~/.alprina/out/
Billing Commands
alprina billing status
Check billing status and usage statistics.
alprina billing statusShows:
- Current subscription tier (Free/Pro/Enterprise)
- Scans used this month
- Remaining quota
- Next billing date
- Payment method
Global Flags
These flags work with all commands:
| Flag | Description |
|---|---|
--verbose, -v | Enable verbose output |
--debug | Enable debug mode with detailed logs |
--help, -h | Show help message for any command |
Examples:
# Verbose output
alprina scan ./src --verbose
# Debug mode
alprina scan ./src --debug
# Get help for specific command
alprina scan --helpVersion Information
alprina version
Show Alprina CLI version.
alprina versionExample output:
Alprina CLI version 0.2.2Exit Codes
Alprina uses standard exit codes:
| Code | Meaning |
|---|---|
0 | Success |
1 | General error |
2 | Authentication required |
3 | Policy violation |
10 | High severity findings detected |
130 | Operation cancelled by user (Ctrl+C) |
Example usage in CI/CD:
alprina scan ./src || exit $?Command Completion
Enable shell completion for faster command entry:
# Bash
alprina --install-completion bash
# Zsh
alprina --install-completion zsh
# Fish
alprina --install-completion fishNext Steps
- Scan Command Details - Complete scan command reference
- Getting Started - Quick start guide
- GitHub Actions Integration - CI/CD workflows
- Policy Management - Security policy guide