@miguelabarcavaldivia/aicommit
v1.0.1
Published
AI-powered commit message generator and code review tool
Maintainers
Readme
@miguelabarcavaldivia/aicommit
AI-powered commit message generator and code review CLI tool.
npx @miguelabarcavaldivia/aicommit generateNo installation required.
Commands
| Command | Description |
|---------|-------------|
| aicommit generate | Generate a commit message from staged changes |
| aicommit review | Review the latest commit |
| aicommit suggest | Suggest improvements for unstaged changes |
| aicommit changelog | Generate a changelog from recent commits |
| aicommit init | Create a .aicommitrc configuration file |
Quick Start
# Create a config file
npx @miguelabarcavaldivia/aicommit init
# Edit .aicommitrc with your API key and provider
# Stage your changes
git add .
# Generate a commit message
npx @miguelabarcavaldivia/aicommit generate
# Review the latest commit
npx @miguelabarcavaldivia/aicommit review
# Get suggestions for unstaged changes
npx @miguelabarcavaldivia/aicommit suggest
# Generate a changelog
npx @miguelabarcavaldivia/aicommit changelog --count 30Or install globally:
npm install -g @miguelabarcavaldivia/aicommit
aicommit generateConfiguration
Create a .aicommitrc file in your project directory or home directory:
{
"provider": "openai",
"model": "gpt-4o",
"apiKey": "sk-...",
"maxTokens": 1000,
"conventionalCommits": true,
"emoji": false,
"language": "en",
"maxDiffLength": 15000
}AI Providers
| Provider | Config Value | Default Model | API Key Env Var |
|----------|-------------|---------------|-----------------|
| OpenAI | openai | gpt-4o | OPENAI_API_KEY |
| Anthropic | anthropic | claude-3-5-sonnet-latest | ANTHROPIC_API_KEY |
| Gemini | gemini | gemini-2.0-flash | GEMINI_API_KEY |
API keys are resolved in this order:
AICOMMIT_API_KEYenvironment variableapiKeyfield in.aicommitrc- Provider-specific env var (
OPENAI_API_KEY,ANTHROPIC_API_KEY,GEMINI_API_KEY)
CLI Options
# Disable conventional commits for this run
npx aicommit generate --no-conventional
# Enable emoji mode for this run
npx aicommit generate --emoji
# Specify commit count for changelog
npx aicommit changelog --count 50GitHub Actions
Add the following secret to your repository:
AICOMMIT_API_KEY— Your AI provider API keyAICOMMIT_PROVIDER(optional) — Provider name (openai,anthropic,gemini)
The .github/workflows/review.yml workflow runs aicommit review on every PR.
Development
git clone ...
npm install
npm run build
node dist/cli.js generate