A powerful interactive CLI tool for generating Conventional Commit messages with AI assistance. Built with Deno and TypeScript.
- Multiple AI Providers: OpenAI, Google Gemini, Anthropic Claude, and Groq
- Intelligent Analysis: AI analyzes your git diff and suggests appropriate commit messages
- Customizable Models: Choose from various models for each provider
- Smart Fallback: Falls back to manual mode if AI generation fails
- File Staging: Interactive file selection with visual indicators
- Conventional Commits: Full support for all commit types
- Rich Prompts: Beautiful CLI interface with color-coded messages
- Edit & Regenerate: Edit AI suggestions or regenerate new ones
- Scope Suggestions: Common scopes + custom scope support
- Persistent Settings: Stores API keys and preferences locally
- Easy Setup: Simple configuration wizard
- Provider Switching: Easily switch between AI providers
- Secure Storage: API keys stored in
~/.config/auto-commit/config.json
- Deno 1.30 or higher
deno run --allow-run --allow-net --allow-write --allow-env --allow-read https://raw.githubusercontent.com/vineyrawat/auto-commit/refs/heads/main/main.tsdeno install --allow-run --allow-net --allow-write --allow-env --allow-read --global -n auto-commit https://raw.githubusercontent.com/vineyrawat/auto-commit/refs/heads/main/main.tsNow you can run:
auto-commit# Generate commit with AI (if configured)
auto-commit
# Force AI generation
auto-commit --ai
# Skip file staging selection
auto-commit -s
# Dry run (preview without committing)
auto-commit -d
# Skip git hooks
auto-commit -n# Open configuration wizard
auto-commit configConfiguration options:
- Select AI Provider - Choose between OpenAI, Gemini, Anthropic, or Groq
- Set API Key - Configure your API key for the selected provider
- Set AI Model - Choose specific model for your provider
- View Current Config - Display current settings
- Clear Config - Reset all configuration
- API Key: Get at platform.openai.com/api-keys
- API Key: Get at aistudio.google.com/app/apikey
- API Key: Get at console.anthropic.com/settings/keys
- API Key: Get at console.groq.com/keys
auto-commit- View all changed files (staged, modified, untracked)
- Select/deselect files with spacebar
- Staged files are pre-selected
- Skip with
--skip-stagingflag
If configured, you'll be prompted:
- Use AI: Analyzes git diff and generates commit message
- Preview: View generated message with type, scope, description, and body
- Actions:
- β Use this commit message
- βοΈ Edit the commit message (description, type, scope, body, breaking change)
- π Regenerate with AI
- βοΈ Create manually
Step-by-step prompts for:
- Type: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
- Scope: Choose from common scopes or enter custom
- Description: Short summary (imperative mood)
- Body: Optional detailed explanation
- Breaking Change: Flag and describe if breaking
- Footers: Add references, issue numbers, reviewers, etc.
- Review formatted commit message
- Confirm or cancel
- Commit with optional
--no-verifyflag
| Type | Description | Example |
|---|---|---|
feat |
New feature | feat(auth): add OAuth2 login |
fix |
Bug fix | fix(api): resolve null pointer error |
docs |
Documentation | docs: update installation guide |
style |
Code formatting | style: fix indentation |
refactor |
Code restructure | refactor(core): simplify validation logic |
perf |
Performance improvement | perf(db): optimize query execution |
test |
Add/update tests | test(api): add integration tests |
build |
Build system changes | build(deps): upgrade to deno 2.0 |
ci |
CI/CD changes | ci: add GitHub Actions workflow |
chore |
Maintenance tasks | chore: update .gitignore |
revert |
Revert previous commit | revert: rollback auth changes |
Pre-configured scopes for faster workflow:
api- API related changesauth- Authentication/Authorizationui- User interface changesdb- Database changesconfig- Configuration changesdeps- Dependencies updatecore- Core functionalityutils- Utility functions- Plus more...
$ auto-commit --ai
π€ Generating commit message with AI...
π€ AI Generated Commit Message (Google Gemini):
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
feat(auth): implement OAuth2 authentication flow
Add OAuth2 provider integration with Google and GitHub.
Includes token refresh mechanism and session management.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Use this commit message$ auto-commit
Select the type of change: feat
Select a scope: api
Enter a short description: migrate to v2 endpoints
Add a detailed body? Yes
Enter the commit body:
Migrate all REST endpoints to v2 schema.
Deprecate v1 endpoints (EOL: 2025-12-31).
Is this a BREAKING CHANGE? Yes
Describe the breaking change:
V1 API endpoints are no longer supported.
Clients must update to v2 endpoints.
π Final commit message:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
feat(api)!: migrate to v2 endpoints
Migrate all REST endpoints to v2 schema.
Deprecate v1 endpoints (EOL: 2025-12-31).
BREAKING CHANGE: V1 API endpoints are no longer supported.
Clients must update to v2 endpoints.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Commit successful!- Runtime: Deno 2.0+
- CLI Framework: Cliffy for interactive prompts
- Git Operations: Native Deno
CommandAPI - AI Integration: Direct API calls to OpenAI, Gemini, Anthropic, and Groq
- β Zero dependencies (except Cliffy)
- β Secure local config storage
- β Graceful error handling
- β Color-coded terminal output
- β
Git hook support with
--no-verify - β Dry-run mode for testing
- β File staging with visual feedback
- β AI-powered commit generation with fallback
- β Multi-provider AI support
--allow-run: Execute git commands--allow-read: Read git repository and config--allow-write: Write commits and config--allow-env: Access environment variables--allow-net: Make API calls to AI providers
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes using this tool! (
auto-commit) - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License Β© 2025 Viney Rawat
Made with β€οΈ by @vineyrawat, for developers
Need help? Found a bug? Open an issue
