ngpt 3.12.2__py3-none-any.whl → 4.0.1__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 +33 -36
- ngpt/cli/main.py +2 -3
- ngpt/cli/modes/interactive.py +1 -1
- ngpt/utils/cli_config.py +0 -6
- {ngpt-3.12.2.dist-info → ngpt-4.0.1.dist-info}/METADATA +22 -37
- {ngpt-3.12.2.dist-info → ngpt-4.0.1.dist-info}/RECORD +9 -9
- {ngpt-3.12.2.dist-info → ngpt-4.0.1.dist-info}/WHEEL +0 -0
- {ngpt-3.12.2.dist-info → ngpt-4.0.1.dist-info}/entry_points.txt +0 -0
- {ngpt-3.12.2.dist-info → ngpt-4.0.1.dist-info}/licenses/LICENSE +0 -0
ngpt/cli/args.py
CHANGED
@@ -12,7 +12,8 @@ def setup_argument_parser():
|
|
12
12
|
# Minimalist, clean epilog design
|
13
13
|
epilog = f"\n{COLORS['yellow']}nGPT {COLORS['bold']}v{__version__}{COLORS['reset']} • {COLORS['green']}Docs: {COLORS['bold']}https://nazdridoy.github.io/ngpt/usage/cli_usage{COLORS['reset']}"
|
14
14
|
|
15
|
-
parser = argparse.ArgumentParser(description=description, formatter_class=ColoredHelpFormatter,
|
15
|
+
parser = argparse.ArgumentParser(description=description, formatter_class=ColoredHelpFormatter,
|
16
|
+
epilog=epilog, add_help=False)
|
16
17
|
|
17
18
|
# Add custom error method with color
|
18
19
|
original_error = parser.error
|
@@ -27,41 +28,16 @@ def setup_argument_parser():
|
|
27
28
|
print(f"{COLORS['green']}{COLORS['bold']}nGPT{COLORS['reset']} version {COLORS['yellow']}{__version__}{COLORS['reset']}")
|
28
29
|
parser.exit()
|
29
30
|
|
30
|
-
# Version flag
|
31
|
-
parser.add_argument('-v', '--version', action=ColoredVersionAction, nargs=0,
|
32
|
-
help='Show version information and exit')
|
33
|
-
|
34
|
-
# Prompt argument
|
35
|
-
parser.add_argument('prompt', nargs='?', default=None,
|
36
|
-
help='The prompt to send')
|
37
|
-
|
38
|
-
# Config options
|
39
|
-
config_group = parser.add_argument_group('Configuration Options')
|
40
|
-
config_group.add_argument('--config', nargs='?', const=True,
|
41
|
-
help='Path to a custom config file or, if no value provided, enter interactive configuration mode to create a new config')
|
42
|
-
config_group.add_argument('--config-index', type=int, default=0,
|
43
|
-
help='Index of the configuration to use or edit (default: 0)')
|
44
|
-
config_group.add_argument('--provider',
|
45
|
-
help='Provider name to identify the configuration to use')
|
46
|
-
config_group.add_argument('--remove', action='store_true',
|
47
|
-
help='Remove the configuration at the specified index (requires --config and --config-index or --provider)')
|
48
|
-
config_group.add_argument('--show-config', action='store_true',
|
49
|
-
help='Show the current configuration(s) and exit')
|
50
|
-
config_group.add_argument('--all', action='store_true',
|
51
|
-
help='Show details for all configurations (requires --show-config)')
|
52
|
-
config_group.add_argument('--list-models', action='store_true',
|
53
|
-
help='List all available models for the current configuration and exit')
|
54
|
-
config_group.add_argument('--list-renderers', action='store_true',
|
55
|
-
help='Show available markdown renderers for use with --prettify')
|
56
|
-
config_group.add_argument('--cli-config', nargs='*', metavar='COMMAND',
|
57
|
-
help='Manage CLI configuration (set, get, unset, list, help)')
|
58
|
-
|
59
|
-
# Role configuration options
|
60
|
-
config_group.add_argument('--role-config', nargs='*', metavar='ACTION',
|
61
|
-
help='Manage custom roles (help, create, show, edit, list, remove) [role_name]')
|
62
|
-
|
63
31
|
# Global options
|
64
32
|
global_group = parser.add_argument_group('Global Options')
|
33
|
+
|
34
|
+
# Add help and version to the global group
|
35
|
+
global_group.add_argument('-h', '--help', action='help',
|
36
|
+
help='show this help message and exit')
|
37
|
+
global_group.add_argument('-v', '--version', action=ColoredVersionAction, nargs=0,
|
38
|
+
help='Show version information and exit')
|
39
|
+
|
40
|
+
# Then add the other global options
|
65
41
|
global_group.add_argument('--api-key',
|
66
42
|
help='API key for the service')
|
67
43
|
global_group.add_argument('--base-url',
|
@@ -88,6 +64,29 @@ def setup_argument_parser():
|
|
88
64
|
prompt_exclusive_group.add_argument('--role',
|
89
65
|
help='Use a predefined role to set system prompt (mutually exclusive with --preprompt)')
|
90
66
|
|
67
|
+
# Config options
|
68
|
+
config_group = parser.add_argument_group('Configuration Options')
|
69
|
+
config_group.add_argument('--config', nargs='?', const=True,
|
70
|
+
help='Path to a custom config file or, if no value provided, enter interactive configuration mode to create a new config')
|
71
|
+
config_group.add_argument('--config-index', type=int, default=0,
|
72
|
+
help='Index of the configuration to use or edit (default: 0)')
|
73
|
+
config_group.add_argument('--provider',
|
74
|
+
help='Provider name to identify the configuration to use')
|
75
|
+
config_group.add_argument('--remove', action='store_true',
|
76
|
+
help='Remove the configuration at the specified index (requires --config and --config-index or --provider)')
|
77
|
+
config_group.add_argument('--show-config', action='store_true',
|
78
|
+
help='Show the current configuration(s) and exit')
|
79
|
+
config_group.add_argument('--all', action='store_true',
|
80
|
+
help='Show details for all configurations (requires --show-config)')
|
81
|
+
config_group.add_argument('--list-models', action='store_true',
|
82
|
+
help='List all available models for the current configuration and exit')
|
83
|
+
config_group.add_argument('--list-renderers', action='store_true',
|
84
|
+
help='Show available markdown renderers for use with --prettify')
|
85
|
+
config_group.add_argument('--cli-config', nargs='*', metavar='COMMAND',
|
86
|
+
help='Manage CLI configuration (set, get, unset, list, help)')
|
87
|
+
config_group.add_argument('--role-config', nargs='*', metavar='ACTION',
|
88
|
+
help='Manage custom roles (help, create, show, edit, list, remove) [role_name]')
|
89
|
+
|
91
90
|
# Output display options (mutually exclusive group)
|
92
91
|
output_group = parser.add_argument_group('Output Display Options (mutually exclusive)')
|
93
92
|
output_exclusive_group = output_group.add_mutually_exclusive_group()
|
@@ -128,8 +127,6 @@ def setup_argument_parser():
|
|
128
127
|
|
129
128
|
# Interactive mode options
|
130
129
|
interactive_group = parser.add_argument_group('Interactive Mode Options')
|
131
|
-
interactive_group.add_argument('--multiline', action='store_true',
|
132
|
-
help='Enable multiline text input with the "ml" command in interactive mode')
|
133
130
|
|
134
131
|
# Mode flags (mutually exclusive)
|
135
132
|
mode_group = parser.add_argument_group('Modes (mutually exclusive)')
|
ngpt/cli/main.py
CHANGED
@@ -510,7 +510,7 @@ def main():
|
|
510
510
|
return
|
511
511
|
|
512
512
|
# For interactive mode, we'll allow continuing without a specific prompt
|
513
|
-
if not args
|
513
|
+
if not getattr(args, 'prompt', None) and not (args.shell or args.code or args.text or args.interactive or args.show_config or args.list_models or args.rewrite or args.gitcommsg):
|
514
514
|
# Simply use the parser's help
|
515
515
|
parser = setup_argument_parser()
|
516
516
|
parser.print_help()
|
@@ -578,8 +578,7 @@ def main():
|
|
578
578
|
prettify=args.prettify,
|
579
579
|
renderer=args.renderer,
|
580
580
|
stream_prettify=args.stream_prettify,
|
581
|
-
logger=logger
|
582
|
-
multiline_enabled=args.multiline
|
581
|
+
logger=logger
|
583
582
|
)
|
584
583
|
elif args.shell:
|
585
584
|
# Apply CLI config for shell mode
|
ngpt/cli/modes/interactive.py
CHANGED
@@ -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, multiline_enabled=
|
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=True):
|
24
24
|
"""Start an interactive chat session with the AI.
|
25
25
|
|
26
26
|
Args:
|
ngpt/utils/cli_config.py
CHANGED
@@ -19,8 +19,6 @@ 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"]},
|
24
22
|
# GitCommit message options
|
25
23
|
"rec-chunk": {"type": "bool", "default": False, "context": ["gitcommsg"]},
|
26
24
|
"diff": {"type": "str", "default": None, "context": ["gitcommsg"]},
|
@@ -245,10 +243,6 @@ def apply_cli_config(args: Any, mode: str) -> Any:
|
|
245
243
|
# Convert dashes to underscores for argparse compatibility
|
246
244
|
arg_name = option.replace("-", "_")
|
247
245
|
|
248
|
-
# Special case for interactive-multiline which maps to multiline argument
|
249
|
-
if option == "interactive-multiline":
|
250
|
-
arg_name = "multiline"
|
251
|
-
|
252
246
|
# Skip if explicitly set via command line
|
253
247
|
cli_option = f"--{option}"
|
254
248
|
if cli_option in explicit_args:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ngpt
|
3
|
-
Version:
|
3
|
+
Version: 4.0.1
|
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
|
@@ -281,44 +281,21 @@ For more examples and detailed usage, visit the [CLI Usage Guide](https://nazdri
|
|
281
281
|
```console
|
282
282
|
❯ ngpt -h
|
283
283
|
|
284
|
-
usage: ngpt [-h] [-v] [--
|
285
|
-
[--all] [--list-models] [--list-renderers] [--cli-config [COMMAND ...]] [--role-config [ACTION ...]]
|
286
|
-
[--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search] [--pipe]
|
284
|
+
usage: ngpt [-h] [-v] [--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search] [--pipe]
|
287
285
|
[--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
|
288
|
-
[--preprompt PREPROMPT | --role ROLE] [--
|
286
|
+
[--preprompt PREPROMPT | --role ROLE] [--config [CONFIG]] [--config-index CONFIG_INDEX]
|
287
|
+
[--provider PROVIDER] [--remove] [--show-config] [--all] [--list-models] [--list-renderers]
|
288
|
+
[--cli-config [COMMAND ...]] [--role-config [ACTION ...]] [--no-stream | --prettify | --stream-prettify]
|
289
289
|
[--renderer {auto,rich,glow}] [--language LANGUAGE] [--rec-chunk] [--diff [FILE]] [--chunk-size CHUNK_SIZE]
|
290
290
|
[--analyses-chunk-size ANALYSES_CHUNK_SIZE] [--max-msg-lines MAX_MSG_LINES]
|
291
|
-
[--max-recursion-depth MAX_RECURSION_DEPTH] [--humanize] [
|
292
|
-
[prompt]
|
291
|
+
[--max-recursion-depth MAX_RECURSION_DEPTH] [--humanize] [-i | -s | -c | -t | -r | -g]
|
293
292
|
|
294
293
|
nGPT - Interact with AI language models via OpenAI-compatible APIs
|
295
294
|
|
296
|
-
|
297
|
-
|
298
|
-
[PROMPT] The prompt to send
|
299
|
-
|
300
|
-
options::
|
295
|
+
Global Options::
|
301
296
|
|
302
297
|
-h, --help show this help message and exit
|
303
298
|
-v, --version Show version information and exit
|
304
|
-
|
305
|
-
Configuration Options::
|
306
|
-
|
307
|
-
--config [CONFIG] Path to a custom config file or, if no value provided, enter interactive
|
308
|
-
configuration mode to create a new config
|
309
|
-
--config-index CONFIG_INDEX Index of the configuration to use or edit (default: 0)
|
310
|
-
--provider PROVIDER Provider name to identify the configuration to use
|
311
|
-
--remove Remove the configuration at the specified index (requires --config and
|
312
|
-
--config-index or --provider)
|
313
|
-
--show-config Show the current configuration(s) and exit
|
314
|
-
--all Show details for all configurations (requires --show-config)
|
315
|
-
--list-models List all available models for the current configuration and exit
|
316
|
-
--list-renderers Show available markdown renderers for use with --prettify
|
317
|
-
--cli-config [COMMAND ...] Manage CLI configuration (set, get, unset, list, help)
|
318
|
-
--role-config [ACTION ...] Manage custom roles (help, create, show, edit, list, remove) [role_name]
|
319
|
-
|
320
|
-
Global Options::
|
321
|
-
|
322
299
|
--api-key API_KEY API key for the service
|
323
300
|
--base-url BASE_URL Base URL for the API
|
324
301
|
--model MODEL Model to use
|
@@ -338,6 +315,21 @@ Global Options::
|
|
338
315
|
--renderer {auto,rich,glow} Select which markdown renderer to use with --prettify or --stream-prettify
|
339
316
|
(auto, rich, or glow)
|
340
317
|
|
318
|
+
Configuration Options::
|
319
|
+
|
320
|
+
--config [CONFIG] Path to a custom config file or, if no value provided, enter interactive
|
321
|
+
configuration mode to create a new config
|
322
|
+
--config-index CONFIG_INDEX Index of the configuration to use or edit (default: 0)
|
323
|
+
--provider PROVIDER Provider name to identify the configuration to use
|
324
|
+
--remove Remove the configuration at the specified index (requires --config and
|
325
|
+
--config-index or --provider)
|
326
|
+
--show-config Show the current configuration(s) and exit
|
327
|
+
--all Show details for all configurations (requires --show-config)
|
328
|
+
--list-models List all available models for the current configuration and exit
|
329
|
+
--list-renderers Show available markdown renderers for use with --prettify
|
330
|
+
--cli-config [COMMAND ...] Manage CLI configuration (set, get, unset, list, help)
|
331
|
+
--role-config [ACTION ...] Manage custom roles (help, create, show, edit, list, remove) [role_name]
|
332
|
+
|
341
333
|
Output Display Options (mutually exclusive)::
|
342
334
|
|
343
335
|
--no-stream Return the whole response without streaming or formatting
|
@@ -365,10 +357,6 @@ Rewrite Mode Options::
|
|
365
357
|
--humanize Transform AI-generated text into human-like content that passes AI detection
|
366
358
|
tools
|
367
359
|
|
368
|
-
Interactive Mode Options::
|
369
|
-
|
370
|
-
--multiline Enable multiline text input with the "ml" command in interactive mode
|
371
|
-
|
372
360
|
Modes (mutually exclusive)::
|
373
361
|
|
374
362
|
-i, --interactive Start an interactive chat session
|
@@ -475,9 +463,6 @@ CLI Configuration Help:
|
|
475
463
|
Code mode options (-c/--code):
|
476
464
|
language - Type: str (default: python)
|
477
465
|
|
478
|
-
Interactive mode options (-i/--interactive):
|
479
|
-
interactive-multiline - Type: bool (default: False)
|
480
|
-
|
481
466
|
Git commit message options (-g/--gitcommsg):
|
482
467
|
analyses-chunk-size - Type: int (default: 200)
|
483
468
|
chunk-size - Type: int (default: 200)
|
@@ -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=0ClIMzfY_qCuIVApphPDQNb8yDz1zA83mJtJwNrsfCE,15316
|
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=SERPyiniRDbqcEcyAmAcP1Uo1E4VFXpdaM_1r9cRCiA,31129
|
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=kBs1TIaMOYR6SBWXhgK-etXxI0zYF1-g3_25zwI2DtQ,19072
|
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=bP-1shJZ2Oshqpjpe0ZVNHKBRjRCFMfCYHzhwOUIHJY,11630
|
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-
|
27
|
-
ngpt-
|
28
|
-
ngpt-
|
29
|
-
ngpt-
|
30
|
-
ngpt-
|
26
|
+
ngpt-4.0.1.dist-info/METADATA,sha256=8wH1Ls5-0R-AgAELLFDGTj24TKX6kTHMyoRj4ruFUH0,31619
|
27
|
+
ngpt-4.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
28
|
+
ngpt-4.0.1.dist-info/entry_points.txt,sha256=SqAAvLhMrsEpkIr4YFRdUeyuXQ9o0IBCeYgE6AVojoI,44
|
29
|
+
ngpt-4.0.1.dist-info/licenses/LICENSE,sha256=mQkpWoADxbHqE0HRefYLJdm7OpdrXBr3vNv5bZ8w72M,1065
|
30
|
+
ngpt-4.0.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|