gac 2.6.1__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.

Potentially problematic release.


This version of gac might be problematic. Click here for more details.

Files changed (47) hide show
  1. gac-2.6.1/.gitignore +213 -0
  2. gac-2.6.1/LICENSE +16 -0
  3. gac-2.6.1/PKG-INFO +276 -0
  4. gac-2.6.1/README.md +234 -0
  5. gac-2.6.1/pyproject.toml +235 -0
  6. gac-2.6.1/src/gac/__init__.py +15 -0
  7. gac-2.6.1/src/gac/__version__.py +3 -0
  8. gac-2.6.1/src/gac/ai.py +153 -0
  9. gac-2.6.1/src/gac/ai_utils.py +219 -0
  10. gac-2.6.1/src/gac/cli.py +183 -0
  11. gac-2.6.1/src/gac/config.py +48 -0
  12. gac-2.6.1/src/gac/config_cli.py +62 -0
  13. gac-2.6.1/src/gac/constants.py +320 -0
  14. gac-2.6.1/src/gac/diff_cli.py +181 -0
  15. gac-2.6.1/src/gac/errors.py +231 -0
  16. gac-2.6.1/src/gac/git.py +325 -0
  17. gac-2.6.1/src/gac/init_cli.py +472 -0
  18. gac-2.6.1/src/gac/language_cli.py +250 -0
  19. gac-2.6.1/src/gac/main.py +767 -0
  20. gac-2.6.1/src/gac/oauth/__init__.py +1 -0
  21. gac-2.6.1/src/gac/oauth/claude_code.py +397 -0
  22. gac-2.6.1/src/gac/preprocess.py +511 -0
  23. gac-2.6.1/src/gac/prompt.py +785 -0
  24. gac-2.6.1/src/gac/providers/__init__.py +46 -0
  25. gac-2.6.1/src/gac/providers/anthropic.py +51 -0
  26. gac-2.6.1/src/gac/providers/cerebras.py +38 -0
  27. gac-2.6.1/src/gac/providers/chutes.py +71 -0
  28. gac-2.6.1/src/gac/providers/claude_code.py +102 -0
  29. gac-2.6.1/src/gac/providers/custom_anthropic.py +133 -0
  30. gac-2.6.1/src/gac/providers/custom_openai.py +99 -0
  31. gac-2.6.1/src/gac/providers/deepseek.py +38 -0
  32. gac-2.6.1/src/gac/providers/fireworks.py +38 -0
  33. gac-2.6.1/src/gac/providers/gemini.py +87 -0
  34. gac-2.6.1/src/gac/providers/groq.py +63 -0
  35. gac-2.6.1/src/gac/providers/lmstudio.py +59 -0
  36. gac-2.6.1/src/gac/providers/minimax.py +38 -0
  37. gac-2.6.1/src/gac/providers/mistral.py +38 -0
  38. gac-2.6.1/src/gac/providers/ollama.py +50 -0
  39. gac-2.6.1/src/gac/providers/openai.py +38 -0
  40. gac-2.6.1/src/gac/providers/openrouter.py +58 -0
  41. gac-2.6.1/src/gac/providers/streamlake.py +51 -0
  42. gac-2.6.1/src/gac/providers/synthetic.py +42 -0
  43. gac-2.6.1/src/gac/providers/together.py +38 -0
  44. gac-2.6.1/src/gac/providers/zai.py +59 -0
  45. gac-2.6.1/src/gac/security.py +293 -0
  46. gac-2.6.1/src/gac/utils.py +371 -0
  47. gac-2.6.1/src/gac/workflow_utils.py +134 -0
