Skip to main content

DevGen

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

PyPI Python License CI Pre-Commit

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 config 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

# 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

# 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 config set Same wizard, available under config
devgen config list Print the current configuration
devgen config edit <key> [v] Update a single configuration value
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 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 generate … Add .gitignore entries to the current project
devgen license generate Interactively add a LICENSE file to the current project

Run devgen <command> --help for full options on any subcommand.

Custom Templates

DevGen uses .tpl files for its commit prompt. To override the default, set custom_template in your config (see devgen config info) and point it at a .tpl file with {{ diff_text }}, {{ context }}, {{ group_name }}, and the conditional {% if use_emoji %} block.

Example minimal template:

{{ diff_text }}
Summarize the change above in one Conventional Commit line.

Architecture

DevGen is built around a small set of composable components:

  • BaseProvider — abstract base for every AI provider; handles API-key validation, token-limit detection, and error wrapping. Adding a new provider is one subclass with a single _generate() method.
  • GitOperator — all subprocess calls to git live here, behind a GitError exception.
  • DiffBuilder / FileGrouper / ManifestInspector — split a staged diff into per-directory groups with compact project context, so the model sees a focused slice instead of a wall of text.
  • Section enum — single source of truth for changelog ordering and emoji, shared by ChangelogGenerator and ReleaseNotesGenerator.

The CLI entry point is devgen.cli.main:app (Typer), exposed as the devgen script.

Development

git clone https://github.com/S4NKALP/DevGen.git
cd DevGen
uv sync --all-extras --dev      # install runtime + dev deps
uv run pre-commit run --all-files
uv run devgen --help

The project uses uv for dependency management, ruff for lint + format, and pyright for type checking. CI runs all three on Python 3.10 through 3.13 (see .github/workflows/ci.yml).

Contributing

Issues and PRs welcome. Please run uv run pre-commit run --all-files before opening a PR so CI stays green.

License

GPL-3.0-or-later. See LICENSE.

Acknowledgments

Built on the shoulders of:

  • Typer & Rich — CLI and terminal UI
  • Questionary — interactive prompts
  • Google Gemini, OpenAI, Anthropic, OpenRouter, HuggingFace, and Ollama — AI providers
  • Ruff — lint and format
Made with ❤️ by Sankalp

Metadata

Release files for devgen-cli 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for devgen-cli 0.3.1
File Size Uploaded Provenance Actions
devgen_cli-0.3.1.tar.gz 100.5 kB Without provenance Details for devgen_cli-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for devgen-cli 0.3.1
File Interpreter ABI Platform Actions
devgen_cli-0.3.1-py3-none-any.whl Python 3 none any Details for devgen_cli-0.3.1-py3-none-any.whl

Total release size: 220.2 kB

Release files / devgen_cli-0.3.1.tar.gz

Download URL devgen_cli-0.3.1.tar.gz
Size 100.5 kB
Tags Source
SHA-256 checksum
How to use checksums
829242bd3609f54400f634ef8bb5b7cf947189261b762e56638b4f5e59ba491e
BLAKE2b-256 checksum
How to use checksums
e6da997f3064eda3848f3dbf394a20bcbc42378303b4c2f26aaa447b017931cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / devgen_cli-0.3.1-py3-none-any.whl

Download URL devgen_cli-0.3.1-py3-none-any.whl
Size 119.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
365dfab42bece69e7dcf719d7e6ef37792a565362d98caa5a8508a0f4cb28248
BLAKE2b-256 checksum
How to use checksums
23eab30c75f96ee4f0fa0e56a50d3b5d1226edd38e27387ae65f2d24cf0878ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.10.22

Security for devgen-cli 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page