AI-powered security analysis CLI tool with intelligent file discovery and comprehensive vulnerability scanning
npm install @codepathfinder/secureflow-cli


š”ļø AI-Powered Security Analysis for Your Codebase
SecureFlow CLI is a powerful command-line tool that performs comprehensive security analysis of your projects using advanced AI models. It intelligently analyzes your code structure, identifies vulnerabilities, and provides actionable security insights with a beautiful TUI interface.
- š¤ AI-Powered Analysis - Supports 13+ AI models including Claude, GPT, and Gemini
- š Intelligent File Discovery - Smart project analysis with iterative file request system
- šÆ Comprehensive Scanning - Full project security analysis with context-aware insights
- š Multiple Output Formats - Text, JSON, and DefectDojo integration
- šļø Project Profiling - Technology stack detection and application type identification
- šØ Beautiful TUI - Claude-style terminal interface with colored output and progress indicators
From the repository root:
``bashRun directly
node packages/secureflow-cli/bin/secureflow --help
$3
SecureFlow CLI requires an AI model to perform analysis. Set up your API key:
`bash
Check current configuration
secureflow config --showThe CLI will prompt for API key configuration on first run
Or manually edit the config file shown in the output
`Supported Models:
- Anthropic Claude:
claude-sonnet-4-5-20250929 (recommended), claude-opus-4-1-20250805, claude-sonnet-4-20250514, claude-3-7-sonnet-20250219, claude-3-5-haiku-20241022, ~~claude-3-5-sonnet-20241022~~ (deprecated)
- OpenAI: gpt-4o, gpt-4o-mini, o1, o1-mini, gpt-4.1-2025-04-14, o3-mini-2025-01-31
- Google Gemini: gemini-2.5-pro, gemini-2.5-flash
- xAI Grok: grok-4-fast-reasoning
- OpenRouter: Access 200+ models from multiple providers (use format: provider/model e.g., anthropic/claude-3-5-sonnet)
- Ollama: qwen3:4b$3
`bash
Scan current directory with default model
secureflow scanScan specific project with Claude
secureflow scan ./my-project --model claude-sonnet-4-5-20250929Get project profile first
secureflow profile ./my-project
`š Commands
$3
Performs comprehensive AI-powered security analysis of your project.
`bash
secureflow scan [path] [options]
`Options:
-
--model - AI model to use for analysis
- --format - Output format: text, json, or defectdojo (default: text)
- --output - Save results to file
- --defectdojo - Export in DefectDojo format (shorthand for --format defectdojo)DefectDojo Integration:
`bash
secureflow scan \
--format defectdojo \
--defectdojo-url https://defectdojo.example.com \
--defectdojo-token your-api-token \
--defectdojo-product-id 123 \
--output findings.json
`DefectDojo Options:
-
--defectdojo-url - DefectDojo instance URL
- --defectdojo-token - API token for authentication
- --defectdojo-product-id - Product ID to submit findings
- --defectdojo-engagement-id - Engagement ID (optional, will create if not provided)
- --defectdojo-test-title - Test title (default: "SecureFlow Scan")$3
Analyzes project structure and identifies technologies, frameworks, and application types.
`bash
secureflow profile [path] [options]
`Options:
-
--model - AI model to use for analysis
- --format - Output format: text or json (default: text)
- --output - Save results to file$3
View and manage CLI configuration.
`bash
secureflow config --show # Show masked configuration
secureflow config --show --raw # Show raw configuration (use with caution)
`š§ Configuration
SecureFlow CLI stores configuration in a local config file. The location is shown when running
secureflow config --show.Example Configuration:
`json
{
"model": "grok-4-fast-reasoning",
"apiKey": "xai-token",
"provider": "grok",
"analytics": {
"enabled": false
}
}
`Getting API Keys:
- Anthropic (Claude): console.anthropic.com
- OpenAI: platform.openai.com
- Google: ai.google.dev
- Grok (xAI): console.x.ai
- OpenRouter: openrouter.ai
šÆ Usage Examples
$3
`bash
Scan current directory
secureflow scanScan with specific model
secureflow scan --model grok-4-fast-reasoningSave results to file
secureflow scan --output security-report.json --format json
`$3
`bash
Profile current project
secureflow profileProfile specific directory
secureflow profile ./backend --format json
`$3
`bash
Export to DefectDojo with minimal setup
secureflow scan \
--defectdojo \
--defectdojo-url https://defectdojo.company.com \
--defectdojo-token $DEFECTDOJO_TOKEN \
--defectdojo-product-id 42Full DefectDojo configuration
secureflow scan \
--format defectdojo \
--defectdojo-url https://defectdojo.company.com \
--defectdojo-token $DEFECTDOJO_TOKEN \
--defectdojo-product-id 42 \
--defectdojo-engagement-id 123 \
--defectdojo-test-title "Weekly Security Scan" \
--output weekly-findings.json
`šļø How It Works
SecureFlow CLI uses an innovative LLM File Request System that works like tool calling:
1. Project Discovery - Analyzes project structure and identifies key files
2. Iterative Analysis - AI makes targeted file requests using XML-like syntax:
`xml
`
3. Security Analysis - Performs up to 3 iterations of analysis with context building
4. Report Generation - Outputs comprehensive security findings with severity levelsSecurity Features:
- ā
Hidden file filtering (ignores
.git, .DS_Store, etc.)
- ā
Symlink protection against directory traversal
- ā
Project scope validation
- ā
File size limits (large files truncated)
- ā
Comprehensive request loggingšØ Output Formats
$3
Beautiful colored terminal output with:
- š“ Critical vulnerabilities
- š High severity issues
- š” Medium severity warnings
- šµ Low severity notes
- ā¹ļø Informational findings$3
Structured output perfect for CI/CD integration:
`json
{
"summary": {
"totalIssues": 5,
"critical": 1,
"high": 2,
"medium": 1,
"low": 1
},
"findings": [...]
}
`$3
Direct integration with DefectDojo security platforms:
- Compliant with Generic Findings Import format
- Automatic severity mapping
- File path and line number extraction
- CWE/CVE detection and tagging---
Need Help?
- Run
secureflow --help` for command overview