@tuanle03/aibranch
v1.2.0
Published
AI-powered git branch name generator with smart detection
Maintainers
Readme
🌿 AI Branch
AI-powered git branch name generator - Never think of a branch name again!
🚀 Features
- 🤖 Smart Detection - Automatically detect branch type from file changes
- 🎯 Conventional Commits - Follow standard types (feat, fix, docs, etc.)
- ⚡️ Auto-Generate - AI analyzes changes and suggests branch names
- 🔧 Multiple AI Providers - OpenAI, TogetherAI, Ollama, Custom
- 🎨 Interactive CLI - Beautiful prompts powered by @clack/prompts
- ✅ Instant Creation - Create and checkout branch immediately
📦 Installation
From npm (recommended)
npm install -g @tuanle03/aibranchFrom GitHub Packages
# Configure npm to use GitHub Packages
echo "@tuanle03:registry=https://npm.pkg.github.com" >> ~/.npmrc
# Install
npm install -g @tuanle03/aibranch🔧 Setup
aibranch setupThis will guide you through:
- Selecting your AI provider
- Configuring your API key
💻 Usage
Quick Start
# If you have file changes, AI will auto-detect and suggest
aibranch
# Manual mode with description
aibranch -d "Add user authentication"
# Generate with specific type
aibranch -t feat -d "Add payment gateway"
# Auto-create branch
aibranch -c -d "Fix login bug"Options
aibranch [options]
Options:
-d, --description <text> Description of what the branch is for
-g, --generate <number> Number of branch names to generate (default: 3)
-t, --type <type> Branch type (feat/fix/docs/style/refactor/perf/test/chore/build/ci)
-c, --create Automatically create the selected branchExamples
# Auto-mode: AI detects changes and generates description
git add .
aibranch
# → 🤖 Auto-generate (AI analyzes your changes)
# Generate 5 branch names
aibranch -g 5 -d "Implement payment gateway"
# Generate bugfix branch
aibranch -t fix -d "Fix login redirect issue"
# Generate and auto-create branch
aibranch -c -d "Add email notifications"🎯 How It Works
Smart Detection
- Detects file changes in your working directory
- Analyzes file patterns to suggest branch type:
.mdfiles →docs.test.tsfiles →test.github/workflows/→citsconfig.json→chore- Source files →
feat
Auto-Generate Mode
- Analyzes your git diff and changed files
- Uses AI to generate a clear description
- Suggests appropriate branch type
- Creates multiple branch name options
- You select and create instantly
🤝 Contributing
Inspired by aicommits
📄 License
MIT © tuanle03
🙏 Credits
- aicommits - Original inspiration
- @clack/prompts - Beautiful CLI prompts
- Vercel AI SDK - AI integration
