gac 3.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.

Potentially problematic release.


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

Files changed (48) hide show
  1. gac-3.1.0/.gitignore +213 -0
  2. gac-3.1.0/LICENSE +16 -0
  3. gac-3.1.0/PKG-INFO +277 -0
  4. gac-3.1.0/README.md +235 -0
  5. gac-3.1.0/pyproject.toml +235 -0
  6. gac-3.1.0/src/gac/__init__.py +15 -0
  7. gac-3.1.0/src/gac/__version__.py +3 -0
  8. gac-3.1.0/src/gac/ai.py +106 -0
  9. gac-3.1.0/src/gac/ai_utils.py +217 -0
  10. gac-3.1.0/src/gac/auth_cli.py +69 -0
  11. gac-3.1.0/src/gac/cli.py +185 -0
  12. gac-3.1.0/src/gac/config.py +46 -0
  13. gac-3.1.0/src/gac/config_cli.py +83 -0
  14. gac-3.1.0/src/gac/constants.py +321 -0
  15. gac-3.1.0/src/gac/diff_cli.py +181 -0
  16. gac-3.1.0/src/gac/errors.py +231 -0
  17. gac-3.1.0/src/gac/git.py +325 -0
  18. gac-3.1.0/src/gac/init_cli.py +488 -0
  19. gac-3.1.0/src/gac/language_cli.py +253 -0
  20. gac-3.1.0/src/gac/main.py +767 -0
  21. gac-3.1.0/src/gac/oauth/__init__.py +1 -0
  22. gac-3.1.0/src/gac/oauth/claude_code.py +397 -0
  23. gac-3.1.0/src/gac/preprocess.py +511 -0
  24. gac-3.1.0/src/gac/prompt.py +785 -0
  25. gac-3.1.0/src/gac/providers/__init__.py +76 -0
  26. gac-3.1.0/src/gac/providers/anthropic.py +51 -0
  27. gac-3.1.0/src/gac/providers/cerebras.py +38 -0
  28. gac-3.1.0/src/gac/providers/chutes.py +71 -0
  29. gac-3.1.0/src/gac/providers/claude_code.py +102 -0
  30. gac-3.1.0/src/gac/providers/custom_anthropic.py +133 -0
  31. gac-3.1.0/src/gac/providers/custom_openai.py +99 -0
  32. gac-3.1.0/src/gac/providers/deepseek.py +38 -0
  33. gac-3.1.0/src/gac/providers/fireworks.py +38 -0
  34. gac-3.1.0/src/gac/providers/gemini.py +87 -0
  35. gac-3.1.0/src/gac/providers/groq.py +63 -0
  36. gac-3.1.0/src/gac/providers/lmstudio.py +59 -0
  37. gac-3.1.0/src/gac/providers/minimax.py +38 -0
  38. gac-3.1.0/src/gac/providers/mistral.py +38 -0
  39. gac-3.1.0/src/gac/providers/ollama.py +50 -0
  40. gac-3.1.0/src/gac/providers/openai.py +38 -0
  41. gac-3.1.0/src/gac/providers/openrouter.py +58 -0
  42. gac-3.1.0/src/gac/providers/streamlake.py +51 -0
  43. gac-3.1.0/src/gac/providers/synthetic.py +42 -0
  44. gac-3.1.0/src/gac/providers/together.py +38 -0
  45. gac-3.1.0/src/gac/providers/zai.py +59 -0
  46. gac-3.1.0/src/gac/security.py +293 -0
  47. gac-3.1.0/src/gac/utils.py +371 -0
  48. gac-3.1.0/src/gac/workflow_utils.py +134 -0
