Skip to main content

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:


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

  • Go to github.com → Settings
  • Click Developer Settings → Personal Access Tokens → Tokens (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 Key → Create 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 Keys → Create 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.

Metadata

Release files for commitgpt-nikesh 1.0.0

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

Source distribution (sdist)

Source distribution for commitgpt-nikesh 1.0.0
File Size Uploaded
commitgpt_nikesh-1.0.0.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for commitgpt-nikesh 1.0.0
File Interpreter ABI Platform
commitgpt_nikesh-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.1 kB

Release files / commitgpt_nikesh-1.0.0.tar.gz

Download URL commitgpt_nikesh-1.0.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
83fc0ff9890483285dfa96bd603ceaa64b404a320805a803e4406bac32dcd730
BLAKE2b-256 checksum
How to use checksums
a4e381116882186a12d8d86258b64dbf5a039a528c5e8dd30bcd82249ff81f45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / commitgpt_nikesh-1.0.0-py3-none-any.whl

Download URL commitgpt_nikesh-1.0.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d909711383cbcaa715fdcd472683036e60a74c4deefb6d50c5104983294f154e
BLAKE2b-256 checksum
How to use checksums
b958357a47c1d2ee2d2417fc374c9aa613b0f9e9fbec88ab479adb7ef0071703
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

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