Skip to main content

AI 生成 commit message

Project description

FastCommit

AI 生成 Git Commit Message - 使用大模型自动分析暂存区修改并生成标准的提交信息

安装

pip install fastcommit

快速开始

1. 首次运行配置

第一次运行 fsc 时,会自动提示你输入 API 配置信息:

$ fsc
==================================================
🚀 欢迎使用 FastCommit!
==================================================
首次运行需要配置 API 信息

请输入以下信息:
API Base URL (默认: https://api.deepseek.com/): 
API Key (必填): sk-your-api-key-here
模型名称 (默认: deepseek-reasoner): 
语言 (默认: en): zh

✅ 配置已保存!
📁 配置文件位置: /path/to/python/site-packages/fastcommit/user_config.json
==================================================

2. 使用

# 1. 添加文件到暂存区
git add .

# 2. 生成 commit message
fsc

# 3. 查看暂存区状态
fsc --status

# 4. 查看配置
fsc config --show

💡 使用示例

$ git add src/main.py README.md tests/
$ fsc
正在分析暂存区修改...

修改的文件 (3 ):
  新增: src/main.py
  修改: README.md  
  新增: tests/test_main.py

生成的 Commit Message:
==================================================
feat(main): 添加用户登录功能模块

实现了用户登录验证逻辑,包括:
- 密码加密和安全验证
- 会话管理和状态维护
- 错误处理和用户提示
==================================================

是否使用此消息进行提交? (y/n/e): y
✅ 提交成功!

配置管理

配置文件

配置文件自动保存在 fastcommit 模块安装目录下:fastcommit/user_config.json

{
  "api_base": "https://api.deepseek.com/",
  "api_key": "your_api_key_here",
  "model": "deepseek-reasoner",
  "language": "en"
}

配置选项说明

选项名 描述 默认值
api_base API 基础 URL https://api.deepseek.com/
api_key API 密钥 (必填)
model 使用的模型 deepseek-reasoner
language 提交信息语言 (zh/en) en

重新配置

# 交互式重新配置
fsc config

# 或单独设置某个选项
fsc config --api-key your_new_api_key
fsc config --api-base https://api.openai.com/v1
fsc config --model gpt-4
fsc config --language zh

📖 命令行选项

fsc --help                      # 显示帮助信息
fsc --version                   # 显示版本信息
fsc --status                    # 显示暂存区文件状态
fsc config                      # 交互式配置
fsc config --show               # 显示当前配置
fsc config --api-key KEY        # 设置 API Key
fsc config --api-base URL       # 设置 API Base URL
fsc config --model MODEL        # 设置模型
fsc config --language LANG      # 设置语言 (zh/en)

参考

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

fastcommit-0.0.4.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

fastcommit-0.0.4-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file fastcommit-0.0.4.tar.gz.

File metadata

  • Download URL: fastcommit-0.0.4.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Darwin/23.4.0

File hashes

Hashes for fastcommit-0.0.4.tar.gz
Algorithm Hash digest
SHA256 f236870e85b5496c124e79bcd40043011249babe0939a966a1a581a469de7d3d
MD5 71ea1eece7df3e666f475c010cc89b2e
BLAKE2b-256 f8d5febca1635165aff204191cadaa39802600dea61a1a27296cf34eba62290e

See more details on using hashes here.

File details

Details for the file fastcommit-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: fastcommit-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Darwin/23.4.0

File hashes

Hashes for fastcommit-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 aebdae400a97be3b9cbf8ab3841f30a62a551f9e3ae71388d52c58f0c4e059b9
MD5 a77f58a3dc5df21bf9dffedaa510e445
BLAKE2b-256 624a884fb85739faf1d020cae3c44d998db1bfb0e19a9b4d79d11b25354fde41

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