Sentinel - AI-Powered Code Guardian: Automated code review with security scanning, dependency analysis, accessibility checks, TypeScript/React analysis, API security, secrets detection, and multi-LLM integration
npm install sentinel-cli> AI-Powered Code Guardian: Security scanning, TypeScript/React analysis, API security, secrets detection, and multi-LLM integration — all running locally.






🔒 Security • 📦 Dependencies • ♿ Accessibility • 🐛 Bugs • ⚡ Performance • 💎 TypeScript • ⚛️ React • 🔑 Secrets • 🌐 API • 🤖 AI-Powered
---
Sentinel CLI is a local-first, developer-owned code review tool with 13+ specialized analyzers:
- AI-powered code analysis using your own API keys (OpenAI, Groq, Gemini, Anthropic, OpenRouter)
- Security scanning (SQL injection, XSS, exposed secrets, dangerous functions)
- TypeScript analysis (any types, @ts-ignore, type safety)
- React analysis (hooks rules, missing keys, performance)
- API security (CORS, JWT misconfig, rate limiting)
- Secrets detection (API keys, passwords, tokens)
- Dependency analysis (CVE scanning via npm audit)
- Accessibility checking (WCAG compliance, ARIA validation)
- Docker security (Dockerfile best practices, root user, secrets, vulnerabilities) NEW
- Kubernetes security (K8s manifest security, privileged containers, network policies) NEW
- GitHub PR integration (post reviews directly to PRs)
- Slack/Discord notifications (team alerts)
- SARIF output (GitHub Security tab integration)
- Auto-fix capabilities (common issues fixed automatically)
- Monorepo/workspace support (analyze entire workspaces)
- Historical trend analysis (track code quality over time)
Unlike hosted SaaS solutions, Sentinel runs entirely on your machine or CI pipeline — your code never leaves your infrastructure.
---
``bashInstall globally
npm install -g sentinel-cli
`Sample Output:
`
🛡️ SENTINEL — AI-Powered Code Guardian v1.8.0✔ Analyzing 12 files with 6 analyzers...
┌─────────────────────────────────────────────────────────────┐
│ CRITICAL │ AWS Access Key ID exposed │
│ File: src/config.js:45 │
│ → Use environment variables or AWS IAM roles │
├─────────────────────────────────────────────────────────────┤
│ HIGH │ SQL injection vulnerability │
│ File: src/db/queries.js:23 │
│ → Use parameterized queries │
├─────────────────────────────────────────────────────────────┤
│ MEDIUM │ Explicit 'any' type used │
│ File: src/utils/helpers.ts:67 │
│ → Replace with specific type or 'unknown' │
├─────────────────────────────────────────────────────────────┤
│ MEDIUM │ useEffect missing dependency array │
│ File: src/components/Dashboard.tsx:34 │
│ → Add dependencies: [userId, fetchData] │
└─────────────────────────────────────────────────────────────┘
Summary: 1 critical, 2 high, 5 medium, 12 low issues found
`---
🆚 Why Sentinel CLI vs Hosted Tools?
| Feature | Sentinel CLI | CodeRabbit | GitHub Copilot | SonarCloud |
|---------|-------------|------------|----------------|------------|
| Local/Self-hosted | ✅ Yes | ❌ SaaS only | ❌ SaaS only | ⚠️ Partial |
| Your own AI keys | ✅ OpenAI/Groq/Gemini | ❌ Their API | ❌ Their API | ❌ N/A |
| Code stays private | ✅ 100% local | ❌ Sent to cloud | ❌ Sent to cloud | ❌ Sent to cloud |
| Security scanning | ✅ Built-in | ⚠️ Limited | ❌ No | ✅ Yes |
| TypeScript analysis | ✅ Yes | ⚠️ Limited | ⚠️ Limited | ✅ Yes |
| React analysis | ✅ Hooks, JSX, a11y | ❌ No | ⚠️ Limited | ❌ No |
| API security | ✅ CORS, JWT, auth | ❌ No | ❌ No | ⚠️ Limited |
| Secrets detection | ✅ 20+ patterns | ⚠️ Limited | ❌ No | ✅ Yes |
| GitHub PR reviews | ✅ Direct posting | ✅ Yes | ❌ No | ✅ Yes |
| Slack/Discord | ✅ Yes | ❌ No | ❌ No | ⚠️ Limited |
| SARIF output | ✅ Yes | ❌ No | ❌ No | ✅ Yes |
| Dependency checks | ✅ npm audit | ❌ No | ❌ No | ✅ Yes |
| Accessibility (a11y) | ✅ WCAG checks | ❌ No | ❌ No | ❌ No |
| Pre-commit hooks | ✅ Yes | ❌ PR only | ❌ No | ❌ No |
| Auto-fix capabilities | ✅ Yes | ❌ No | ❌ No | ❌ No |
| Monorepo support | ✅ Yes | ⚠️ Limited | ❌ No | ⚠️ Limited |
| Free & Open Source | ✅ MIT License | ❌ Paid | ❌ Paid | ⚠️ Freemium |
---
✨ Features (v1.4.0)
| Category | What It Does |
|----------|--------------|
| 🔒 Security Analysis | SQL injection, XSS, CSRF, exposed secrets, dangerous functions |
| 🔑 Secrets Detection | API keys (AWS, Stripe, GitHub), passwords, tokens, private keys, high-entropy strings |
| 💎 TypeScript |
any types, @ts-ignore, @ts-nocheck, non-null assertions, namespace usage |
| ⚛️ React/JSX | Hooks rules, missing keys, index-as-key, dangerouslySetInnerHTML, a11y |
| 🌐 API Security | CORS misconfiguration, JWT issues, rate limiting, disabled SSL, exposed errors |
| 📦 Dependency Scanning | npm audit integration, CVE detection, deprecated packages, license compliance |
| ♿ Accessibility (a11y) | Missing alt text, form labels, ARIA validation, semantic HTML, keyboard access |
| 📊 Code Quality | Cyclomatic complexity, code duplication, maintainability index |
| 🐛 Bug Detection | Null pointer risks, type mismatches, async/await issues |
| ⚡ Performance | Memory leaks, N+1 queries, expensive operations |
| 🤖 AI Review | Multi-LLM analysis with OpenAI, Groq, Gemini, Anthropic, OpenRouter |
| 📝 Custom Rules | Define your own regex rules in .sentinelrules.yaml |
| 🛠️ Auto-fix | Automatically fix common issues (console.log, debugger, missing alt text, etc.) |
| 📊 Trend Analysis | Historical analysis and code quality trends |
| 🔗 PR Integration | GitHub PR review posting and comments |---
🔧 Configuration
$3
The fastest way to get started is with the interactive auth command:
`bash
sentinel auth
`This will:
- ✅ Prompt you for API keys for each provider (OpenAI, Anthropic, Gemini, Groq, OpenRouter)
- ✅ Save them securely to
~/.sentinel.json (readable only by you)
- ✅ Never send your keys anywhere except to the AI providersOther auth commands:
`bash
sentinel auth status # See which providers are configured
sentinel auth set openai # Set just one provider
sentinel auth logout # Clear all API keys
`$3
Sentinel looks for
.sentinel.json in these locations (in order of priority):1.
./.sentinel.json (project-local - highest priority)
2. $XDG_CONFIG_HOME/sentinel/.sentinel.json
3. $HOME/.sentinel.json (global config)Example
.sentinel.json:`json
{
"providers": {
"openai": { "apiKey": "sk-...", "disabled": false },
"anthropic": { "apiKey": "sk-ant-...", "disabled": false },
"gemini": { "apiKey": "AI...", "disabled": false },
"groq": { "apiKey": "gsk_...", "disabled": false },
"openrouter": { "apiKey": "sk-or-...", "disabled": false }
},
"agents": {
"coder": { "model": "gpt-4o-mini", "maxTokens": 5000 }
},
"debug": false
}
`$3
If you prefer environment variables (e.g., in CI/CD pipelines):
`bash
export OPENAI_API_KEY="sk-..."
export GROQ_API_KEY="gsk_..."
export GEMINI_API_KEY="AI..."
export ANTHROPIC_API_KEY="sk-ant-..."
sentinel analyze # Uses all available providers
`$3
`bash
Security checks only
sentinel analyze --analyzers securityDependencies only
sentinel analyze --analyzers dependencyAccessibility only
sentinel analyze --analyzers accessibilityDocker/Kubernetes security only (NEW)
sentinel analyze --analyzers docker,kubernetesMultiple specific analyzers
sentinel analyze --analyzers security,dependency,accessibility,docker,kubernetesEverything except AI (faster, no API calls)
sentinel analyze --analyzers security,quality,bugs,performance,dependency,accessibility,docker,kubernetes
`$3
Create
.codereviewrc.json in your project root:`json
{
"analysis": {
"enabledAnalyzers": ["security", "quality", "bugs", "performance", "dependency", "accessibility", "docker", "kubernetes"],
"ignoredFiles": ["node_modules/", "dist/", ".min.js", "coverage/*"]
},
"ai": {
"enabled": true,
"providers": [
{
"id": "openai",
"provider": "openai",
"model": "gpt-4o-mini",
"enabled": true
},
{
"id": "groq",
"provider": "groq",
"model": "llama3-70b-8192",
"enabled": true
}
]
},
"output": {
"format": "console",
"minSeverity": "low"
}
}
`$3
Create a
.sentinelrules.yaml file in your project:`yaml
rules:
- id: no-console-log
pattern: "console\\.log"
message: "Avoid using console.log in production"
severity: warning
filePattern: "\\.(js|ts)$"
suggestion: "Use a proper logging library"
`---
🚀 CI/CD Integration
$3
Create
.github/workflows/sentinel.yml:`yaml
name: Sentinel Code Reviewon:
pull_request:
branches: [main, develop]
push:
branches: [main]
jobs:
code-review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Sentinel CLI
run: npm install -g sentinel-cli
- name: Run Security Scan
run: sentinel analyze --analyzers security --format json --output security-report.json
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Run Full Analysis
run: sentinel analyze --format json --output full-report.json
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Check for Critical Issues
run: |
if grep -q '"severity":"critical"' full-report.json; then
echo "❌ Critical issues found!"
cat full-report.json | jq '.issues[] | select(.severity=="critical")'
exit 1
fi
echo "✅ No critical issues found"
- name: Upload Report
uses: actions/upload-artifact@v4
with:
name: sentinel-report
path: |
security-report.json
full-report.json
`$3
`bash
Install husky
npm install --save-dev husky
npx husky initAdd sentinel to pre-commit
echo 'sentinel analyze --staged --format console' > .husky/pre-commit
`Or manually add to
.git/hooks/pre-commit:`bash
#!/bin/sh
echo "🛡️ Running Sentinel pre-commit check..."
sentinel analyze --staged --format consoleif [ $? -ne 0 ]; then
echo "❌ Code review failed. Please fix issues before committing."
exit 1
fi
echo "✅ Code review passed!"
`$3
`yaml
sentinel-review:
image: node:20-alpine
stage: test
script:
- npm install -g sentinel-cli
- sentinel analyze --format json --output report.json
artifacts:
reports:
codequality: report.json
only:
- merge_requests
`---
♿ Accessibility Checks Explained
Sentinel checks for WCAG 2.1 Level AA compliance issues:
| Check | What It Detects | Why It Matters |
|-------|-----------------|----------------|
| Missing alt text |
without alt attribute | Screen readers can't describe images |
| Empty alt on meaningful images | alt="" on non-decorative images | Important content is hidden |
| Form labels | without associated