gac 1.12.1__tar.gz → 3.10.11__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.
Files changed (104) hide show
  1. {gac-1.12.1 → gac-3.10.11}/PKG-INFO +90 -26
  2. gac-3.10.11/README.md +242 -0
  3. {gac-1.12.1 → gac-3.10.11}/pyproject.toml +3 -7
  4. {gac-1.12.1 → gac-3.10.11}/src/gac/__init__.py +4 -6
  5. {gac-1.12.1 → gac-3.10.11}/src/gac/__version__.py +1 -1
  6. {gac-1.12.1 → gac-3.10.11}/src/gac/ai.py +33 -43
  7. gac-3.10.11/src/gac/ai_utils.py +243 -0
  8. gac-3.10.11/src/gac/auth_cli.py +214 -0
  9. {gac-1.12.1 → gac-3.10.11}/src/gac/cli.py +83 -9
  10. gac-3.10.11/src/gac/commit_executor.py +59 -0
  11. gac-3.10.11/src/gac/config.py +125 -0
  12. gac-3.10.11/src/gac/config_cli.py +95 -0
  13. gac-3.10.11/src/gac/constants/__init__.py +34 -0
  14. gac-3.10.11/src/gac/constants/commit.py +63 -0
  15. gac-3.10.11/src/gac/constants/defaults.py +40 -0
  16. gac-1.12.1/src/gac/constants.py → gac-3.10.11/src/gac/constants/file_patterns.py +1 -43
  17. gac-3.10.11/src/gac/constants/languages.py +119 -0
  18. {gac-1.12.1 → gac-3.10.11}/src/gac/diff_cli.py +0 -22
  19. {gac-1.12.1 → gac-3.10.11}/src/gac/errors.py +8 -2
  20. {gac-1.12.1 → gac-3.10.11}/src/gac/git.py +162 -16
  21. gac-3.10.11/src/gac/git_state_validator.py +193 -0
  22. gac-3.10.11/src/gac/grouped_commit_workflow.py +458 -0
  23. gac-3.10.11/src/gac/init_cli.py +70 -0
  24. gac-3.10.11/src/gac/interactive_mode.py +179 -0
  25. gac-3.10.11/src/gac/language_cli.py +377 -0
  26. gac-3.10.11/src/gac/main.py +328 -0
  27. gac-3.10.11/src/gac/model_cli.py +430 -0
  28. gac-3.10.11/src/gac/model_identifier.py +70 -0
  29. gac-3.10.11/src/gac/oauth/__init__.py +27 -0
  30. gac-3.10.11/src/gac/oauth/claude_code.py +464 -0
  31. gac-3.10.11/src/gac/oauth/qwen_oauth.py +327 -0
  32. gac-3.10.11/src/gac/oauth/token_store.py +81 -0
  33. gac-3.10.11/src/gac/oauth_retry.py +161 -0
  34. gac-3.10.11/src/gac/postprocess.py +155 -0
  35. {gac-1.12.1 → gac-3.10.11}/src/gac/preprocess.py +3 -3
  36. gac-3.10.11/src/gac/prompt.py +425 -0
  37. gac-3.10.11/src/gac/prompt_builder.py +88 -0
  38. gac-3.10.11/src/gac/providers/README.md +437 -0
  39. gac-3.10.11/src/gac/providers/__init__.py +80 -0
  40. gac-3.10.11/src/gac/providers/anthropic.py +17 -0
  41. gac-3.10.11/src/gac/providers/azure_openai.py +57 -0
  42. gac-3.10.11/src/gac/providers/base.py +329 -0
  43. gac-3.10.11/src/gac/providers/cerebras.py +15 -0
  44. gac-3.10.11/src/gac/providers/chutes.py +25 -0
  45. gac-3.10.11/src/gac/providers/claude_code.py +79 -0
  46. gac-3.10.11/src/gac/providers/custom_anthropic.py +103 -0
  47. gac-3.10.11/src/gac/providers/custom_openai.py +44 -0
  48. gac-3.10.11/src/gac/providers/deepseek.py +15 -0
  49. gac-3.10.11/src/gac/providers/error_handler.py +139 -0
  50. gac-3.10.11/src/gac/providers/fireworks.py +15 -0
  51. gac-3.10.11/src/gac/providers/gemini.py +90 -0
  52. gac-3.10.11/src/gac/providers/groq.py +15 -0
  53. gac-3.10.11/src/gac/providers/kimi_coding.py +27 -0
  54. gac-3.10.11/src/gac/providers/lmstudio.py +80 -0
  55. gac-3.10.11/src/gac/providers/minimax.py +15 -0
  56. gac-3.10.11/src/gac/providers/mistral.py +15 -0
  57. gac-3.10.11/src/gac/providers/moonshot.py +15 -0
  58. gac-3.10.11/src/gac/providers/ollama.py +73 -0
  59. gac-3.10.11/src/gac/providers/openai.py +32 -0
  60. gac-3.10.11/src/gac/providers/openrouter.py +21 -0
  61. gac-3.10.11/src/gac/providers/protocol.py +71 -0
  62. gac-3.10.11/src/gac/providers/qwen.py +64 -0
  63. gac-3.10.11/src/gac/providers/registry.py +58 -0
  64. gac-3.10.11/src/gac/providers/replicate.py +156 -0
  65. gac-3.10.11/src/gac/providers/streamlake.py +31 -0
  66. gac-3.10.11/src/gac/providers/synthetic.py +40 -0
  67. gac-3.10.11/src/gac/providers/together.py +15 -0
  68. gac-3.10.11/src/gac/providers/zai.py +31 -0
  69. gac-3.10.11/src/gac/py.typed +0 -0
  70. {gac-1.12.1 → gac-3.10.11}/src/gac/security.py +2 -2
  71. gac-3.10.11/src/gac/templates/__init__.py +1 -0
  72. gac-3.10.11/src/gac/templates/question_generation.txt +60 -0
  73. gac-3.10.11/src/gac/templates/system_prompt.txt +224 -0
  74. gac-3.10.11/src/gac/templates/user_prompt.txt +28 -0
  75. gac-3.10.11/src/gac/utils.py +401 -0
  76. gac-3.10.11/src/gac/workflow_context.py +162 -0
  77. gac-3.10.11/src/gac/workflow_utils.py +217 -0
  78. gac-1.12.1/README.md +0 -178
  79. gac-1.12.1/src/gac/ai_utils.py +0 -200
  80. gac-1.12.1/src/gac/config.py +0 -43
  81. gac-1.12.1/src/gac/config_cli.py +0 -62
  82. gac-1.12.1/src/gac/init_cli.py +0 -122
  83. gac-1.12.1/src/gac/main.py +0 -355
  84. gac-1.12.1/src/gac/prompt.py +0 -548
  85. gac-1.12.1/src/gac/providers/__init__.py +0 -38
  86. gac-1.12.1/src/gac/providers/anthropic.py +0 -51
  87. gac-1.12.1/src/gac/providers/cerebras.py +0 -38
  88. gac-1.12.1/src/gac/providers/chutes.py +0 -71
  89. gac-1.12.1/src/gac/providers/deepseek.py +0 -38
  90. gac-1.12.1/src/gac/providers/fireworks.py +0 -38
  91. gac-1.12.1/src/gac/providers/gemini.py +0 -87
  92. gac-1.12.1/src/gac/providers/groq.py +0 -63
  93. gac-1.12.1/src/gac/providers/lmstudio.py +0 -59
  94. gac-1.12.1/src/gac/providers/minimax.py +0 -38
  95. gac-1.12.1/src/gac/providers/ollama.py +0 -50
  96. gac-1.12.1/src/gac/providers/openai.py +0 -38
  97. gac-1.12.1/src/gac/providers/openrouter.py +0 -58
  98. gac-1.12.1/src/gac/providers/streamlake.py +0 -51
  99. gac-1.12.1/src/gac/providers/synthetic.py +0 -42
  100. gac-1.12.1/src/gac/providers/together.py +0 -38
  101. gac-1.12.1/src/gac/providers/zai.py +0 -59
  102. gac-1.12.1/src/gac/utils.py +0 -132
  103. {gac-1.12.1 → gac-3.10.11}/.gitignore +0 -0
  104. {gac-1.12.1 → gac-3.10.11}/LICENSE +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gac
