A CLI tool for scanning GitHub repositories for vulnerabilities, secrets, and generating SBOMs
Project description
Prismor CLI
A powerful command-line tool for scanning GitHub repositories for security vulnerabilities, secrets, and generating Software Bill of Materials (SBOM).
Get started at https://prismor.dev - Sign up for free to get your API key and access full dashboarding and analysis features!
Features
- 🔍 Vulnerability Scanning (scan) - Detect security vulnerabilities in your codebase
- 🔐 Secret Detection - Find exposed secrets, API keys, and credentials
- 📦 SBOM Generation - Generate comprehensive Software Bill of Materials
- ⚡ Full Scan - Run all security checks in one command
- 🎨 Beautiful CLI Output - Colorful, easy-to-read results
- 🔗 Flexible Repository Input - Support for multiple GitHub URL formats including SSH, HTTPS, and bare domain formats
Quick Start
- Sign up at https://prismor.dev
- Generate your API Key from the dashboard
- Install the CLI:
pip install prismor - Set your API key:
export PRISMOR_API_KEY=your_api_key - Run your first scan:
prismor --repo username/repo --fullscan
For the complete analysis with dashboards and reports, visit Prismor.dev after running scans!
Installation
Install Prismor CLI via pip:
pip install prismor
Prerequisites
Getting Your API Key
Before using Prismor CLI, you need to get your API key from Prismor.dev:
- Visit https://prismor.dev
- Sign up for a free account
- Navigate to your dashboard
- Generate an API Key
- Copy your API key
Setting Up Your API Key
Once you have your API key, set it as an environment variable:
export PRISMOR_API_KEY=your_api_key_here
To make this permanent, add it to your shell configuration file (~/.bashrc, ~/.zshrc, etc.):
echo 'export PRISMOR_API_KEY=your_api_key_here' >> ~/.zshrc
source ~/.zshrc
Private Repositories
To scan private repositories, you need to integrate your GitHub account:
- Go to Prismor.dev
- Navigate to Settings or Integrations
- Connect your GitHub account
- Authorize Prismor to access your private repositories
This allows Prismor to securely access and scan your private repositories.
Usage
Basic Syntax
prismor --repo <repository> [scan-type]
Note: The --scan flag is used to enable vulnerability scanning, while --repo specifies the repository to scan.
Repository Format
Prismor CLI supports multiple GitHub repository URL formats for maximum flexibility:
1. Username/Repository format (recommended):
prismor --repo Ar9av/trychai-web-revamped --fullscan
2. HTTPS URLs:
prismor --repo https://github.com/Ar9av/trychai-web-revamped --fullscan
prismor --repo https://www.github.com/Ar9av/trychai-web-revamped --fullscan
prismor --repo https://github.com/Ar9av/trychai-web-revamped.git --fullscan
3. HTTP URLs:
prismor --repo http://github.com/Ar9av/trychai-web-revamped --fullscan
prismor --repo http://www.github.com/Ar9av/trychai-web-revamped --fullscan
4. Bare domain formats:
prismor --repo github.com/Ar9av/trychai-web-revamped --fullscan
prismor --repo www.github.com/Ar9av/trychai-web-revamped --fullscan
5. SSH format:
prismor --repo git@github.com:Ar9av/trychai-web-revamped.git --fullscan
6. URLs with paths and fragments:
prismor --repo https://github.com/Ar9av/trychai-web-revamped/tree/main --fullscan
prismor --repo https://github.com/Ar9av/trychai-web-revamped/blob/main/file.py --fullscan
prismor --repo https://github.com/Ar9av/trychai-web-revamped#branch --fullscan
All formats are automatically parsed and normalized to extract the user/repo_name format for processing.
Smart URL Parsing
Prismor CLI features intelligent GitHub URL parsing that automatically:
- ✅ Detects and extracts repository information from any supported format
- ✅ Handles edge cases like trailing slashes,
.gitsuffixes, and branch references - ✅ Validates input to ensure it's a valid GitHub repository
- ✅ Provides clear error messages for unsupported formats
- ✅ Supports special characters in repository names (hyphens, underscores, numbers)
Examples of what gets automatically parsed:
# All of these resolve to "facebook/react":
prismor --repo facebook/react --scan
prismor --repo https://github.com/facebook/react --scan
prismor --repo git@github.com:facebook/react.git --scan
prismor --repo github.com/facebook/react --scan
prismor --repo https://github.com/facebook/react/tree/main --scan
Scan Types
1. Vulnerability Scanning (scan)
Scan for security vulnerabilities in your dependencies and code:
prismor --repo myrepository --scan
Note: Vulnerability scans now run asynchronously for large repositories. The CLI will wait for completion automatically, but you can also use prismor start-scan to get a job ID and check status separately.
2. Secret Detection
Detect exposed secrets, API keys, passwords, and other sensitive information:
prismor --repo myrepository --detect-secret
3. SBOM Generation
Generate a Software Bill of Materials for your repository:
prismor --repo myrepository --sbom
4. Full Scan
Run all security checks (scan + Secret Detection + SBOM):
prismor --repo myrepository --fullscan
Multiple Scan Types
You can combine multiple scan types:
prismor --repo myrepository --scan --detect-secret
JSON Output
Get results in JSON format for automation and integration:
prismor --repo myrepository --fullscan --json
Examples
Example 1: Quick Vulnerability Scan (Username/Repo format)
prismor --repo facebook/react --scan
Example 2: Comprehensive Security Audit (HTTPS URL)
prismor --repo https://github.com/microsoft/vscode --fullscan
Example 3: Secret Detection with SSH URL
prismor --repo git@github.com:openai/gpt-3.git --detect-secret
Example 4: SBOM Generation with Bare Domain
prismor --repo github.com/kubernetes/kubernetes --sbom --json > sbom-results.json
Example 5: Full Scan with Branch Reference
prismor --repo https://github.com/tensorflow/tensorflow/tree/v2.13.0 --fullscan
Example 6: Multiple Scan Types with Different URL Formats
# Using HTTPS URL
prismor --repo https://github.com/pytorch/pytorch --scan --sbom
# Using SSH URL
prismor --repo git@github.com:nodejs/node.git --detect-secret --sbom
# Using bare domain
prismor --repo www.github.com/vercel/next.js --fullscan
Example 7: Async Scan with Status Checking
# Start a scan and get job ID
prismor start-scan username/repo --branch main
# Check scan status (use job ID from previous command)
prismor scan-status <job_id>
# Check status with JSON output
prismor scan-status <job_id> --json
Additional Commands
Start Async Vulnerability Scan
Start a vulnerability scan asynchronously and get a job ID for status checking:
prismor start-scan username/repo
prismor start-scan username/repo --branch develop
prismor start-scan username/repo --token ghp_xxxxx
Note: Requires GitHub token. Set GITHUB_TOKEN environment variable or use --token option.
Check Scan Status
Check the status of a running or completed vulnerability scan:
prismor scan-status <job_id>
prismor scan-status <job_id> --json
Status Response Includes:
- Job status (running/completed/failed)
- Repository and branch information
- Results URLs (public and presigned)
- Vulnerability summary with severity breakdown
- Scan date and duration
Example Output:
============================================================
Scan Status
============================================================
Job ID: abc123def456...
Status: completed
Repository:
https://github.com/username/repo
Branch:
main
Vulnerability Summary:
Total Vulnerabilities: 15
Total Targets Scanned: 3
Severity Breakdown:
CRITICAL: 2
HIGH: 5
MEDIUM: 6
LOW: 2
Results URL:
https://prismor-sbom-public-dev.s3.amazonaws.com/...
Check Configuration
View your current Prismor CLI configuration:
prismor config
Version Information
Display the version of Prismor CLI:
prismor version
Or:
prismor --version
Help
Get help and see all available options:
prismor --help
Output
Prismor CLI provides clear, colorful output with:
- ✓ Success indicators
- ✗ Error messages
- ℹ Information updates
- ⚠ Warnings
- Detailed scan results including:
- Repository information
- Vulnerability counts
- Secret detection findings
- SBOM artifact counts
- Download links for detailed reports
Full Analysis & Dashboarding
For comprehensive analysis and visualization of your scan results, visit the Prismor Dashboard:
Features Available on Prismor.dev:
- 📊 Interactive Dashboards - Visualize security trends and metrics
- 📈 Historical Analysis - Track vulnerabilities over time
- 🎯 Detailed Reports - In-depth analysis of all findings
- 🔔 Alerts & Notifications - Get notified of critical issues
- 👥 Team Collaboration - Share reports with your team
- 🔄 CI/CD Integration - Automate scans in your pipeline
- 📁 Repository Management - Manage multiple repositories in one place
Accessing Full Reports:
After running a scan with the CLI, you can:
- Visit https://prismor.dev
- Log into your dashboard
- View all your scan results with rich visualizations
- Export reports in various formats
- Set up automated scanning schedules
The CLI provides quick results in your terminal, while the web dashboard offers comprehensive analysis and long-term security monitoring.
API Information
Prismor CLI communicates with the Prismor API at https://api.prismor.dev. The CLI handles:
- Authentication via API key
- Request formatting
- Error handling
- Response parsing
- Result presentation
Troubleshooting
API Key Not Set
If you see an error about PRISMOR_API_KEY not being set:
export PRISMOR_API_KEY=your_api_key_here
Invalid Repository Format
Ensure your repository is in one of the supported formats:
Supported formats:
username/repository(recommended)https://github.com/username/repositoryhttps://www.github.com/username/repositoryhttp://github.com/username/repositoryhttp://www.github.com/username/repositorygithub.com/username/repositorywww.github.com/username/repositorygit@github.com:username/repository.githttps://github.com/username/repository/tree/branchhttps://github.com/username/repository/blob/branch/file
Not supported:
- Non-GitHub URLs (GitLab, Bitbucket, etc.)
- Invalid URL formats
- Empty or malformed repository names
Connection Issues
If you experience connection issues:
- Check your internet connection
- Verify the API endpoint is accessible
- Ensure your API key is valid
Development
Local Installation
For development, clone the repository and install in editable mode:
git clone https://github.com/PrismorSec/prismor-cli.git
cd prismor-cli
pip install -e .
Project Structure
prismor-cli/
├── prismor/
│ ├── __init__.py # Package initialization
│ ├── cli.py # CLI interface and commands
│ └── api.py # API client and communication
├── setup.py # Package configuration
├── requirements.txt # Dependencies
└── README.md # Documentation
Requirements
- Python 3.7 or higher
click>= 8.0.0requests>= 2.25.0
License
MIT License - See LICENSE file for details
Support
- Website: https://prismor.dev
- Dashboard: https://prismor.dev (Sign up for full features)
- Documentation: https://docs.prismor.dev
- Issues: https://github.com/PrismorSec/prismor-cli/issues
Need Help?
- Visit Prismor.dev for full documentation and support
- Check the dashboard for detailed scan results and analysis
- Join our community for questions and discussions
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Made with ❤️ by Prismor
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prismor-1.0.5.tar.gz.
File metadata
- Download URL: prismor-1.0.5.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fae006ffc865e55a1055d8ea8f7a1cf7b925f16da3b520097633130c0b4b8dd7
|
|
| MD5 |
77506caa350e763136cef0200d4c2603
|
|
| BLAKE2b-256 |
de941776519525d36d0636b7ae93aba634381662edf10317246bffddae339831
|
File details
Details for the file prismor-1.0.5-py3-none-any.whl.
File metadata
- Download URL: prismor-1.0.5-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad3050b86b49acf3fe9228da1726890ca08709cd99027c0cf29f62b8cb322ec3
|
|
| MD5 |
ba4fe025bce03a2f2cc3654aad713520
|
|
| BLAKE2b-256 |
262a421150caea6ff24b1e7d89371ee8d2dc442146c2495b6c5c0564c44c0ef4
|