gac 0.15.3__tar.gz → 0.16.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gac
3
- Version: 0.15.3
3
+ Version: 0.16.1
4
4
  Summary: AI-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
@@ -23,6 +23,7 @@ Requires-Python: >=3.10
23
23
  Requires-Dist: aisuite
24
24
  Requires-Dist: anthropic
25
25
  Requires-Dist: black
26
+ Requires-Dist: cerebras-cloud-sdk
26
27
  Requires-Dist: click
27
28
  Requires-Dist: docstring-parser
28
29
  Requires-Dist: groq
@@ -47,7 +48,7 @@ Description-Content-Type: text/markdown
47
48
 
48
49
  <!-- markdownlint-disable MD013 -->
49
50
 
50
- # gac (Git Auto Commit)
51
+ # Git Auto Commit (gac)
51
52
 
52
53
  [![PyPI version](https://img.shields.io/pypi/v/gac.svg)](https://pypi.org/project/gac/)
53
54
  [![Python](https://img.shields.io/badge/python-3.10%20|%203.11%20|%203.12%20|%203.13-blue.svg)](https://www.python.org/downloads/)
@@ -61,7 +62,7 @@ Description-Content-Type: text/markdown
61
62
 
62
63
  - **AI-Powered Commit Messages:** Automatically generates clear, concise, and context-aware commit messages using large language models.
63
64
  - **Deep Contextual Analysis:** Understands your code by analyzing staged changes, repository structure, and recent commit history to provide highly relevant suggestions.
64
- - **Multi-Provider & Model Support:** Flexibly works with various leading AI providers (like Anthropic, Groq, OpenAI) and models, easily configured through an interactive setup or environment variables.
65
+ - **Multi-Provider & Model Support:** Flexibly works with various leading AI providers (like Anthropic, Cerebras, Groq, OpenAI) and models, easily configured through an interactive setup or environment variables.
65
66
  - **Seamless Git Workflow:** Integrates smoothly into your existing Git routine as a simple drop-in replacement for `git commit`.
66
67
  - **Extensive Customization:** Tailor commit messages to your needs with a rich set of flags, including one-liners (`-o`), AI hints (`-h`), commit scope (`-s`), and specific model selection (`-m`).
67
68
  - **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.
@@ -85,6 +86,24 @@ gac
85
86
 
86
87
  ### 1. Installation
87
88
 
89
+ #### Quick Try with uvx (no installation)
90
+
91
+ You can try gac without installing it using uvx:
92
+
93
+ ```sh
94
+ # Try gac without installation
95
+ uvx gac --help
96
+
97
+ # Set up configuration (creates ~/.gac.env)
98
+ uvx gac init
99
+
100
+ # Use gac on staged changes
101
+ git add .
102
+ uvx gac
103
+ ```
104
+
105
+ #### Permanent Installation
106
+
88
107
  Install system-wide using pipx from the GitHub repository:
89
108
 
90
109
  ```sh
@@ -93,7 +112,7 @@ python3 -m pip install --user pipx
93
112
  python3 -m pipx ensurepath
94
113
 
95
114
  # Install gac
96
- pipx install git+https://github.com/cellwebb/gac.git
115
+ pipx install gac
97
116
  ```
98
117
 
99
118
  Verify installation:
@@ -200,5 +219,3 @@ This project is licensed under the MIT License. See [LICENSE](LICENSE) for detai
200
219
  ## Community & Support
201
220
 
202
221
  For questions, suggestions, or support, please open an issue or discussion on GitHub.
203
-
204
- _Brought to you by [Criteria](https://criteria.dev)_
@@ -1,6 +1,6 @@
1
1
  <!-- markdownlint-disable MD013 -->
2
2
 
3
- # gac (Git Auto Commit)
3
+ # Git Auto Commit (gac)
4
4
 
5
5
  [![PyPI version](https://img.shields.io/pypi/v/gac.svg)](https://pypi.org/project/gac/)
6
6
  [![Python](https://img.shields.io/badge/python-3.10%20|%203.11%20|%203.12%20|%203.13-blue.svg)](https://www.python.org/downloads/)
@@ -14,7 +14,7 @@
14
14
 
15
15
  - **AI-Powered Commit Messages:** Automatically generates clear, concise, and context-aware commit messages using large language models.
16
16
  - **Deep Contextual Analysis:** Understands your code by analyzing staged changes, repository structure, and recent commit history to provide highly relevant suggestions.
17
- - **Multi-Provider & Model Support:** Flexibly works with various leading AI providers (like Anthropic, Groq, OpenAI) and models, easily configured through an interactive setup or environment variables.
17
+ - **Multi-Provider & Model Support:** Flexibly works with various leading AI providers (like Anthropic, Cerebras, Groq, OpenAI) and models, easily configured through an interactive setup or environment variables.
18
18
  - **Seamless Git Workflow:** Integrates smoothly into your existing Git routine as a simple drop-in replacement for `git commit`.
19
19
  - **Extensive Customization:** Tailor commit messages to your needs with a rich set of flags, including one-liners (`-o`), AI hints (`-h`), commit scope (`-s`), and specific model selection (`-m`).
20
20
  - **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.
@@ -38,6 +38,24 @@ gac
38
38
 
39
39
  ### 1. Installation
40
40
 
41
+ #### Quick Try with uvx (no installation)
42
+
43
+ You can try gac without installing it using uvx:
44
+
45
+ ```sh
46
+ # Try gac without installation
47
+ uvx gac --help
48
+
49
+ # Set up configuration (creates ~/.gac.env)
50
+ uvx gac init
51
+
52
+ # Use gac on staged changes
53
+ git add .
54
+ uvx gac
55
+ ```
56
+
57
+ #### Permanent Installation
58
+
41
59
  Install system-wide using pipx from the GitHub repository:
42
60
 
43
61
  ```sh
@@ -46,7 +64,7 @@ python3 -m pip install --user pipx
46
64
  python3 -m pipx ensurepath
47
65
 
48
66
  # Install gac
49
- pipx install git+https://github.com/cellwebb/gac.git
67
+ pipx install gac
50
68
  ```
51
69
 
52
70
  Verify installation:
@@ -153,5 +171,3 @@ This project is licensed under the MIT License. See [LICENSE](LICENSE) for detai
153
171
  ## Community & Support
154
172
 
155
173
  For questions, suggestions, or support, please open an issue or discussion on GitHub.
156
-
157
- _Brought to you by [Criteria](https://criteria.dev)_
@@ -27,6 +27,7 @@ dependencies = [
27
27
  # AI components - base providers
28
28
  "aisuite",
29
29
  "anthropic",
30
+ "cerebras_cloud_sdk",
30
31
  "groq",
31
32
  "ollama",
32
33
  "openai",
@@ -1,3 +1,3 @@
1
1
  """Version information for gac package."""
2
2
 
3
- __version__ = "0.15.3"
3
+ __version__ = "0.16.1"
@@ -28,10 +28,7 @@ def count_tokens(content: str | list[dict[str, str]] | dict[str, Any], model: st
28
28
  if model.startswith("anthropic"):
29
29
  import anthropic
30
30
 
31
- return anthropic.Client().messages.count_tokens(
32
- model=model,
33
- messages=[{"role": "user", "content": text}],
34
- )
31
+ return anthropic.Client().count_tokens(text)
35
32
 
36
33
  try:
37
34
  encoding = get_encoding(model)
@@ -12,12 +12,18 @@ from gac.constants import EnvDefaults, Logging
12
12
 
13
13
 
14
14
  def load_config() -> dict[str, str | int | float | bool]:
15
- """Load configuration from $HOME/.gac.env, then ./.env, then environment variables."""
15
+ """Load configuration from $HOME/.gac.env, then ./.gac.env or ./.env, then environment variables."""
16
16
  user_config = Path.home() / ".gac.env"
17
17
  if user_config.exists():
18
18
  load_dotenv(user_config)
19
+
20
+ # Check for both .gac.env and .env in project directory
21
+ project_gac_env = Path(".gac.env")
19
22
  project_env = Path(".env")
20
- if project_env.exists():
23
+
24
+ if project_gac_env.exists():
25
+ load_dotenv(project_gac_env, override=True)
26
+ elif project_env.exists():
21
27
  load_dotenv(project_env, override=True)
22
28
 
23
29
  config = {
@@ -28,7 +28,11 @@ import click
28
28
 
29
29
  from gac.errors import GitError, with_error_handling
30
30
  from gac.git import get_diff, get_staged_files
31
- from gac.preprocess import filter_binary_and_minified, smart_truncate_diff, split_diff_into_sections
31
+ from gac.preprocess import (
32
+ filter_binary_and_minified,
33
+ smart_truncate_diff,
34
+ split_diff_into_sections,
35
+ )
32
36
  from gac.utils import print_message, setup_logging
33
37
 
34
38
 
@@ -21,7 +21,8 @@ def init() -> None:
21
21
 
22
22
  providers = [
23
23
  ("Anthropic", "claude-3-5-haiku-latest"),
24
- ("Groq", "meta-llama/llama-4-scout-17b-16e-instruct"),
24
+ ("Cerebras", "qwen-3-coder-480b"),
25
+ ("Groq", "meta-llama/llama-4-maverick-17b-128e-instruct"),
25
26
  ("Ollama", "gemma3"),
26
27
  ("OpenAI", "gpt-4.1-mini"),
27
28
  ]
@@ -209,6 +209,7 @@ def main(
209
209
  console.print("[green]Commit created successfully[/green]")
210
210
  except AIError as e:
211
211
  logger.error(str(e))
212
+ console = Console()
212
213
  console.print(f"[red]Failed to generate commit message: {str(e)}[/red]")
213
214
  sys.exit(1)
214
215
 
@@ -11,7 +11,12 @@ import os
11
11
  import re
12
12
 
13
13
  from gac.ai import count_tokens
14
- from gac.constants import CodePatternImportance, FilePatterns, FileTypeImportance, Utility
14
+ from gac.constants import (
15
+ CodePatternImportance,
16
+ FilePatterns,
17
+ FileTypeImportance,
18
+ Utility,
19
+ )
15
20
 
16
21
  logger = logging.getLogger(__name__)
17
22
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes