gac 0.15.4__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.4
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
@@ -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.
@@ -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.
@@ -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.4"
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