Skip to content

Commit 4a6e278

Browse files
committed
init
0 parents  commit 4a6e278

11 files changed

Lines changed: 610 additions & 0 deletions

File tree

‎.eslintrc.json‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"env": {
3+
"browser": false,
4+
"commonjs": true,
5+
"es6": true,
6+
"node": true
7+
},
8+
"parserOptions": {
9+
"ecmaVersion": 2020,
10+
"sourceType": "module"
11+
},
12+
"rules": {
13+
"no-const-assign": "warn",
14+
"no-this-before-super": "warn",
15+
"no-undef": "warn",
16+
"no-unreachable": "warn",
17+
"no-unused-vars": "warn",
18+
"constructor-super": "warn",
19+
"valid-typeof": "warn"
20+
}
21+
}

‎.gitignore‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
.vscode-test/
3+
*.vsix
4+
dist/
5+
out/
6+
.DS_Store

‎.vscode/launch.json‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Run Extension",
6+
"type": "extensionHost",
7+
"request": "launch",
8+
"args": [
9+
"--extensionDevelopmentPath=${workspaceFolder}"
10+
],
11+
"outFiles": [
12+
"${workspaceFolder}/dist/**/*.js"
13+
],
14+
"preLaunchTask": "${defaultBuildTask}"
15+
}
16+
]
17+
}

‎.vscode/tasks.json‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "npm",
6+
"script": "watch",
7+
"problemMatcher": "$tsc-watch",
8+
"isBackground": true,
9+
"presentation": {
10+
"reveal": "never"
11+
},
12+
"group": {
13+
"kind": "build",
14+
"isDefault": true
15+
}
16+
}
17+
]
18+
}

‎.vscodeignore‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.vscode/**
2+
.vscode-test/**
3+
node_modules/**
4+
.gitignore
5+
.eslintrc.json
6+
webpack.config.js

‎ICON.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Icon Setup
2+
3+
The extension uses VS Code's built-in `$(sparkle)` icon for the commit generation button in the Source Control panel.
4+
5+
## Extension Icon
6+
7+
To add a custom extension icon, create a 128x128 PNG file named `icon.png` in the root of the extension folder.
8+
9+
You can:
10+
1. Use any AI image generator to create a star/sparkle icon
11+
2. Use a free icon from https://www.flaticon.com/
12+
3. Create your own using design tools
13+
14+
The icon should represent:
15+
- AI/automation (sparkle, star, magic wand)
16+
- Git/commits (git logo, commit symbol)
17+
- Claude branding (if desired)
18+
19+
Recommended colors: Purple, blue, or orange to match Claude branding.
20+
21+
For now, you can comment out the `"icon": "icon.png"` line in package.json to skip the icon requirement.

‎README.md‎

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
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

‎package.json‎

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
{
2+
"name": "claude-commit-vscode",
3+
"displayName": "Claude Commit",
4+
"description": "AI-powered git commit message generator using Claude AI",
5+
"version": "1.0.0",
6+
"publisher": "uaoa",
7+
"engines": {
8+
"vscode": "^1.75.0"
9+
},
10+
"categories": [
11+
"SCM Providers",
12+
"Other"
13+
],
14+
"keywords": [
15+
"git",
16+
"commit",
17+
"ai",
18+
"claude",
19+
"conventional-commits",
20+
"anthropic"
21+
],
22+
"activationEvents": [
23+
"onStartupFinished"
24+
],
25+
"main": "./src/extension.js",
26+
"contributes": {
27+
"commands": [
28+
{
29+
"command": "claude-commit.generate",
30+
"title": "Generate Commit Message",
31+
"category": "Claude Commit",
32+
"icon": "$(sparkle)"
33+
}
34+
],
35+
"menus": {
36+
"scm/title": [
37+
{
38+
"command": "claude-commit.generate",
39+
"group": "navigation",
40+
"when": "scmProvider == git"
41+
}
42+
]
43+
},
44+
"configuration": {
45+
"title": "Claude Commit",
46+
"properties": {
47+
"claudeCommit.apiKey": {
48+
"type": "string",
49+
"default": "",
50+
"description": "Anthropic API key for Claude AI (optional if using Claude Code CLI)",
51+
"order": 1
52+
},
53+
"claudeCommit.preferredMethod": {
54+
"type": "string",
55+
"enum": [
56+
"auto",
57+
"cli",
58+
"api"
59+
],
60+
"default": "auto",
61+
"description": "Preferred method for generating commits: auto (try CLI first, then API), cli (Claude Code CLI only), or api (Anthropic API only)",
62+
"order": 2
63+
},
64+
"claudeCommit.language": {
65+
"type": "string",
66+
"enum": [
67+
"en",
68+
"ua"
69+
],
70+
"default": "en",
71+
"enumDescriptions": [
72+
"English",
73+
"Ukrainian"
74+
],
75+
"description": "Language for commit messages",
76+
"order": 3
77+
}
78+
}
79+
}
80+
},
81+
"scripts": {
82+
"vscode:prepublish": "npm run package",
83+
"package": "webpack --mode production --devtool hidden-source-map",
84+
"compile": "webpack",
85+
"watch": "webpack --watch",
86+
"lint": "eslint src"
87+
},
88+
"devDependencies": {
89+
"@types/node": "^18.0.0",
90+
"@types/vscode": "^1.75.0",
91+
"eslint": "^8.50.0",
92+
"webpack": "^5.88.0",
93+
"webpack-cli": "^5.1.4"
94+
},
95+
"optionalDependencies": {
96+
"@anthropic-ai/sdk": "^0.68.0"
97+
},
98+
"repository": {
99+
"type": "git",
100+
"url": "https://github.com/uaoa/claude-commit.git"
101+
},
102+
"author": {
103+
"name": "Zakharii Melnyk",
104+
"url": "https://github.com/uaoa",
105+
"email": "contact@uaoa.dev"
106+
},
107+
"license": "MIT"
108+
}

0 commit comments

Comments
 (0)