3
- Version: 1.12.1
3
+ Version: 3.10.11
4
4
  Summary: LLM-powered Git commit message generator with multi-provider support
5
5
  Project-URL: Homepage, https://github.com/cellwebb/gac
6
6
  Project-URL: Documentation, https://github.com/cellwebb/gac#readme
@@ -22,9 +22,9 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
22
22
  Classifier: Programming Language :: Python :: Implementation :: PyPy
23
23
  Requires-Python: >=3.10
24
24
  Requires-Dist: click>=8.3.0
25
- Requires-Dist: halo
26
25
  Requires-Dist: httpcore>=1.0.9
27
26
  Requires-Dist: httpx>=0.28.0
27
+ Requires-Dist: prompt-toolkit>=3.0.36
28
28
  Requires-Dist: pydantic>=2.12.0
29
29
  Requires-Dist: python-dotenv>=1.1.1
30
30
  Requires-Dist: questionary
@@ -40,21 +40,26 @@ Requires-Dist: twine; extra == 'dev'
40
40
  Description-Content-Type: text/markdown
41
41
 
42
42
  <!-- markdownlint-disable MD013 -->
43
+ <!-- markdownlint-disable MD033 MD036 -->
44
+
45
+ <div align="center">
43
46
 
44
47
  # 🚀 Git Auto Commit (gac)
45
48
 
