|
| 1 | +--- |
| 2 | +title: "Installation Guide" |
| 3 | +description: "Complete guide to installing CommitWeave on your system" |
| 4 | +order: 2 |
| 5 | +--- |
| 6 | + |
| 7 | +# Installation Guide |
| 8 | + |
| 9 | +This guide will walk you through installing CommitWeave on your system and getting it configured for your development workflow. |
| 10 | + |
| 11 | +## Prerequisites |
| 12 | + |
| 13 | +Before installing CommitWeave, ensure you have: |
| 14 | + |
| 15 | +- **Node.js 18.0.0 or higher** - CommitWeave requires modern Node.js features |
| 16 | +- **Git** - CommitWeave integrates with your Git workflow |
| 17 | +- **NPM or Yarn** - For package management |
| 18 | + |
| 19 | +You can verify your Node.js version: |
| 20 | +```bash |
| 21 | +node --version |
| 22 | +``` |
| 23 | + |
| 24 | +## Installation Methods |
| 25 | + |
| 26 | +### Method 1: Global NPM Installation (Recommended) |
| 27 | + |
| 28 | +Install CommitWeave globally for use across all your projects: |
| 29 | + |
| 30 | +```bash |
| 31 | +npm install -g commitweave |
| 32 | +``` |
| 33 | + |
| 34 | +Verify the installation: |
| 35 | +```bash |
| 36 | +commitweave --version |
| 37 | +``` |
| 38 | + |
| 39 | +### Method 2: Local Project Installation |
| 40 | + |
| 41 | +Install CommitWeave as a development dependency in your project: |
| 42 | + |
| 43 | +```bash |
| 44 | +# Using npm |
| 45 | +npm install --save-dev commitweave |
| 46 | + |
| 47 | +# Using yarn |
| 48 | +yarn add -D commitweave |
| 49 | + |
| 50 | +# Using pnpm |
| 51 | +pnpm add -D commitweave |
| 52 | +``` |
| 53 | + |
| 54 | +Add a script to your `package.json`: |
| 55 | +```json |
| 56 | +{ |
| 57 | + "scripts": { |
| 58 | + "commit": "commitweave" |
| 59 | + } |
| 60 | +} |
| 61 | +``` |
| 62 | + |
| 63 | +Then run with: |
| 64 | +```bash |
| 65 | +npm run commit |
| 66 | +``` |
| 67 | + |
| 68 | +### Method 3: Using npx (No Installation) |
| 69 | + |
| 70 | +Run CommitWeave directly without installing: |
| 71 | + |
| 72 | +```bash |
| 73 | +npx commitweave |
| 74 | +``` |
| 75 | + |
| 76 | +## Initial Setup |
| 77 | + |
| 78 | +### 1. Initialize Configuration |
| 79 | + |
| 80 | +After installation, set up CommitWeave for your project: |
| 81 | + |
| 82 | +```bash |
| 83 | +commitweave init |
| 84 | +``` |
| 85 | + |
| 86 | +This creates a `glinr-commit.json` configuration file with sensible defaults: |
| 87 | + |
| 88 | +```json |
| 89 | +{ |
| 90 | + "commitTypes": [ |
| 91 | + { |
| 92 | + "type": "feat", |
| 93 | + "description": "A new feature", |
| 94 | + "emoji": "✨" |
| 95 | + }, |
| 96 | + { |
| 97 | + "type": "fix", |
| 98 | + "description": "A bug fix", |
| 99 | + "emoji": "🐛" |
| 100 | + } |
| 101 | + // ... more types |
| 102 | + ], |
| 103 | + "emojiEnabled": true, |
| 104 | + "conventionalCommits": true, |
| 105 | + "maxSubjectLength": 50, |
| 106 | + "ui": { |
| 107 | + "fancyUI": true, |
| 108 | + "asciiArt": true, |
| 109 | + "animations": true, |
| 110 | + "colors": true, |
| 111 | + "emoji": true |
| 112 | + } |
| 113 | +} |
| 114 | +``` |
| 115 | + |
| 116 | +### 2. Configure AI Providers (Optional) |
| 117 | + |
| 118 | +To use AI-powered commit generation, you'll need to configure an AI provider. |
| 119 | + |
| 120 | +#### OpenAI Setup |
| 121 | + |
| 122 | +1. Get an API key from [OpenAI Platform](https://platform.openai.com/api-keys) |
| 123 | +2. Configure CommitWeave: |
| 124 | + |
| 125 | +```bash |
| 126 | +# Set your API key |
| 127 | +export OPENAI_API_KEY="your-api-key-here" |
| 128 | + |
| 129 | +# Or add to your shell profile (.bashrc, .zshrc, etc.) |
| 130 | +echo 'export OPENAI_API_KEY="your-api-key-here"' >> ~/.zshrc |
| 131 | +``` |
| 132 | + |
| 133 | +3. Update your configuration: |
| 134 | + |
| 135 | +```json |
| 136 | +{ |
| 137 | + "ai": { |
| 138 | + "provider": "openai", |
| 139 | + "model": "gpt-3.5-turbo", |
| 140 | + "temperature": 0.7, |
| 141 | + "maxTokens": 150 |
| 142 | + } |
| 143 | +} |
| 144 | +``` |
| 145 | + |
| 146 | +#### Anthropic Claude Setup |
| 147 | + |
| 148 | +1. Get an API key from [Anthropic Console](https://console.anthropic.com/) |
| 149 | +2. Configure CommitWeave: |
| 150 | + |
| 151 | +```bash |
| 152 | +# Set your API key |
| 153 | +export ANTHROPIC_API_KEY="your-api-key-here" |
| 154 | +``` |
| 155 | + |
| 156 | +3. Update your configuration: |
| 157 | + |
| 158 | +```json |
| 159 | +{ |
| 160 | + "ai": { |
| 161 | + "provider": "anthropic", |
| 162 | + "model": "claude-3-sonnet-20240229", |
| 163 | + "temperature": 0.7, |
| 164 | + "maxTokens": 150 |
| 165 | + } |
| 166 | +} |
| 167 | +``` |
| 168 | + |
| 169 | +## Verification |
| 170 | + |
| 171 | +Test your installation with these commands: |
| 172 | + |
| 173 | +```bash |
| 174 | +# Check version |
| 175 | +commitweave --version |
| 176 | + |
| 177 | +# Validate configuration |
| 178 | +commitweave doctor |
| 179 | + |
| 180 | +# Test basic functionality |
| 181 | +commitweave --help |
| 182 | + |
| 183 | +# Test AI functionality (if configured) |
| 184 | +commitweave --ai |
| 185 | +``` |
| 186 | + |
| 187 | +## Platform-Specific Notes |
| 188 | + |
| 189 | +### Windows |
| 190 | + |
| 191 | +CommitWeave works on Windows with Command Prompt, PowerShell, and Git Bash. For the best experience: |
| 192 | + |
| 193 | +1. Use Windows Terminal for enhanced colors and emoji support |
| 194 | +2. Ensure your terminal supports Unicode for proper emoji display |
| 195 | +3. Consider using Git Bash for a Unix-like experience |
| 196 | + |
| 197 | +### macOS |
| 198 | + |
| 199 | +CommitWeave works out of the box on macOS. For enhanced terminal experience: |
| 200 | + |
| 201 | +1. Use iTerm2 or the built-in Terminal app |
| 202 | +2. Install a Nerd Font for better emoji and icon support |
| 203 | +3. Enable "Use Unicode UTF-8" in Terminal preferences |
| 204 | + |
| 205 | +### Linux |
| 206 | + |
| 207 | +CommitWeave works on all major Linux distributions: |
| 208 | + |
| 209 | +1. Ensure your terminal supports Unicode |
| 210 | +2. Install font packages for emoji support: |
| 211 | + ```bash |
| 212 | + # Ubuntu/Debian |
| 213 | + sudo apt install fonts-noto-color-emoji |
| 214 | + |
| 215 | + # Arch Linux |
| 216 | + sudo pacman -S noto-fonts-emoji |
| 217 | + ``` |
| 218 | + |
| 219 | +## Configuration Management |
| 220 | + |
| 221 | +### Global vs Project Configuration |
| 222 | + |
| 223 | +CommitWeave supports both global and project-specific configurations: |
| 224 | + |
| 225 | +- **Global**: `~/.config/commitweave/glinr-commit.json` |
| 226 | +- **Project**: `./glinr-commit.json` (takes precedence) |
| 227 | + |
| 228 | +### Environment Variables |
| 229 | + |
| 230 | +CommitWeave respects these environment variables: |
| 231 | + |
| 232 | +```bash |
| 233 | +# API Keys |
| 234 | +OPENAI_API_KEY="" |
| 235 | +ANTHROPIC_API_KEY="" |
| 236 | + |
| 237 | +# Configuration overrides |
| 238 | +COMMITWEAVE_EMOJI_ENABLED="true" |
| 239 | +COMMITWEAVE_AI_PROVIDER="openai" |
| 240 | +COMMITWEAVE_MAX_SUBJECT_LENGTH="50" |
| 241 | +``` |
| 242 | + |
| 243 | +## Troubleshooting |
| 244 | + |
| 245 | +### Common Issues |
| 246 | + |
| 247 | +#### "Command not found" |
| 248 | +- Ensure Node.js and npm are installed |
| 249 | +- Check if global npm bin directory is in your PATH |
| 250 | +- Try reinstalling: `npm uninstall -g commitweave && npm install -g commitweave` |
| 251 | + |
| 252 | +#### "Permission denied" |
| 253 | +- Use `sudo` for global installation: `sudo npm install -g commitweave` |
| 254 | +- Or configure npm to use a different directory for global packages |
| 255 | + |
| 256 | +#### AI features not working |
| 257 | +- Verify your API key is set correctly |
| 258 | +- Check your internet connection |
| 259 | +- Ensure you have API credits available |
| 260 | +- Run `commitweave doctor` for diagnostics |
| 261 | + |
| 262 | +#### Unicode/Emoji display issues |
| 263 | +- Ensure your terminal supports Unicode |
| 264 | +- Install appropriate font packages |
| 265 | +- Check terminal encoding settings |
| 266 | + |
| 267 | +### Getting Help |
| 268 | + |
| 269 | +If you encounter issues: |
| 270 | + |
| 271 | +1. Run `commitweave doctor` for health checks |
| 272 | +2. Check the configuration with `commitweave list` |
| 273 | +3. Review the logs for error messages |
| 274 | +4. Visit our GitHub repository for support |
| 275 | + |
| 276 | +## Next Steps |
| 277 | + |
| 278 | +Now that CommitWeave is installed and configured: |
| 279 | + |
| 280 | +1. [Learn basic usage patterns](./usage.md) |
| 281 | +2. [Explore the API reference](./api/reference.md) |
| 282 | +3. Customize your configuration for your team's needs |
| 283 | +4. Set up AI providers for intelligent commit generation |
| 284 | + |
| 285 | +--- |
| 286 | + |
| 287 | +*Ready to create beautiful commits? Let's get started!* |
0 commit comments