claude-commit 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- claude_commit-0.1.0/LICENSE +22 -0
- claude_commit-0.1.0/PKG-INFO +292 -0
- claude_commit-0.1.0/README.md +263 -0
- claude_commit-0.1.0/pyproject.toml +54 -0
- claude_commit-0.1.0/setup.cfg +4 -0
- claude_commit-0.1.0/src/claude_commit/__init__.py +12 -0
- claude_commit-0.1.0/src/claude_commit/config.py +149 -0
- claude_commit-0.1.0/src/claude_commit/main.py +876 -0
- claude_commit-0.1.0/src/claude_commit.egg-info/PKG-INFO +292 -0
- claude_commit-0.1.0/src/claude_commit.egg-info/SOURCES.txt +12 -0
- claude_commit-0.1.0/src/claude_commit.egg-info/dependency_links.txt +1 -0
- claude_commit-0.1.0/src/claude_commit.egg-info/entry_points.txt +2 -0
- claude_commit-0.1.0/src/claude_commit.egg-info/requires.txt +10 -0
- claude_commit-0.1.0/src/claude_commit.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 claude-commit contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: claude-commit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: AI-powered git commit message generator using Claude Agent SDK
|
|
5
|
+
Author-email: Johannlai <johannli666@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: git,commit,ai,claude,automation
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Requires-Python: >=3.9
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: claude-agent-sdk>=0.1.0
|
|
20
|
+
Requires-Dist: click>=8.0.0
|
|
21
|
+
Requires-Dist: rich>=13.0.0
|
|
22
|
+
Requires-Dist: pyperclip>=1.8.0
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
25
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
26
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
27
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
# claude-commit
|
|
31
|
+
|
|
32
|
+
🤖 AI-powered git commit message generator using Claude Agent SDK and Claude Code CLI
|
|
33
|
+
|
|
34
|
+
## What is this?
|
|
35
|
+
|
|
36
|
+
`claude-commit` uses Claude AI to analyze your code changes and write meaningful commit messages. Claude reads your files, understands the context, and generates commit messages following best practices.
|
|
37
|
+
|
|
38
|
+
## Quick Start
|
|
39
|
+
|
|
40
|
+
**Install:**
|
|
41
|
+
```bash
|
|
42
|
+
pip install claude-commit
|
|
43
|
+
|
|
44
|
+
# Required dependency
|
|
45
|
+
npm install -g @anthropic-ai/claude-code
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Use:**
|
|
49
|
+
```bash
|
|
50
|
+
git add .
|
|
51
|
+
claude-commit --commit
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
That's it! Claude will analyze your changes and create a commit.
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
### Prerequisites
|
|
59
|
+
|
|
60
|
+
- Python 3.10+
|
|
61
|
+
- Node.js
|
|
62
|
+
- Git
|
|
63
|
+
|
|
64
|
+
### Install Steps
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# 1. Install Claude Code CLI (required)
|
|
68
|
+
npm install -g @anthropic-ai/claude-code
|
|
69
|
+
|
|
70
|
+
# 2. Install claude-commit
|
|
71
|
+
pip install claude-commit
|
|
72
|
+
|
|
73
|
+
# Or use pipx for isolation
|
|
74
|
+
pipx install claude-commit
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Authentication
|
|
78
|
+
|
|
79
|
+
`claude-commit` supports two ways to authenticate with Claude:
|
|
80
|
+
|
|
81
|
+
**Option 1: [Official Claude Code Login](https://docs.claude.com/en/docs/claude-code/quickstart#step-2%3A-log-in-to-your-account) (Recommended)**
|
|
82
|
+
|
|
83
|
+
**Option 2: Custom API Endpoint (Environment Variables)**
|
|
84
|
+
|
|
85
|
+
For custom Claude API endpoints or proxies, set these environment variables:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Required: Set custom endpoint and credentials
|
|
89
|
+
export ANTHROPIC_BASE_URL="https://your-endpoint.com/api/v1"
|
|
90
|
+
export ANTHROPIC_AUTH_TOKEN="your-auth-token"
|
|
91
|
+
|
|
92
|
+
# Optional: Specify custom model name
|
|
93
|
+
export ANTHROPIC_MODEL="your-model-name"
|
|
94
|
+
|
|
95
|
+
# Then use claude-commit normally
|
|
96
|
+
claude-commit --commit
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Add these to your `~/.zshrc` or `~/.bashrc` to persist across sessions.
|
|
100
|
+
|
|
101
|
+
## Usage
|
|
102
|
+
|
|
103
|
+
### Basic Commands
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Generate commit message (default: staged changes only)
|
|
107
|
+
claude-commit
|
|
108
|
+
|
|
109
|
+
# Auto-commit with generated message
|
|
110
|
+
claude-commit --commit
|
|
111
|
+
|
|
112
|
+
# Include all changes (staged + unstaged)
|
|
113
|
+
claude-commit --all
|
|
114
|
+
|
|
115
|
+
# Copy message to clipboard
|
|
116
|
+
claude-commit --copy
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Common Options
|
|
120
|
+
|
|
121
|
+
| Option | Description |
|
|
122
|
+
| -------------------- | ---------------------------------- |
|
|
123
|
+
| `-a, --all` | Include unstaged changes |
|
|
124
|
+
| `-c, --commit` | Auto-commit with generated message |
|
|
125
|
+
| `--copy` | Copy message to clipboard |
|
|
126
|
+
| `--preview` | Preview message only |
|
|
127
|
+
| `-v, --verbose` | Show detailed analysis |
|
|
128
|
+
| `-p, --path PATH` | Specify repository path |
|
|
129
|
+
| `--max-diff-lines N` | Limit diff lines (default: 500) |
|
|
130
|
+
|
|
131
|
+
## Aliases
|
|
132
|
+
|
|
133
|
+
Create shortcuts for common commands:
|
|
134
|
+
|
|
135
|
+
### Install Shell Aliases
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Install to your shell config
|
|
139
|
+
claude-commit alias install
|
|
140
|
+
|
|
141
|
+
# Activate in current terminal
|
|
142
|
+
source ~/.zshrc # zsh
|
|
143
|
+
source ~/.bashrc # bash
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Default Aliases
|
|
147
|
+
|
|
148
|
+
| Alias | Command | Description |
|
|
149
|
+
| ------- | ------------------------------ | ------------------- |
|
|
150
|
+
| `ccc` | `claude-commit --commit` | Quick commit |
|
|
151
|
+
| `ccp` | `claude-commit --preview` | Preview message |
|
|
152
|
+
| `cca` | `claude-commit --all` | Include all changes |
|
|
153
|
+
| `ccac` | `claude-commit --all --commit` | Commit all changes |
|
|
154
|
+
| `ccopy` | `claude-commit --copy` | Copy to clipboard |
|
|
155
|
+
|
|
156
|
+
After installation, just use:
|
|
157
|
+
```bash
|
|
158
|
+
git add .
|
|
159
|
+
ccc # analyzes and commits
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Custom Aliases
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
# Create your own aliases
|
|
166
|
+
claude-commit alias set quick --all --commit
|
|
167
|
+
claude-commit alias list
|
|
168
|
+
claude-commit alias unset quick
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## How It Works
|
|
172
|
+
|
|
173
|
+
Claude autonomously analyzes your changes:
|
|
174
|
+
|
|
175
|
+
1. **Reads** your modified files to understand context
|
|
176
|
+
2. **Searches** the codebase for related code
|
|
177
|
+
3. **Understands** the intent and impact of changes
|
|
178
|
+
4. **Generates** a clear commit message following conventions
|
|
179
|
+
|
|
180
|
+
**Example:**
|
|
181
|
+
```
|
|
182
|
+
feat: add JWT authentication
|
|
183
|
+
|
|
184
|
+
Implement secure authentication system with token refresh.
|
|
185
|
+
Includes login, logout, and session management.
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Examples
|
|
189
|
+
|
|
190
|
+
### Typical Workflow
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# Make changes
|
|
194
|
+
git add .
|
|
195
|
+
|
|
196
|
+
# Preview message
|
|
197
|
+
claude-commit --preview
|
|
198
|
+
|
|
199
|
+
# Commit if satisfied
|
|
200
|
+
claude-commit --commit
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### With Aliases
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
# Make changes
|
|
207
|
+
git add .
|
|
208
|
+
|
|
209
|
+
# Quick commit
|
|
210
|
+
ccc
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Large Changes
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
# Limit analysis for faster results
|
|
217
|
+
claude-commit --max-diff-lines 200 --commit
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Configuration
|
|
221
|
+
|
|
222
|
+
Configuration files:
|
|
223
|
+
- Aliases: `~/.claude-commit/config.json`
|
|
224
|
+
- Shell integration: `~/.zshrc`, `~/.bashrc`, or `$PROFILE`
|
|
225
|
+
|
|
226
|
+
## Platform Support
|
|
227
|
+
|
|
228
|
+
| Platform | Status | Shells |
|
|
229
|
+
| -------- | ------ | -------------------- |
|
|
230
|
+
| macOS | ✅ | zsh, bash, fish |
|
|
231
|
+
| Linux | ✅ | bash, zsh, fish |
|
|
232
|
+
| Windows | ✅ | PowerShell, Git Bash |
|
|
233
|
+
|
|
234
|
+
**Windows PowerShell** first-time setup:
|
|
235
|
+
```powershell
|
|
236
|
+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## Troubleshooting
|
|
240
|
+
|
|
241
|
+
**Claude Code not found?**
|
|
242
|
+
```bash
|
|
243
|
+
npm install -g @anthropic-ai/claude-code
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
**No changes detected?**
|
|
247
|
+
```bash
|
|
248
|
+
git add . # stage changes
|
|
249
|
+
# or
|
|
250
|
+
claude-commit --all # include unstaged
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Analysis too slow?**
|
|
254
|
+
```bash
|
|
255
|
+
claude-commit --max-diff-lines 200
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## Development
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
# Clone and setup
|
|
262
|
+
git clone https://github.com/yourusername/claude-commit.git
|
|
263
|
+
cd claude-commit
|
|
264
|
+
python -m venv venv
|
|
265
|
+
source venv/bin/activate
|
|
266
|
+
pip install -e ".[dev]"
|
|
267
|
+
|
|
268
|
+
# Run tests
|
|
269
|
+
pytest tests/
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## Contributing
|
|
273
|
+
|
|
274
|
+
Contributions welcome! Please:
|
|
275
|
+
1. Fork the repository
|
|
276
|
+
2. Create a feature branch
|
|
277
|
+
3. Make your changes
|
|
278
|
+
4. Submit a Pull Request
|
|
279
|
+
|
|
280
|
+
## License
|
|
281
|
+
|
|
282
|
+
MIT License - see [LICENSE](LICENSE) file
|
|
283
|
+
|
|
284
|
+
## Links
|
|
285
|
+
|
|
286
|
+
- [Claude Agent SDK](https://docs.anthropic.com/en/docs/claude-code/agent-sdk)
|
|
287
|
+
- [Conventional Commits](https://www.conventionalcommits.org/)
|
|
288
|
+
- [Issue Tracker](https://github.com/yourusername/claude-commit/issues)
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
Made with ❤️ by [Johann Lai](https://x.com/programerjohann)
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
# claude-commit
|
|
2
|
+
|
|
3
|
+
🤖 AI-powered git commit message generator using Claude Agent SDK and Claude Code CLI
|
|
4
|
+
|
|
5
|
+
## What is this?
|
|
6
|
+
|
|
7
|
+
`claude-commit` uses Claude AI to analyze your code changes and write meaningful commit messages. Claude reads your files, understands the context, and generates commit messages following best practices.
|
|
8
|
+
|
|
9
|
+
## Quick Start
|
|
10
|
+
|
|
11
|
+
**Install:**
|
|
12
|
+
```bash
|
|
13
|
+
pip install claude-commit
|
|
14
|
+
|
|
15
|
+
# Required dependency
|
|
16
|
+
npm install -g @anthropic-ai/claude-code
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Use:**
|
|
20
|
+
```bash
|
|
21
|
+
git add .
|
|
22
|
+
claude-commit --commit
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
That's it! Claude will analyze your changes and create a commit.
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
### Prerequisites
|
|
30
|
+
|
|
31
|
+
- Python 3.10+
|
|
32
|
+
- Node.js
|
|
33
|
+
- Git
|
|
34
|
+
|
|
35
|
+
### Install Steps
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# 1. Install Claude Code CLI (required)
|
|
39
|
+
npm install -g @anthropic-ai/claude-code
|
|
40
|
+
|
|
41
|
+
# 2. Install claude-commit
|
|
42
|
+
pip install claude-commit
|
|
43
|
+
|
|
44
|
+
# Or use pipx for isolation
|
|
45
|
+
pipx install claude-commit
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Authentication
|
|
49
|
+
|
|
50
|
+
`claude-commit` supports two ways to authenticate with Claude:
|
|
51
|
+
|
|
52
|
+
**Option 1: [Official Claude Code Login](https://docs.claude.com/en/docs/claude-code/quickstart#step-2%3A-log-in-to-your-account) (Recommended)**
|
|
53
|
+
|
|
54
|
+
**Option 2: Custom API Endpoint (Environment Variables)**
|
|
55
|
+
|
|
56
|
+
For custom Claude API endpoints or proxies, set these environment variables:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Required: Set custom endpoint and credentials
|
|
60
|
+
export ANTHROPIC_BASE_URL="https://your-endpoint.com/api/v1"
|
|
61
|
+
export ANTHROPIC_AUTH_TOKEN="your-auth-token"
|
|
62
|
+
|
|
63
|
+
# Optional: Specify custom model name
|
|
64
|
+
export ANTHROPIC_MODEL="your-model-name"
|
|
65
|
+
|
|
66
|
+
# Then use claude-commit normally
|
|
67
|
+
claude-commit --commit
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Add these to your `~/.zshrc` or `~/.bashrc` to persist across sessions.
|
|
71
|
+
|
|
72
|
+
## Usage
|
|
73
|
+
|
|
74
|
+
### Basic Commands
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Generate commit message (default: staged changes only)
|
|
78
|
+
claude-commit
|
|
79
|
+
|
|
80
|
+
# Auto-commit with generated message
|
|
81
|
+
claude-commit --commit
|
|
82
|
+
|
|
83
|
+
# Include all changes (staged + unstaged)
|
|
84
|
+
claude-commit --all
|
|
85
|
+
|
|
86
|
+
# Copy message to clipboard
|
|
87
|
+
claude-commit --copy
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Common Options
|
|
91
|
+
|
|
92
|
+
| Option | Description |
|
|
93
|
+
| -------------------- | ---------------------------------- |
|
|
94
|
+
| `-a, --all` | Include unstaged changes |
|
|
95
|
+
| `-c, --commit` | Auto-commit with generated message |
|
|
96
|
+
| `--copy` | Copy message to clipboard |
|
|
97
|
+
| `--preview` | Preview message only |
|
|
98
|
+
| `-v, --verbose` | Show detailed analysis |
|
|
99
|
+
| `-p, --path PATH` | Specify repository path |
|
|
100
|
+
| `--max-diff-lines N` | Limit diff lines (default: 500) |
|
|
101
|
+
|
|
102
|
+
## Aliases
|
|
103
|
+
|
|
104
|
+
Create shortcuts for common commands:
|
|
105
|
+
|
|
106
|
+
### Install Shell Aliases
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Install to your shell config
|
|
110
|
+
claude-commit alias install
|
|
111
|
+
|
|
112
|
+
# Activate in current terminal
|
|
113
|
+
source ~/.zshrc # zsh
|
|
114
|
+
source ~/.bashrc # bash
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Default Aliases
|
|
118
|
+
|
|
119
|
+
| Alias | Command | Description |
|
|
120
|
+
| ------- | ------------------------------ | ------------------- |
|
|
121
|
+
| `ccc` | `claude-commit --commit` | Quick commit |
|
|
122
|
+
| `ccp` | `claude-commit --preview` | Preview message |
|
|
123
|
+
| `cca` | `claude-commit --all` | Include all changes |
|
|
124
|
+
| `ccac` | `claude-commit --all --commit` | Commit all changes |
|
|
125
|
+
| `ccopy` | `claude-commit --copy` | Copy to clipboard |
|
|
126
|
+
|
|
127
|
+
After installation, just use:
|
|
128
|
+
```bash
|
|
129
|
+
git add .
|
|
130
|
+
ccc # analyzes and commits
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Custom Aliases
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Create your own aliases
|
|
137
|
+
claude-commit alias set quick --all --commit
|
|
138
|
+
claude-commit alias list
|
|
139
|
+
claude-commit alias unset quick
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## How It Works
|
|
143
|
+
|
|
144
|
+
Claude autonomously analyzes your changes:
|
|
145
|
+
|
|
146
|
+
1. **Reads** your modified files to understand context
|
|
147
|
+
2. **Searches** the codebase for related code
|
|
148
|
+
3. **Understands** the intent and impact of changes
|
|
149
|
+
4. **Generates** a clear commit message following conventions
|
|
150
|
+
|
|
151
|
+
**Example:**
|
|
152
|
+
```
|
|
153
|
+
feat: add JWT authentication
|
|
154
|
+
|
|
155
|
+
Implement secure authentication system with token refresh.
|
|
156
|
+
Includes login, logout, and session management.
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Examples
|
|
160
|
+
|
|
161
|
+
### Typical Workflow
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Make changes
|
|
165
|
+
git add .
|
|
166
|
+
|
|
167
|
+
# Preview message
|
|
168
|
+
claude-commit --preview
|
|
169
|
+
|
|
170
|
+
# Commit if satisfied
|
|
171
|
+
claude-commit --commit
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### With Aliases
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# Make changes
|
|
178
|
+
git add .
|
|
179
|
+
|
|
180
|
+
# Quick commit
|
|
181
|
+
ccc
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Large Changes
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Limit analysis for faster results
|
|
188
|
+
claude-commit --max-diff-lines 200 --commit
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Configuration
|
|
192
|
+
|
|
193
|
+
Configuration files:
|
|
194
|
+
- Aliases: `~/.claude-commit/config.json`
|
|
195
|
+
- Shell integration: `~/.zshrc`, `~/.bashrc`, or `$PROFILE`
|
|
196
|
+
|
|
197
|
+
## Platform Support
|
|
198
|
+
|
|
199
|
+
| Platform | Status | Shells |
|
|
200
|
+
| -------- | ------ | -------------------- |
|
|
201
|
+
| macOS | ✅ | zsh, bash, fish |
|
|
202
|
+
| Linux | ✅ | bash, zsh, fish |
|
|
203
|
+
| Windows | ✅ | PowerShell, Git Bash |
|
|
204
|
+
|
|
205
|
+
**Windows PowerShell** first-time setup:
|
|
206
|
+
```powershell
|
|
207
|
+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Troubleshooting
|
|
211
|
+
|
|
212
|
+
**Claude Code not found?**
|
|
213
|
+
```bash
|
|
214
|
+
npm install -g @anthropic-ai/claude-code
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**No changes detected?**
|
|
218
|
+
```bash
|
|
219
|
+
git add . # stage changes
|
|
220
|
+
# or
|
|
221
|
+
claude-commit --all # include unstaged
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**Analysis too slow?**
|
|
225
|
+
```bash
|
|
226
|
+
claude-commit --max-diff-lines 200
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Development
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
# Clone and setup
|
|
233
|
+
git clone https://github.com/yourusername/claude-commit.git
|
|
234
|
+
cd claude-commit
|
|
235
|
+
python -m venv venv
|
|
236
|
+
source venv/bin/activate
|
|
237
|
+
pip install -e ".[dev]"
|
|
238
|
+
|
|
239
|
+
# Run tests
|
|
240
|
+
pytest tests/
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## Contributing
|
|
244
|
+
|
|
245
|
+
Contributions welcome! Please:
|
|
246
|
+
1. Fork the repository
|
|
247
|
+
2. Create a feature branch
|
|
248
|
+
3. Make your changes
|
|
249
|
+
4. Submit a Pull Request
|
|
250
|
+
|
|
251
|
+
## License
|
|
252
|
+
|
|
253
|
+
MIT License - see [LICENSE](LICENSE) file
|
|
254
|
+
|
|
255
|
+
## Links
|
|
256
|
+
|
|
257
|
+
- [Claude Agent SDK](https://docs.anthropic.com/en/docs/claude-code/agent-sdk)
|
|
258
|
+
- [Conventional Commits](https://www.conventionalcommits.org/)
|
|
259
|
+
- [Issue Tracker](https://github.com/yourusername/claude-commit/issues)
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
Made with ❤️ by [Johann Lai](https://x.com/programerjohann)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "claude-commit"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "AI-powered git commit message generator using Claude Agent SDK"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "Johannlai", email = "johannli666@gmail.com" }]
|
|
13
|
+
keywords = ["git", "commit", "ai", "claude", "automation"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.9",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
dependencies = [
|
|
26
|
+
"claude-agent-sdk>=0.1.0",
|
|
27
|
+
"click>=8.0.0",
|
|
28
|
+
"rich>=13.0.0",
|
|
29
|
+
"pyperclip>=1.8.0",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
dev = [
|
|
34
|
+
"pytest>=7.0.0",
|
|
35
|
+
"pytest-asyncio>=0.21.0",
|
|
36
|
+
"black>=23.0.0",
|
|
37
|
+
"mypy>=1.0.0",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
[project.scripts]
|
|
41
|
+
claude-commit = "claude_commit.main:main"
|
|
42
|
+
|
|
43
|
+
[tool.setuptools.packages.find]
|
|
44
|
+
where = ["src"]
|
|
45
|
+
|
|
46
|
+
[tool.black]
|
|
47
|
+
line-length = 100
|
|
48
|
+
target-version = ['py39']
|
|
49
|
+
|
|
50
|
+
[tool.mypy]
|
|
51
|
+
python_version = "3.9"
|
|
52
|
+
warn_return_any = true
|
|
53
|
+
warn_unused_configs = true
|
|
54
|
+
disallow_untyped_defs = false
|