gac 1.9.3__py3-none-any.whl → 1.9.5__py3-none-any.whl
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.
Potentially problematic release.
This version of gac might be problematic. Click here for more details.
- gac/__version__.py +1 -1
- gac/constants.py +1 -1
- gac/main.py +6 -1
- gac-1.9.5.dist-info/METADATA +226 -0
- {gac-1.9.3.dist-info → gac-1.9.5.dist-info}/RECORD +8 -8
- gac-1.9.3.dist-info/METADATA +0 -246
- {gac-1.9.3.dist-info → gac-1.9.5.dist-info}/WHEEL +0 -0
- {gac-1.9.3.dist-info → gac-1.9.5.dist-info}/entry_points.txt +0 -0
- {gac-1.9.3.dist-info → gac-1.9.5.dist-info}/licenses/LICENSE +0 -0
gac/__version__.py
CHANGED
gac/constants.py
CHANGED
|
@@ -20,7 +20,7 @@ class EnvDefaults:
|
|
|
20
20
|
|
|
21
21
|
MAX_RETRIES: int = 3
|
|
22
22
|
TEMPERATURE: float = 1
|
|
23
|
-
MAX_OUTPUT_TOKENS: int =
|
|
23
|
+
MAX_OUTPUT_TOKENS: int = 1024 # includes reasoning tokens
|
|
24
24
|
WARNING_LIMIT_TOKENS: int = 16384
|
|
25
25
|
ALWAYS_INCLUDE_SCOPE: bool = False
|
|
26
26
|
SKIP_SECRET_SCAN: bool = False
|
gac/main.py
CHANGED
|
@@ -294,12 +294,17 @@ def main(
|
|
|
294
294
|
# No hint given, just reroll with same prompts
|
|
295
295
|
reroll_system_prompt, reroll_user_prompt = system_prompt, user_prompt
|
|
296
296
|
|
|
297
|
+
# Update prompts and recalculate token count for the next generation
|
|
298
|
+
system_prompt = reroll_system_prompt
|
|
299
|
+
user_prompt = reroll_user_prompt
|
|
300
|
+
prompt_tokens = count_tokens(system_prompt, model) + count_tokens(user_prompt, model)
|
|
301
|
+
|
|
297
302
|
console.print() # Add blank line for readability
|
|
298
303
|
|
|
299
304
|
# Generate new message
|
|
300
305
|
commit_message = generate_commit_message(
|
|
301
306
|
model=model,
|
|
302
|
-
prompt=(
|
|
307
|
+
prompt=(system_prompt, user_prompt),
|
|
303
308
|
temperature=temperature,
|
|
304
309
|
max_tokens=max_output_tokens,
|
|
305
310
|
max_retries=max_retries,
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gac
|
|
3
|
+
Version: 1.9.5
|
|
4
|
+
Summary: LLM-powered Git commit message generator with multi-provider support
|
|
5
|
+
Project-URL: Homepage, https://github.com/cellwebb/gac
|
|
6
|
+
Project-URL: Documentation, https://github.com/cellwebb/gac#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/cellwebb/gac.git
|
|
8
|
+
Project-URL: Issues, https://github.com/cellwebb/gac/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/cellwebb/gac/blob/main/CHANGELOG.md
|
|
10
|
+
Project-URL: Source, https://github.com/cellwebb/gac
|
|
11
|
+
Author-email: cellwebb <cellwebb@users.noreply.github.com>
|
|
12
|
+
License-Expression: MIT
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Programming Language :: Python
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
22
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: click>=8.3.0
|
|
25
|
+
Requires-Dist: halo
|
|
26
|
+
Requires-Dist: httpcore>=1.0.9
|
|
27
|
+
Requires-Dist: httpx>=0.28.0
|
|
28
|
+
Requires-Dist: pydantic>=2.12.0
|
|
29
|
+
Requires-Dist: python-dotenv>=1.1.1
|
|
30
|
+
Requires-Dist: questionary
|
|
31
|
+
Requires-Dist: rich>=14.1.0
|
|
32
|
+
Requires-Dist: tiktoken>=0.12.0
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: build; extra == 'dev'
|
|
35
|
+
Requires-Dist: codecov; extra == 'dev'
|
|
36
|
+
Requires-Dist: pre-commit; extra == 'dev'
|
|
37
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
38
|
+
Requires-Dist: pytest-cov; extra == 'dev'
|
|
39
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
40
|
+
Requires-Dist: twine; extra == 'dev'
|
|
41
|
+
Description-Content-Type: text/markdown
|
|
42
|
+
|
|
43
|
+
<!-- markdownlint-disable MD013 -->
|
|
44
|
+
|
|
45
|
+
# 🚀 Git Auto Commit (gac)
|
|
46
|
+
|
|
47
|
+
[](https://pypi.org/project/gac/)
|
|
48
|
+
[](https://www.python.org/downloads/)
|
|
49
|
+
[](https://github.com/cellwebb/gac/actions)
|
|
50
|
+
[](https://app.codecov.io/gh/cellwebb/gac)
|
|
51
|
+
[](https://github.com/astral-sh/ruff)
|
|
52
|
+
[](https://mypy-lang.org/)
|
|
53
|
+
[](docs/CONTRIBUTING.md)
|
|
54
|
+
[](LICENSE)
|
|
55
|
+
|
|
56
|
+
**LLM-powered commit messages that understand your code.**
|
|
57
|
+
|
|
58
|
+
**Tired of writing commit messages?** Replace `git commit -m "..."` with `gac` for contextual, well-formatted commit messages generated by large language models.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## What You Get
|
|
63
|
+
|
|
64
|
+
Instead of generic messages like `"update stuff"`, `"fix bug"`, or `"add feature"`, you get intelligent, contextual messages that explain the **why** behind your changes:
|
|
65
|
+
|
|
66
|
+

|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Quick Start
|
|
71
|
+
|
|
72
|
+
### Install & Use
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# 1. Install globally
|
|
76
|
+
uv tool install gac
|
|
77
|
+
|
|
78
|
+
# 2. Configure your LLM provider
|
|
79
|
+
gac init
|
|
80
|
+
|
|
81
|
+
# 3. Use on your staged changes
|
|
82
|
+
git add .
|
|
83
|
+
gac
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
That's it! Review the generated message and confirm with `y`.
|
|
87
|
+
|
|
88
|
+
### Use without installing
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
uvx gac init
|
|
92
|
+
uvx gac
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Key Features
|
|
98
|
+
|
|
99
|
+
### **Supported Providers**
|
|
100
|
+
|
|
101
|
+
- **Anthropic** • **Cerebras** • **Chutes.ai** • **Gemini** • **Groq**
|
|
102
|
+
- **LM Studio** • **Ollama** • **OpenAI** • **OpenRouter**
|
|
103
|
+
- **Streamlake** • **Synthetic.new** • **Z.AI** • **Z.AI Coding**
|
|
104
|
+
|
|
105
|
+
### **Smart LLM Analysis**
|
|
106
|
+
|
|
107
|
+
- **Understands intent**: Analyzes code structure, logic, and patterns to understand the "why" behind your changes, not just what changed
|
|
108
|
+
- **Semantic awareness**: Recognizes refactoring, bug fixes, features, and breaking changes to generate contextually appropriate messages
|
|
109
|
+
- **Intelligent filtering**: Prioritizes meaningful changes while ignoring generated files, dependencies, and artifacts
|
|
110
|
+
|
|
111
|
+
### **Multiple Message Formats**
|
|
112
|
+
|
|
113
|
+
- **One-liner** (-o flag): Single-line commit message following conventional commit format
|
|
114
|
+
- **Standard** (default): Summary with bullet points explaining implementation details
|
|
115
|
+
- **Verbose** (-v flag): Comprehensive explanations including motivation, technical approach, and impact analysis
|
|
116
|
+
|
|
117
|
+
### **Developer Experience**
|
|
118
|
+
|
|
119
|
+
- **Interactive feedback**: Regenerate messages with specific requests like `r "make it shorter"` or `r "focus on the bug fix"`
|
|
120
|
+
- **One-command workflows**: Complete workflows with flags like `gac -ayp` (stage all, auto-confirm, push)
|
|
121
|
+
- **Git integration**: Respects pre-commit and lefthook hooks, running them before expensive LLM operations
|
|
122
|
+
|
|
123
|
+
### **Built-in Security**
|
|
124
|
+
|
|
125
|
+
- **Automatic secret detection**: Scans for API keys, passwords, and tokens before committing
|
|
126
|
+
- **Interactive protection**: Prompts before committing potentially sensitive data with clear remediation options
|
|
127
|
+
- **Smart filtering**: Ignores example files, template files, and placeholder text to reduce false positives
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Usage Examples
|
|
132
|
+
|
|
133
|
+
### Basic Workflow
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Stage your changes
|
|
137
|
+
git add .
|
|
138
|
+
|
|
139
|
+
# Generate and commit with LLM
|
|
140
|
+
gac
|
|
141
|
+
|
|
142
|
+
# Review → y (commit) | n (cancel) | r (reroll)
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Common Commands
|
|
146
|
+
|
|
147
|
+
| Command | Description |
|
|
148
|
+
| --------------- | ---------------------------------------------- |
|
|
149
|
+
| `gac` | Generate commit message |
|
|
150
|
+
| `gac -y` | Auto-confirm (no review needed) |
|
|
151
|
+
| `gac -a` | Stage all + commit |
|
|
152
|
+
| `gac -o` | One-line message only |
|
|
153
|
+
| `gac -v` | Detailed verbose format |
|
|
154
|
+
| `gac -h "hint"` | Add context for LLM (e.g., `gac -h "bug fix"`) |
|
|
155
|
+
| `gac -s` | Include scope (e.g., feat(auth):) |
|
|
156
|
+
| `gac -p` | Commit and push |
|
|
157
|
+
|
|
158
|
+
### Power User Examples
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# Complete workflow in one command
|
|
162
|
+
gac -ayp -h "release preparation"
|
|
163
|
+
|
|
164
|
+
# Detailed explanation with scope
|
|
165
|
+
gac -v -s
|
|
166
|
+
|
|
167
|
+
# Quick one-liner for small changes
|
|
168
|
+
gac -o
|
|
169
|
+
|
|
170
|
+
# Debug what the LLM sees
|
|
171
|
+
gac --show-prompt
|
|
172
|
+
|
|
173
|
+
# Skip security scan (use carefully)
|
|
174
|
+
gac --skip-secret-scan
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Interactive Reroll System
|
|
178
|
+
|
|
179
|
+
Not happy with the result? Use the reroll feature for intelligent regeneration:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# Simple regeneration (uses previous context)
|
|
183
|
+
r
|
|
184
|
+
|
|
185
|
+
# With specific feedback
|
|
186
|
+
r make it shorter and focus on the performance improvement
|
|
187
|
+
r use conventional commit format with scope
|
|
188
|
+
r explain the security implications
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Configuration
|
|
194
|
+
|
|
195
|
+
Run `gac init` to configure your provider interactively, or set environment variables:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Example configuration
|
|
199
|
+
GAC_MODEL=anthropic:your-model-name
|
|
200
|
+
OPENAI_API_KEY=your_key_here
|
|
201
|
+
ANTHROPIC_API_KEY=your_key_here
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
See `.gac.env.example` for all available options.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Getting Help
|
|
209
|
+
|
|
210
|
+
- **Full documentation**: [USAGE.md](USAGE.md) - Complete CLI reference
|
|
211
|
+
- **Troubleshooting**: [TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md) - Common issues and solutions
|
|
212
|
+
- **Contributing**: [CONTRIBUTING.md](docs/CONTRIBUTING.md) - Development setup and guidelines
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
<!-- markdownlint-disable MD033 MD036 -->
|
|
217
|
+
|
|
218
|
+
<div align="center">
|
|
219
|
+
|
|
220
|
+
Made with ❤️ for developers who want better commit messages
|
|
221
|
+
|
|
222
|
+
[⭐ Star us on GitHub](https://github.com/cellwebb/gac) • [🐛 Report issues](https://github.com/cellwebb/gac/issues) • [📖 Full docs](USAGE.md)
|
|
223
|
+
|
|
224
|
+
</div>
|
|
225
|
+
|
|
226
|
+
<!-- markdownlint-enable MD033 MD036 -->
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
gac/__init__.py,sha256=z9yGInqtycFIT3g1ca24r-A3699hKVaRqGUI79wsmMc,415
|
|
2
|
-
gac/__version__.py,sha256=
|
|
2
|
+
gac/__version__.py,sha256=yksa_gnQUQ8A-21rG93rnvVwWUiw5gocNqEFu06B9pg,66
|
|
3
3
|
gac/ai.py,sha256=-0rIZQCHC7yOEmkLtCLDzeInnrm960hVpiEELi8NM_U,3513
|
|
4
4
|
gac/ai_utils.py,sha256=eqrpiBTueCgSOxUC2b4Ei0G4DM1GMt866sJEIhWpytU,7333
|
|
5
5
|
gac/cli.py,sha256=crUUI6osYtE3QAZ7r6DRlVk9gR3X2PctzS1sssVQ9_g,5070
|
|
6
6
|
gac/config.py,sha256=n3TkQYBqSKkH68QUM6M7kwSK83ghmItoh0p5ZDFnhHA,1746
|
|
7
7
|
gac/config_cli.py,sha256=v9nFHZO1RvK9fzHyuUS6SG-BCLHMsdOMDwWamBhVVh4,1608
|
|
8
|
-
gac/constants.py,sha256=
|
|
8
|
+
gac/constants.py,sha256=8GHB7yeK2CYT0t80-k9N6LvgZPe-StNH3dK3NsUO46c,4977
|
|
9
9
|
gac/diff_cli.py,sha256=wnVQ9OFGnM0d2Pj9WVjWbo0jxqIuRHVAwmb8wU9Pa3E,5676
|
|
10
10
|
gac/errors.py,sha256=ysDIVRCd0YQVTOW3Q6YzdolxCdtkoQCAFf3_jrqbjUY,7916
|
|
11
11
|
gac/git.py,sha256=g6tvph50zV-wrTWrxARYXEpl0NeI8-ffFwHoqhp3fSE,8033
|
|
12
12
|
gac/init_cli.py,sha256=wq2MMi1xQrbVTib-5BsVdbPXQkPStB3G3Q8VnSKiKFQ,4740
|
|
13
|
-
gac/main.py,sha256=
|
|
13
|
+
gac/main.py,sha256=IBzBuZkdEBpaxBLzuRw-LS-6wpOMt8admdKDLzP1gDc,16471
|
|
14
14
|
gac/preprocess.py,sha256=aMxsjGxy9YP752NWjgf0KP5Sn6p8keIJAGlMYr8jDgQ,15373
|
|
15
15
|
gac/prompt.py,sha256=d_kBXmhf3bDVLyDj8J7AS7GBAxF2jlc8lXoHX3Dzi5k,24255
|
|
16
16
|
gac/security.py,sha256=15Yp6YR8QC4eECJi1BUCkMteh_veZXUbLL6W8qGcDm4,9920
|
|
@@ -28,8 +28,8 @@ gac/providers/openrouter.py,sha256=H3ce8JcRUYq1I30lOjGESdX7jfoPkW3mKAYnc2aYfBw,2
|
|
|
28
28
|
gac/providers/streamlake.py,sha256=KAA2ZnpuEI5imzvdWVWUhEBHSP0BMnprKXte6CbwBWY,2047
|
|
29
29
|
gac/providers/synthetic.py,sha256=sRMIJTS9LpcXd9A7qp_ZjZxdqtTKRn9fl1W4YwJZP4c,1855
|
|
30
30
|
gac/providers/zai.py,sha256=kywhhrCfPBu0rElZyb-iENxQxxpVGykvePuL4xrXlaU,2739
|
|
31
|
-
gac-1.9.
|
|
32
|
-
gac-1.9.
|
|
33
|
-
gac-1.9.
|
|
34
|
-
gac-1.9.
|
|
35
|
-
gac-1.9.
|
|
31
|
+
gac-1.9.5.dist-info/METADATA,sha256=NEi3DaMvArxIi6h9UZZ_yVNa6_HCQDaEW1ZOXLFWCGM,7680
|
|
32
|
+
gac-1.9.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
33
|
+
gac-1.9.5.dist-info/entry_points.txt,sha256=tdjN-XMmcWfL92swuRAjT62bFLOAwk9bTMRLGP5Z4aI,36
|
|
34
|
+
gac-1.9.5.dist-info/licenses/LICENSE,sha256=vOab37NouL1PNs5BswnPayrMCqaN2sqLfMQfqPDrpZg,1103
|
|
35
|
+
gac-1.9.5.dist-info/RECORD,,
|
gac-1.9.3.dist-info/METADATA
DELETED
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: gac
|
|
3
|
-
Version: 1.9.3
|
|
4
|
-
Summary: AI-powered Git commit message generator with multi-provider support
|
|
5
|
-
Project-URL: Homepage, https://github.com/cellwebb/gac
|
|
6
|
-
Project-URL: Documentation, https://github.com/cellwebb/gac#readme
|
|
7
|
-
Project-URL: Repository, https://github.com/cellwebb/gac.git
|
|
8
|
-
Project-URL: Issues, https://github.com/cellwebb/gac/issues
|
|
9
|
-
Project-URL: Changelog, https://github.com/cellwebb/gac/blob/main/CHANGELOG.md
|
|
10
|
-
Project-URL: Source, https://github.com/cellwebb/gac
|
|
11
|
-
Author-email: cellwebb <cellwebb@users.noreply.github.com>
|
|
12
|
-
License-Expression: MIT
|
|
13
|
-
License-File: LICENSE
|
|
14
|
-
Classifier: Development Status :: 4 - Beta
|
|
15
|
-
Classifier: Programming Language :: Python
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
-
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
22
|
-
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
23
|
-
Requires-Python: >=3.10
|
|
24
|
-
Requires-Dist: anthropic>=0.68.0
|
|
25
|
-
Requires-Dist: click>=8.3.0
|
|
26
|
-
Requires-Dist: halo
|
|
27
|
-
Requires-Dist: httpcore>=1.0.9
|
|
28
|
-
Requires-Dist: httpx>=0.28.0
|
|
29
|
-
Requires-Dist: pydantic>=2.12.0
|
|
30
|
-
Requires-Dist: python-dotenv>=1.1.1
|
|
31
|
-
Requires-Dist: questionary
|
|
32
|
-
Requires-Dist: rich>=14.1.0
|
|
33
|
-
Requires-Dist: sumy
|
|
34
|
-
Requires-Dist: tiktoken>=0.12.0
|
|
35
|
-
Provides-Extra: dev
|
|
36
|
-
Requires-Dist: build; extra == 'dev'
|
|
37
|
-
Requires-Dist: codecov; extra == 'dev'
|
|
38
|
-
Requires-Dist: pre-commit; extra == 'dev'
|
|
39
|
-
Requires-Dist: pytest; extra == 'dev'
|
|
40
|
-
Requires-Dist: pytest-cov; extra == 'dev'
|
|
41
|
-
Requires-Dist: ruff; extra == 'dev'
|
|
42
|
-
Requires-Dist: twine; extra == 'dev'
|
|
43
|
-
Description-Content-Type: text/markdown
|
|
44
|
-
|
|
45
|
-
<!-- markdownlint-disable MD013 -->
|
|
46
|
-
|
|
47
|
-
# Git Auto Commit (gac)
|
|
48
|
-
|
|
49
|
-
[](https://pypi.org/project/gac/)
|
|
50
|
-
[](https://www.python.org/downloads/)
|
|
51
|
-
[](https://github.com/cellwebb/gac/actions)
|
|
52
|
-
[](https://app.codecov.io/gh/cellwebb/gac)
|
|
53
|
-
[](https://github.com/astral-sh/ruff)
|
|
54
|
-
[](https://mypy-lang.org/)
|
|
55
|
-
[](docs/CONTRIBUTING.md)
|
|
56
|
-
[](LICENSE)
|
|
57
|
-
|
|
58
|
-
## Features
|
|
59
|
-
|
|
60
|
-
- **LLM-Powered Commit Messages:** Automatically generates clear, concise, and context-aware commit messages using large language models.
|
|
61
|
-
- **Deep Contextual Analysis:** Understands your code by analyzing staged changes, repository structure, and recent commit history to provide highly relevant suggestions.
|
|
62
|
-
- **Multi-Provider & Model Support:** Flexibly works with leading AI providers (Anthropic, Cerebras, Chutes.ai, Gemini, Groq, OpenAI, OpenRouter, Streamlake/Vanchin, Synthetic.new, & Z.AI) and local providers (LM Studio & Ollama), easily configured through an interactive setup or environment variables.
|
|
63
|
-
- **Seamless Git Workflow:** Integrates smoothly into your existing Git routine as a simple drop-in replacement for `git commit`.
|
|
64
|
-
- **Extensive Customization:** Tailor commit messages to your needs with a rich set of flags, including one-liners (`-o`), detailed verbose messages (`-v`), AI hints (`-h`), scope inference (`-s`), and specific model selection (`-m`).
|
|
65
|
-
- **Streamlined Workflow Commands:** Boost your productivity with convenient options to stage all changes (`-a`), auto-confirm commits (`-y`), and push to your remote repository (`-p`) in a single step.
|
|
66
|
-
- **Interactive Reroll with Feedback:** Not satisfied with the generated commit message? Use `r` for a simple regeneration, or `r <feedback>` to provide specific improvement suggestions (e.g., `r make it shorter`, `r focus on the bug fix`).
|
|
67
|
-
- **Token Usage Tracking:** Display token consumption statistics (prompt, completion, and total tokens).
|
|
68
|
-
- **Security Scanner:** Built-in detection of secrets and API keys in staged changes to prevent accidental commits of sensitive information.
|
|
69
|
-
|
|
70
|
-
## How It Works
|
|
71
|
-
|
|
72
|
-
gac analyzes your staged changes to generate high-quality commit messages with the help of large language models. The tool uses a sophisticated prompt architecture that separates system instructions from user data, enabling better AI understanding and more consistent results.
|
|
73
|
-
|
|
74
|
-
## How to Use
|
|
75
|
-
|
|
76
|
-
```sh
|
|
77
|
-
git add .
|
|
78
|
-
gac
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-

|
|
82
|
-
|
|
83
|
-
## Installation and Configuration
|
|
84
|
-
|
|
85
|
-
### 1. Installation
|
|
86
|
-
|
|
87
|
-
#### Quick Try with uvx (no installation)
|
|
88
|
-
|
|
89
|
-
You can try gac without installing it using uvx:
|
|
90
|
-
|
|
91
|
-
```sh
|
|
92
|
-
# Try gac without installation
|
|
93
|
-
uvx gac --help
|
|
94
|
-
|
|
95
|
-
# Set up configuration (creates ~/.gac.env)
|
|
96
|
-
uvx gac init
|
|
97
|
-
|
|
98
|
-
# Use gac on staged changes
|
|
99
|
-
git add .
|
|
100
|
-
uvx gac
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
#### Permanent Installation
|
|
104
|
-
|
|
105
|
-
Install system-wide using pipx from the GitHub repository:
|
|
106
|
-
|
|
107
|
-
```sh
|
|
108
|
-
# Install pipx if you don't have it
|
|
109
|
-
python3 -m pip install --user pipx
|
|
110
|
-
python3 -m pipx ensurepath
|
|
111
|
-
|
|
112
|
-
# Install gac
|
|
113
|
-
pipx install gac
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Verify installation:
|
|
117
|
-
|
|
118
|
-
```sh
|
|
119
|
-
gac --version
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### 2. Configuration
|
|
123
|
-
|
|
124
|
-
The recommended way to configure `gac` is using the interactive setup:
|
|
125
|
-
|
|
126
|
-
```sh
|
|
127
|
-
gac init
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
This command will guide you through selecting an AI provider, model, and securely entering your API keys. It will create or update a user-level configuration file at `$HOME/.gac.env`.
|
|
131
|
-
|
|
132
|
-
Example `$HOME/.gac.env` output:
|
|
133
|
-
|
|
134
|
-
```env
|
|
135
|
-
GAC_MODEL=anthropic:claude-3-5-haiku-latest
|
|
136
|
-
ANTHROPIC_API_KEY=your_anthropic_key_here
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
Alternatively, you can configure `gac` using environment variables or by manually creating/editing the configuration file.
|
|
140
|
-
|
|
141
|
-
#### Managing Configuration with `gac config`
|
|
142
|
-
|
|
143
|
-
You can manage settings in your `$HOME/.gac.env` file using `gac config` commands:
|
|
144
|
-
|
|
145
|
-
- Streamlake uses inference endpoint IDs instead of model names. When prompted, paste the exact endpoint ID from the Streamlake console.
|
|
146
|
-
- For local providers like Ollama and LM Studio, gac will ask for the base API URL. API keys are optional for these providers unless your instance requires authentication.
|
|
147
|
-
|
|
148
|
-
- Show config: `gac config show`
|
|
149
|
-
- Set a value: `gac config set GAC_MODEL groq:meta-llama/llama-4-scout-17b-16e-instruct`
|
|
150
|
-
- Get a value: `gac config get GAC_MODEL`
|
|
151
|
-
- Unset a value: `gac config unset GAC_MODEL`
|
|
152
|
-
|
|
153
|
-
### 3. Verify Setup
|
|
154
|
-
|
|
155
|
-
Test that `gac` is working properly with your configuration:
|
|
156
|
-
|
|
157
|
-
```sh
|
|
158
|
-
# Make a change to a file
|
|
159
|
-
echo "# Test change" >> README.md
|
|
160
|
-
git add README.md
|
|
161
|
-
gac -o # Generate a one-line commit message
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
You should see an AI-generated commit message.
|
|
165
|
-
|
|
166
|
-
### 4. Upgrade
|
|
167
|
-
|
|
168
|
-
To upgrade `gac` to the latest version, run:
|
|
169
|
-
|
|
170
|
-
```sh
|
|
171
|
-
pipx upgrade gac
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
## Basic Usage
|
|
175
|
-
|
|
176
|
-
Once installed and configured, using `gac` is straightforward:
|
|
177
|
-
|
|
178
|
-
1. Stage your changes:
|
|
179
|
-
|
|
180
|
-
```sh
|
|
181
|
-
git add .
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
2. Run `gac`:
|
|
185
|
-
|
|
186
|
-
```sh
|
|
187
|
-
gac
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
This will generate a commit message for review. Confirm with `y` to accept the message.
|
|
191
|
-
|
|
192
|
-
### Common Commands
|
|
193
|
-
|
|
194
|
-
- Generate a commit message: `gac`
|
|
195
|
-
- Auto-accept the commit message: `gac -y`
|
|
196
|
-
- Stage all changes and generate a commit message: `gac -a`
|
|
197
|
-
- Generate a one-line commit message: `gac -o`
|
|
198
|
-
- Add a hint for the AI: `gac -h "Fixed the authentication bug"`
|
|
199
|
-
- Push the commit (requires accepting the commit message): `gac -p`
|
|
200
|
-
- Advanced usage: Add all, auto-confirm, push a one-liner with a hint: `gac -aypo -h "update for release"`
|
|
201
|
-
- Skip security scan: `gac --skip-secret-scan` (use with caution)
|
|
202
|
-
|
|
203
|
-
### Security Features
|
|
204
|
-
|
|
205
|
-
GAC includes a built-in security scanner to prevent accidental commits of sensitive information:
|
|
206
|
-
|
|
207
|
-
- **Automatic Scanning**: By default, scans all staged changes for potential secrets and API keys
|
|
208
|
-
- **Interactive Protection**: When secrets are detected, you can:
|
|
209
|
-
- Abort the commit (recommended)
|
|
210
|
-
- Continue anyway (not recommended)
|
|
211
|
-
- Remove affected files and continue
|
|
212
|
-
- **Wide Coverage**: Detects AWS keys, GitHub tokens, OpenAI API keys, database URLs, private keys, and more
|
|
213
|
-
- **Smart Filtering**: Ignores example keys, placeholders, and test values to reduce false positives
|
|
214
|
-
|
|
215
|
-
To disable the security scan (not recommended unless you know what you're doing):
|
|
216
|
-
|
|
217
|
-
```sh
|
|
218
|
-
# Skip scan for one command
|
|
219
|
-
gac --skip-secret-scan
|
|
220
|
-
|
|
221
|
-
# Or disable via environment variable
|
|
222
|
-
export GAC_SKIP_SECRET_SCAN=true
|
|
223
|
-
gac
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
For a full list of CLI flags, advanced options, and example workflows, see [USAGE.md](USAGE.md).
|
|
227
|
-
|
|
228
|
-
## Best Practices
|
|
229
|
-
|
|
230
|
-
- gac loads configuration from two locations (in order of precedence):
|
|
231
|
-
1. User-level `$HOME/.gac.env` (applies to all projects for the user)
|
|
232
|
-
2. Project-level `.env` (in the project root, overrides user config if present) Environment variables always take final precedence over both files.
|
|
233
|
-
- Keep API keys out of version control
|
|
234
|
-
- For troubleshooting, see [docs/TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md)
|
|
235
|
-
|
|
236
|
-
## Contributing
|
|
237
|
-
|
|
238
|
-
We welcome contributions! Please see [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md) for guidelines.
|
|
239
|
-
|
|
240
|
-
## License
|
|
241
|
-
|
|
242
|
-
This project is licensed under the MIT License. See [LICENSE](LICENSE) for details.
|
|
243
|
-
|
|
244
|
-
## Community & Support
|
|
245
|
-
|
|
246
|
-
For questions, suggestions, or support, please open an issue or discussion on GitHub.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|