@codecora/cli
v0.0.5
Published
CORA CLI - AI code review before commit
Downloads
178
Maintainers
Readme
CORA CLI
Catch bugs & security issues BEFORE you commit. Save 2+ hours/week on code reviews.
Website: https://codecora.dev | Docs: https://codecora.dev/docs/cli
CORA CLI brings AI code review to your local development workflow. Get instant feedback on your code changes before they leave your machine.
Features
- Pre-commit Review - Review code changes before committing
- Instant Feedback - Get AI analysis in seconds
- Privacy-first - Your code diffs are analyzed directly by your AI provider
- Git Hooks - Automatic review on every commit
- Cross-platform - Works on macOS, Linux, and Windows
Benefits
- Save Time - Reduce code review time by 2+ hours per week
- Catch Bugs Early - Find issues before they reach production
- Security First - Detect vulnerabilities and security risks
- Learn Best Practices - Get AI-powered suggestions for code improvement
- Zero Friction - Works with your existing Git workflow
Installation
Using npm/bun (Requires Node.js 20+)
# Using npm
npm install -g @codecora/cli
# Using bun
bun install -g @codecora/cliQuick Start
# 1. Install CORA CLI
npm install -g @codecora/cli
# 2. Login to CORA
cora auth login
# 3. Review staged changes
cora reviewExample Output:
✅ Review complete
Found 2 issues:
🔴 Critical: SQL injection risk
File: src/auth.ts:45
User input not sanitized before query
🟡 Major: Missing error handling
File: src/api.ts:12
API call lacks try-catch block
💡 Suggestions available. Run with --include-walkthrough for details.Use Cases
CORA CLI is perfect for:
- Pre-commit Hooks - Automatically review code before every commit
- CI/CD Pipelines - Integrate into GitHub Actions, GitLab CI, Jenkins
- Legacy Code Audit - Review entire codebases with
--baseflag - Pull Request Reviews - Check feature branches before merging
- Learning Projects - Get AI feedback on code quality and best practices
Why CORA vs Others?
| Feature | CORA | SonarQube | CodeClimate | DeepSource | |---------|------|-----------|-------------|------------| | Setup Time | 30 seconds | Hours | Hours | Hours | | Pre-commit | ✅ Native | ❌ Plugin | ❌ Plugin | ❌ Plugin | | AI-Powered | ✅ GPT-4/Claude | ❌ Rule-based | ❌ Rule-based | ❌ Rule-based | | Your AI Key | ✅ Use your own | ❌ Locked in | ❌ Locked in | ❌ Locked in | | Privacy | ✅ Code stays local | ⚠️ Cloud scan | ⚠️ Cloud scan | ⚠️ Cloud scan | | Free Tier | ✅ 100 reviews/mo | ❌ $120/yr min | ❌ $50/yr min | ❌ Subscription | | Languages | All languages | Limited | Limited | Limited |
Key Differentiators:
- Fastest Setup - Install and run in 30 seconds, no configuration needed
- AI-Powered - Uses latest GPT-4/Claude models, not outdated rule engines
- Your AI Key - Use your own OpenAI/Anthropic key, no vendor lock-in
- Privacy-First - Code analyzed by YOUR AI provider, we never see your code
- Zero Maintenance - No servers to manage, no databases to configure
- Always Updated - Automatically benefits from latest AI model improvements
Usage
Authentication
# Login via GitHub OAuth
cora auth login
# Check authentication status
cora auth status
# Logout
cora auth logout
# View/set configuration
cora auth config [key] [value]Review Code
# Review staged changes (default)
cora review
# Review unstaged changes
cora review --unstaged
# Review specific files
cora review --files src/app.ts src/utils.ts
# Review committed changes
cora review --base main # Review branch vs main
cora review --commits 3 # Review last 3 commits
cora review --revision-range abc..def # Review specific range
cora review --unpushed # Review unpushed commits
# JSON output for CI/CD
cora review --format jsonGit Hooks
# Install pre-commit hook
cora hook install
# Uninstall hook
cora hook uninstall
# List installed hooks
cora hook list
# Quick enable/disable
cora enable # Install pre-commit hook
cora disable # Uninstall pre-commit hookOptions
| Option | Description |
|--------|-------------|
| -w, --workspace <id> | Workspace ID |
| -r, --repository <name> | Repository name (owner/repo) |
| -b, --branch <name> | Branch name |
| -s, --staged | Review staged changes (default) |
| -u, --unstaged | Review unstaged changes |
| -f, --files <files...> | Review specific files |
| --base <ref> | Review changes from base ref to HEAD (e.g., "main") |
| --revision-range <range> | Review specific commit range (e.g., "HEAD~3..HEAD") |
| --commits <number> | Review last N commits |
| --unpushed | Review unpushed commits |
| --format <format> | Output format (pretty, json, compact) |
Configuration
Configuration is stored in ~/.codecora/:
auth.json- Session token and user infoconfig.json- Preferences and settings
Environment Variables
| Variable | Description |
|----------|-------------|
| CORA_SKIP | Skip pre-commit hook when set to 1 |
| CORA_SERVER | Override server URL |
| CORA_WORKSPACE | Override workspace ID |
| CORA_API_KEY | API key for CI/CD authentication |
CI/CD Integration
Supported Languages
CORA CLI supports code review for all programming languages including:
- JavaScript / TypeScript
- Python
- Java / Kotlin
- Go
- Rust
- PHP
- Ruby
- C# / .NET
- And more...
Using API Keys (Recommended)
For CI/CD workflows, use API Keys instead of session tokens.
Getting an API Key:
- Login to codecora.dev
- Go to Dashboard → API Keys
- Click "Generate API Key"
- Copy the key and use in your CI/CD pipeline
# Example: GitHub Actions
- name: Run CORA Review
run: |
npm install -g @codecora/cli
cora review --format json > review-results.json
env:
CORA_API_KEY: ${{ secrets.CORA_API_KEY }}
CORA_SERVER_URL: https://codecora.devBenefits of API Keys:
- No interactive login required
- Can be scoped to specific permissions
- Can have expiration dates
- Revocable without affecting other workflows
Create API Key: Visit Dashboard → API Keys to generate a key for CI/CD.
Troubleshooting
Authentication Errors
# Check your authentication status
cora auth status
# Re-authenticate if needed
cora auth loginHook Not Running
# Verify hook is installed
cora hook list
# Reinstall hook
cora hook uninstall && cora hook installSkip Hook Temporarily
# Skip for one commit
git commit --no-verify -m "message"
# Or use environment variable
CORA_SKIP=1 git commit -m "message"Requirements
- Node.js 20+ or Bun 1.0+
- A Codecora account (sign up at https://codecora.dev)
- An OpenAI-compatible API key configured in your workspace
Pricing
- Free Tier - 100 reviews/month during beta
- Pro Tier - Coming soon
- Enterprise - Contact us for custom solutions
License
MIT © CORA
Support
- 📧 Email: [email protected]
- 📚 Documentation
- 🌐 Website
- 💬 Community Discord
Getting Help:
- Check our Documentation for detailed guides
- Join our Discord community for quick questions
- Email us at [email protected] for technical issues
