ngpt 3.11.3__py3-none-any.whl → 3.12.0__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/args.py +5 -0
- ngpt/cli/main.py +21 -24
- ngpt/cli/modes/interactive.py +22 -2
- ngpt/utils/cli_config.py +6 -0
- {ngpt-3.11.3.dist-info → ngpt-3.12.0.dist-info}/METADATA +1 -1
- {ngpt-3.11.3.dist-info → ngpt-3.12.0.dist-info}/RECORD +9 -9
- {ngpt-3.11.3.dist-info → ngpt-3.12.0.dist-info}/WHEEL +0 -0
- {ngpt-3.11.3.dist-info → ngpt-3.12.0.dist-info}/entry_points.txt +0 -0
- {ngpt-3.11.3.dist-info → ngpt-3.12.0.dist-info}/licenses/LICENSE +0 -0
ngpt/cli/args.py
CHANGED
@@ -124,6 +124,11 @@ def setup_argument_parser():
|
|
124
124
|
rewrite_group.add_argument('--humanize', action='store_true',
|
125
125
|
help='Transform AI-generated text into human-like content that passes AI detection tools')
|
126
126
|
|
127
|
+
# Interactive mode options
|
128
|
+
interactive_group = parser.add_argument_group('Interactive Mode Options')
|
129
|
+
interactive_group.add_argument('--multiline', action='store_true',
|
130
|
+
help='Enable multiline text input with the "ml" command in interactive mode')
|
131
|
+
|
127
132
|
# Mode flags (mutually exclusive)
|
128
133
|
mode_group = parser.add_argument_group('Modes (mutually exclusive)')
|
129
134
|
mode_exclusive_group = mode_group.add_mutually_exclusive_group()
|
ngpt/cli/main.py
CHANGED
@@ -63,29 +63,25 @@ def show_cli_config_help():
|
|
63
63
|
# Print general options (available in all contexts)
|
64
64
|
print(f" {COLORS['yellow']}General options (all modes):{COLORS['reset']}")
|
65
65
|
for option in sorted(context_groups["all"]):
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
("
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
meta = CLI_CONFIG_OPTIONS[option]
|
86
|
-
default = f"(default: {meta['default']})" if meta['default'] is not None else ""
|
87
|
-
exclusive = f" [exclusive with: {', '.join(meta['exclusive'])}]" if "exclusive" in meta else ""
|
88
|
-
print(f" {COLORS['green']}{option}{COLORS['reset']} - {meta['type']} {default}{exclusive}")
|
66
|
+
print(f" {option}")
|
67
|
+
|
68
|
+
# Print code options
|
69
|
+
if context_groups["code"]:
|
70
|
+
print(f"\n {COLORS['yellow']}Code mode options (-c/--code):{COLORS['reset']}")
|
71
|
+
for option in sorted(context_groups["code"]):
|
72
|
+
print(f" {option}")
|
73
|
+
|
74
|
+
# Print interactive mode options
|
75
|
+
if context_groups["interactive"]:
|
76
|
+
print(f"\n {COLORS['yellow']}Interactive mode options (-i/--interactive):{COLORS['reset']}")
|
77
|
+
for option in sorted(context_groups["interactive"]):
|
78
|
+
print(f" {option}")
|
79
|
+
|
80
|
+
# Print gitcommsg options
|
81
|
+
if context_groups["gitcommsg"]:
|
82
|
+
print(f"\n {COLORS['yellow']}Git commit message options (-g/--gitcommsg):{COLORS['reset']}")
|
83
|
+
for option in sorted(context_groups["gitcommsg"]):
|
84
|
+
print(f" {option}")
|
89
85
|
|
90
86
|
print(f"\n {COLORS['cyan']}Example usage:{COLORS['reset']}")
|
91
87
|
print(f" {COLORS['yellow']}ngpt --cli-config set language java{COLORS['reset']} - Set default language to java for code generation")
|
@@ -543,7 +539,8 @@ def main():
|
|
543
539
|
prettify=args.prettify,
|
544
540
|
renderer=args.renderer,
|
545
541
|
stream_prettify=args.stream_prettify,
|
546
|
-
logger=logger
|
542
|
+
logger=logger,
|
543
|
+
multiline_enabled=args.multiline
|
547
544
|
)
|
548
545
|
elif args.shell:
|
549
546
|
# Apply CLI config for shell mode
|
ngpt/cli/modes/interactive.py
CHANGED
@@ -6,7 +6,7 @@ import sys
|
|
6
6
|
import time
|
7
7
|
from ..formatters import COLORS
|
8
8
|
from ..renderers import prettify_markdown, prettify_streaming_markdown, TERMINAL_RENDER_LOCK
|
9
|
-
from ..ui import spinner
|
9
|
+
from ..ui import spinner, get_multiline_input
|
10
10
|
from ...utils import enhance_prompt_with_web_search
|
11
11
|
|
12
12
|
# Optional imports for enhanced UI
|
@@ -20,7 +20,7 @@ try:
|
|
20
20
|
except ImportError:
|
21
21
|
HAS_PROMPT_TOOLKIT = False
|
22
22
|
|
23
|
-
def interactive_chat_session(client, web_search=False, no_stream=False, temperature=0.7, top_p=1.0, max_tokens=None, preprompt=None, prettify=False, renderer='auto', stream_prettify=False, logger=None):
|
23
|
+
def interactive_chat_session(client, web_search=False, no_stream=False, temperature=0.7, top_p=1.0, max_tokens=None, preprompt=None, prettify=False, renderer='auto', stream_prettify=False, logger=None, multiline_enabled=False):
|
24
24
|
"""Start an interactive chat session with the AI.
|
25
25
|
|
26
26
|
Args:
|
@@ -35,6 +35,7 @@ def interactive_chat_session(client, web_search=False, no_stream=False, temperat
|
|
35
35
|
renderer: Which markdown renderer to use
|
36
36
|
stream_prettify: Whether to enable streaming with prettify
|
37
37
|
logger: Logger instance for logging the conversation
|
38
|
+
multiline_enabled: Whether to enable the multiline input command
|
38
39
|
"""
|
39
40
|
# Get terminal width for better formatting
|
40
41
|
try:
|
@@ -60,6 +61,9 @@ def interactive_chat_session(client, web_search=False, no_stream=False, temperat
|
|
60
61
|
print(f" {COLORS['yellow']}clear{COLORS['reset']} : Reset conversation")
|
61
62
|
print(f" {COLORS['yellow']}exit{COLORS['reset']} : End session")
|
62
63
|
|
64
|
+
if multiline_enabled:
|
65
|
+
print(f" {COLORS['yellow']}ml{COLORS['reset']} : Open multiline editor")
|
66
|
+
|
63
67
|
print(f"\n{separator}\n")
|
64
68
|
|
65
69
|
# Show logging info if logger is available
|
@@ -184,6 +188,22 @@ def interactive_chat_session(client, web_search=False, no_stream=False, temperat
|
|
184
188
|
if user_input.lower() == 'clear':
|
185
189
|
clear_history()
|
186
190
|
continue
|
191
|
+
|
192
|
+
if multiline_enabled and user_input.lower() == 'ml':
|
193
|
+
print(f"{COLORS['cyan']}Opening multiline editor. Press Ctrl+D to submit.{COLORS['reset']}")
|
194
|
+
multiline_input = get_multiline_input()
|
195
|
+
if multiline_input is None:
|
196
|
+
# Input was cancelled
|
197
|
+
print(f"{COLORS['yellow']}Multiline input cancelled.{COLORS['reset']}")
|
198
|
+
continue
|
199
|
+
elif not multiline_input.strip():
|
200
|
+
print(f"{COLORS['yellow']}Empty message skipped.{COLORS['reset']}")
|
201
|
+
continue
|
202
|
+
else:
|
203
|
+
# Use the multiline input as user_input
|
204
|
+
user_input = multiline_input
|
205
|
+
print(f"{user_header()}")
|
206
|
+
print(f"{COLORS['cyan']}│ {COLORS['reset']}{user_input}")
|
187
207
|
|
188
208
|
# Skip empty messages but don't raise an error
|
189
209
|
if not user_input.strip():
|
ngpt/utils/cli_config.py
CHANGED
@@ -19,6 +19,8 @@ CLI_CONFIG_OPTIONS = {
|
|
19
19
|
"renderer": {"type": "str", "default": "auto", "context": ["all"]},
|
20
20
|
"config-index": {"type": "int", "default": 0, "context": ["all"], "exclusive": ["provider"]},
|
21
21
|
"web-search": {"type": "bool", "default": False, "context": ["all"]},
|
22
|
+
# Interactive mode options
|
23
|
+
"interactive-multiline": {"type": "bool", "default": False, "context": ["interactive"]},
|
22
24
|
# GitCommit message options
|
23
25
|
"rec-chunk": {"type": "bool", "default": False, "context": ["gitcommsg"]},
|
24
26
|
"diff": {"type": "str", "default": None, "context": ["gitcommsg"]},
|
@@ -243,6 +245,10 @@ def apply_cli_config(args: Any, mode: str) -> Any:
|
|
243
245
|
# Convert dashes to underscores for argparse compatibility
|
244
246
|
arg_name = option.replace("-", "_")
|
245
247
|
|
248
|
+
# Special case for interactive-multiline which maps to multiline argument
|
249
|
+
if option == "interactive-multiline":
|
250
|
+
arg_name = "multiline"
|
251
|
+
|
246
252
|
# Skip if explicitly set via command line
|
247
253
|
cli_option = f"--{option}"
|
248
254
|
if cli_option in explicit_args:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ngpt
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.12.0
|
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
|
@@ -2,10 +2,10 @@ ngpt/__init__.py,sha256=kpKhViLakwMdHZkuLht2vWcjt0uD_5gR33gvMhfXr6w,664
|
|
2
2
|
ngpt/__main__.py,sha256=j3eFYPOtCCFBOGh7NK5IWEnADnTMMSEB9GLyIDoW724,66
|
3
3
|
ngpt/client.py,sha256=XjpA2UnvrRvzk6_DzVEddUTzoPlF8koQ-cZURpHoT7c,9041
|
4
4
|
ngpt/cli/__init__.py,sha256=hebbDSMGiOd43YNnQP67uzr67Ue6rZPwm2czynr5iZY,43
|
5
|
-
ngpt/cli/args.py,sha256=
|
5
|
+
ngpt/cli/args.py,sha256=Sp5SfBmnmdUywne8swQCcOwlH9qz3d0ZXqFnAjUA1us,15341
|
6
6
|
ngpt/cli/config_manager.py,sha256=NQQcWnjUppAAd0s0p9YAf8EyKS1ex5-0EB4DvKdB4dk,3662
|
7
7
|
ngpt/cli/formatters.py,sha256=HBYGlx_7eoAKyzfy0Vq5L0yn8yVKjngqYBukMmXCcz0,9401
|
8
|
-
ngpt/cli/main.py,sha256=
|
8
|
+
ngpt/cli/main.py,sha256=P5ljHSRoWsmHBDKbY3WxMNNZB19ntZ3NURd7CWfHtOg,28811
|
9
9
|
ngpt/cli/renderers.py,sha256=vAoDkpvgG2Fl81zkJDk_-zM1Fsw8E4Uv6m1AI81Fawo,17049
|
10
10
|
ngpt/cli/roles.py,sha256=jtARS_XgZ1_UW8eAdLLMe7trpYhDnzEyCH9PYAiH-Og,9675
|
11
11
|
ngpt/cli/ui.py,sha256=8-WyPMwgQiqLXWO0mGfBhKTRnIDDtPUtm_XCvOnqBJA,11334
|
@@ -13,18 +13,18 @@ ngpt/cli/modes/__init__.py,sha256=KP7VR6Xw9k1p5Jcu0F38RDxSFvFIzH3j1ThDLNwznUI,36
|
|
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
15
|
ngpt/cli/modes/gitcommsg.py,sha256=qFOrll333ebFOkzLP_WD1Qw0VfpphYqeiuHumkP6OB4,54833
|
16
|
-
ngpt/cli/modes/interactive.py,sha256=
|
16
|
+
ngpt/cli/modes/interactive.py,sha256=bfXE7S3pSBgtazzmmOElbrRMZd7ahuZUB1uic1RDD-w,19073
|
17
17
|
ngpt/cli/modes/rewrite.py,sha256=RaN4NOItKrGy5ilRrTa2amK4zmNo59j6K7plUf5SJPM,20290
|
18
18
|
ngpt/cli/modes/shell.py,sha256=it1Brq1-LGeNfPKYBeVAwF-a78g9UP-KscofBZQkbr4,41589
|
19
19
|
ngpt/cli/modes/text.py,sha256=NOikaU9YVCBgyaCl6pwy9EVt-YY5Q4jBx0l47izpVTA,6986
|
20
20
|
ngpt/utils/__init__.py,sha256=_92f8eGMMOtQQA3uwgSRVwUEl1EIRFjWPUjcfGgI-eI,1244
|
21
|
-
ngpt/utils/cli_config.py,sha256=
|
21
|
+
ngpt/utils/cli_config.py,sha256=2RX0PIiz9z6DCYe2fpWIPSRC8JQmzRLY4RTApJRVWe4,11491
|
22
22
|
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.
|
27
|
-
ngpt-3.
|
28
|
-
ngpt-3.
|
29
|
-
ngpt-3.
|
30
|
-
ngpt-3.
|
26
|
+
ngpt-3.12.0.dist-info/METADATA,sha256=UzFPmk3d6LssglEvLzSceT2mUuqrdMIPOYRE3TZYJxQ,31332
|
27
|
+
ngpt-3.12.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
28
|
+
ngpt-3.12.0.dist-info/entry_points.txt,sha256=SqAAvLhMrsEpkIr4YFRdUeyuXQ9o0IBCeYgE6AVojoI,44
|
29
|
+
ngpt-3.12.0.dist-info/licenses/LICENSE,sha256=mQkpWoADxbHqE0HRefYLJdm7OpdrXBr3vNv5bZ8w72M,1065
|
30
|
+
ngpt-3.12.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|