Installation

Get CommitGuard running in under 60 seconds and start protecting your codebase with every commit. CommitGuard works seamlessly with any git repository and works out of the box with VSCode.

Quick Start

1

Install CommitGuard globally

$ npm install -g @commitguard/cli
2

Navigate to your project

$ cd your-project
3

Initialize CommitGuard

$ commitguard init
4

Commit as usual

CommitGuard now runs automatically on every commit. That's it (Also will automatically work with VSCode and other git integrations)!

$ git commit -m "Add new feature"
[CommitGuard] Analyzing commit...
Commit passed all checks
5

Want to bypass checks for a commit?

You can bypass CommitGuard checks for a specific commit by adding --skip to your commit message.

$ git commit -m "Add new feature --skip"
6

Want to configure CommitGuard checks?

You can view or update CommitGuard preferences for the current repository using. On the pro plan you can add your own custom rules here too!

$ commitguard config
Haven't signed up yet? Create your free account.

CLI Commands

commitguard init

Install git hooks in your current repository

$ commitguard init
✓ CommitGuard hooks installed successfully
commitguard remove

Remove CommitGuard hooks from the current repository

$ commitguard remove
✓ CommitGuard hooks removed
commitguard config

View or update CommitGuard preferences for the current repository. On the Pro plan you can add your own custom rules here too!

$ commitguard config
Select enabled checks for this project:
Security, Performance, Code Quality, Architecture
commitguard keys

Manage your global API key for AI-powered analysis

$ commitguard keys
Current API key: sk-ant-***************

What Happens After Installation?

  • CommitGuard hooks are installed
  • Every commit is automatically analyzed before it's created
  • No config files are added to your project
  • You can bypass checks anytime with git commit -m "chore: update unsecure --skip" in your commit message (Obvioulsy it is auto removed ;). If you use git in your terminal you will be auto-prompted to bypass if you want.

Troubleshooting

CommitGuard isn't running on commits

Make sure you're in a git repository and that commitguard is installed:

$ commitguard init
How do I skip a single commit?

Use the standard git bypass flag:

$ git commit -m "Emergency hotfix --skip"
How do I completely remove CommitGuard?

Remove from a specific repo:

$ commitguard remove

Uninstall globally:

$ npm uninstall -g @commitguard/cli