AI-powered git commit message generator with GPT-5-nano support π
npm install alcapushgpt-4o-mini if GPT-5-nano is unavailable
acp config test
describe and test subcommands
bash
npm install -g alcapush
`
π Quick Start
1. Configure your API key:
`bash
acp config set ACP_API_KEY=sk-your-openai-api-key
`
2. Make some changes to your code
3. Generate and commit:
`bash
acp
`
That's it! Alcapush will:
- Analyze your changes
- Generate a meaningful commit message
- Ask for confirmation
- Commit your changes
π― Usage
$3
`bash
Generate commit for staged changes
acp
Auto-commit without confirmation
acp --yes
Add additional context
acp -c "Fixing bug reported in issue #123"
Use full GitMoji specification
acp --fgm
`
$3
`bash
Set configuration
acp config set KEY=VALUE
Get configuration value
acp config get KEY
List all configuration
acp config list
Describe configuration options
acp config describe
acp config describe ACP_MODEL
Test your configuration
acp config test
`
$3
`bash
Install git hooks (prepare-commit-msg and commit-msg)
acp hook install
Check hook status
acp hook status
Uninstall git hooks
acp hook uninstall
`
Installed Hooks:
- prepare-commit-msg: Automatically generates commit messages when you run git commit without a message
- commit-msg: Validates commit messages against Conventional Commits specification
After installing hooks, you can simply run git commit and Alcapush will automatically generate and validate your commit messages!
$3
`bash
View commit history (last 50 commits)
acp history
View commit history with custom limit
acp history 20
Clear commit history
acp history clear
Add a commit message to favorites
acp favorite add "feat: add user authentication"
Remove a commit message from favorites
acp favorite remove "feat: add user authentication"
List all favorites (sorted by usage)
acp favorite list
`
Features:
- π Automatic History: All commits are automatically saved to history with branch information
- β Favorites: Save frequently used commit message patterns for quick reference
- π Usage Tracking: Favorites are sorted by usage count to show your most-used patterns
- π Branch Context: History includes branch information for better context
$3
Split large changes into multiple logical commits with AI-powered grouping:
`bash
Split changes into 3 commits
acp batch 3
Include unstaged changes
acp batch 3 --all
Auto-commit without confirmation
acp batch 3 --yes
Add context to commit messages
acp batch 3 --context "Refactoring authentication system"
`
How it works:
1. AI analyzes all your changed files
2. Groups related files together based on functionality, dependencies, and feature boundaries
3. Creates logical commit groups (e.g., "User authentication feature", "Update dependencies")
4. Generates commit messages for each group
5. Commits each group separately
Example:
`bash
$ acp batch 2
β Found 5 file(s) with changes
β Grouped into 2 commit(s)
π¦ Will create 2 commit(s):
1. User authentication feature (3 files)
Adds login and registration functionality with related utilities
Files: src/auth.ts, src/login.ts, test/auth.test.ts
2. Update dependencies (2 files)
Updates package.json with new dependency versions
Files: package.json, package-lock.json
β Generated 2 commit message(s)
`
Features:
- π€ AI-Powered Grouping: Intelligently groups related files together
- π Logical Commits: Creates meaningful, atomic commits
- π Smart Validation: Only commits files that actually have changes
- β‘ Automatic Staging: Handles file staging/unstaging automatically
- π― Context-Aware: Uses branch context to improve grouping decisions
$3
Alcapush automatically detects your current branch and includes branch context in commit message generation:
`bash
On feature/user-auth branch
git checkout -b feature/user-auth
acp
AI will suggest: feat(user-auth): ... based on branch name
On fix/login-bug branch
git checkout -b fix/login-bug
acp
AI will suggest: fix(login-bug): ... based on branch name
On hotfix/security-patch branch
git checkout -b hotfix/security-patch
acp
AI will suggest: fix(security-patch): ... based on branch name
`
Supported Branch Patterns:
- feature/ or feat/ β Suggests feat type
- fix/ or bugfix/ β Suggests fix type
- hotfix/ β Suggests fix type
- chore/ β Suggests chore type
- docs/ β Suggests docs type
- refactor/ β Suggests refactor type
- test/ β Suggests test type
- perf/ β Suggests perf type
- release/ β Suggests chore type
Scope Extraction:
- Automatically extracts scope from branch names (e.g., feature/user-auth β scope: user-auth)
- Cleans up ticket numbers and other patterns (e.g., feature/JIRA-123-auth β scope: auth)
- Works with multi-level branch names (e.g., feature/api/user-auth β scope: api/user-auth)
βοΈ Configuration Options
| Option | Description | Default |
|--------|-------------|---------|
| ACP_API_KEY | API key for the AI provider | - |
| ACP_AI_PROVIDER | AI provider (openai, anthropic, gemini, ollama) | openai |
| ACP_MODEL | Model name | gpt-5-nano (fallback: gpt-4o-mini) |
| ACP_TOKENS_MAX_INPUT | Max input tokens | 4096 |
| ACP_TOKENS_MAX_OUTPUT | Max output tokens | 500 |
| ACP_EMOJI | Enable GitMoji emojis | false |
| ACP_LANGUAGE | Language for commit messages | en |
| ACP_DESCRIPTION | Add detailed description | false |
| ACP_ONE_LINE_COMMIT | Generate one-line commits | false |
| ACP_API_URL | Custom API URL | - |
π€ AI Provider Setup
$3
`bash
acp config set ACP_AI_PROVIDER=openai
acp config set ACP_API_KEY=sk-...
acp config set ACP_MODEL=gpt-5-nano # or gpt-4o, gpt-4o-mini
`
$3
`bash
acp config set ACP_AI_PROVIDER=anthropic
acp config set ACP_API_KEY=sk-ant-...
acp config set ACP_MODEL=claude-3-5-sonnet-20241022
`
$3
`bash
acp config set ACP_AI_PROVIDER=gemini
acp config set ACP_API_KEY=your-gemini-key
acp config set ACP_MODEL=gemini-pro
`
$3
`bash
Start Ollama first
ollama run mistral
Configure Alcapush
acp config set ACP_AI_PROVIDER=ollama
acp config set ACP_MODEL=mistral
`
π¨ Examples
$3
`bash
acp config set ACP_EMOJI=true
acp
Output: β¨ feat: add user authentication
`
$3
`bash
acp config set ACP_DESCRIPTION=true
acp
Output:
feat: add user authentication
#
Implemented JWT-based authentication system with login and
registration endpoints. Added middleware for protected routes.
`
$3
`bash
acp config set ACP_LANGUAGE=es
acp
Output: feat: agregar autenticaciΓ³n de usuario
`
$3
`bash
acp config set ACP_ONE_LINE_COMMIT=true
acp
Output: feat: add user authentication
`
$3
`bash
View your commit history
$ acp history
π Commit History (last 10 commits):
1. feat(auth): add user authentication [feature/user-auth] β
12/15/2024, 2:30:45 PM
2. fix(login): resolve session timeout bug [fix/login-bug]
12/15/2024, 1:15:20 PM
3. docs: update API documentation [main]
12/14/2024, 4:22:10 PM
`
$3
`bash
Add frequently used patterns
$ acp favorite add "feat: add new feature"
β
Added to favorites: feat: add new feature
$ acp favorite add "fix: resolve bug"
β
Added to favorites: fix: resolve bug
List favorites
$ acp favorite list
β Favorites (2):
1. feat: add new feature (used 5x)
Added: 12/10/2024
2. fix: resolve bug (used 3x)
Added: 12/08/2024
`
$3
`bash
Create a feature branch
$ git checkout -b feature/payment-integration
Make changes and commit
$ acp
AI will automatically:
- Detect branch type: feature
- Extract scope: payment-integration
- Suggest commit type: feat
- Include branch context in prompt
Generated message might be:
feat(payment-integration): add Stripe payment integration
`
π° Cost Estimation
Alcapush provides real-time cost estimation before generating commit messages, helping you understand the API usage and costs upfront.
$3
Before generating a commit message, Alcapush displays:
- Input tokens: Estimated tokens in your diff and prompts
- Output tokens: Estimated tokens for the generated message
- Estimated cost: Calculated cost in USD based on your selected model
$3
`bash
$ acp
π Usage Estimate:
Input tokens: 1,234
Output tokens (estimated): 500
Estimated cost: $0.000062
Proceed with generating commit message? βΊ (Y/n)
`
$3
Alcapush includes up-to-date pricing for popular models:
| Model | Input (per 1M tokens) | Output (per 1M tokens) |
|-------|---------------------|----------------------|
| GPT-5-nano | $0.05 | $0.40 |
| GPT-4o-mini | $0.15 | $0.60 |
| GPT-4o | $2.50 | $10.00 |
| Claude 3.5 Sonnet | $3.00 | $15.00 |
| Gemini Pro | $0.50 | $1.50 |
| Ollama (local) | Free | Free |
Pricing is automatically calculated based on current API rates (verified November 2024)
$3
- Use gpt-5-nano or gpt-4o-mini for the lowest costs
- Use Ollama for free local processing
- Adjust ACP_TOKENS_MAX_OUTPUT to limit output token usage
- Use ACP_TOKENS_MAX_INPUT to control input size for large diffs
πΈ Screenshots
$3
!Cost Estimation
Real-time cost estimation before generating commit messages
$3
!GPT-5-nano
Native GPT-5-nano integration with optimized API handling
$3
!Config Test
Test your AI provider configuration with acp config test
$3
!Progress Indicators
Beautiful CLI with colorful progress indicators and better feedback
$3
!Auto Fallback
Automatic fallback to gpt-4o-mini when GPT-5-nano is unavailable
$3
!Error Handling
Descriptive error messages with troubleshooting tips
$3
!Config Management
Enhanced configuration commands with describe and test subcommands
π Comparison with OpenCommit
| Feature | Alcapush | OpenCommit |
|---------|-------------|------------|
| GPT-5-nano Support | β
| β |
| Auto-fallback Mechanism | β
| β |
| Cost Estimation | β
| β |
| Config Test Command | β
| β |
| Custom API URL Support | β
| β |
| Enhanced Error Messages | β
| β |
| Colorful CLI | β
| β
|
| Progress Indicators | β
| β |
| Multiple AI Providers | β
| β
|
| GitMoji Support | β
| β
|
| Config Management | β
| β
|
| Context Flag | β
| β
|
| Commit History | β
| β |
| Favorites | β
| β |
| Branch-Aware Commits | β
| β |
| Batch Commit Generation | β
| β |
π οΈ Development
`bash
Clone the repository
git clone https://github.com/dablon/alcapush.git
cd alcapush
Install dependencies
npm install
Build
npm run build
Link locally
npm link
Test
acp
``