DiffGraph-CLI is a powerful command-line tool that visualizes code changes using AI. It reads your current git diffs and untracked files, uses AI to understand the implications of your changes, and generates a beautiful, shareable HTML report with a dependency graph.
- 📊 Visualizes code changes as a dependency graph
- 🤖 AI-powered analysis of code changes
- 🌙 Dark mode support
- 📝 Markdown-formatted summaries
- 🔍 Syntax highlighting for code blocks
- 📱 Responsive design
- 🔄 Works with both tracked and untracked files
- Clone the repository:
git clone https://github.com/yourusername/DiffGraph-CLI.git
cd DiffGraph-CLI
- Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate # On Windows, use: venv\Scripts\activate
- Install the package:
pip install -e .
- Set up your OpenAI API key:
# Create a .env file in the project root
cp .env.example .env # On Windows, use: type nul > .env
Add your OpenAI API key to the .env file
Note: The
.env
file is git-ignored for security reasons. Make sure to keep your API key secure and never commit it to version control.
Basic usage:
wild
This will:
- Read your current git changes
- Analyze them using AI
- Generate an HTML report (
diffgraph.html
) - Open the report in your default browser
--api-key
: Specify your OpenAI API key (defaults to OPENAI_API_KEY environment variable)--output
or-o
: Specify the output HTML file path (default: diffgraph.html)--no-open
: Don't automatically open the HTML report in browser--version
: Show version information
Example:
wild --output my-report.html --no-open
The generated HTML report includes:
- A summary of code changes
- A Mermaid.js dependency graph
- Syntax-highlighted code blocks
- Dark mode support
- Responsive design for all screen sizes
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
- Mermaid.js for graph visualization
- Highlight.js for syntax highlighting
- Tailwind CSS for styling
- OpenAI for AI capabilities