bit-cli-ai
v1.0.7
Published
Git with a brain - intelligent Git wrapper with AI-powered commits, ghost branches, and predictive merge
Maintainers
Readme
Bit CLI
Git with a brain - An intelligent Git wrapper with AI-powered commits, ghost branches, and predictive merge analysis.
Features
Level 1: Foundation
- Transparent Passthrough - All git commands work through bit (
bit status=git status) - Smart Init - Auto-detects project type and generates appropriate
.gitignore - AI Commits - Generates meaningful commit messages using AI or rule-based analysis
Level 2: Architect
- Ghost Branches - Hidden experimental branches that don't clutter your branch list
- Virtual Merge - Preview merge conflicts before actually merging
.bitDirectory - Intelligent metadata storage separate from.git
Level 3: Visionary
- Symbol Tracking - Track function-level changes, not just file-level
- Hot Zone Detection - Warns when teammates are editing the same functions
Installation
# Install globally
npm install -g bit-cli
# Or use npx
npx bit-cli <command>Quick Start
# Initialize a new repository with smart defaults
bit init
# Make some changes, then commit with AI
git add .
bit commit
# Create a ghost branch for experiments
bit branch --ghost experiment
# Preview merge conflicts before merging
bit merge --preview feature-branch
# Check for team conflicts
bit hotzone
# Analyze code changes
bit analyzeCommands
| 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 <name> | Create a ghost (hidden) branch |
| bit branch | List all branches including ghost branches |
| bit checkout <branch> --ghost | Checkout a ghost branch |
| bit merge --preview <branch> | Preview merge conflicts |
| bit merge <branch> | Smart merge with conflict preview |
| bit hotzone | Detect overlapping work with team |
| bit analyze | Analyze code at function/symbol level |
| bit <any-git-cmd> | Passthrough to git |
Configuration
Environment Variables
# Required for AI features
OPENAI_API_KEY=sk-your-key-here
# Optional
BIT_AI_MODEL=gpt-4o-mini
BIT_DEBUG=true
BIT_LOG_LEVEL=debug
BIT_VERBOSE=trueGlobal Configuration
Config stored in ~/.bit/config.json:
{
"ai": {
"provider": "openai",
"model": "gpt-4o-mini",
"maxTokens": 500,
"temperature": 0.7
},
"git": {
"ghostPrefix": "ghost/",
"autoStage": false
},
"ui": {
"colors": true,
"spinners": true
}
}Project Configuration
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/CDDevelopment
# Clone repository
git clone https://github.com/yourusername/bit-cli.git
cd bit-cli
# Install dependencies
npm install
# Run in development
npm run dev
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Lint code
npm run lint
# Format code
npm run formatContributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing) - Commit your changes (
bit commit) - Push to the branch (
git push origin feature/amazing) - Open a Pull Request
License
MIT License - see LICENSE for details.
