commitmessagegenerator 2.5.0__tar.gz → 2.5.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.
Files changed (15) hide show
  1. {commitmessagegenerator-2.5.0 → commitmessagegenerator-2.5.1}/PKG-INFO +8 -8
  2. {commitmessagegenerator-2.5.0 → commitmessagegenerator-2.5.1}/README.md +120 -120
  3. {commitmessagegenerator-2.5.0 → commitmessagegenerator-2.5.1}/commitmessagegenerator/cli.py +12 -12
  4. {commitmessagegenerator-2.5.0 → commitmessagegenerator-2.5.1}/commitmessagegenerator/configure.py +2 -2
  5. {commitmessagegenerator-2.5.0 → commitmessagegenerator-2.5.1}/commitmessagegenerator.egg-info/PKG-INFO +8 -8
  6. {commitmessagegenerator-2.5.0 → commitmessagegenerator-2.5.1}/pyproject.toml +21 -21
  7. {commitmessagegenerator-2.5.0 → commitmessagegenerator-2.5.1}/LICENSE +0 -0
  8. {commitmessagegenerator-2.5.0 → commitmessagegenerator-2.5.1}/commitmessagegenerator/__init__.py +0 -0
  9. {commitmessagegenerator-2.5.0 → commitmessagegenerator-2.5.1}/commitmessagegenerator/generator.py +0 -0
  10. {commitmessagegenerator-2.5.0 → commitmessagegenerator-2.5.1}/commitmessagegenerator.egg-info/SOURCES.txt +0 -0
  11. {commitmessagegenerator-2.5.0 → commitmessagegenerator-2.5.1}/commitmessagegenerator.egg-info/dependency_links.txt +0 -0
  12. {commitmessagegenerator-2.5.0 → commitmessagegenerator-2.5.1}/commitmessagegenerator.egg-info/entry_points.txt +0 -0
  13. {commitmessagegenerator-2.5.0 → commitmessagegenerator-2.5.1}/commitmessagegenerator.egg-info/requires.txt +0 -0
  14. {commitmessagegenerator-2.5.0 → commitmessagegenerator-2.5.1}/commitmessagegenerator.egg-info/top_level.txt +0 -0
  15. {commitmessagegenerator-2.5.0 → commitmessagegenerator-2.5.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: commitmessagegenerator
3
- Version: 2.5.0
3
+ Version: 2.5.1
4
4
  Summary: Generate commit messages with AI (Google Gemini) automatically using `git diff`.
5
5
  Author-email: Gabriel Terceiro <gcarolinoterceiro@gmail.com>
6
6
  License: MIT
@@ -61,7 +61,7 @@ Create a `.env` file in the directory where you will run commitgen (usually the
61
61
 
62
62
  ```
63
63
  GEMINI_API_KEY=your-gemini-api-key
64
- AI_MODEL=gemini-2.0-flash
64
+ AI_MODEL=gemini-2.5-flash
65
65
  AUTO_ADD_ALL=true
66
66
  ```
67
67
 
@@ -100,12 +100,12 @@ The command will:
100
100
 
101
101
  When configuring with `-cf`, you can choose from:
102
102
 
103
- 1. **gemini-2.0-flash** (default) - Fast and efficient
104
- 2. **gemini-1.5-flash** - Good balance of speed and quality
105
- 3. **gemini-1.5-pro** - Highest quality, slower
106
- 4. **gemini-2.0-flash-exp** - Experimental version
107
- 5. **gemini-2.5-flash** - Latest version, fast and efficient
108
- 6. **gemini-2.5-pro** - Latest version, highest quality
103
+ 1. **gemini-2.5-flash** (default) - Fast and efficient, best price-performance
104
+ 2. **gemini-2.5-flash-lite** - Fastest and most economical
105
+ 3. **gemini-2.5-pro** - Advanced reasoning and coding
106
+ 4. **gemini-3-flash** - Frontier performance (preview)
107
+ 5. **gemini-3.5-flash** - Latest stable model, best for coding
108
+ 6. **gemini-3.1-pro** - Highest quality (preview)
109
109
 
110
110
  ### File Staging Behavior
111
111
 
@@ -1,120 +1,120 @@
1
- # commitmessagegenerator
2
-
3
- Generate objective and technical commit messages with AI (Google Gemini) automatically using your `git diff`.
4
-
5
- ## 📦 Install
6
-
7
- ```bash
8
- pip install commitmessagegenerator
9
- ```
10
-
11
- Or, if you're using a `venv`:
12
-
13
- ```bash
14
- python -m venv venv
15
- source venv/bin/activate # or .\venv\Scripts\activate in Windows
16
- pip install commitmessagegenerator
17
- ```
18
-
19
- ## ⚙️ Configuring
20
-
21
- ```bash
22
- commitgen -cf
23
- ```
24
-
25
- You can explicitly choose where configuration is written:
26
-
27
- ```bash
28
- commitgen -cf --config-scope auto # default behavior
29
- commitgen -cf --config-scope local # always write .env in current directory
30
- commitgen -cf --config-scope global # always write ~/.commitgen/.env
31
- ```
32
-
33
- This opens an interactive configuration menu where you can:
34
-
35
- 1. Set or update your Gemini API key
36
- 2. Change the AI model
37
- 3. Configure file staging behavior
38
-
39
- Each option can be configured independently, and you can exit at any time without saving changes.
40
-
41
- ## Run this and type you API key to the terminal so the package creates the .env file and automatically adds it to the .gitignore
42
-
43
- Or do it manually:
44
-
45
- ## IMPORTANT - BEFORE CREATING THIS FILE ADD '.venv' TO YOUR .gitignore SO YOUR API KEY ISN'T EXPOSED
46
-
47
- Create a `.env` file in the directory where you will run commitgen (usually the root of your Git project):
48
-
49
- ```
50
- GEMINI_API_KEY=your-gemini-api-key
51
- AI_MODEL=gemini-2.0-flash
52
- AUTO_ADD_ALL=true
53
- ```
54
-
55
- Config discovery order:
56
-
57
- 1. `.env` in current directory
58
- 2. `.env` in parent directories (useful when running from subfolders)
59
- 3. Global config in `~/.commitgen/.env` (created automatically by `commitgen -cf --config-scope auto` when no local `.env` exists)
60
-
61
- Environment variables already set in your shell (e.g. `GEMINI_API_KEY`) are also respected.
62
-
63
- ## 🚀 Usage
64
-
65
- With the terminal, inside any Git repository with pending changes, run:
66
-
67
- ```bash
68
- commitgen (-c/-cp)
69
- ```
70
-
71
- The command will:
72
-
73
- - Read the git diff;
74
- - Send it to the Google Gemini API using your configured model;
75
- - Return a commit message suggestion directly in your terminal.
76
-
77
- ### Available Commands
78
-
79
- - `commitgen` - Generate commit message only
80
- - `commitgen -c` - Generate and commit with the message
81
- - `commitgen -cp` - Generate, commit, and push
82
- - `commitgen -cf` - Configure API key, model, and file staging behavior
83
- - `commitgen -cf --config-scope [auto|local|global]` - Choose where `.env` is created/updated
84
- - `commitgen -s` - Show current configuration status
85
-
86
- ### Available Models
87
-
88
- When configuring with `-cf`, you can choose from:
89
-
90
- 1. **gemini-2.0-flash** (default) - Fast and efficient
91
- 2. **gemini-1.5-flash** - Good balance of speed and quality
92
- 3. **gemini-1.5-pro** - Highest quality, slower
93
- 4. **gemini-2.0-flash-exp** - Experimental version
94
- 5. **gemini-2.5-flash** - Latest version, fast and efficient
95
- 6. **gemini-2.5-pro** - Latest version, highest quality
96
-
97
- ### File Staging Behavior
98
-
99
- When configuring with `-cf`, you can choose how files are staged:
100
-
101
- 1. **Auto-add all files** (default) - Automatically runs `git add --all` before generating the commit message
102
- 2. **Staged only** - Only reads the diff from files you've already staged with `git add`
103
-
104
- The "staged only" option gives you more control over which changes are included in the commit message.
105
-
106
- ## 🧩 Requisites
107
-
108
- - Python 3.8 or higher
109
- - Gemini API Key (Google Generative AI, free at: https://aistudio.google.com/app/apikey)
110
- - Initialized Git repository
111
- - Python dependencies (Automatically installed with the package):
112
- - `GitPython`
113
- - `google-generativeai`
114
- - `python-dotenv`
115
-
116
- ## 📄 License
117
-
118
- ```
119
- MIT License
120
- ```
1
+ # commitmessagegenerator
2
+
3
+ Generate objective and technical commit messages with AI (Google Gemini) automatically using your `git diff`.
4
+
5
+ ## 📦 Install
6
+
7
+ ```bash
8
+ pip install commitmessagegenerator
9
+ ```
10
+
11
+ Or, if you're using a `venv`:
12
+
13
+ ```bash
14
+ python -m venv venv
15
+ source venv/bin/activate # or .\venv\Scripts\activate in Windows
16
+ pip install commitmessagegenerator
17
+ ```
18
+
19
+ ## ⚙️ Configuring
20
+
21
+ ```bash
22
+ commitgen -cf
23
+ ```
24
+
25
+ You can explicitly choose where configuration is written:
26
+
27
+ ```bash
28
+ commitgen -cf --config-scope auto # default behavior
29
+ commitgen -cf --config-scope local # always write .env in current directory
30
+ commitgen -cf --config-scope global # always write ~/.commitgen/.env
31
+ ```
32
+
33
+ This opens an interactive configuration menu where you can:
34
+
35
+ 1. Set or update your Gemini API key
36
+ 2. Change the AI model
37
+ 3. Configure file staging behavior
38
+
39
+ Each option can be configured independently, and you can exit at any time without saving changes.
40
+
41
+ ## Run this and type you API key to the terminal so the package creates the .env file and automatically adds it to the .gitignore
42
+
43
+ Or do it manually:
44
+
45
+ ## IMPORTANT - BEFORE CREATING THIS FILE ADD '.venv' TO YOUR .gitignore SO YOUR API KEY ISN'T EXPOSED
46
+
47
+ Create a `.env` file in the directory where you will run commitgen (usually the root of your Git project):
48
+
49
+ ```
50
+ GEMINI_API_KEY=your-gemini-api-key
51
+ AI_MODEL=gemini-2.5-flash
52
+ AUTO_ADD_ALL=true
53
+ ```
54
+
55
+ Config discovery order:
56
+
57
+ 1. `.env` in current directory
58
+ 2. `.env` in parent directories (useful when running from subfolders)
59
+ 3. Global config in `~/.commitgen/.env` (created automatically by `commitgen -cf --config-scope auto` when no local `.env` exists)
60
+
61
+ Environment variables already set in your shell (e.g. `GEMINI_API_KEY`) are also respected.
62
+
63
+ ## 🚀 Usage
64
+
65
+ With the terminal, inside any Git repository with pending changes, run:
66
+
67
+ ```bash
68
+ commitgen (-c/-cp)
69
+ ```
70
+
71
+ The command will:
72
+
73
+ - Read the git diff;
74
+ - Send it to the Google Gemini API using your configured model;
75
+ - Return a commit message suggestion directly in your terminal.
76
+
77
+ ### Available Commands
78
+
79
+ - `commitgen` - Generate commit message only
80
+ - `commitgen -c` - Generate and commit with the message
81
+ - `commitgen -cp` - Generate, commit, and push
82
+ - `commitgen -cf` - Configure API key, model, and file staging behavior
83
+ - `commitgen -cf --config-scope [auto|local|global]` - Choose where `.env` is created/updated
84
+ - `commitgen -s` - Show current configuration status
85
+
86
+ ### Available Models
87
+
88
+ When configuring with `-cf`, you can choose from:
89
+
90
+ 1. **gemini-2.5-flash** (default) - Fast and efficient, best price-performance
91
+ 2. **gemini-2.5-flash-lite** - Fastest and most economical
92
+ 3. **gemini-2.5-pro** - Advanced reasoning and coding
93
+ 4. **gemini-3-flash** - Frontier performance (preview)
94
+ 5. **gemini-3.5-flash** - Latest stable model, best for coding
95
+ 6. **gemini-3.1-pro** - Highest quality (preview)
96
+
97
+ ### File Staging Behavior
98
+
99
+ When configuring with `-cf`, you can choose how files are staged:
100
+
101
+ 1. **Auto-add all files** (default) - Automatically runs `git add --all` before generating the commit message
102
+ 2. **Staged only** - Only reads the diff from files you've already staged with `git add`
103
+
104
+ The "staged only" option gives you more control over which changes are included in the commit message.
105
+
106
+ ## 🧩 Requisites
107
+
108
+ - Python 3.8 or higher
109
+ - Gemini API Key (Google Generative AI, free at: https://aistudio.google.com/app/apikey)
110
+ - Initialized Git repository
111
+ - Python dependencies (Automatically installed with the package):
112
+ - `GitPython`
113
+ - `google-generativeai`
114
+ - `python-dotenv`
115
+
116
+ ## 📄 License
117
+
118
+ ```
119
+ MIT License
120
+ ```
@@ -14,12 +14,12 @@ import sys
14
14
  import getpass
15
15
 
16
16
  MODEL_MAP = {
17
- "1": "gemini-2.0-flash",
18
- "2": "gemini-1.5-flash",
19
- "3": "gemini-1.5-pro",
20
- "4": "gemini-2.0-flash-exp",
21
- "5": "gemini-2.5-flash",
22
- "6": "gemini-2.5-pro"
17
+ "1": "gemini-2.5-flash",
18
+ "2": "gemini-2.5-flash-lite",
19
+ "3": "gemini-2.5-pro",
20
+ "4": "gemini-3-flash",
21
+ "5": "gemini-3.5-flash",
22
+ "6": "gemini-3.1-pro",
23
23
  }
24
24
 
25
25
  def configure_menu():
@@ -84,12 +84,12 @@ def configure_model(config_scope):
84
84
  print("-"*40)
85
85
  print(f"Current model: {current_model}\n")
86
86
  print("Available models:")
87
- print("1. gemini-2.0-flash (fast and efficient)")
88
- print("2. gemini-1.5-flash (good balance)")
89
- print("3. gemini-1.5-pro (highest quality, slower)")
90
- print("4. gemini-2.0-flash-exp (experimental)")
91
- print("5. gemini-2.5-flash (latest, fast)")
92
- print("6. gemini-2.5-pro (latest, highest quality)")
87
+ print("1. gemini-2.5-flash (default, fast and efficient)")
88
+ print("2. gemini-2.5-flash-lite (fastest, most economical)")
89
+ print("3. gemini-2.5-pro (advanced reasoning and coding)")
90
+ print("4. gemini-3-flash (frontier performance, preview)")
91
+ print("5. gemini-3.5-flash (latest stable, best for coding)")
92
+ print("6. gemini-3.1-pro (highest quality, preview)")
93
93
  print("\n0. Cancel")
94
94
 
95
95
  choice = input("\nSelect model (0-6): ").strip()
@@ -111,7 +111,7 @@ def _ensure_gitignore(env_path):
111
111
  if not env_in_gitignore:
112
112
  outfile.write("\n.env")
113
113
 
114
- def api_key(key, model="gemini-2.0-flash", auto_add_all=True, scope="auto"):
114
+ def api_key(key, model="gemini-2.5-flash", auto_add_all=True, scope="auto"):
115
115
  """Set all configuration at once (legacy function)"""
116
116
  config = {
117
117
  "GEMINI_API_KEY": key,
@@ -178,7 +178,7 @@ def get_configured_model():
178
178
  model_line = next((line for line in lines if line.startswith("AI_MODEL=")), None)
179
179
  if model_line:
180
180
  return model_line.split("=", 1)[1].strip()
181
- return "gemini-2.0-flash" # Default fallback
181
+ return "gemini-2.5-flash" # Default fallback
182
182
 
183
183
  def get_auto_add_setting():
184
184
  """Get the auto-add all files setting from .env file"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: commitmessagegenerator
3
- Version: 2.5.0
3
+ Version: 2.5.1
4
4
  Summary: Generate commit messages with AI (Google Gemini) automatically using `git diff`.
5
5
  Author-email: Gabriel Terceiro <gcarolinoterceiro@gmail.com>
6
6
  License: MIT
@@ -61,7 +61,7 @@ Create a `.env` file in the directory where you will run commitgen (usually the
61
61
 
62
62
  ```
63
63
  GEMINI_API_KEY=your-gemini-api-key
64
- AI_MODEL=gemini-2.0-flash
64
+ AI_MODEL=gemini-2.5-flash
65
65
  AUTO_ADD_ALL=true
66
66
  ```
67
67
 
@@ -100,12 +100,12 @@ The command will:
100
100
 
101
101
  When configuring with `-cf`, you can choose from:
102
102
 
103
- 1. **gemini-2.0-flash** (default) - Fast and efficient
104
- 2. **gemini-1.5-flash** - Good balance of speed and quality
105
- 3. **gemini-1.5-pro** - Highest quality, slower
106
- 4. **gemini-2.0-flash-exp** - Experimental version
107
- 5. **gemini-2.5-flash** - Latest version, fast and efficient
108
- 6. **gemini-2.5-pro** - Latest version, highest quality
103
+ 1. **gemini-2.5-flash** (default) - Fast and efficient, best price-performance
104
+ 2. **gemini-2.5-flash-lite** - Fastest and most economical
105
+ 3. **gemini-2.5-pro** - Advanced reasoning and coding
106
+ 4. **gemini-3-flash** - Frontier performance (preview)
107
+ 5. **gemini-3.5-flash** - Latest stable model, best for coding
108
+ 6. **gemini-3.1-pro** - Highest quality (preview)
109
109
 
110
110
  ### File Staging Behavior
111
111
 
@@ -1,21 +1,21 @@
1
- [build-system]
2
- requires = ["setuptools>=61.0"]
3
- build-backend = "setuptools.build_meta"
4
-
5
- [project]
6
- name = "commitmessagegenerator"
7
- version = "2.5.0"
8
- description = "Generate commit messages with AI (Google Gemini) automatically using `git diff`."
9
- readme = "README.md"
10
- license = {text = "MIT"}
11
- authors = [
12
- {name = "Gabriel Terceiro", email = "gcarolinoterceiro@gmail.com"}
13
- ]
14
- dependencies = [
15
- "google-genai==1.20.0",
16
- "GitPython==3.1.44",
17
- "python-dotenv==1.1.0"
18
- ]
19
-
20
- [project.scripts]
21
- commitgen = "commitmessagegenerator.cli:main"
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "commitmessagegenerator"
7
+ version = "2.5.1"
8
+ description = "Generate commit messages with AI (Google Gemini) automatically using `git diff`."
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ authors = [
12
+ {name = "Gabriel Terceiro", email = "gcarolinoterceiro@gmail.com"}
13
+ ]
14
+ dependencies = [
15
+ "google-genai==1.20.0",
16
+ "GitPython==3.1.44",
17
+ "python-dotenv==1.1.0"
18
+ ]
19
+
20
+ [project.scripts]
21
+ commitgen = "commitmessagegenerator.cli:main"