gmsg 0.1.4__py3-none-any.whl → 0.1.5__py3-none-any.whl

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.
gmsg/README.md ADDED
@@ -0,0 +1,121 @@
1
+ # gmsg
2
+
3
+ A command-line tool that automatically generates concise and meaningful Git commit messages using Google's Gemini model based on your staged changes.
4
+
5
+ ---
6
+
7
+ ## 🚀 Features
8
+
9
+ * ✅ Detects if the current directory is a Git repository
10
+ * ✅ Retrieves your staged changes via `git diff --cached`
11
+ * ✅ Uses Gemini (for now) to generate a one-liner commit message
12
+ * ✅ Allows you to:
13
+
14
+ * Accept the suggestion
15
+ * Edit the message in your preferred text editor
16
+ * Regenerate a new suggestion
17
+ * ✅ Automatically commits the changes with your selected message
18
+
19
+ ---
20
+
21
+ ## 📦 Installation
22
+
23
+ ```bash
24
+ pip install gmsg
25
+ ```
26
+
27
+ ---
28
+
29
+ ## 🛠️ Configuration
30
+
31
+ Get your [Google Gemini API key](https://aistudio.google.com/app/apikey) if you don't have already.
32
+
33
+ ### 1. Set API key
34
+
35
+ Enter your api key when package is used for the first time.
36
+
37
+ ```bash
38
+ $ ENTER your API Key=
39
+ ```
40
+
41
+ ---
42
+
43
+ ## ⚙️ Usage
44
+
45
+ 1. Stage your changes:
46
+
47
+ ```bash
48
+ git add .
49
+ or
50
+ git add <file>
51
+ ```
52
+
53
+ 2. Run the package:
54
+
55
+ ```bash
56
+ gmsg
57
+ ```
58
+
59
+ 3. Follow the prompts:
60
+
61
+ * Press `y/Y/enter` to commit with the suggested message
62
+ * Press `e` to edit the message in your default `$EDITOR` (e.g., `vim`)
63
+ * Press `n` to regenerate the commit message
64
+
65
+ ---
66
+
67
+ ## ✨ Example
68
+
69
+ ```bash
70
+ $ git add some_file.py
71
+ $ gmsg
72
+
73
+ > Generate a one liner git commit message for these changes...
74
+ > Added error handling in API response parser
75
+
76
+ Do you want to continue with this message? [Y = yes / e = edit / n = no]: y
77
+ Running: `git commit -m Added error handling in API response parser`
78
+ Message committed to git. You can run `git commit --amend` to modify it.
79
+ ```
80
+
81
+ ---
82
+
83
+ ## 🧩 Requirements
84
+
85
+ * Python 3.10+
86
+ * [Google Generative AI SDK](https://pypi.org/project/google-generativeai/)
87
+ * Git installed and available in your system path
88
+ ---
89
+
90
+ ## 📍 Roadmap
91
+
92
+ Here are some upcoming features and improvements planned for this project:
93
+
94
+ * [ ] **CLI Arguments Support**
95
+ Add flags like `--dry-run` for non-interactive use.
96
+
97
+ * [ ] **Multi-line Commit Messages**
98
+ Option to generate more descriptive, multi-line messages with summaries and bullet points.
99
+
100
+ * [ ] **Better Diff Parsing**
101
+ Use syntax-aware parsing to improve prompt context and generate more accurate commit messages.
102
+
103
+ * [ ] **Git Hook Integration**
104
+ Provide an installable Git commit hook that auto-runs this tool on `git commit`.
105
+
106
+ * [ ] **Support for Other LLMs**
107
+ Add support for OpenAI's GPT, Claude, or local models using plugins/adapters.
108
+
109
+ ---
110
+
111
+
112
+ ## 📝 License
113
+
114
+ MIT License. Feel free to use, modify, and contribute!
115
+
116
+ ---
117
+
118
+ ## 🤝 Contributing
119
+
120
+ Pull requests are welcome. For major changes, open an issue first to discuss what you'd like to change.
121
+
gmsg/gmsg.py CHANGED
@@ -118,6 +118,7 @@ def printt(text: str, is_success: bool = True):
118
118
 
119
119
  def main():
120
120
  try:
121
+ user_api_key = get_or_set_api_key()
121
122
  if not is_git_repo():
122
123
  printt("Not a git repository.", is_success=False)
123
124
  sys.exit(1)
@@ -127,7 +128,6 @@ def main():
127
128
  printt("No staged changes found.", is_success=False)
128
129
  sys.exit(1)
129
130
 
130
- user_api_key = get_or_set_api_key()
131
131
  cycle_through_messages(diff, user_api_key)
132
132
 
133
133
  except KeyboardInterrupt:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: gmsg
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: Generates git commit messages for you using AI.
5
5
  License: MIT
6
6
  Author: shiyan99s@gmail.com
@@ -0,0 +1,9 @@
1
+ gmsg/README.md,sha256=r08M-p_W2PtDdAEoapaqRCWZAKBbDCjYOEzE7CsNoKY,2676
2
+ gmsg/__init__.py,sha256=9B4ZkbOBiBYYqv3Kh-mdlNn-yDPvkpXOqrm52Ng8CTk,23
3
+ gmsg/api_key.py,sha256=73RAEjrcN6f1tc3cqaJ5888COTm4gnjQ4G7VRB3-CnQ,569
4
+ gmsg/gmsg.py,sha256=SSmIomjS7c6JfWygp6aZApXvzS33qoNRpYuEcO46-mM,3871
5
+ gmsg-0.1.5.dist-info/LICENSE,sha256=4gnFnu1ft89RQUn-ohdbqKLhpQ6-wHtq2eAOs1p6X6M,1071
6
+ gmsg-0.1.5.dist-info/METADATA,sha256=Ds9Kf8kZJ9Dq4NMZDUU7oV5tNmvL4PappxLaMAWYvTM,609
7
+ gmsg-0.1.5.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
8
+ gmsg-0.1.5.dist-info/entry_points.txt,sha256=LqLzIXT9IVenl_xEptCn4LqWHm34ypTaVMhoW5tFBSg,39
9
+ gmsg-0.1.5.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- gmsg/__init__.py,sha256=9B4ZkbOBiBYYqv3Kh-mdlNn-yDPvkpXOqrm52Ng8CTk,23
2
- gmsg/api_key.py,sha256=73RAEjrcN6f1tc3cqaJ5888COTm4gnjQ4G7VRB3-CnQ,569
3
- gmsg/gmsg.py,sha256=bPHA3Unsoe6XqpsY8rc5qnZ-rQGNcEBiJSrtgBJvXGk,3871
4
- gmsg-0.1.4.dist-info/LICENSE,sha256=4gnFnu1ft89RQUn-ohdbqKLhpQ6-wHtq2eAOs1p6X6M,1071
5
- gmsg-0.1.4.dist-info/METADATA,sha256=5hAkqmK7DnukSCFt5M7y7m8b9F49QL5gjHbG1s09WRw,609
6
- gmsg-0.1.4.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
7
- gmsg-0.1.4.dist-info/entry_points.txt,sha256=LqLzIXT9IVenl_xEptCn4LqWHm34ypTaVMhoW5tFBSg,39
8
- gmsg-0.1.4.dist-info/RECORD,,
File without changes
File without changes