Skip to main content

AI-powered commit messages, standups and PR descriptions from your git diff

Project description

commitgpt ⚡

AI-powered commit messages, standups, and PR descriptions — generated from your git diff in 2 seconds.

PyPI Python License


The problem

Every day as a developer you waste time writing:

  • git commit -m "fix" — lazy, meaningless commit messages
  • Standup updates — "what did I do yesterday??"
  • PR descriptions — explaining your changes all over again

commitgpt fixes all 3 with one command.


Demo

$ git add .
$ cmt

✨ feat(auth): add Google OAuth2 login with session timeout

- Implemented OAuth2 flow using Google provider
- Sessions expire after 30 mins of inactivity
- Fixed bug where users stayed logged in after password change
- Added redirect to dashboard on successful login

Install

pip install commitgpt

Setup

You only need ONE of these. Pick whichever you prefer:


Option 1 — GitHub Token (FREE, recommended)

Best for beginners. No credit card. 150 requests/day free.

  • Go to github.com → Settings
  • Click Developer SettingsPersonal Access TokensTokens (classic)
  • Click Generate new token (classic)
  • Give it any name, no scopes needed
  • Copy the token starting with ghp_

Create a .env file in your project:

GITHUB_TOKEN=ghp_your_token_here

Option 2 — Gemini (FREE, best free option)

Best free option. 1,500 requests/day free. No credit card.

  • Go to aistudio.google.com
  • Click Get API KeyCreate API key
  • Copy the key starting with AIza

Create a .env file in your project:

GEMINI_API_KEY=AIza_your_key_here

Option 3 — OpenAI (Paid)

Best quality. Costs roughly $0.001 per request.

  • Go to platform.openai.com
  • Click API KeysCreate new secret key
  • Copy the key starting with sk-proj-

Create a .env file in your project:

OPENAI_API_KEY=sk-proj-your_key_here

Option 4 — Anthropic Claude (Paid)

Great quality. Costs roughly $0.001 per request.

Create a .env file in your project:

ANTHROPIC_API_KEY=sk-ant-your_key_here

Make your token permanent

So you never have to set it again every time you open terminal:

Mac/Linux:

echo 'export GITHUB_TOKEN=ghp_yourtoken' >> ~/.zshrc
source ~/.zshrc

Windows:

setx GITHUB_TOKEN "ghp_yourtoken"

Usage

Commit message

git add .
cmt

Daily standup

cmt standup

Output:

Yesterday: Implemented OAuth2 login flow, fixed session expiry bug
Today: Writing tests for auth middleware, reviewing PR #42
Blockers: None

PR description

cmt pr

Output:

## What changed
Added Google OAuth2 login with automatic session timeout after 30 minutes.

## Why
Users were being kept logged in indefinitely, creating a security risk.

## Testing
- Manual: tested login, logout, session expiry
- Unit: auth middleware coverage at 94%
- Edge: concurrent login sessions handled correctly

Extra flags

cmt --emoji     # adds emoji to commit message
cmt --copy      # copies output to clipboard automatically

How the tool picks your API

You don't need to configure anything. Just put your key in .env and the tool automatically detects it in this order:

GITHUB_TOKEN     → GitHub Models (gpt-4o-mini)
GEMINI_API_KEY   → Gemini 2.0 Flash
OPENAI_API_KEY   → OpenAI gpt-4o-mini
ANTHROPIC_API_KEY → Claude Haiku

First key found = that provider gets used.


Requirements

  • Python 3.8+
  • Git installed
  • Any one API key from the options above

Troubleshooting

cmt: command not found

pip install commitgpt

Error: No API key found Make sure your .env file exists with one of these:

GITHUB_TOKEN=ghp_...
GEMINI_API_KEY=AIza...
OPENAI_API_KEY=sk-proj-...
ANTHROPIC_API_KEY=sk-ant-...

Not a git repository You need to be inside a git project. Run git init first.

No staged changes found Run git add . before running cmt

pip install fails Make sure Python 3.8+ is installed:

python --version

Contributing

Pull requests are welcome! Here's how:

  1. Fork the repo
  2. Create a branch: git checkout -b feat/your-feature
  3. Make your changes
  4. Use commitgpt to write your own commit message 😄
  5. Push and open a PR

License

MIT — free to use, modify and distribute.


Made by a developer who was tired of writing "fix" as a commit message.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

commitgpt_nikesh-1.0.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

commitgpt_nikesh-1.0.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file commitgpt_nikesh-1.0.0.tar.gz.

File metadata

  • Download URL: commitgpt_nikesh-1.0.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for commitgpt_nikesh-1.0.0.tar.gz
Algorithm Hash digest
SHA256 83fc0ff9890483285dfa96bd603ceaa64b404a320805a803e4406bac32dcd730
MD5 186cc83780f1d7814ae8a6dee987a932
BLAKE2b-256 a4e381116882186a12d8d86258b64dbf5a039a528c5e8dd30bcd82249ff81f45

See more details on using hashes here.

File details

Details for the file commitgpt_nikesh-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for commitgpt_nikesh-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d909711383cbcaa715fdcd472683036e60a74c4deefb6d50c5104983294f154e
MD5 0b9db3d4986d15c8a33a828ceaa2ac4e
BLAKE2b-256 b958357a47c1d2ee2d2417fc374c9aa613b0f9e9fbec88ab479adb7ef0071703

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page