Overview
The Fraim CLI is your primary interface for running AI-powered security analysis on code repositories and local directories. It supports multiple input sources, workflows, and output formats.Basic Syntax
Quick Start Examples
Analyze a Git Repository
Analyze Local Directory
Workflows
Specify which security analysis workflows to run. Available workflows:code
- Source code security analysisiac
- Infrastructure as Code analysisrisk_flagger
- Risk analysis for security team investigationsystem_analysis
- System purpose and business context analysis
Command-Line Options
Input Sources
--location <URL>
Specify a Git repository URL to clone and analyze. Fraim will automatically clone the repository to a temporary directory and analyze its contents.
Examples:
--location <DIRECTORY>
Analyze a local directory or file path. This is useful for analyzing code that’s already on your local system.
Examples:
File Filtering
--globs <PATTERN_LIST>
Specify custom file patterns to include in the analysis. If not provided, Fraim uses default patterns based on the selected workflows.
Examples:
- Code workflow:
*.py
,*.c
,*.cpp
,*.h
,*.go
,*.ts
,*.js
,*.java
,*.rb
,*.php
,*.swift
,*.rs
,*.kt
,*.scala
,*.tsx
,*.jsx
- IAC workflow:
*.tf
,*.tfvars
,*.tfstate
,*.yaml
,*.yml
,*.json
,Dockerfile
,.dockerfile
,docker-compose.yml
,docker-compose.yaml
, and various Kubernetes/Ansible files - Risk Flagger workflow: Uses the same patterns as the Code workflow
- System Analysis workflow: Documentation files (
*.md
,*.rst
,*.txt
), configuration files (package.json
,setup.py
, etc.), and application entry points
--limit <NUMBER>
Limit the number of files to analyze. Useful for testing or when working with very large repositories.
Examples:
AI Model Configuration
--model <MODEL_NAME>
Specify the AI model to use for analysis. Fraim supports multiple model providers through LiteLLM.
Default: anthropic/claude-sonnet-4-20250514
Examples:
--temperature <NUMBER>
Set the temperature setting for the model (0.0-1.0). Lower values make the model more deterministic, higher values make it more creative.
Default: 0
Examples:
Performance Configuration
--chunk-size <NUMBER>
Set the number of lines per chunk when processing large files. Smaller chunks provide more granular analysis but may increase processing time.
Default: 500
Examples:
- Detailed analysis: 100-300 lines
- Balanced: 400-600 lines (default)
- Performance: 800-1200 lines
--max-concurrent-chunks <NUMBER>
Set the maximum number of chunks to process concurrently. Higher values can speed up analysis but use more system resources.
Default: 5
Examples:
--max-concurrent-triagers <NUMBER>
(Code workflow only)
Set the maximum number of triager requests per chunk to run concurrently. This controls how many vulnerability assessments happen in parallel.
Default: 3
Examples:
Quality Control
--confidence <NUMBER>
Set the minimum confidence threshold (1-10) for filtering findings. Higher values reduce false positives but may miss some issues.
Default: 7
Examples:
- 1-3: Include all potential findings (high false positive rate)
- 4-6: Include likely findings (moderate false positive rate)
- 7-8: Include probable findings (balanced - default range)
- 9-10: Include only very confident findings (low false positive rate)
Git Diff Analysis
--diff
Enable git diff analysis mode. This analyzes only the changes in a git repository rather than the entire codebase.
Examples:
--head <COMMIT>
Specify the head commit for diff analysis. Uses HEAD if not provided.
Examples:
--base <COMMIT>
Specify the base commit for diff analysis. Uses empty tree if not provided.
Examples:
Output Configuration
--output <PATH>
Specify a custom path for output files. If not provided, Fraim uses a default output directory.
Default: fraim_output/
in the project directory
Examples:
fraim_report_[repo]_[timestamp].sarif
- SARIF JSON reportfraim_report_[repo]_[timestamp].html
- HTML report
Global Options
--debug
Enable debug logging for troubleshooting and development. This provides detailed information about the analysis process.
Example:
--show-logs <BOOLEAN>
Control whether logs are printed to standard error output.
Default: true
Examples:
--log-output <PATH>
Specify the output directory for log files.
Default: fraim_output
Examples:
Observability
--observability <BACKEND_LIST>
Enable LLM observability backends for monitoring and analyzing AI model usage.
Available backends:
langfuse
- Langfuse observability platform
- Langfuse: Set
LANGFUSE_PUBLIC_KEY
,LANGFUSE_SECRET_KEY
, andLANGFUSE_HOST
environment variables
Workflow-Specific Options
Risk Flagger Workflow Options
Therisk_flagger
workflow has additional options for customizing risk analysis and GitHub integration:
--pr-url <URL>
URL of the pull request to analyze. Used for GitHub integration.
Example:
--approver <USERNAME>
GitHub username or group to notify for approval when risks are found.
Example:
--custom-risk-list-action <append|replace>
Whether to append to or replace the default risks list with custom risks.
Default: append
--custom-risk-list-filepath <PATH>
Path to JSON/YAML file containing additional risks to consider.
Example:
--custom-risk-list-json <JSON>
JSON string containing additional risks to consider.
--custom-false-positive-considerations <LIST>
List of additional considerations to help reduce false positives.
Example:
System Analysis Workflow Options
Thesystem_analysis
workflow has options for understanding system context:
--business-context <TEXT>
Additional business context to consider during analysis.
Example:
--focus-areas <AREAS>
Specific areas to focus on during analysis.
Example:
Environment Variables
Fraim requires API keys for AI model providers. Set these in your environment or.env
file:
Anthropic Claude
OpenAI
Google Gemini
Langfuse Observability
Advanced Usage Examples
Comprehensive Analysis
CI/CD Integration
Large Codebase Analysis
Specific File Analysis
Risk Analysis on Pull Request
System Analysis with Context
Understanding Output
Fraim generates two types of reports:SARIF Report (.sarif)
- Industry-standard format for security analysis results
- Machine-readable JSON format
- Compatible with security platforms and CI/CD tools
- Contains detailed vulnerability information, locations, and metadata
HTML Report (.html)
- Human-readable report with rich formatting
- Interactive elements for browsing findings
- Code snippets with highlighted vulnerabilities
- Summary statistics and charts
Troubleshooting
Common Issues
“No input specified” error:Performance Tips
- Start small: Use
--limit
to test on a subset of files first - Optimize chunks: Adjust
--chunk-size
based on your system capabilities - Balance chunks: Smaller
--chunk-size
for accuracy, larger for speed - Control concurrency: Use
--max-concurrent-chunks
and--max-concurrent-triagers
to balance speed vs resources - Filter confidence: Use higher
--confidence
to reduce processing time - Use diff mode: For incremental analysis, use
--diff
to analyze only changes - Monitor resources: Use system monitoring to optimize settings