An AI-powered Git pre-commit hook using Ollama to review code.
Project description
🤖 Git Guardian AI
An intelligent Git pre-commit hook that uses a local Ollama LLM to automatically review your code changes before you commit them.
Features
- Automated Code Review: Catches potential bugs, security flaws, and performance issues.
- Local & Private: Uses your own Ollama instance, so your code never leaves your machine.
- Configurable: Easily configure the model, blocking rules, and ignored files.
- Easy Installation: Get started in any Git repository with two commands.
Installation
You need to have a running Ollama instance with a model pulled (e.g., ollama pull codellama:latest).
Install the package using pip:
pip install git-guardian-ai
Usage
Navigate to your Git repository:
cd /path/to/your/project
Run the install command: This sets up the pre-commit hook in your repository's .git folder.
guardian install
(Optional) Configure Guardian: Create a .guardian.toml file in the root of your repository to customize the settings.
# .guardian.toml
model = "llama3:8b"
block_on = ["security", "logic"]
warn_on = ["performance", "style"]
Now, whenever you run git commit, the Guardian will automatically analyze your staged changes!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_git_guardian-0.1.0.tar.gz.
File metadata
- Download URL: ai_git_guardian-0.1.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1f7fecff1eb0a86f454c86d3ff12963280d351513d7e32e2a62a891a86c7f68
|
|
| MD5 |
6cd165ae1ddf183a5ef698988885b948
|
|
| BLAKE2b-256 |
4a57beb8316cd5dffd7334e9755ed3a5b3981e4f62e836721f8f75f33df0b94a
|
File details
Details for the file ai_git_guardian-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ai_git_guardian-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f022fa209d117732a3d0e239e29dc5388e104d986574735a6a5ac391ea71947
|
|
| MD5 |
16b335dde3ab045e178f150cf63b48e8
|
|
| BLAKE2b-256 |
b84daca6a7227a4f7e8717cb8bc2def8f21e77f977f4dcd661e90d8568acc6f2
|