@commitguard/cli
v0.0.17
Published
AI-powered git commit checker that blocks bad code before it ships
Downloads
69
Readme
CommitGuard
Protect your codebase with every commit. CommitGuard automatically analyzes your code for security vulnerabilities, performance issues, and code quality problems before they enter your repository. Grab your free API key at https://commitguard.ai.
Installation
Get CommitGuard running in under 60 seconds. It works seamlessly with any git repository and integrates automatically with VSCode and other git clients.
Quick Start
1. Install CommitGuard globally
npm install -g @commitguard/cli2. Navigate to your project
cd your-project3. Initialize CommitGuard
commitguard init4. Commit as usual
CommitGuard now runs automatically on every commit. It works with all git integrations including VSCode, terminal, and other git clients.
git commit -m "Add new feature"
[CommitGuard] Analyzing commit...
✓ Commit passed all checksUsage
Bypassing Checks
To bypass CommitGuard checks for a specific commit, add --skip to your commit message:
git commit -m "Add new feature --skip"The --skip flag is automatically removed from the final commit message. When using git in your terminal, you'll be prompted to confirm if you want to bypass checks.
Configuring Checks
View or update CommitGuard preferences for your repository:
commitguard configOn the Pro plan, you can add custom rules through the config comand.
CLI Commands
commitguard init
Install CommitGuard in your current repository.
$ commitguard init
✓ CommitGuard installed successfullycommitguard remove
Remove CommitGuard from the current repository.
$ commitguard remove
✓ CommitGuard removedcommitguard config
View or update CommitGuard preferences for the current repository. Pro plan users can add custom rules.
$ commitguard config
Select enabled checks for this project:
Security, Performance, Code Quality, Architecturecommitguard keys
Manage your global API key for CommitGuard.
$ commitguard keys
Current API key: sk-ant-***************What Happens After Installation?
- Every commit is analyzed before it's created.
- No config files are added to your project
- Bypass checks anytime with
--skipin your commit message - Works seamlessly with all git clients and IDEs
Troubleshooting
Try reinstalling the hooks:
commitguard remove
commitguard initVerify that the hooks are installed:
ls -la .git/hooks/You should see a pre-commit hook file.
Add --skip to your commit message:
git commit -m "Emergency fix --skip"The --skip flag is automatically removed from the final message.
Remove the hooks and uninstall the package:
commitguard remove
npm uninstall -g @commitguard/cliFeatures
- Security Analysis - Detect vulnerabilities before they reach your repo
- Performance Checks - Identify performance bottlenecks early
- Code Quality - Maintain consistent code standards
- Architecture Review - Ensure architectural patterns are followed
- Zero Configuration - Works out of the box
- Universal Compatibility - Works with any git workflow -- Custom Rules - Add your own custom checks to the code reviews
Support
For issues, feature requests, or questions related to this package please open an issue or email us at [email protected]
License
MIT
