GuardScan - Privacy-first AI Code Review CLI with comprehensive security scanning
npm install guardscan100% Free & Open Source โข Privacy-First Security Scanning and AI Code Review CLI
``
____ _ _ _ ____ ____ ____ ____ _ _ _ ____ _ ___
/ ___| | | | / \ | _ \| _ \ / ___| / ___| / \ | \ | | / ___| | |_ _|
| | _| | | |/ _ \ | |_) | | | | \___ \| | / _ \ | \| | _____ | | | | | |
| |_| | |_| / ___ \| _ <| |_| | ___) | |___ / ___ \| |\ | |_____| | |___| |___ | |
\____|\___/_/ \_\_| \_\____/ |____/ \____/_/ \_\_| \_| \____|_____|___|
Privacy-First AI Code Review & Security Scanning
`


---
GuardScan is 100% free and open source! No credit system, no paywalls, no subscriptions.
- โ
Unlimited static analysis - 9 security scanners + code quality tools
- โ
AI-enhanced code review - Bring your own API key (OpenAI, Claude, Gemini, Ollama)
- โ
Works fully offline - No internet required for static analysis
- โ
Privacy-first - Never uploads your source code
- โ
No usage limits - Scan unlimited LOC, unlimited repositories
---
`bashInstall globally via npm
npm install -g guardscan
---
๐ Core Features
$3
GuardScan includes comprehensive security scanners:
1. Secrets Detection - Find hardcoded API keys, passwords, tokens (20+ patterns)
2. Dependency Vulnerabilities - Scan npm, pip, Maven, Cargo dependencies
3. OWASP Top 10 - SQL injection, XSS, insecure configs, CSRF, XXE
4. Docker Security - Dockerfile and container scanning
5. Infrastructure as Code - Terraform, CloudFormation, Kubernetes security
6. API Security - REST and GraphQL endpoint analysis
$3
7. Code Metrics - Cyclomatic complexity, Halstead metrics, maintainability index
8. Code Smells - 30+ anti-patterns (god classes, long methods, magic numbers)
9. License Compliance - Check dependency licenses (MIT, GPL, Apache, etc.)
10. Compliance Checks - GDPR, HIPAA, PCI-DSS compliance scanning
11. Linter Integration - ESLint, Pylint, RuboCop, etc.
12. LOC Counter - Language-aware line counting (20+ languages)
$3
13. Test Runner - Execute and analyze Jest, pytest, JUnit tests
14. Mutation Testing - Validate test suite effectiveness
15. Performance Testing - Load testing and benchmarking
16. SBOM Generation - Software Bill of Materials (CycloneDX, SPDX)
$3
9 Advanced AI-Powered Features:
1. Code Explainer (
guardscan explain) - Understand complex code
2. Code Review (guardscan review) - Comprehensive AI code review
3. Commit Generator (guardscan commit) - Generate commit messages
4. Docs Generator (guardscan docs) - Auto-generate documentation
5. Test Generator (guardscan test-gen) - Generate unit tests
6. Refactoring Suggestions (guardscan refactor) - Improve code quality
7. Threat Modeling (guardscan threat-model) - Security architecture analysis
8. Migration Assistant (guardscan migrate) - Framework/language migrations
9. Interactive Chat (guardscan chat) - RAG-powered codebase Q&A$3
AST Parsers for 7+ Languages:
- TypeScript/JavaScript
- Python
- Java
- Go
- Rust
- Ruby
- PHP
- C#
$3
Configure any AI provider you prefer:
- OpenAI (GPT-4, GPT-4 Turbo, GPT-3.5)
- Anthropic Claude (Claude 3 Opus, Sonnet, Haiku)
- Google Gemini (Gemini Pro)
- Ollama (Local, privacy-focused - llama2, codellama, mistral)
- LM Studio (Local models)
- OpenRouter (Access to multiple models)
You pay the AI provider directly - GuardScan charges nothing!
---
๐ ๏ธ Commands
All commands are 100% FREE with no limits!
$3
| Command | Description |
| ------------------ | ------------------------------------- |
|
guardscan init | Initialize config, generate client_id |
| guardscan config | Configure AI provider & settings |
| guardscan status | Show configuration and repo info |
| guardscan reset | Clear local cache & config |$3
| Command | Description |
| -------------------- | ----------------------------------------- |
|
guardscan security | Run comprehensive security scan (offline) |
| guardscan scan | Quick security scan |
| guardscan run | AI-enhanced full code review (BYOK) |$3
| Command | Description |
| -------------------- | ---------------------------------- |
|
guardscan test | Run tests & code quality analysis |
| guardscan perf | Performance testing & load testing |
| guardscan mutation | Mutation testing for test quality |$3
| Command | Description |
| ----------------- | ----------------------------------- |
|
guardscan sbom | Generate Software Bill of Materials |
| guardscan rules | Custom YAML-based rule engine |$3
| Command | Description |
| --------------------------- | ------------------------------------ |
|
guardscan explain | Explain how code works |
| guardscan review | Comprehensive AI code review |
| guardscan commit | Generate commit messages |
| guardscan docs | Auto-generate documentation |
| guardscan test-gen | Generate unit tests |
| guardscan refactor | Get refactoring suggestions |
| guardscan threat-model | Security architecture analysis |
| guardscan migrate | Framework/language migration help |
| guardscan chat | Interactive Q&A about codebase (RAG) |---
๐ Privacy Guarantees
We take privacy seriously:
$3
- Your source code
- File paths or file names
- Code snippets
- API keys or secrets
- Proprietary information
$3
- Command usage (e.g., "security" command ran)
- Execution duration
- LOC count (aggregate number only)
- AI model used (e.g., "gpt-4")
Telemetry is:
- Optional (easily disabled:
guardscan config --telemetry=false)
- Completely anonymized
- Only used to improve GuardScan
- Never sold or shared---
๐ฏ How It Works
$3
`bash
guardscan security
`Runs 9 security scanners locally:
- Scans your codebase
- Generates markdown report
- 100% offline - no internet needed
- 100% free - no limits
$3
`bash
Step 1: Configure your AI provider (one-time)
guardscan config
Choose provider: OpenAI, Claude, Gemini, Ollama
Enter your API key
Step 2: Run AI review
guardscan run
`How it works:
1. GuardScan analyzes your code locally
2. Sends anonymized context to your AI provider (using your API key)
3. AI provides insights and suggestions
4. Report saved locally
You pay your AI provider directly - GuardScan is free!
---
๐ฐ Pricing
$3
No credit system. No subscriptions. No paywalls.
$3
You pay them directly (not GuardScan):
- OpenAI GPT-4: ~$0.01-0.03 per 1K tokens
- Claude Sonnet: ~$0.003 per 1K tokens
- Gemini Pro: Free tier available
- Ollama: 100% free (runs locally)
Example costs for 10K LOC codebase:
- Static analysis only: $0
- With OpenAI GPT-4: ~$2-5 (paid to OpenAI)
- With Ollama (local): $0
---
๐๏ธ Architecture
GuardScan follows a privacy-first, client-side architecture where all code analysis happens locally.
`
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ USER'S MACHINE โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ GuardScan CLI (Node.js/TypeScript) โ โ
โ โ โ โ
โ โ โข 21 Commands (security, run, test, explain...) โ โ
โ โ โข 30 Core Modules (scanners, parsers, metrics) โ โ
โ โ โข 9 AI Features (explain, review, test-gen, etc.) โ โ
โ โ โข 7 Language Parsers (Python, Java, Go, Rust...) โ โ
โ โ โข 6 AI Provider Integrations โ โ
โ โ โ โ
โ โ Config: ~/.guardscan/config.yml โ โ
โ โ Cache: ~/.guardscan/cache/ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โ Optional telemetry only โ
โ โผ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโดโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ User's AI Provider โ โ GuardScan Backend โ
โ (User pays directly) โ โ (Optional telemetry) โ
โ โ โ โ
โ โข OpenAI (GPT-4) โ โ Cloudflare Workers โ
โ โข Anthropic (Claude) โ โ + Supabase โ
โ โข Google (Gemini) โ โ โ
โ โข Ollama (Local) โ โ โข Health checks โ
โ โ โ โข Anonymous telemetry โ
โ User's API Key โ โ โ โข NO source code โ
โ User's billing โ โ โ โข NO credit validation โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
`$3
CLI (34,213 LOC):
- Language: TypeScript 5.3+ (strict mode)
- Runtime: Node.js 18+
- Framework: Commander.js
- Testing: Jest (70%+ coverage)
- Build: TypeScript Compiler (tsc)
Backend (913 LOC - Optional):
- Platform: Cloudflare Workers (serverless)
- Database: Supabase PostgreSQL (optional)
- Purpose: Anonymous telemetry only
- Cost: $0-5/month (Cloudflare free tier)
---
๐ฆ Installation
$3
`bash
npm install -g guardscan
`This will automatically install all required runtime dependencies, including TypeScript which is needed for AST parsing.
$3
`bash
Clone repository
git clone https://github.com/ntanwir10/GuardScan.git
cd GuardScan/cliInstall dependencies
npm installBuild
npm run buildLink globally
npm linkVerify
guardscan --help
`$3
GuardScan requires the following runtime dependencies (automatically installed with npm):
- TypeScript (
typescript) - Required for AST parsing of TypeScript/JavaScript files
- Automatically included when installing via npm install -g guardscan
- If you encounter "Cannot find module 'typescript'" errors, ensure it's installed:
`bash
npm install typescript
`All other dependencies are automatically managed by npm during installation.
---
๐ค Contributing
GuardScan is open source and we welcome contributions!
- Report bugs: GitHub Issues
- Request features: GitHub Issues
- Submit PRs: See CONTRIBUTING.md
---
๐ Documentation
- Installation Guide
- Configuration Guide
- API Documentation
- Security Scanners
- Contributing Guidelines
---
โ FAQ
Q: Is GuardScan really free?
A: Yes! 100% free, no credit system, no subscriptions, no limits.
Q: Do I need to create an account?
A: No! Just
npm install -g guardscan and run guardscan init.Q: Do I need an AI API key?
A: Only if you want AI-enhanced review. Static analysis (9 security scanners) works without any API key.
Q: Which AI provider should I use?
A: Your choice! OpenAI (powerful), Claude (balanced), Gemini (affordable), Ollama (free, local).
Q: Does GuardScan upload my code?
A: Never. GuardScan only uploads anonymized metadata for optional telemetry.
Q: Can I disable telemetry?
A: Yes! Run
guardscan config --telemetry=false or set telemetryEnabled: false in ~/.guardscan/config.yml`.Q: How do I support this project?
A: Star the repo on GitHub, contribute code, report bugs, or sponsor the project!
---
MIT License - see LICENSE
---
GuardScan is built with these amazing open-source tools:
- Commander.js - CLI framework
- Chalk - Terminal styling
- Axios - HTTP client
- Cloudflare Workers - Serverless backend
- Supabase - Open-source Firebase alternative
---
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email:
---
Made with โค๏ธ by developers, for developers
โญ Star us on GitHub โข ๐ Report Bug โข ๐ก Request Feature