aicommit

command module
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2026 License: MIT Imports: 2 Imported by: 0

README

aicommit

中文

AI-powered Git commit message generator. Reads your staged changes and uses an AI model to generate a Conventional Commits message.

Features

  • Generates commit messages following Conventional Commits specification
  • Supports any OpenAI-compatible API (OpenAI, DeepSeek, OpenRouter, Bailian, etc.)
  • Interactive setup wizard with built-in provider presets
  • Edit, regenerate, or reject generated messages before committing
  • Validates message format and re-checks after manual edits
  • Environment variable overrides for CI and power users

Install

curl (macOS / Linux):

curl -fsSL https://raw.githubusercontent.com/wungjyan/aicommit/main/scripts/install.sh | sh

npm:

npm i -g @wungjyan/aicommit

go install:

go install github.com/wungjyan/aicommit@latest

Build from source:

git clone https://github.com/wungjyan/aicommit.git
cd aicommit
go build -o aicommit .

Quick Start

1. Set up your AI provider:

aicommit ai --setup

The wizard shows built-in presets (OpenAI, DeepSeek, OpenRouter, Bailian) with correct URLs and models pre-filled, then verifies the connection before saving.

2. Generate a commit message:

git add .
aicommit

The tool reads your staged diff, sends it to the AI, and shows the generated message. Choose:

Key Action
Enter Commit with the generated message
e Edit the message in your $EDITOR
r Regenerate a new message
q Quit without committing

Configuration

Config is stored at ~/.aicommit/config.json. You can view it with:

aicommit ai
Environment Variables

Environment variables take priority over the config file:

Variable Description
OPENAI_API_KEY API key
OPENAI_BASE_URL Base URL (e.g. https://api.deepseek.com/v1)
OPENAI_MODEL Model name (e.g. deepseek-chat)

This is useful for CI or when you want to override settings without changing the config file.

Supported Providers

The setup wizard includes presets for:

  • OpenAIhttps://api.openai.com/v1 / gpt-4o-mini
  • DeepSeekhttps://api.deepseek.com/v1 / deepseek-chat
  • OpenRouterhttps://openrouter.ai/api/v1 / openai/gpt-4o-mini
  • Bailianhttps://dashscope.aliyuncs.com/compatible-mode/v1 / qwen3.5-plus
  • Custom — any OpenAI-compatible endpoint

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
ai
git
ui

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL