A simple command-line interface (CLI) tool that leverages AI agents to analyze Git commits for potential security and performance risks.
- Commit Summarization: Provides a concise summary of the changes in a given commit.
- Risk Analysis: Identifies potential security vulnerabilities and performance bottlenecks introduced in a commit.
- Code Review: Summaries and identifies potential vulnerabilities in repo diff before committing.
- Extensible LLM Support: Easily configure different Language Model (LLM) providers through CrewAI.
- File Content Retrieval: Agents can fetch the full content of a file for more in-depth analysis.
- External Information Search: Agents can search for information about identified risks and provide relevant links.
-
Clone the repository:
git clone https://github.com/chains229/git-analyzer.git cd git-analyzer -
Install dependencies using uv:
uv pip install -r requirements.txt
-
Set up your environment variables:
- Create a
.envfile from the.env.example:cp .env.example .env
- Open the
.envfile and add your Azure OpenAI API key. - You can custom the default model in
source/main.pyand the API key to use your preferred model.
- Create a
First, enter the virtual environment of this repo
-m venv .venv
source .venv/bin/activate # On Linux/macOS
.\.venv\Scripts\activate # On WindowsThen, cd to the repo that contains the commit you want to analyze (i know it sucks).
The main command to run the analyzer is ga.
- To summary a commit:
ga summary --commit <your-commit-id>- To analyze performance/security risk of a commit:
ga summary --commit <your-commit-id>- To review uncommitted code:
ga review--model: Choose the LLM you want.--output-dir: You can save the result into a .txt file by setting this argument. (dont think it's working)