quinneden/acmsg

一个使用 OpenRouter API 自动生成 git commit message 的工具。

介绍

这是一个用 Python 编写的命令行工具,它使用 OpenRouter API 通过 AI 模型生成 git commit message

Create Release and Publish to PyPI Run Tests

功能特性

前置条件

安装

使用 pipx

pipx install acmsg

使用 nix

使用 flakes (例如:nixos/nix-darwin/home-manager):

# 将 `acmsg` 添加到你的 flake inputs
inputs.acmsg.url = "github:quinneden/acmsg";
# 添加 nixpkgs overlay 并将 package 包含在你的配置中
nixpkgs.overlays = [ inputs.acmsg.overlays.default ];
environment.systemPackages = [ pkgs.acmsg ];
# 或者 home.packages = [ pkgs.acmsg ];
# 也可以直接从 inputs 中包含 package
environment.systemPackages = [ inputs.acmsg.packages.${pkgs.system}.acmsg ];

使用独立的 profile:

$ nix profile install "github:quinneden/acmsg"

配置

配置文件位于 ~/.config/acmsg/config.yaml

首次运行 acmsg 时,会提示你配置 OpenRouter API token。你也可以运行以下命令:

$ acmsg config set api_token <your_api_token>

用法

usage: acmsg [-h] [--version] {commit,config} ...
Automated commit message generator
positional arguments:
 {commit,config} Commands
  commit     generate a commit message
  config     manage configuration settings
options:
 -h, --help    show this help message and exit
 --version    display the program version and exit

许可证

acmsg 使用 MIT 许可证,许可证文件包含在 LICENSE 文件中。