gitwise
v1.0.2
Published
AI-powered Git workflow automator with OpenAI integration
Downloads
13
Maintainers
Readme
GitWise
AI-powered Git workflow automator with Google Gemini AI integration. Automate your Git operations with intelligent AI suggestions for commits, branches, and repository analysis.
Features
- 🤖 AI-Powered Commits: Generate intelligent commit messages using Google Gemini AI
- 🌿 Smart Branching: Create feature branches with AI-suggested names
- 📊 Repository Analysis: Analyze commit patterns and provide insights
- ⚙️ Flexible Configuration: Works with or without environment variables
- 🚀 Easy Setup: Simple initialization process with fallback options
Installation
Global Installation (Recommended)
npm install -g gitwiseLocal Installation
npm install gitwise
npx gitwiseQuick Start
Set up your environment (optional but recommended):
gitwise setupInitialize GitWise in your repository:
gitwise initCreate AI-powered commits:
gitwise commitCreate feature branches:
gitwise branchAnalyze your repository:
gitwise analyze
Configuration
GitWise is designed to work with minimal configuration. Here are the different ways to set it up:
Option 1: Environment Variables (Recommended for AI features)
Create a .env file in your project root:
# Google Gemini Configuration
GEMINI_API_KEY=your_gemini_api_key_here
GEMINI_MODEL=gemini-1.5-flash
GEMINI_TEMPERATURE=0.3
# Git Configuration
GIT_AUTHOR_NAME=Your Name
[email protected]
# Application Configuration
AUTO_CONFIRM=false
DEFAULT_COMMIT_TYPE=feat
LOG_LEVEL=infoOption 2: System Environment Variables
Set these in your shell profile:
export GEMINI_API_KEY="your_api_key"
export GIT_AUTHOR_NAME="Your Name"
export GIT_AUTHOR_EMAIL="[email protected]"Option 3: Git Global Config (for author info)
git config --global user.name "Your Name"
git config --global user.email "[email protected]"Option 4: No Configuration (Limited Features)
GitWise will work without any configuration, but with limitations:
- AI features will be disabled without
GEMINI_API_KEY - Git author info will be prompted during initialization
- Default values will be used for other settings
Environment Variables Reference
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| GEMINI_API_KEY | Yes* | - | Google Gemini API key for AI features |
| GEMINI_MODEL | No | gemini-1.5-flash | Gemini model to use |
| GEMINI_TEMPERATURE | No | 0.3 | AI creativity level (0.0-1.0) |
| GIT_AUTHOR_NAME | No | - | Your name for commits |
| GIT_AUTHOR_EMAIL | No | - | Your email for commits |
| AUTO_CONFIRM | No | false | Skip confirmation prompts |
| DEFAULT_COMMIT_TYPE | No | feat | Default commit type |
| LOG_LEVEL | No | info | Logging level |
*Required only for AI features. The tool will work without it but with limited functionality.
Commands
gitwise setup
Interactive setup wizard for configuring your environment. This command will:
- Guide you through setting up environment variables
- Create a
.envfile with your configuration - Set git author information globally
- Provide helpful defaults for optional settings
gitwise init
Initialize GitWise for your repository. This command will:
- Validate your configuration
- Set up git author information if needed
- Provide guidance for missing environment variables
gitwise commit
Create an AI-powered commit message based on your staged changes.
gitwise branch
Create a new feature branch with an AI-suggested name.
gitwise analyze
Analyze your repository patterns and provide insights.
gitwise config
View and manage your current configuration.
Getting a Google Gemini API Key
- Go to Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy the API key and add it to your
.envfile
Troubleshooting
"GEMINI_API_KEY is required" Error
- Create a
.envfile with your API key - Or set the environment variable directly
- AI features will be disabled without this key
Git Author Information Not Found
- Set
GIT_AUTHOR_NAMEandGIT_AUTHOR_EMAILin your.env - Or run
git config --global user.nameandgit config --global user.email - GitWise will prompt you during initialization if needed
Permission Denied Errors
- Ensure you have write access to the repository
- Check that git is properly configured
Development
# Clone the repository
git clone <repository-url>
cd gitwise
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode
npm run devContributing
Contributions are welcome! Please feel free to submit a Pull Request.
