Git with a brain - intelligent Git wrapper with AI-powered commits, ghost branches, and predictive merge
npm install bit-cli-ai> Git with a brain - An intelligent Git wrapper with AI-powered commits, ghost branches, and predictive merge analysis.





bit status = git status).gitignore.bit Directory - Intelligent metadata storage separate from .git``bashInstall globally
npm install -g bit-cli
Quick Start
`bash
Initialize a new repository with smart defaults
bit initMake some changes, then commit with AI
git add .
bit commitCreate a ghost branch for experiments
bit branch --ghost experimentPreview merge conflicts before merging
bit merge --preview feature-branchCheck for team conflicts
bit hotzoneAnalyze code changes
bit analyze
`Commands
| Command | Description |
|---------|-------------|
|
bit init | Initialize repo with smart .gitignore and .bit directory |
| bit commit | AI-powered commit message generation |
| bit commit -m "msg" | Manual commit message |
| bit branch --ghost | Create a ghost (hidden) branch |
| bit branch | List all branches including ghost branches |
| bit checkout | Checkout a ghost branch |
| bit merge --preview | Preview merge conflicts |
| bit merge | Smart merge with conflict preview |
| bit hotzone | Detect overlapping work with team |
| bit analyze | Analyze code at function/symbol level |
| bit | Passthrough to git |Configuration
$3
`bash
Required for AI features
OPENAI_API_KEY=sk-your-key-hereOptional
BIT_AI_MODEL=gpt-4o-mini
BIT_DEBUG=true
BIT_LOG_LEVEL=debug
BIT_VERBOSE=true
`$3
Config stored in
~/.bit/config.json:`json
{
"ai": {
"provider": "openai",
"model": "gpt-4o-mini",
"maxTokens": 500,
"temperature": 0.7
},
"git": {
"ghostPrefix": "ghost/",
"autoStage": false
},
"ui": {
"colors": true,
"spinners": true
}
}
`$3
Project-specific config in
.bit/config.json overrides global settings.Architecture
`
bit-cli/
├── src/
│ ├── index.js # CLI entry point
│ ├── commands/ # Command implementations
│ │ ├── init.js
│ │ ├── commit.js
│ │ ├── branch.js
│ │ ├── merge.js
│ │ ├── hotzone.js
│ │ └── analyze.js
│ └── utils/ # Shared utilities
│ ├── ai.js # AI service
│ ├── config.js # Configuration management
│ ├── errors.js # Error handling
│ ├── git.js # Git operations
│ ├── logger.js # Logging
│ └── validation.js # Input validation
├── tests/ # Test files
└── .github/workflows/ # CI/CD
`Development
`bash
Clone repository
git clone https://github.com/yourusername/bit-cli.git
cd bit-cliInstall dependencies
npm installRun in development
npm run devRun tests
npm testRun tests with coverage
npm run test:coverageLint code
npm run lintFormat code
npm run format
`Contributing
1. Fork the repository
2. Create a feature branch (
git checkout -b feature/amazing)
3. Commit your changes (bit commit)
4. Push to the branch (git push origin feature/amazing`)MIT License - see LICENSE for details.