titanshield
v0.6.2
Published
TitanShieldAI CLI — AI-powered security scanner for your codebase. Zero config. Under 2 minutes.
Maintainers
Readme
🛡️ titanshield
AI-powered security scanner. Zero config. Under 2 minutes.
Scans your codebase for security vulnerabilities before you deploy — using fast static analysis + Gemini AI deep analysis. Explains every issue in plain English and shows you the exact fix.
Quick Start
# Scan your project right now (static analysis — instant, no key required)
npx titanshield scan ./src
# Full AI scan (Gemini finds what static patterns miss)
npx titanshield scan ./src --key YOUR_GEMINI_API_KEY
# Or set the key as an env var (recommended)
export GEMINI_API_KEY=AIzaSy...
npx titanshield scan ./srcFree Gemini key: aistudio.google.com/app/apikey
What it finds
| Category | Examples |
|----------|---------|
| 🔴 Hardcoded Secrets | API keys, passwords, tokens in source code |
| 🔴 Code Injection | eval(userInput), shell command injection |
| 🔴 SQL Injection | String-concatenated queries |
| 🟠 Missing Auth | Unprotected routes touching user data |
| 🟠 IDOR | Missing ownership checks on resource endpoints |
| 🟠 Path Traversal | User input in file paths |
| 🟡 Insecure Config | CORS *, weak JWT algorithms, MD5 hashing |
| 🟡 XSS Sinks | innerHTML = userInput |
Options
npx titanshield scan <path> [options]
--key, -k <key> Gemini API key (or GEMINI_API_KEY env var)
--output, -o <file> Save HTML report (e.g. report.html)
--format <type> terminal (default) | json | html
--fail-on <level> Exit code 1 if findings at level+ (CI/CD)
--no-ai Static analysis only (faster, offline)
--verbose, -v Show all findings including low/info
--no-color Disable colors (clean CI logs)
--help, -h Show helpExample Output
🔴 [CRITICAL] Hardcoded Secret Detected
src/firebase.ts:12
A secret key is hardcoded in your source code. Anyone who sees your code can steal it.
Before: const apiKey = "AIzaSy_abc123_realkey"
After: const apiKey = process.env.FIREBASE_API_KEY
Fix: Move secret to environment variable (5 minutes)CI/CD Integration
# GitHub Actions example
- name: Security Scan
run: npx titanshield scan ./src --fail-on high
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}Exit codes: 0 = pass, 1 = vulnerability found at fail-on level
Config File (optional)
Create titanshield.config.json in your project root:
{
"geminiApiKey": "AIzaSy...",
"failOn": "high",
"skipDirs": ["vendor", "fixtures"],
"outputFile": "security-report.html"
}HTML Report
npx titanshield scan ./src --output report.htmlGenerates a beautiful, shareable security report. Send it to your CTO, embed in Confluence, or commit as a CI artifact.
Languages Supported
TypeScript · JavaScript (ESM/CJS) · Python · Go · JSX/TSX
Built by TitanShieldAI · Dashboard
