Write Git commits the smart way.
Project description
GCM
基于大模型的 Git Commit Message 生成,支持所有 OpenAI 协议兼容的大模型服务
安装
pip install git-gcm
配置
设置环境变量:
export GCM_API_URL=https://api.openai.com/v1
export GCM_API_KEY=your-api-key
export GCM_MODEL=gpt-4o-mini
使用
git add .
gcm # 生成 commit message 并进入交互菜单
gcm -v # 生成详细 commit message 并进入交互菜单
gcm -f # 提交时跳过 git hooks(等价 git commit --no-verify)
gcm --print-only # 仅输出 message,不提交(用于脚本/管道)
运行 gcm 后会展示生成的 commit message,并用方向键导航的菜单让你选择:
- 提交此 message:选中后按 Enter 直接执行
git commit - 修改 message:在预填的编辑框里直接微调(支持多行,兼容
-v),Alt+Enter 提交后回到菜单 - 仅输出,不提交:只打印 message
↑↓ 移动选择,Enter 确认,ESC / Ctrl-C 取消。在管道或非交互终端(如
gcm | cat)中,gcm 会自动仅输出 message,不弹交互。
示例
精简模式:
feat(auth): 添加用户登录功能
详细模式 (-v):
feat(auth): 添加用户登录功能
- 实现 JWT token 认证
- 添加登录表单验证
- 集成第三方 OAuth 登录
MIT License
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
git_gcm-2.0.0.tar.gz
(11.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
git_gcm-2.0.0-py3-none-any.whl
(12.1 kB
view details)
File details
Details for the file git_gcm-2.0.0.tar.gz.
File metadata
- Download URL: git_gcm-2.0.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8ba04948ea03880b753170759cdb954c28925599c2a80fce95bd4f6f122b5d2
|
|
| MD5 |
4197e88b906fd3aeb857e4fc28bc1d71
|
|
| BLAKE2b-256 |
8f07c7c9362a81ea7f07713b9603ffa635ed7d76bfcf75c33f4c39be3bd5433c
|
File details
Details for the file git_gcm-2.0.0-py3-none-any.whl.
File metadata
- Download URL: git_gcm-2.0.0-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99ff4e37a41cc4bdfcd135e81d94b3e3d750a86be69290dc1f7a5a9076631802
|
|
| MD5 |
0443fd91eea5add8b0fe79ee35324860
|
|
| BLAKE2b-256 |
3b9865c0106a9d222db6cf0956700f4af9136b0b01e608b6bc51a7e9fd689b86
|