|
| 1 | +# Claude Commit - VS Code Extension |
| 2 | + |
| 3 | +AI-powered Git commit message generator using Claude AI. Automatically generates conventional commit messages with a single click. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- **One-Click Generation**: Click the sparkle button in Source Control panel to generate commit messages |
| 8 | +- **Conventional Commits**: Generates properly formatted conventional commit messages |
| 9 | +- **Bilingual Support**: English and Ukrainian languages |
| 10 | +- **Flexible AI Backend**: Works with Claude Code CLI or Anthropic API |
| 11 | +- **Smart Fallback**: Automatically tries CLI first, then API |
| 12 | + |
| 13 | +## Installation |
| 14 | + |
| 15 | +### From Source |
| 16 | + |
| 17 | +1. Clone this repository |
| 18 | +2. Navigate to the `vscode-extension` folder |
| 19 | +3. Run `npm install` |
| 20 | +4. Press F5 to open Extension Development Host |
| 21 | +5. Or run `vsce package` to create a .vsix file and install manually |
| 22 | + |
| 23 | +## Setup |
| 24 | + |
| 25 | +Choose one of the following methods: |
| 26 | + |
| 27 | +### Option 1: Claude Code CLI (Recommended) |
| 28 | + |
| 29 | +Install Claude Code CLI: |
| 30 | +```bash |
| 31 | +# Follow instructions at https://docs.claude.com/claude-code |
| 32 | +``` |
| 33 | + |
| 34 | +### Option 2: Anthropic API |
| 35 | + |
| 36 | +1. Get your API key from https://console.anthropic.com/ |
| 37 | +2. Add it to VS Code settings: |
| 38 | + - Open Settings (Cmd+, or Ctrl+,) |
| 39 | + - Search for "Claude Commit" |
| 40 | + - Enter your API key in "Claude Commit: Api Key" |
| 41 | + |
| 42 | +Or set environment variable: |
| 43 | +```bash |
| 44 | +export ANTHROPIC_API_KEY="your-key-here" |
| 45 | +``` |
| 46 | + |
| 47 | +## Usage |
| 48 | + |
| 49 | +1. Make changes to your code |
| 50 | +2. Stage files with `git add` (or use VS Code Source Control UI) |
| 51 | +3. Click the **sparkle icon** ✨ in the Source Control panel (top right) |
| 52 | +4. The commit message will be automatically generated and inserted into the message box |
| 53 | +5. Review and commit! |
| 54 | + |
| 55 | +## Configuration |
| 56 | + |
| 57 | +Open VS Code settings and search for "Claude Commit": |
| 58 | + |
| 59 | +- **API Key**: Your Anthropic API key (optional if using CLI) |
| 60 | +- **Preferred Method**: Choose between `auto`, `cli`, or `api` |
| 61 | + - `auto`: Try CLI first, fallback to API |
| 62 | + - `cli`: Use only Claude Code CLI |
| 63 | + - `api`: Use only Anthropic API |
| 64 | +- **Language**: Choose `en` (English) or `ua` (Ukrainian) |
| 65 | + |
| 66 | +## Commands |
| 67 | + |
| 68 | +- **Claude Commit: Generate Commit Message** - Generate AI-powered commit message |
| 69 | + |
| 70 | +Access via: |
| 71 | +- Sparkle button in Source Control panel |
| 72 | +- Command Palette (Cmd+Shift+P / Ctrl+Shift+P) → "Claude Commit: Generate" |
| 73 | + |
| 74 | +## Examples |
| 75 | + |
| 76 | +Generated commit messages follow conventional commits format: |
| 77 | + |
| 78 | +``` |
| 79 | +feat(auth): added Google OAuth provider |
| 80 | +fix(api): fixed validation error in user endpoint |
| 81 | +refactor(store): optimized cart state management |
| 82 | +docs(readme): updated installation instructions |
| 83 | +``` |
| 84 | + |
| 85 | +## Requirements |
| 86 | + |
| 87 | +- VS Code 1.75.0 or higher |
| 88 | +- Git repository |
| 89 | +- One of: |
| 90 | + - Claude Code CLI installed |
| 91 | + - Anthropic API key |
| 92 | + |
| 93 | +## License |
| 94 | + |
| 95 | +MIT |
| 96 | + |
| 97 | +## Author |
| 98 | + |
| 99 | +Zakharii Melnyk |
| 100 | +- GitHub: [@uaoa](https://github.com/uaoa) |
| 101 | +- Email: contact@uaoa.dev |
0 commit comments