gac-3.1.0/.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-3.1.0/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-3.1.0/PKG-INFO ADDED
@@ -0,0 +1,277 @@
1
+ Metadata-Version: 2.4
2
+ Name: gac
3
+ Version: 3.1.0
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** • **Chutes.ai** • **Claude Code**
111
+ - **DeepSeek** • **Fireworks** • **Gemini** • **Groq** • **LM Studio**
112
+ - **MiniMax** • **Mistral** • **Ollama** • **OpenAI** • **OpenRouter**
113
+ - **Streamlake** • **Synthetic.new** • **Together AI**
114
+ - **Z.AI** • **Z.AI Coding** • **Custom Endpoints (Anthropic/OpenAI)**
115
+
116
+ ### 🧠 **Smart LLM Analysis**
117
+
118
+ - **Understands intent**: Analyzes code structure, logic, and patterns to understand the "why" behind your changes, not just what changed
119
+ - **Semantic awareness**: Recognizes refactoring, bug fixes, features, and breaking changes to generate contextually appropriate messages
120
+ - **Intelligent filtering**: Prioritizes meaningful changes while ignoring generated files, dependencies, and artifacts
121
+ - **Intelligent commit grouping** - Automatically group related changes into multiple logical commits with `--group`
122
+
123
+ ### 📝 **Multiple Message Formats**
124
+
125
+ - **One-liner** (-o flag): Single-line commit message following conventional commit format
126
+ - **Standard** (default): Summary with bullet points explaining implementation details
127
+ - **Verbose** (-v flag): Comprehensive explanations including motivation, technical approach, and impact analysis
128
+
129
+ ### 🌍 **Multilingual Support**
130
+
131
+ - **25+ languages**: Generate commit messages in English, Chinese, Japanese, Korean, Spanish, French, German, and 20+ more languages
132
+ - **Flexible translation**: Choose to keep conventional commit prefixes in English for tool compatibility, or fully translate them
133
+ - **Multiple workflows**: Set a default language with `gac language`, or use `-l <language>` flag for one-time overrides
134
+ - **Native script support**: Full support for non-Latin scripts including CJK, Cyrillic, Thai, and more
135
+
136
+ ### 💻 **Developer Experience**
137
+
138
+ - **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`
139
+ - **One-command workflows**: Complete workflows with flags like `gac -ayp` (stage all, auto-confirm, push)
140
+ - **Git integration**: Respects pre-commit and lefthook hooks, running them before expensive LLM operations
141
+
142
+ ### 🛡️ **Built-in Security**
143
+
144
+ - **Automatic secret detection**: Scans for API keys, passwords, and tokens before committing
145
+ - **Interactive protection**: Prompts before committing potentially sensitive data with clear remediation options
146
+ - **Smart filtering**: Ignores example files, template files, and placeholder text to reduce false positives
147
+
148
+ ---
149
+
150
+ ## Usage Examples
151
+
152
+ ### Basic Workflow
153
+
154
+ ```bash
155
+ # Stage your changes
156
+ git add .
157
+
158
+ # Generate and commit with LLM
159
+ gac
160
+
161
+ # Review → y (commit) | n (cancel) | r (reroll) | e (edit) | or type feedback
162
+ ```
163
+
164
+ ### Common Commands
165
+
166
+ | Command | Description |
167
+ | --------------- | ----------------------------------------------------------------------- |
168
+ | `gac` | Generate commit message |
169
+ | `gac -y` | Auto-confirm (no review needed) |
170
+ | `gac -a` | Stage all before generating commit message |
171
+ | `gac -o` | One-line message for trivial changes |
172
+ | `gac -v` | Verbose format with Motivation, Technical Approach, and Impact Analysis |
173
+ | `gac -h "hint"` | Add context for LLM (e.g., `gac -h "bug fix"`) |
174
+ | `gac -s` | Include scope (e.g., feat(auth):) |
175
+ | `gac -p` | Commit and push |
176
+
177
+ ### Power User Examples
178
+
179
+ ```bash
180
+ # Complete workflow in one command
181
+ gac -ayp -h "release preparation"
182
+
183
+ # Detailed explanation with scope
184
+ gac -v -s
185
+
186
+ # Quick one-liner for small changes
187
+ gac -o
188
+
189
+ # Group changes into logically related commits
190
+ gac -ag
191
+
192
+ # Debug what the LLM sees
193
+ gac --show-prompt
194
+
195
+ # Skip security scan (use carefully)
196
+ gac --skip-secret-scan
197
+ ```
198
+
199
+ ### Interactive Feedback System
200
+
201
+ Not happy with the result? You have several options:
202
+
203
+ ```bash
204
+ # Simple reroll (no feedback)
205
+ r
206
+
207
+ # Edit in-place with rich terminal editing
208
+ e
209
+ # Uses prompt_toolkit for multi-line editing with vi/emacs keybindings
210
+ # Press Esc+Enter or Ctrl+S to submit, Ctrl+C to cancel
211
+
212
+ # Or just type your feedback directly!
213
+ make it shorter and focus on the performance improvement
214
+ use conventional commit format with scope
215
+ explain the security implications
216
+
217
+ # Press Enter on empty input to see the prompt again
218
+ ```
219
+
220
+ The edit feature (`e`) provides rich in-place terminal editing, allowing you to:
221
+
222
+ - **Edit naturally**: Multi-line editing with familiar vi/emacs key bindings
223
+ - **Make quick fixes**: Correct typos, adjust wording, or refine formatting
224
+ - **Add details**: Include information the LLM might have missed
225
+ - **Restructure**: Reorganize bullet points or change the message structure
226
+
227
+ ---
228
+
229
+ ## Configuration
230
+
231
+ Run `gac init` to configure your provider interactively, or set environment variables:
232
+
233
+ Need to change providers or models later without touching language settings? Use `gac model` for a streamlined flow that skips the language prompts.
234
+
235
+ ```bash
236
+ # Example configuration
237
+ GAC_MODEL=anthropic:your-model-name
238
+ OPENAI_API_KEY=your_key_here
239
+ ANTHROPIC_API_KEY=your_key_here
240
+ ```
241
+
242
+ See `.gac.env.example` for all available options.
243
+
244
+ **Want commit messages in another language?** Run `gac language` to select from 25+ languages including Español, Français, 日本語, and more.
245
+
246
+ **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.
247
+
248
+ ---
249
+
250
+ ## Project Analytics
251
+
252
+ 📊 **[View live usage analytics and statistics →](https://clickpy.clickhouse.com/dashboard/gac)**
253
+
254
+ Track real-time installation metrics and package download statistics.
255
+
256
+ ---
257
+
258
+ ## Getting Help
259
+
260
+ - **Full documentation**: [docs/USAGE.md](docs/en/USAGE.md) - Complete CLI reference
261
+ - **Custom prompts**: [docs/CUSTOM_SYSTEM_PROMPTS.md](docs/en/CUSTOM_SYSTEM_PROMPTS.md) - Customize commit message style
262
+ - **Troubleshooting**: [docs/TROUBLESHOOTING.md](docs/en/TROUBLESHOOTING.md) - Common issues and solutions
263
+ - **Contributing**: [docs/CONTRIBUTING.md](docs/en/CONTRIBUTING.md) - Development setup and guidelines
264
+
265
+ ---
266
+
267
+ <!-- markdownlint-disable MD033 MD036 -->
268
+
269
+ <div align="center">
270
+
271
+ Made with ❤️ for developers who want better commit messages
272
+
273
+ [⭐ Star us on GitHub](https://github.com/cellwebb/gac) • [🐛 Report issues](https://github.com/cellwebb/gac/issues) • [📖 Full docs](docs/en/USAGE.md)
274
+
275
+ </div>
276
+
277
+ <!-- markdownlint-enable MD033 MD036 -->