**AI-Powered Git & Project Workflows in One CLI**
Stop wasting time on repetitive tasks. DevGen automates commits, changelogs, `.gitignore`, and license files using AI — from cloud providers or a local Ollama model.
> PyPI didn't allow the original name, so you'll find it as **devgen-cli** on PyPI
>

>

>

>

>
## Why DevGen
DevGen is a CLI for the parts of development that should be invisible. It writes Conventional Commits from your diff, drafts SemVer changelogs, fetches `.gitignore` and license templates, and routes everything through whichever AI provider you prefer — including a fully local Ollama model if you don't want to send code to the cloud.
## Features
- **AI-Powered Commits** — Conventional Commit messages generated from your staged diff, grouped by directory, with optional emoji prefixes.
- **Multiple Providers** — Google Gemini, OpenAI, Anthropic, OpenRouter, HuggingFace, and local Ollama, all behind one CLI.
- **Smart Caching** — `.gitignore` and license templates are cached for offline use; AI responses are de-duplicated.
- **Conventional Changelogs** — `feat`, `fix`, `refactor`, `perf`, `docs`, `test`, `build`, `ci`, `chore`, `style`, and a `BREAKING CHANGES` section.
- **Project Scaffolding** — Pull `.gitignore` from GitHub's collection and drop in SPDX license files (MIT, Apache-2.0, GPL-3.0, AGPL-3.0, BSD, MPL-2.0, …).
- **Custom Templates** — Override the commit-message prompt via a `.tpl` file in your config.
- **Interactive Setup** — `devgen setup` walks you through provider + API key + options.
- **Undo Support** — `devgen commit undo` rolls back the last AI commit while keeping changes staged.
- **Token-Limit Aware** — When a diff exceeds a model's context window, you get a single actionable error with `--max-groups` and `--max-diff-size` hints.
## Supported AI Providers
| Provider | Notes |
| ----------------- | ---------------------------------------------------- |
| **Google Gemini** | Default-friendly, generous free tier |
| **OpenAI** | GPT-4o, GPT-4.1, o-series |
| **Anthropic** | Claude 3.5 / 3.7 / 4 |
| **OpenRouter** | Single key, many models |
| **HuggingFace** | Inference API |
| **Ollama** | Fully local, no API key, no data leaves your machine |
## Installation
```bash
# Recommended: isolated environment
pipx install devgen-cli
# Or use uv for speed
uv tool install devgen-cli
# Or plain pip
pip install devgen-cli
# Shell completion (bash/zsh/fish)
devgen --install-completion
```
Requires **Python 3.10 or newer**.
## Quick Start
```bash
# 1. Configure a provider and API key
devgen setup config
# 2. Stage your work as usual
git add .
# 3. Let DevGen write the commit message
devgen commit run
# 4. Or preview first, then commit
devgen commit run --dry-run
devgen commit run --push
```
## Commands
| Command | Description |
| ------------------------------- | ----------------------------------------------------------------------------- |
| `devgen setup config` | Interactive provider / API key / options wizard |
| `devgen commit run` | Stage, generate message, commit (optionally `--push`, `--check`, `--dry-run`) |
| `devgen commit undo` | Undo the last AI commit, keep changes staged |
| `devgen changelog` | Generate a Conventional Commits changelog from recent history |
| `devgen release-notes` | Generate release notes for a version range |
| `devgen gitignore list` | List available GitHub `.gitignore` templates |
| `devgen gitignore add