AI-powered CLI tool for generating conventional commit messages and branch names based on your code changes.
- 🤖 AI-Powered Commit Messages: Generate meaningful commit messages using OpenAI, Anthropic, or Google models.
- 🌿 AI-Powered Branch Names: Generate conventional branch names based on your staged changes.
- 📝 Conventional Commit Format: Follows the conventional commit standard.
- 🔍 Smart File Analysis: Analyzes staged files and their diffs for context-aware messages and branch names.
- ⚡ Quick Commands: Simple CLI commands and aliases for fast workflow: analyze, generate, and commit or branch within a single command.
- 🎨 Beautiful Output: Colorful, user-friendly CLI interface.
- 🔧 Easy Configuration: Interactive setup for AI provider and API key.
npm install -g @cwdpk/cocommitgit clone <repository-url>
cd cocommit
npm install
npm run build
npm linkcocommit configFollow the prompts to select your provider and enter your API key. This will be saved to ~/.cocommit-config.json.
Stage your changes, then run:
cocommit commitOr use the alias:
cocommit cYou can also provide your own message:
cocommit commit -m "your message"Stage your changes, then run:
cocommit branch newOr use the alias:
cocommit b nYou can also provide your own branch name:
cocommit branch new -n "your-branch-name"The tool will suggest an AI-generated branch name based on your staged changes, and prompt for confirmation or a custom name before creating and checking out the new branch.
cocommit status- OpenAI (GPT-4o, GPT-4o-mini, GPT-3.5 Turbo)
- Anthropic (Claude 3.5 Sonnet, Haiku, Opus)
- Google (Gemini 1.5 Pro, Flash)
- Location:
~/.cocommit-config.json - Stores: provider, model, and API key
- Node.js v16 or higher
- An API key from your chosen AI provider
MIT