gac-2.6.1/.gitignore ADDED
@@ -0,0 +1,213 @@
1
+ # Git Auto Commit (gac) .gitignore
2
+ # ----------------------------------------------------------------------------
3
+
4
+ # =========================
5
+ # Operating System Files
6
+ # =========================
7
+ # macOS
8
+ .DS_Store
9
+ .AppleDouble
10
+ .LSOverride
11
+ ._*
12
+ .Spotlight-V100
13
+ .Trashes
14
+
15
+ # Windows
16
+ Thumbs.db
17
+ ehthumbs.db
18
+ Desktop.ini
19
+ $RECYCLE.BIN/
20
+ *.cab
21
+ *.msi
22
+ *.msm
23
+ *.msp
24
+ *.lnk
25
+
26
+ # =========================
27
+ # GAC Project-specific files
28
+ # =========================
29
+ .gac.env
30
+ .gac_cache/
31
+ .gac-history
32
+ .gac-config.json
33
+ conversation_cache/
34
+ saved_messages/
35
+ secrets/
36
+ temp/
37
+ CLAUDE.md
38
+
39
+ # =========================
40
+ # Python
41
+ # =========================
42
+ # Byte-compiled / optimized / DLL files
43
+ __pycache__/
44
+ *.py[cod]
45
+ *$py.class
46
+
47
+ # C extensions
48
+ *.so
49
+
50
+ # Distribution / packaging
51
+ .Python
52
+ build/
53
+ develop-eggs/
54
+ dist/
55
+ downloads/
56
+ eggs/
57
+ .eggs/
58
+ lib/
59
+ lib64/
60
+ parts/
61
+ sdist/
62
+ var/
63
+ wheels/
64
+ share/python-wheels/
65
+ *.egg-info/
66
+ .installed.cfg
67
+ *.egg
68
+ MANIFEST
69
+
70
+ # Installer logs
71
+ pip-log.txt
72
+ pip-delete-this-directory.txt
73
+
74
+ # Unit test / coverage reports
75
+ htmlcov/
76
+ .tox/
77
+ .nox/
78
+ .coverage
79
+ .coverage.*
80
+ .cache
81
+ nosetests.xml
82
+ coverage.xml
83
+ *.cover
84
+ *.py,cover
85
+ .hypothesis/
86
+ .pytest_cache/
87
+ cover/
88
+
89
+ # Virtual environments
90
+ .env
91
+ .venv
92
+ env/
93
+ venv/
94
+ ENV/
95
+ env.bak/
96
+ venv.bak/
97
+
98
+ # Package management
99
+ poetry.toml
100
+
101
+ # =========================
102
+ # Python tools and linters
103
+ # =========================
104
+ # Ruff
105
+ .ruff_cache/
106
+
107
+ # mypy
108
+ .mypy_cache/
109
+ .dmypy.json
110
+ dmypy.json
111
+
112
+ # Pyre
113
+ .pyre/
114
+
115
+ # pytype
116
+ .pytype/
117
+
118
+ # Cython
119
+ cython_debug/
120
+
121
+ # LSP
122
+ pyrightconfig.json
123
+
124
+ # =========================
125
+ # Node.js
126
+ # =========================
127
+ # Logs
128
+ logs
129
+ *.log
130
+ npm-debug.log*
131
+ yarn-debug.log*
132
+ yarn-error.log*
133
+ lerna-debug.log*
134
+ .pnpm-debug.log*
135
+
136
+ # Dependency directories
137
+ node_modules/
138
+ jspm_packages/
139
+ web_modules/
140
+
141
+ # Caches
142
+ .npm
143
+ .eslintcache
144
+ .stylelintcache
145
+ .parcel-cache
146
+ .cache
147
+ .rpt2_cache/
148
+ .rts2_cache_cjs/
149
+ .rts2_cache_es/
150
+ .rts2_cache_umd/
151
+
152
+ # Build outputs
153
+ dist/
154
+ build/
155
+ .next
156
+ out
157
+ .nuxt
158
+ .vuepress/dist
159
+ .temp
160
+ .docusaurus
161
+
162
+ # Yarn
163
+ .yarn/cache
164
+ .yarn/unplugged
165
+ .yarn/build-state.yml
166
+ .yarn/install-state.gz
167
+ .pnp.*
168
+
169
+ # =========================
170
+ # Editors
171
+ # =========================
172
+ # Visual Studio Code
173
+ .vscode/*
174
+ !.vscode/settings.json
175
+ !.vscode/tasks.json
176
+ !.vscode/launch.json
177
+ !.vscode/extensions.json
178
+ .vscode-test
179
+
180
+ # JetBrains IDEs
181
+ .idea/
182
+
183
+ # Cursor
184
+ .cursor/
185
+ .cursorrules
186
+
187
+ # Other editors
188
+ .spyderproject
189
+ .spyproject
190
+ .ropeproject
191
+ .windsurfrules
192
+
193
+ # =========================
194
+ # Backups and temporary files
195
+ # =========================
196
+ *.bak
197
+ *.tmp
198
+ *.swp
199
+
200
+ # =========================
201
+ # Private Scripts (to exclude from repository)
202
+ # =========================
203
+ scripts/auto_changelog.py
204
+ scripts/auto_release.py
205
+ scripts/prep_changelog_for_release.py
206
+ scripts/changelog_config.yaml
207
+ scripts/changelog_prompt.md
208
+
209
+ **/.claude/settings.local.json
210
+ .plandex-v2/
211
+ .vscode/
212
+ .serena/
213
+ .crush.json
gac-2.6.1/LICENSE ADDED
@@ -0,0 +1,16 @@
1
+ # MIT License
2
+
3
+ Copyright (c) 2025 cellwebb <cellwebb@users.noreply.github.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
6
+ documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
7
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
8
+ persons to whom the Software is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
11
+ Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
14
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
15
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
16
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
gac-2.6.1/PKG-INFO ADDED
@@ -0,0 +1,276 @@
1
+ Metadata-Version: 2.4
2
+ Name: gac
3
+ Version: 2.6.1
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: prompt-toolkit>=3.0.36
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: tiktoken>=0.12.0
34
+ Provides-Extra: dev
35
+ Requires-Dist: build; extra == 'dev'
36
+ Requires-Dist: codecov; 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
+ <!-- markdownlint-disable MD033 MD036 -->
45
+
46
+ <div align="center">
47
+
48
+ # 🚀 Git Auto Commit (gac)
49
+
50
+ [![PyPI version](https://img.shields.io/pypi/v/gac.svg)](https://pypi.org/project/gac/)
51
+ [![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/)
52
+ [![Build Status](https://github.com/cellwebb/gac/actions/workflows/ci.yml/badge.svg)](https://github.com/cellwebb/gac/actions)
53
+ [![codecov](https://codecov.io/gh/cellwebb/gac/branch/main/graph/badge.svg)](https://app.codecov.io/gh/cellwebb/gac)
54
+ [![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)
55
+ [![mypy](https://img.shields.io/badge/mypy-checked-blue.svg)](https://mypy-lang.org/)
56
+ [![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](docs/en/CONTRIBUTING.md)
57
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
58
+
59
+ **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)
60
+
61
+ **LLM-powered commit messages that understand your code!**
62
+
63
+ **Automate your commits!** Replace `git commit -m "..."` with `gac` for contextual, well-formatted commit messages generated by large language models!
64
+
65
+ ---
66
+
67
+ ## What You Get
68
+
69
+ Intelligent, contextual messages that explain the **why** behind your changes:
70
+
71
+ ![GAC generating a contextual commit message](assets/gac-simple-usage.png)
72
+
73
+ ---
74
+
75
+ </div>
76
+
77
+ <!-- markdownlint-enable MD033 MD036 -->
78
+
79
+ ## Quick Start
80
+
81
+ ### Use gac without installing
82
+
83
+ ```bash
84
+ uvx gac init # Configure your provider, model, and language
85
+ uvx gac # Generate and commit with LLM
86
+ ```
87
+
88
+ That's it! Review the generated message and confirm with `y`.
89
+
90
+ ### Install and use gac
91
+
92
+ ```bash
93
+ uv tool install gac
94
+ gac init
95
+ gac
96
+ ```
97
+
98
+ ### Upgrade installed gac
99
+
100
+ ```bash
101
+ uv tool upgrade gac
102
+ ```
103
+
104
+ ---
105
+
106
+ ## Key Features
107
+
108
+ ### 🌐 **Supported Providers**
109
+
110
+ - **Anthropic** • **Cerebras** • **Claude Code** • **Chutes.ai** • **DeepSeek** • **Fireworks**
111
+ - **Gemini** • **Groq** • **LM Studio** • **MiniMax** • **Mistral** • **Ollama** • **OpenAI**
112
+ - **OpenRouter** • **Streamlake** • **Synthetic.new** • **Together AI**
113
+ - **Z.AI** • **Z.AI Coding** • **Custom Endpoints (Anthropic/OpenAI)**
114
+
115
+ ### 🧠 **Smart LLM Analysis**
116
+
117
+ - **Understands intent**: Analyzes code structure, logic, and patterns to understand the "why" behind your changes, not just what changed
118
+ - **Semantic awareness**: Recognizes refactoring, bug fixes, features, and breaking changes to generate contextually appropriate messages
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`
121
+
122
+ ### 📝 **Multiple Message Formats**
123
+
124
+ - **One-liner** (-o flag): Single-line commit message following conventional commit format
125
+ - **Standard** (default): Summary with bullet points explaining implementation details
126
+ - **Verbose** (-v flag): Comprehensive explanations including motivation, technical approach, and impact analysis
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, Arabic, and more
134
+
135
+ ### 💻 **Developer Experience**
136
+
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
+ - **One-command workflows**: Complete workflows with flags like `gac -ayp` (stage all, auto-confirm, push)
139
+ - **Git integration**: Respects pre-commit and lefthook hooks, running them before expensive LLM operations
140
+
141
+ ### 🛡️ **Built-in Security**
142
+
143
+ - **Automatic secret detection**: Scans for API keys, passwords, and tokens before committing
144
+ - **Interactive protection**: Prompts before committing potentially sensitive data with clear remediation options
145
+ - **Smart filtering**: Ignores example files, template files, and placeholder text to reduce false positives
146
+
147
+ ---
148
+
149
+ ## Usage Examples
150
+
151
+ ### Basic Workflow
152
+
153
+ ```bash
154
+ # Stage your changes
155
+ git add .
156
+
157
+ # Generate and commit with LLM
158
+ gac
159
+
160
+ # Review → y (commit) | n (cancel) | r (reroll) | e (edit) | or type feedback
161
+ ```
162
+
163
+ ### Common Commands
164
+
165
+ | Command | Description |
166
+ | --------------- | ----------------------------------------------------------------------- |
167
+ | `gac` | Generate commit message |
168
+ | `gac -y` | Auto-confirm (no review needed) |
169
+ | `gac -a` | Stage all before generating commit message |
170
+ | `gac -o` | One-line message for trivial changes |
171
+ | `gac -v` | Verbose format with Motivation, Technical Approach, and Impact Analysis |
172
+ | `gac -h "hint"` | Add context for LLM (e.g., `gac -h "bug fix"`) |
173
+ | `gac -s` | Include scope (e.g., feat(auth):) |
174
+ | `gac -p` | Commit and push |
175
+
176
+ ### Power User Examples
177
+
178
+ ```bash
179
+ # Complete workflow in one command
180
+ gac -ayp -h "release preparation"
181
+
182
+ # Detailed explanation with scope
183
+ gac -v -s
184
+
185
+ # Quick one-liner for small changes
186
+ gac -o
187
+
188
+ # Group changes into logically related commits
189
+ gac -ag
190
+
191
+ # Debug what the LLM sees
192
+ gac --show-prompt
193
+
194
+ # Skip security scan (use carefully)
195
+ gac --skip-secret-scan
196
+ ```
197
+
198
+ ### Interactive Feedback System
199
+
200
+ Not happy with the result? You have several options:
201
+
202
+ ```bash
203
+ # Simple reroll (no feedback)
204
+ r
205
+
206
+ # Edit in-place with rich terminal editing
207
+ e
208
+ # Uses prompt_toolkit for multi-line editing with vi/emacs keybindings
209
+ # Press Esc+Enter or Ctrl+S to submit, Ctrl+C to cancel
210
+
211
+ # Or just type your feedback directly!
212
+ make it shorter and focus on the performance improvement
213
+ use conventional commit format with scope
214
+ explain the security implications
215
+
216
+ # Press Enter on empty input to see the prompt again
217
+ ```
218
+
219
+ The edit feature (`e`) provides rich in-place terminal editing, allowing you to:
220
+
221
+ - **Edit naturally**: Multi-line editing with familiar vi/emacs key bindings
222
+ - **Make quick fixes**: Correct typos, adjust wording, or refine formatting
223
+ - **Add details**: Include information the LLM might have missed
224
+ - **Restructure**: Reorganize bullet points or change the message structure
225
+
226
+ ---
227
+
228
+ ## Configuration
229
+
230
+ Run `gac init` to configure your provider interactively, or set environment variables:
231
+
232
+ Need to change providers or models later without touching language settings? Use `gac model` for a streamlined flow that skips the language prompts.
233
+
234
+ ```bash
235
+ # Example configuration
236
+ GAC_MODEL=anthropic:your-model-name
237
+ OPENAI_API_KEY=your_key_here
238
+ ANTHROPIC_API_KEY=your_key_here
239
+ ```
240
+
241
+ See `.gac.env.example` for all available options.
242
+
243
+ **Want commit messages in another language?** Run `gac language` to select from 25+ languages including Español, Français, 日本語, and more.
244
+
245
+ **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.
246
+
247
+ ---
248
+
249
+ ## Project Analytics
250
+
251
+ 📊 **[View live usage analytics and statistics →](https://clickpy.clickhouse.com/dashboard/gac)**
252
+
253
+ Track real-time installation metrics and package download statistics.
254
+
255
+ ---
256
+
257
+ ## Getting Help
258
+
259
+ - **Full documentation**: [docs/USAGE.md](docs/en/USAGE.md) - Complete CLI reference
260
+ - **Custom prompts**: [docs/CUSTOM_SYSTEM_PROMPTS.md](docs/en/CUSTOM_SYSTEM_PROMPTS.md) - Customize commit message style
261
+ - **Troubleshooting**: [docs/TROUBLESHOOTING.md](docs/en/TROUBLESHOOTING.md) - Common issues and solutions
262
+ - **Contributing**: [docs/CONTRIBUTING.md](docs/en/CONTRIBUTING.md) - Development setup and guidelines
263
+
264
+ ---
265
+
266
+ <!-- markdownlint-disable MD033 MD036 -->
267
+
268
+ <div align="center">
269
+
270
+ Made with ❤️ for developers who want better commit messages
271
+
272
+ [⭐ Star us on GitHub](https://github.com/cellwebb/gac) • [🐛 Report issues](https://github.com/cellwebb/gac/issues) • [📖 Full docs](docs/en/USAGE.md)
273
+
274
+ </div>
275
+
276
+ <!-- markdownlint-enable MD033 MD036 -->