46
49
  [![PyPI version](https://img.shields.io/pypi/v/gac.svg)](https://pypi.org/project/gac/)
47
- [![Python](https://img.shields.io/badge/python-3.10%20|%203.11%20|%203.12%20|%203.13%20|%203.14-blue.svg)](https://www.python.org/downloads/)
50
+ [![Python](https://img.shields.io/badge/python-3.10--3.14-blue.svg)](https://www.python.org/downloads/)
48
51
  [![Build Status](https://github.com/cellwebb/gac/actions/workflows/ci.yml/badge.svg)](https://github.com/cellwebb/gac/actions)
49
52
  [![codecov](https://codecov.io/gh/cellwebb/gac/branch/main/graph/badge.svg)](https://app.codecov.io/gh/cellwebb/gac)
50
53
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
51
54
  [![mypy](https://img.shields.io/badge/mypy-checked-blue.svg)](https://mypy-lang.org/)
52
- [![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](docs/CONTRIBUTING.md)
55
+ [![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](docs/en/CONTRIBUTING.md)
53
56
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
54
57
 
55
- **LLM-powered commit messages that understand your code.**
58
+ **English** | [简体中文](docs/zh-CN/README.md) | [繁體中文](docs/zh-TW/README.md) | [日本語](docs/ja/README.md) | [한국어](docs/ko/README.md) | [हिन्दी](docs/hi/README.md) | [Tiếng Việt](docs/vi/README.md) | [Français](docs/fr/README.md) | [Русский](docs/ru/README.md) | [Español](docs/es/README.md) | [Português](docs/pt/README.md) | [Norsk](docs/no/README.md) | [Svenska](docs/sv/README.md) | [Deutsch](docs/de/README.md) | [Nederlands](docs/nl/README.md) | [Italiano](docs/it/README.md)
59
+
60
+ **LLM-powered commit messages that understand your code!**
56
61
 
57
- **Tired of writing commit messages?** Replace `git commit -m "..."` with `gac` for contextual, well-formatted commit messages generated by large language models.
62
+ **Automate your commits!** Replace `git commit -m "..."` with `gac` for contextual, well-formatted commit messages generated by large language models!
58
63
 
59
64
  ---
60
65
 
@@ -66,18 +71,22 @@ Intelligent, contextual messages that explain the **why** behind your changes:
66
71
 
67
72
  ---
68
73
 
74
+ </div>
75
+
76
+ <!-- markdownlint-enable MD033 MD036 -->
77
+
69
78
  ## Quick Start
70
79
 
71
- ### Use without installing
80
+ ### Use gac without installing
72
81
 
73
82
  ```bash
74
- uvx gac init # Configure your LLM provider
83
+ uvx gac init # Configure your provider, model, and language
75
84
  uvx gac # Generate and commit with LLM
76
85
  ```
77
86
 
78
87
  That's it! Review the generated message and confirm with `y`.
79
88
 
80
- ### Install gac globally
89
+ ### Install and use gac
81
90
 
82
91
  ```bash
83
92
  uv tool install gac
@@ -85,21 +94,30 @@ gac init
85
94
  gac
86
95
  ```
87
96
 
97
+ ### Upgrade installed gac
98
+
99
+ ```bash
100
+ uv tool upgrade gac
101
+ ```
102
+
88
103
  ---
89
104
 
90
105
  ## Key Features
91
106
 
92
- ### 🌐 **Supported Providers**
107
+ ### 🌐 **25+ Supported Providers**
93
108
 
94
- - **Anthropic** • **Cerebras** • **Chutes.ai** • **DeepSeek** • **Fireworks** **Gemini**
95
- - **Groq** • **LM Studio** • **MiniMax** • **Ollama** • **OpenAI** • **OpenRouter**
96
- - **Streamlake** • **Synthetic.new** • **Together AI** • **Z.AI** • **Z.AI Coding**
109
+ - **Anthropic** • **Azure OpenAI** • **Cerebras** • **Chutes.ai** • **Claude Code (OAuth)**
110
+ - **DeepSeek** • **Fireworks** • **Gemini** • **Groq** • **Kimi for Coding** • **LM Studio**
111
+ - **MiniMax.io** • **Mistral AI** • **Moonshot AI** • **Ollama** • **OpenAI** **OpenRouter**
112
+ - **Qwen.ai (OAuth)** • **Replicate** • **Streamlake** • **Synthetic.new** • **Together AI**
113
+ - **Z.AI** • **Z.AI Coding** • **Custom Endpoints (Anthropic/OpenAI)**
97
114
 
98
115
  ### 🧠 **Smart LLM Analysis**
99
116
 
100
117
  - **Understands intent**: Analyzes code structure, logic, and patterns to understand the "why" behind your changes, not just what changed
101
118
  - **Semantic awareness**: Recognizes refactoring, bug fixes, features, and breaking changes to generate contextually appropriate messages
102
119
  - **Intelligent filtering**: Prioritizes meaningful changes while ignoring generated files, dependencies, and artifacts
120
+ - **Intelligent commit grouping** - Automatically group related changes into multiple logical commits with `--group`
103
121
 
104
122
  ### 📝 **Multiple Message Formats**
105
123
 
@@ -107,9 +125,17 @@ gac
107
125
  - **Standard** (default): Summary with bullet points explaining implementation details
108
126
  - **Verbose** (-v flag): Comprehensive explanations including motivation, technical approach, and impact analysis
109
127
 
128
+ ### 🌍 **Multilingual Support**
129
+
130
+ - **25+ languages**: Generate commit messages in English, Chinese, Japanese, Korean, Spanish, French, German, and 20+ more languages
131
+ - **Flexible translation**: Choose to keep conventional commit prefixes in English for tool compatibility, or fully translate them
132
+ - **Multiple workflows**: Set a default language with `gac language`, or use `-l <language>` flag for one-time overrides
133
+ - **Native script support**: Full support for non-Latin scripts including CJK, Cyrillic, Thai, and more
134
+
110
135
  ### 💻 **Developer Experience**
111
136
 
112
- - **Interactive feedback**: Regenerate messages with specific requests like `r "make it shorter"` or `r "focus on the bug fix"`
137
+ - **Interactive feedback**: Type `r` to reroll, `e` to edit in-place with vi/emacs keybindings, or directly type your feedback like `make it shorter` or `focus on the bug fix`
138
+ - **Interactive questioning**: Use `--interactive` (`-i`) to answer targeted questions about your changes for more contextual commit messages
113
139
  - **One-command workflows**: Complete workflows with flags like `gac -ayp` (stage all, auto-confirm, push)
114
140
  - **Git integration**: Respects pre-commit and lefthook hooks, running them before expensive LLM operations
115
141
 
@@ -132,7 +158,7 @@ git add .
132
158
  # Generate and commit with LLM
133
159
  gac
134
160
 
135
- # Review → y (commit) | n (cancel) | r (reroll)
161
+ # Review → y (commit) | n (cancel) | r (reroll) | e (edit) | or type feedback
136
162
  ```
137
163
 
138
164
  ### Common Commands
@@ -146,6 +172,7 @@ gac
146
172
  | `gac -v` | Verbose format with Motivation, Technical Approach, and Impact Analysis |
147
173
  | `gac -h "hint"` | Add context for LLM (e.g., `gac -h "bug fix"`) |
148
174
  | `gac -s` | Include scope (e.g., feat(auth):) |
175
+ | `gac -i` | Ask questions about changes for better context |
149
176
  | `gac -p` | Commit and push |
150
177
 
151
178
  ### Power User Examples
@@ -160,6 +187,12 @@ gac -v -s
160
187
  # Quick one-liner for small changes
161
188
  gac -o
162
189
 
190
+ # Group changes into logically related commits
191
+ gac -ag
192
+
193
+ # Interactive mode with verbose output for detailed explanations
194
+ gac -iv
195
+
163
196
  # Debug what the LLM sees
164
197
  gac --show-prompt
165
198
 
@@ -167,26 +200,42 @@ gac --show-prompt
167
200
  gac --skip-secret-scan
168
201
  ```
169
202
 
170
- ### Interactive Reroll System
203
+ ### Interactive Feedback System
171
204
 
172
- Not happy with the result? Use the reroll feature for intelligent regeneration:
205
+ Not happy with the result? You have several options:
173
206
 
174
207
  ```bash
175
- # Simple reroll
208
+ # Simple reroll (no feedback)
176
209
  r
177
210
 
178
- # With specific feedback
179
- r make it shorter and focus on the performance improvement
180
- r use conventional commit format with scope
181
- r explain the security implications
211
+ # Edit in-place with rich terminal editing
212
+ e
213
+ # Uses prompt_toolkit for multi-line editing with vi/emacs keybindings
214
+ # Press Esc+Enter or Ctrl+S to submit, Ctrl+C to cancel
215
+
216
+ # Or just type your feedback directly!
217
+ make it shorter and focus on the performance improvement
218
+ use conventional commit format with scope
219
+ explain the security implications
220
+
221
+ # Press Enter on empty input to see the prompt again
182
222
  ```
183
223
 
224
+ The edit feature (`e`) provides rich in-place terminal editing, allowing you to:
225
+
226
+ - **Edit naturally**: Multi-line editing with familiar vi/emacs key bindings
227
+ - **Make quick fixes**: Correct typos, adjust wording, or refine formatting
228
+ - **Add details**: Include information the LLM might have missed
229
+ - **Restructure**: Reorganize bullet points or change the message structure
230
+
184
231
  ---
185
232
 
186
233
  ## Configuration
187
234
 
188
235
  Run `gac init` to configure your provider interactively, or set environment variables:
189
236
 
237
+ Need to change providers or models later without touching language settings? Use `gac model` for a streamlined flow that skips the language prompts.
238
+
190
239
  ```bash
191
240
  # Example configuration
192
241
  GAC_MODEL=anthropic:your-model-name
@@ -196,13 +245,28 @@ ANTHROPIC_API_KEY=your_key_here
196
245
 
197
246
  See `.gac.env.example` for all available options.
198
247
 
248
+ **Want commit messages in another language?** Run `gac language` to select from 25+ languages including Español, Français, 日本語, and more.
249
+
250
+ **Want to customize commit message style?** See [docs/CUSTOM_SYSTEM_PROMPTS.md](docs/en/CUSTOM_SYSTEM_PROMPTS.md) for guidance on writing custom system prompts.
251
+
252
+ ---
253
+
254
+ ## Project Analytics
255
+
256
+ 📊 **[View live usage analytics and statistics →](https://clickpy.clickhouse.com/dashboard/gac)**
257
+
258
+ Track real-time installation metrics and package download statistics.
259
+
199
260
  ---
200
261
 
201
262
  ## Getting Help
202
263
 
203
- - **Full documentation**: [USAGE.md](USAGE.md) - Complete CLI reference
204
- - **Troubleshooting**: [TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md) - Common issues and solutions
205
- - **Contributing**: [CONTRIBUTING.md](docs/CONTRIBUTING.md) - Development setup and guidelines
264
+ - **Full documentation**: [docs/USAGE.md](docs/en/USAGE.md) - Complete CLI reference
265
+ - **Claude Code OAuth**: [docs/CLAUDE_CODE.md](docs/en/CLAUDE_CODE.md) - Claude Code setup and authentication
266
+ - **Qwen.ai OAuth**: [docs/QWEN.md](docs/en/QWEN.md) - Qwen.ai setup and authentication
267
+ - **Custom prompts**: [docs/CUSTOM_SYSTEM_PROMPTS.md](docs/en/CUSTOM_SYSTEM_PROMPTS.md) - Customize commit message style
268
+ - **Troubleshooting**: [docs/TROUBLESHOOTING.md](docs/en/TROUBLESHOOTING.md) - Common issues and solutions
269
+ - **Contributing**: [docs/CONTRIBUTING.md](docs/en/CONTRIBUTING.md) - Development setup and guidelines
206
270
 
207
271
  ---
208
272
 
@@ -212,7 +276,7 @@ See `.gac.env.example` for all available options.
212
276
 
213
277
  Made with ❤️ for developers who want better commit messages
214
278
 
215
- [⭐ Star us on GitHub](https://github.com/cellwebb/gac) • [🐛 Report issues](https://github.com/cellwebb/gac/issues) • [📖 Full docs](USAGE.md)
279
+ [⭐ Star us on GitHub](https://github.com/cellwebb/gac) • [🐛 Report issues](https://github.com/cellwebb/gac/issues) • [📖 Full docs](docs/en/USAGE.md)
216
280
 
217
281
  </div>
218
282
 
gac-3.10.11/README.md ADDED
@@ -0,0 +1,242 @@
1
+ <!-- markdownlint-disable MD013 -->
2
+ <!-- markdownlint-disable MD033 MD036 -->
3
+
4
+ <div align="center">
5
+
6
+ # 🚀 Git Auto Commit (gac)
7
+
8
+ [![PyPI version](https://img.shields.io/pypi/v/gac.svg)](https://pypi.org/project/gac/)
9
+ [![Python](https://img.shields.io/badge/python-3.10--3.14-blue.svg)](https://www.python.org/downloads/)
10
+ [![Build Status](https://github.com/cellwebb/gac/actions/workflows/ci.yml/badge.svg)](https://github.com/cellwebb/gac/actions)
11
+ [![codecov](https://codecov.io/gh/cellwebb/gac/branch/main/graph/badge.svg)](https://app.codecov.io/gh/cellwebb/gac)
12
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
13
+ [![mypy](https://img.shields.io/badge/mypy-checked-blue.svg)](https://mypy-lang.org/)
14
+ [![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](docs/en/CONTRIBUTING.md)
15
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
16
+
17
+ **English** | [简体中文](docs/zh-CN/README.md) | [繁體中文](docs/zh-TW/README.md) | [日本語](docs/ja/README.md) | [한국어](docs/ko/README.md) | [हिन्दी](docs/hi/README.md) | [Tiếng Việt](docs/vi/README.md) | [Français](docs/fr/README.md) | [Русский](docs/ru/README.md) | [Español](docs/es/README.md) | [Português](docs/pt/README.md) | [Norsk](docs/no/README.md) | [Svenska](docs/sv/README.md) | [Deutsch](docs/de/README.md) | [Nederlands](docs/nl/README.md) | [Italiano](docs/it/README.md)
18
+
19
+ **LLM-powered commit messages that understand your code!**
20
+
21
+ **Automate your commits!** Replace `git commit -m "..."` with `gac` for contextual, well-formatted commit messages generated by large language models!
22
+
23
+ ---
24
+
25
+ ## What You Get
26
+
27
+ Intelligent, contextual messages that explain the **why** behind your changes:
28
+
29
+ ![GAC generating a contextual commit message](assets/gac-simple-usage.png)
30
+
31
+ ---
32
+
33
+ </div>
34
+
35
+ <!-- markdownlint-enable MD033 MD036 -->
36
+
37
+ ## Quick Start
38
+
39
+ ### Use gac without installing
40
+
41
+ ```bash
42
+ uvx gac init # Configure your provider, model, and language
43
+ uvx gac # Generate and commit with LLM
44
+ ```
45
+
46
+ That's it! Review the generated message and confirm with `y`.
47
+
48
+ ### Install and use gac
49
+
50
+ ```bash
51
+ uv tool install gac
52
+ gac init
53
+ gac
54
+ ```
55
+
56
+ ### Upgrade installed gac
57
+
58
+ ```bash
59
+ uv tool upgrade gac
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Key Features
65
+
66
+ ### 🌐 **25+ Supported Providers**
67
+
68
+ - **Anthropic** • **Azure OpenAI** • **Cerebras** • **Chutes.ai** • **Claude Code (OAuth)**
69
+ - **DeepSeek** • **Fireworks** • **Gemini** • **Groq** • **Kimi for Coding** • **LM Studio**
70
+ - **MiniMax.io** • **Mistral AI** • **Moonshot AI** • **Ollama** • **OpenAI** • **OpenRouter**
71
+ - **Qwen.ai (OAuth)** • **Replicate** • **Streamlake** • **Synthetic.new** • **Together AI**
72
+ - **Z.AI** • **Z.AI Coding** • **Custom Endpoints (Anthropic/OpenAI)**
73
+
74
+ ### 🧠 **Smart LLM Analysis**
75
+
76
+ - **Understands intent**: Analyzes code structure, logic, and patterns to understand the "why" behind your changes, not just what changed
77
+ - **Semantic awareness**: Recognizes refactoring, bug fixes, features, and breaking changes to generate contextually appropriate messages
78
+ - **Intelligent filtering**: Prioritizes meaningful changes while ignoring generated files, dependencies, and artifacts
79
+ - **Intelligent commit grouping** - Automatically group related changes into multiple logical commits with `--group`
80
+
81
+ ### 📝 **Multiple Message Formats**
82
+
83
+ - **One-liner** (-o flag): Single-line commit message following conventional commit format
84
+ - **Standard** (default): Summary with bullet points explaining implementation details
85
+ - **Verbose** (-v flag): Comprehensive explanations including motivation, technical approach, and impact analysis
86
+
87
+ ### 🌍 **Multilingual Support**
88
+
89
+ - **25+ languages**: Generate commit messages in English, Chinese, Japanese, Korean, Spanish, French, German, and 20+ more languages
90
+ - **Flexible translation**: Choose to keep conventional commit prefixes in English for tool compatibility, or fully translate them
91
+ - **Multiple workflows**: Set a default language with `gac language`, or use `-l <language>` flag for one-time overrides
92
+ - **Native script support**: Full support for non-Latin scripts including CJK, Cyrillic, Thai, and more
93
+
94
+ ### 💻 **Developer Experience**
95
+
96
+ - **Interactive feedback**: Type `r` to reroll, `e` to edit in-place with vi/emacs keybindings, or directly type your feedback like `make it shorter` or `focus on the bug fix`
97
+ - **Interactive questioning**: Use `--interactive` (`-i`) to answer targeted questions about your changes for more contextual commit messages
98
+ - **One-command workflows**: Complete workflows with flags like `gac -ayp` (stage all, auto-confirm, push)
99
+ - **Git integration**: Respects pre-commit and lefthook hooks, running them before expensive LLM operations
100
+
101
+ ### 🛡️ **Built-in Security**
102
+
103
+ - **Automatic secret detection**: Scans for API keys, passwords, and tokens before committing
104
+ - **Interactive protection**: Prompts before committing potentially sensitive data with clear remediation options
105
+ - **Smart filtering**: Ignores example files, template files, and placeholder text to reduce false positives
106
+
107
+ ---
108
+
109
+ ## Usage Examples
110
+
111
+ ### Basic Workflow
112
+
113
+ ```bash
114
+ # Stage your changes
115
+ git add .
116
+
117
+ # Generate and commit with LLM
118
+ gac
119
+
120
+ # Review → y (commit) | n (cancel) | r (reroll) | e (edit) | or type feedback
121
+ ```
122
+
123
+ ### Common Commands
124
+
125
+ | Command | Description |
126
+ | --------------- | ----------------------------------------------------------------------- |
127
+ | `gac` | Generate commit message |
128
+ | `gac -y` | Auto-confirm (no review needed) |
129
+ | `gac -a` | Stage all before generating commit message |
130
+ | `gac -o` | One-line message for trivial changes |
131
+ | `gac -v` | Verbose format with Motivation, Technical Approach, and Impact Analysis |
132
+ | `gac -h "hint"` | Add context for LLM (e.g., `gac -h "bug fix"`) |
133
+ | `gac -s` | Include scope (e.g., feat(auth):) |
134
+ | `gac -i` | Ask questions about changes for better context |
135
+ | `gac -p` | Commit and push |
136
+
137
+ ### Power User Examples
138
+
139
+ ```bash
140
+ # Complete workflow in one command
141
+ gac -ayp -h "release preparation"
142
+
143
+ # Detailed explanation with scope
144
+ gac -v -s
145
+
146
+ # Quick one-liner for small changes
147
+ gac -o
148
+
149
+ # Group changes into logically related commits
150
+ gac -ag
151
+
152
+ # Interactive mode with verbose output for detailed explanations
153
+ gac -iv
154
+
155
+ # Debug what the LLM sees
156
+ gac --show-prompt
157
+
158
+ # Skip security scan (use carefully)
159
+ gac --skip-secret-scan
160
+ ```
161
+
162
+ ### Interactive Feedback System
163
+
164
+ Not happy with the result? You have several options:
165
+
166
+ ```bash
167
+ # Simple reroll (no feedback)
168
+ r
169
+
170
+ # Edit in-place with rich terminal editing
171
+ e
172
+ # Uses prompt_toolkit for multi-line editing with vi/emacs keybindings
173
+ # Press Esc+Enter or Ctrl+S to submit, Ctrl+C to cancel
174
+
175
+ # Or just type your feedback directly!
176
+ make it shorter and focus on the performance improvement
177
+ use conventional commit format with scope
178
+ explain the security implications
179
+
180
+ # Press Enter on empty input to see the prompt again
181
+ ```
182
+
183
+ The edit feature (`e`) provides rich in-place terminal editing, allowing you to:
184
+
185
+ - **Edit naturally**: Multi-line editing with familiar vi/emacs key bindings
186
+ - **Make quick fixes**: Correct typos, adjust wording, or refine formatting
187
+ - **Add details**: Include information the LLM might have missed
188
+ - **Restructure**: Reorganize bullet points or change the message structure
189
+
190
+ ---
191
+
192
+ ## Configuration
193
+
194
+ Run `gac init` to configure your provider interactively, or set environment variables:
195
+
196
+ Need to change providers or models later without touching language settings? Use `gac model` for a streamlined flow that skips the language prompts.
197
+
198
+ ```bash
199
+ # Example configuration
200
+ GAC_MODEL=anthropic:your-model-name
201
+ OPENAI_API_KEY=your_key_here
202
+ ANTHROPIC_API_KEY=your_key_here
203
+ ```
204
+
205
+ See `.gac.env.example` for all available options.
206
+
207
+ **Want commit messages in another language?** Run `gac language` to select from 25+ languages including Español, Français, 日本語, and more.
208
+
209
+ **Want to customize commit message style?** See [docs/CUSTOM_SYSTEM_PROMPTS.md](docs/en/CUSTOM_SYSTEM_PROMPTS.md) for guidance on writing custom system prompts.
210
+
211
+ ---
212
+
213
+ ## Project Analytics
214
+
215
+ 📊 **[View live usage analytics and statistics →](https://clickpy.clickhouse.com/dashboard/gac)**
216
+
217
+ Track real-time installation metrics and package download statistics.
218
+
219
+ ---
220
+
221
+ ## Getting Help
222
+
223
+ - **Full documentation**: [docs/USAGE.md](docs/en/USAGE.md) - Complete CLI reference
224
+ - **Claude Code OAuth**: [docs/CLAUDE_CODE.md](docs/en/CLAUDE_CODE.md) - Claude Code setup and authentication
225
+ - **Qwen.ai OAuth**: [docs/QWEN.md](docs/en/QWEN.md) - Qwen.ai setup and authentication
226
+ - **Custom prompts**: [docs/CUSTOM_SYSTEM_PROMPTS.md](docs/en/CUSTOM_SYSTEM_PROMPTS.md) - Customize commit message style
227
+ - **Troubleshooting**: [docs/TROUBLESHOOTING.md](docs/en/TROUBLESHOOTING.md) - Common issues and solutions
228
+ - **Contributing**: [docs/CONTRIBUTING.md](docs/en/CONTRIBUTING.md) - Development setup and guidelines
229
+
230
+ ---
231
+
232
+ <!-- markdownlint-disable MD033 MD036 -->
233
+
234
+ <div align="center">
235
+
236
+ Made with ❤️ for developers who want better commit messages
237
+
238
+ [⭐ Star us on GitHub](https://github.com/cellwebb/gac) • [🐛 Report issues](https://github.com/cellwebb/gac/issues) • [📖 Full docs](docs/en/USAGE.md)
239
+
240
+ </div>
241
+
242
+ <!-- markdownlint-enable MD033 MD036 -->
@@ -38,9 +38,9 @@ dependencies = [
38
38
 
39
39
  # CLI and formatting
40
40
  "click>=8.3.0",
41
- "halo",
42
41
  "questionary",
43
42
  "rich>=14.1.0",
43
+ "prompt_toolkit>=3.0.36",
44
44
 
45
45
  ]
46
46
 
@@ -202,8 +202,8 @@ addopts = "-m 'not integration'"
202
202
  python_version = "3.10"
203
203
  warn_return_any = true
204
204
  warn_unused_configs = true
205
- disallow_untyped_defs = false
206
- disallow_incomplete_defs = false
205
+ disallow_untyped_defs = true
206
+ disallow_incomplete_defs = true
207
207
  check_untyped_defs = true
208
208
  no_implicit_optional = true
209
209
  warn_redundant_casts = true
@@ -217,10 +217,6 @@ show_error_codes = true
217
217
  module = "gac.providers.*"
218
218
  warn_return_any = false
219
219
 
220
- [[tool.mypy.overrides]]
221
- module = "halo"
222
- ignore_missing_imports = true
223
-
224
220
  [template.plugins.default]
225
221
  tests = true
226
222
  src-layout = true
@@ -1,15 +1,13 @@
1
1
  """Git Auto Commit (gac) - Generate commit messages using AI."""
2
2
 
3
+ from gac import init_cli
3
4
  from gac.__version__ import __version__
4
5
  from gac.ai import generate_commit_message
5
- from gac.git import get_staged_files, push_changes
6
- from gac.prompt import build_prompt, clean_commit_message
6
+ from gac.prompt import build_prompt
7
7
 
8
8
  __all__ = [
9
9
  "__version__",
10
- "generate_commit_message",
11
10
  "build_prompt",
12
- "clean_commit_message",
13
- "get_staged_files",
14
- "push_changes",
11
+ "generate_commit_message",
12
+ "init_cli",
15
13
  ]
@@ -1,3 +1,3 @@
1
1
  """Version information for gac package."""
2
2
 
3
- __version__ = "1.12.1"
3
+ __version__ = "3.10.11"
@@ -9,25 +9,7 @@ import logging
9
9
  from gac.ai_utils import generate_with_retries
10
10
  from gac.constants import EnvDefaults
11
11
  from gac.errors import AIError
12
- from gac.providers import (
13
- call_anthropic_api,
14
- call_cerebras_api,
15
- call_chutes_api,
16
- call_deepseek_api,
17
- call_fireworks_api,
18
- call_gemini_api,
19
- call_groq_api,
20
- call_lmstudio_api,
21
- call_minimax_api,
22
- call_ollama_api,
23
- call_openai_api,
24
- call_openrouter_api,
25
- call_streamlake_api,
26
- call_synthetic_api,
27
- call_together_api,
28
- call_zai_api,
29
- call_zai_coding_api,
30
- )
12
+ from gac.providers import PROVIDER_REGISTRY
31
13
 
32
14
  logger = logging.getLogger(__name__)
33
15
 
@@ -39,11 +21,14 @@ def generate_commit_message(
39
21
  max_tokens: int = EnvDefaults.MAX_OUTPUT_TOKENS,
40
22
  max_retries: int = EnvDefaults.MAX_RETRIES,
41
23
  quiet: bool = False,
24
+ is_group: bool = False,
25
+ skip_success_message: bool = False,
26
+ task_description: str = "commit message",
42
27
  ) -> str:
43
28
  """Generate a commit message using direct API calls to AI providers.
44
29
 
45
30
  Args:
46
- model: The model to use in provider:model_name format (e.g., 'anthropic:claude-3-5-haiku-latest')
31
+ model: The model to use in provider:model_name format (e.g., 'anthropic:claude-haiku-4-5')
47
32
  prompt: Either a string prompt (for backward compatibility) or tuple of (system_prompt, user_prompt)
48
33
  temperature: Controls randomness (0.0-1.0), lower values are more deterministic
49
34
  max_tokens: Maximum tokens in the response
@@ -57,7 +42,7 @@ def generate_commit_message(
57
42
  AIError: If generation fails after max_retries attempts
58
43
 
59
44
  Example:
60
- >>> model = "anthropic:claude-3-5-haiku-latest"
45
+ >>> model = "anthropic:claude-haiku-4-5"
61
46
  >>> system_prompt, user_prompt = build_prompt("On branch main", "diff --git a/README.md b/README.md")
62
47
  >>> generate_commit_message(model, (system_prompt, user_prompt))
63
48
  'docs: Update README with installation instructions'
@@ -79,37 +64,19 @@ def generate_commit_message(
79
64
  {"role": "user", "content": user_prompt},
80
65
  ]
81
66
 
82
- # Provider functions mapping
83
- provider_funcs = {
84
- "anthropic": call_anthropic_api,
85
- "cerebras": call_cerebras_api,
86
- "chutes": call_chutes_api,
87
- "deepseek": call_deepseek_api,
88
- "fireworks": call_fireworks_api,
89
- "gemini": call_gemini_api,
90
- "groq": call_groq_api,
91
- "lm-studio": call_lmstudio_api,
92
- "minimax": call_minimax_api,
93
- "ollama": call_ollama_api,
94
- "openai": call_openai_api,
95
- "openrouter": call_openrouter_api,
96
- "streamlake": call_streamlake_api,
97
- "synthetic": call_synthetic_api,
98
- "together": call_together_api,
99
- "zai": call_zai_api,
100
- "zai-coding": call_zai_coding_api,
101
- }
102
-
103
67
  # Generate the commit message using centralized retry logic
104
68
  try:
105
69
  return generate_with_retries(
106
- provider_funcs=provider_funcs,
70
+ provider_funcs=PROVIDER_REGISTRY,
107
71
  model=model,
108
72
  messages=messages,
109
73
  temperature=temperature,
110
74
  max_tokens=max_tokens,
111
75
  max_retries=max_retries,
112
76
  quiet=quiet,
77
+ is_group=is_group,
78
+ skip_success_message=skip_success_message,
79
+ task_description=task_description,
113
80
  )
114
81
  except AIError:
115
82
  # Re-raise AIError exceptions as-is to preserve error classification
@@ -117,3 +84,26 @@ def generate_commit_message(
117
84
  except Exception as e:
118
85
  logger.error(f"Failed to generate commit message: {e}")
119
86
  raise AIError.model_error(f"Failed to generate commit message: {e}") from e
87
+
88
+
89
+ def generate_grouped_commits(
90
+ model: str,
91
+ prompt: list[dict[str, str]],
92
+ temperature: float,
93
+ max_tokens: int,
94
+ max_retries: int,
95
+ quiet: bool = False,
96
+ skip_success_message: bool = False,
97
+ ) -> str:
98
+ """Generate grouped commits JSON response."""
99
+ return generate_commit_message(
100
+ model=model,
101
+ prompt=prompt,
102
+ temperature=temperature,
103
+ max_tokens=max_tokens,
104
+ max_retries=max_retries,
105
+ quiet=quiet,
106
+ is_group=True,
107
+ skip_success_message=skip_success_message,
108
+ task_description="commit message",
109
+ )