ngpt 3.9.3__py3-none-any.whl → 3.9.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.
- ngpt/cli/modes/gitcommsg.py +20 -0
- {ngpt-3.9.3.dist-info → ngpt-3.9.5.dist-info}/METADATA +5 -1
- {ngpt-3.9.3.dist-info → ngpt-3.9.5.dist-info}/RECORD +6 -6
- {ngpt-3.9.3.dist-info → ngpt-3.9.5.dist-info}/WHEEL +0 -0
- {ngpt-3.9.3.dist-info → ngpt-3.9.5.dist-info}/entry_points.txt +0 -0
- {ngpt-3.9.3.dist-info → ngpt-3.9.5.dist-info}/licenses/LICENSE +0 -0
ngpt/cli/modes/gitcommsg.py
CHANGED
@@ -998,6 +998,23 @@ def is_git_diff(content):
|
|
998
998
|
|
999
999
|
return False
|
1000
1000
|
|
1001
|
+
def strip_code_block_formatting(text):
|
1002
|
+
"""Strip code block formatting from the text if present.
|
1003
|
+
|
1004
|
+
Args:
|
1005
|
+
text: Text to strip code block formatting from
|
1006
|
+
|
1007
|
+
Returns:
|
1008
|
+
str: Text without code block formatting
|
1009
|
+
"""
|
1010
|
+
# Check if the text starts with ``` and ends with ```
|
1011
|
+
pattern = r'^```(?:.*?)\n(.*?)```$'
|
1012
|
+
match = re.search(pattern, text, re.DOTALL)
|
1013
|
+
if match:
|
1014
|
+
# Extract content between backticks and remove any trailing whitespace
|
1015
|
+
return match.group(1).rstrip()
|
1016
|
+
return text
|
1017
|
+
|
1001
1018
|
def gitcommsg_mode(client, args, logger=None):
|
1002
1019
|
"""Handle the Git commit message generation mode.
|
1003
1020
|
|
@@ -1183,6 +1200,9 @@ def gitcommsg_mode(client, args, logger=None):
|
|
1183
1200
|
print(f"{COLORS['red']}Failed to generate commit message.{COLORS['reset']}")
|
1184
1201
|
return
|
1185
1202
|
|
1203
|
+
# Strip any code block formatting
|
1204
|
+
result = strip_code_block_formatting(result)
|
1205
|
+
|
1186
1206
|
# Display the result
|
1187
1207
|
print(f"\n{COLORS['green']}✨ Generated Commit Message:{COLORS['reset']}\n")
|
1188
1208
|
print(result)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ngpt
|
3
|
-
Version: 3.9.
|
3
|
+
Version: 3.9.5
|
4
4
|
Summary: A Swiss army knife for LLMs: A fast, lightweight CLI and interactive chat tool that brings the power of any OpenAI-compatible LLM (OpenAI, Ollama, Groq, Claude, Gemini, etc.) straight to your terminal. rewrite texts or refine code, craft git commit messages, generate and run OS-aware shell commands.
|
5
5
|
Project-URL: Homepage, https://github.com/nazdridoy/ngpt
|
6
6
|
Project-URL: Repository, https://github.com/nazdridoy/ngpt
|
@@ -37,6 +37,10 @@ Description-Content-Type: text/markdown
|
|
37
37
|
|
38
38
|
# nGPT
|
39
39
|
|
40
|
+
<p align="center">
|
41
|
+
<img src="https://raw.githubusercontent.com/nazdridoy/ngpt/main/.github/banner.svg" alt="nGPT Banner">
|
42
|
+
</p>
|
43
|
+
|
40
44
|
<p align="center">
|
41
45
|
<a href="https://pypi.org/project/ngpt/"><img src="https://img.shields.io/pypi/v/ngpt.svg" alt="PyPI version"></a>
|
42
46
|
<a href="https://aur.archlinux.org/packages/ngpt"><img alt="AUR Version" src="https://img.shields.io/aur/version/ngpt"></a>
|
@@ -12,7 +12,7 @@ ngpt/cli/ui.py,sha256=8-WyPMwgQiqLXWO0mGfBhKTRnIDDtPUtm_XCvOnqBJA,11334
|
|
12
12
|
ngpt/cli/modes/__init__.py,sha256=KP7VR6Xw9k1p5Jcu0F38RDxSFvFIzH3j1ThDLNwznUI,363
|
13
13
|
ngpt/cli/modes/chat.py,sha256=x1leClKq7UupA_CdW4tym0AivY2o_II123-I5IcAkxQ,7091
|
14
14
|
ngpt/cli/modes/code.py,sha256=Qj59xq6fZqgUDw7SbvmPKX_gdpc7DHJhNkn1sB5qgUU,12932
|
15
|
-
ngpt/cli/modes/gitcommsg.py,sha256=
|
15
|
+
ngpt/cli/modes/gitcommsg.py,sha256=21I3WZYa8Eb3BKPn6-aLMN7OhEmo1KHHnhTpnJkGesg,50242
|
16
16
|
ngpt/cli/modes/interactive.py,sha256=E0c38NA8xnuRKAce40F35uFYcohFDvaqSB8nf1ywS-4,17958
|
17
17
|
ngpt/cli/modes/rewrite.py,sha256=QQm453X9aoUQP9CAtmeghlMytMJPlsDZPKef9tGfj6g,11181
|
18
18
|
ngpt/cli/modes/shell.py,sha256=it1Brq1-LGeNfPKYBeVAwF-a78g9UP-KscofBZQkbr4,41589
|
@@ -23,8 +23,8 @@ ngpt/utils/config.py,sha256=wsArA4osnh8fKqOvtsPqqBxAz3DpdjtaWUFaRtnUdyc,10452
|
|
23
23
|
ngpt/utils/log.py,sha256=f1jg2iFo35PAmsarH8FVL_62plq4VXH0Mu2QiP6RJGw,15934
|
24
24
|
ngpt/utils/pipe.py,sha256=qRHF-Ma7bbU0cOcb1Yhe4S-kBavivtnnvLA3EYS4FY4,2162
|
25
25
|
ngpt/utils/web_search.py,sha256=w5ke4KJMRxq7r5jtbUXvspja6XhjoPZloVkZ0IvBXIE,30731
|
26
|
-
ngpt-3.9.
|
27
|
-
ngpt-3.9.
|
28
|
-
ngpt-3.9.
|
29
|
-
ngpt-3.9.
|
30
|
-
ngpt-3.9.
|
26
|
+
ngpt-3.9.5.dist-info/METADATA,sha256=OiNZBFl7V7WyfNSurU4DDmLvWswvukcx8xzo8FP4QIQ,31174
|
27
|
+
ngpt-3.9.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
28
|
+
ngpt-3.9.5.dist-info/entry_points.txt,sha256=SqAAvLhMrsEpkIr4YFRdUeyuXQ9o0IBCeYgE6AVojoI,44
|
29
|
+
ngpt-3.9.5.dist-info/licenses/LICENSE,sha256=mQkpWoADxbHqE0HRefYLJdm7OpdrXBr3vNv5bZ8w72M,1065
|
30
|
+
ngpt-3.9.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|