codefeed
v1.4.0
Published
A CLI tool to summarize git changes using AI.
Readme
Codefeed 🚀
Ever wondered what has changed in the repository since you last pulled? Have you wished for a high-level summary of all the recent updates, plus a clear breakdown of the changes in each individual file?
Codefeed is a CLI tool that answers these questions. It uses AI to analyze your git repository's recent changes and generates clear, high-level summaries for each branch and file, helping you quickly understand the evolution of your codebase.
Table of Contents
Getting Started
1. Get Your Gemini API Key
Codefeed uses the Google Gemini API to generate summaries.
- Go to Google AI Studio.
- Click "Get API key" and follow the instructions to create a new API key.
2. Set the Environment Variable
Your API key must be available as an environment variable named GEMINI_API_KEY.
Mac/Linux:
export GEMINI_API_KEY="YOUR_API_KEY_HERE"(To make this permanent, add it to your shell's startup file, like ~/.zshrc or ~/.bashrc)
Windows (Command Prompt):
setx GEMINI_API_KEY "YOUR_API_KEY_HERE"3. Install Codefeed
npm install -g codefeed4. Run Codefeed
- Navigate to any local git repository:
cd /path/to/your/project - Run the command:
codefeed - Your browser will open with the dashboard, and the analysis will begin.
Note: Codefeed is smart! If you run it again without any new commits or pulls, it won't re-run the analysis. It knows the work has already been summarized. To generate a new analysis, you need to either
git pullnew changes or make new local commits.
Example: No New Changes
If you run codefeed when there are no new commits since the last analysis, you'll see a message like this, and the tool will simply open the dashboard without re-running anything:
user@machine project % codefeed
Dashboard is available at: http://localhost:8000
? Open in browser? Yes
? What would you like to do next? (Use arrow keys)
❯ Re-analyze
Exit Fetching latest changes...
Analyzing branch: main
Changes since last pull (6ae75c9)...
Analysis for main between 6ae75c9 and f5e0f16 already exists. Skipping.
No new changes detected on analyzed branches.Example: Forcing a Re-analysis
Even if an analysis for a set of changes already exists, you can force the tool to run it again by selecting "Re-analyze" from the menu.
user@machine project % codefeed
Dashboard is available at: http://localhost:8000
? Open in browser? No
Fetching latest changes...
Analyzing branch: main
Changes since last pull (6ae75c9)...
Analysis for main between 6ae75c9 and f5e0f16 already exists. Skipping.
No new changes detected on analyzed branches.
? What would you like to do next? Re-analyze
Fetching latest changes...
Analyzing branch: main
Changes since last pull (6ae75c9)...
Found 112 changed file(s) to analyze.
More than 10 files in the diff. Analyzing in 12 batches...
Analyzing batch 1 of 12...
Analyzing batch 2 of 12...
...
Analyzing batch 12 of 12...
Analysis saved to /path/to/project/.codefeed/analyses/2025-08-09T05-16-53.934Z.json
? What would you like to do next? ExitWhat is Codefeed?
Tired of deciphering long, complex git logs? Codefeed connects to Google's powerful Gemini AI model to do the heavy lifting for you.
Run a single command in your repository, and Codefeed will:
- Analyze recent commits on your main and current branches.
- Generate a high-level summary of the overall changes.
- Provide a detailed summary for each modified file, focusing on the "why" behind the changes, not just the "what".
- Launch a local web dashboard for you to interactively explore the analysis.
Features
- 🌐 Interactive Dashboard & Analysis History: The dashboard displays a series of analyses. Each analysis is a snapshot of the changes made since your last
git pull, captured at the moment you run the tool. This creates a historical timeline, allowing you to browse and review summaries from different points in your development process. While an analysis is running, the dashboard will show a clear "Analysis in progress..." message.
- 🤖 AI-Powered Summaries: Leverages generative AI to create human-readable explanations of your code changes.
- 📄 Detailed Diff Viewer: A GUI-style diff viewer for each file, showing additions and deletions in a clear, hunk-by-hunk format.
- 🧠 Smart Analysis: Automatically detects the commit range since your last
git pulland analyzes your local work. - ⚡️ Efficient: Caches analyses to avoid re-processing the same commit ranges, saving you time and API calls.
- ⚙️ Configurable: Choose your preferred Gemini model (e.g.,
gemini-2.5-flash) during the initial setup.
Understanding the Feed: A Timeline of Your Work
❗️ Important: You won't see a feed of multiple analyses immediately in a new repository. Codefeed builds its history over time. Each time you run
codefeed, it creates one analysis summarizing the work done since your lastgit pull.
To see the feed grow, you need to introduce changes over time. Here’s a typical workflow:
Day 1: Your First Analysis
git clone https://github.com/some/project.gitcd project- Run
codefeed- Result: The first analysis is created. It establishes a baseline. The dashboard shows one item.
Day 2: New Changes
- Your team pushes updates to the remote repository.
- You run
git pullto get these updates. - You do some work and make a few of your own local commits.
- Run
codefeedagain.- Result: A new analysis appears in the dashboard. It summarizes all the changes (from the pull and your local work) that have occurred since the first run. You now have a feed of two analyses.
How It Works
Codefeed is designed to analyze the work you've done locally before you push it. It intelligently determines the correct range of commits to summarize by inspecting your repository's reflog.
- Finds the Last Sync Point: It scans the
reflog(a log of all localHEADmovements) to find the most recentgit pullorfetchfrom your remoteorigin. This marks the starting point. - Gets Your Current State: It uses your current
HEADas the ending point. - Generates the Diff: It creates a diff between these two points and sends it to the AI for summarization.
Because the reflog is stored locally in your .git directory, Codefeed can find your last sync point even if you installed it long after you last pulled.
✔️ Local Commits are Included
Because Codefeed analyzes the commits up to your current HEAD, it will include all local commits you have made, even if you haven't pushed them to the remote repository yet. This is perfect for summarizing your work before creating a pull request.
❌ Unstaged Changes are Not Included
Codefeed operates on your repository's commit history. Therefore, it does not see or analyze any unstaged or uncommitted changes. Always commit your work before running codefeed to ensure it's included in the analysis.
License
This project is licensed under the MIT License.
