ngpt 3.12.1__tar.gz → 4.0.0__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.
- {ngpt-3.12.1 → ngpt-4.0.0}/PKG-INFO +46 -59
- {ngpt-3.12.1 → ngpt-4.0.0}/README.md +45 -58
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/configuration.md +21 -35
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/usage/cli_config.md +16 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/usage/cli_usage.md +55 -33
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/cli/args.py +33 -36
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/cli/main.py +54 -16
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/cli/modes/interactive.py +1 -1
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/utils/cli_config.py +16 -9
- {ngpt-3.12.1 → ngpt-4.0.0}/pyproject.toml +1 -1
- {ngpt-3.12.1 → ngpt-4.0.0}/uv.lock +1 -1
- {ngpt-3.12.1 → ngpt-4.0.0}/.github/banner.svg +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/.github/workflows/aur-publish.yml +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/.github/workflows/python-publish.yml +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/.github/workflows/repo-mirror.yml +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/.gitignore +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/.python-version +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/COMMIT_GUIDELINES.md +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/CONTRIBUTING.md +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/LICENSE +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/PKGBUILD +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/CONTRIBUTING.md +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/LICENSE.md +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/_config.yml +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/_sass/custom/custom.scss +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/examples/advanced.md +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/examples/basic.md +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/examples/role_gallery.md +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/examples/specialized_tools.md +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/examples.md +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/index.md +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/installation.md +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/overview.md +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/usage/gitcommsg.md +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/usage/roles.md +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/usage/web_search.md +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/docs/usage.md +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/__init__.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/__main__.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/cli/__init__.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/cli/config_manager.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/cli/formatters.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/cli/modes/__init__.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/cli/modes/chat.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/cli/modes/code.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/cli/modes/gitcommsg.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/cli/modes/rewrite.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/cli/modes/shell.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/cli/modes/text.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/cli/renderers.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/cli/roles.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/cli/ui.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/client.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/utils/__init__.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/utils/config.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/utils/log.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/utils/pipe.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/ngpt/utils/web_search.py +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/previews/icon.png +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/previews/ngpt-g.png +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/previews/ngpt-i.png +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/previews/ngpt-s-c.png +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/previews/ngpt-sh-c-a.png +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/previews/ngpt-w-self.png +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/previews/ngpt-w.png +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/previews/social-preview.png +0 -0
- {ngpt-3.12.1 → ngpt-4.0.0}/wiki.md +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ngpt
|
3
|
-
Version:
|
3
|
+
Version: 4.0.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
|
@@ -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
|
@@ -455,37 +443,36 @@ CLI Configuration Help:
|
|
455
443
|
ngpt --cli-config get OPTION - Get the current value of OPTION
|
456
444
|
ngpt --cli-config get - Show all CLI configuration settings
|
457
445
|
ngpt --cli-config unset OPTION - Remove OPTION from configuration
|
458
|
-
ngpt --cli-config list - List all available options
|
446
|
+
ngpt --cli-config list - List all available options with types and defaults
|
459
447
|
|
460
448
|
Available options:
|
461
449
|
General options (all modes):
|
462
|
-
config-index - int (default: 0)
|
463
|
-
log - str
|
464
|
-
max_tokens - int
|
465
|
-
no-stream - bool (default: False)
|
466
|
-
preprompt - str
|
467
|
-
prettify - bool (default: False)
|
468
|
-
provider - str
|
469
|
-
renderer - str (default: auto)
|
470
|
-
stream-prettify - bool (default:
|
471
|
-
temperature - float (default: 0.7)
|
472
|
-
top_p - float (default: 1.0)
|
473
|
-
web-search - bool (default: False)
|
474
|
-
|
475
|
-
|
476
|
-
language - str (default: python)
|
477
|
-
|
478
|
-
|
479
|
-
analyses-chunk-size - int (default: 200)
|
480
|
-
chunk-size - int (default: 200)
|
481
|
-
diff - str
|
482
|
-
max-msg-lines - int (default: 20)
|
483
|
-
max-recursion-depth - int (default: 3)
|
484
|
-
rec-chunk - bool (default: False)
|
450
|
+
config-index - Type: int (default: 0)
|
451
|
+
log - Type: str (default: None)
|
452
|
+
max_tokens - Type: int (default: None)
|
453
|
+
no-stream - Type: bool (default: False)
|
454
|
+
preprompt - Type: str (default: None)
|
455
|
+
prettify - Type: bool (default: False)
|
456
|
+
provider - Type: str (default: None)
|
457
|
+
renderer - Type: str (default: auto)
|
458
|
+
stream-prettify - Type: bool (default: True)
|
459
|
+
temperature - Type: float (default: 0.7)
|
460
|
+
top_p - Type: float (default: 1.0)
|
461
|
+
web-search - Type: bool (default: False)
|
462
|
+
|
463
|
+
Code mode options (-c/--code):
|
464
|
+
language - Type: str (default: python)
|
465
|
+
|
466
|
+
Git commit message options (-g/--gitcommsg):
|
467
|
+
analyses-chunk-size - Type: int (default: 200)
|
468
|
+
chunk-size - Type: int (default: 200)
|
469
|
+
diff - Type: str (default: None)
|
470
|
+
max-msg-lines - Type: int (default: 20)
|
471
|
+
max-recursion-depth - Type: int (default: 3)
|
472
|
+
rec-chunk - Type: bool (default: False)
|
485
473
|
|
486
474
|
Example usage:
|
487
475
|
ngpt --cli-config set language java - Set default language to java for code generation
|
488
|
-
ngpt --cli-config set provider Gemini - Set Gemini as your default provider
|
489
476
|
ngpt --cli-config set temperature 0.9 - Set default temperature to 0.9
|
490
477
|
ngpt --cli-config set no-stream true - Disable streaming by default
|
491
478
|
ngpt --cli-config set recursive-chunk true - Enable recursive chunking for git commit messages
|
@@ -244,44 +244,21 @@ For more examples and detailed usage, visit the [CLI Usage Guide](https://nazdri
|
|
244
244
|
```console
|
245
245
|
❯ ngpt -h
|
246
246
|
|
247
|
-
usage: ngpt [-h] [-v] [--
|
248
|
-
[--all] [--list-models] [--list-renderers] [--cli-config [COMMAND ...]] [--role-config [ACTION ...]]
|
249
|
-
[--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search] [--pipe]
|
247
|
+
usage: ngpt [-h] [-v] [--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search] [--pipe]
|
250
248
|
[--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
|
251
|
-
[--preprompt PREPROMPT | --role ROLE] [--
|
249
|
+
[--preprompt PREPROMPT | --role ROLE] [--config [CONFIG]] [--config-index CONFIG_INDEX]
|
250
|
+
[--provider PROVIDER] [--remove] [--show-config] [--all] [--list-models] [--list-renderers]
|
251
|
+
[--cli-config [COMMAND ...]] [--role-config [ACTION ...]] [--no-stream | --prettify | --stream-prettify]
|
252
252
|
[--renderer {auto,rich,glow}] [--language LANGUAGE] [--rec-chunk] [--diff [FILE]] [--chunk-size CHUNK_SIZE]
|
253
253
|
[--analyses-chunk-size ANALYSES_CHUNK_SIZE] [--max-msg-lines MAX_MSG_LINES]
|
254
|
-
[--max-recursion-depth MAX_RECURSION_DEPTH] [--humanize] [
|
255
|
-
[prompt]
|
254
|
+
[--max-recursion-depth MAX_RECURSION_DEPTH] [--humanize] [-i | -s | -c | -t | -r | -g]
|
256
255
|
|
257
256
|
nGPT - Interact with AI language models via OpenAI-compatible APIs
|
258
257
|
|
259
|
-
|
260
|
-
|
261
|
-
[PROMPT] The prompt to send
|
262
|
-
|
263
|
-
options::
|
258
|
+
Global Options::
|
264
259
|
|
265
260
|
-h, --help show this help message and exit
|
266
261
|
-v, --version Show version information and exit
|
267
|
-
|
268
|
-
Configuration Options::
|
269
|
-
|
270
|
-
--config [CONFIG] Path to a custom config file or, if no value provided, enter interactive
|
271
|
-
configuration mode to create a new config
|
272
|
-
--config-index CONFIG_INDEX Index of the configuration to use or edit (default: 0)
|
273
|
-
--provider PROVIDER Provider name to identify the configuration to use
|
274
|
-
--remove Remove the configuration at the specified index (requires --config and
|
275
|
-
--config-index or --provider)
|
276
|
-
--show-config Show the current configuration(s) and exit
|
277
|
-
--all Show details for all configurations (requires --show-config)
|
278
|
-
--list-models List all available models for the current configuration and exit
|
279
|
-
--list-renderers Show available markdown renderers for use with --prettify
|
280
|
-
--cli-config [COMMAND ...] Manage CLI configuration (set, get, unset, list, help)
|
281
|
-
--role-config [ACTION ...] Manage custom roles (help, create, show, edit, list, remove) [role_name]
|
282
|
-
|
283
|
-
Global Options::
|
284
|
-
|
285
262
|
--api-key API_KEY API key for the service
|
286
263
|
--base-url BASE_URL Base URL for the API
|
287
264
|
--model MODEL Model to use
|
@@ -301,6 +278,21 @@ Global Options::
|
|
301
278
|
--renderer {auto,rich,glow} Select which markdown renderer to use with --prettify or --stream-prettify
|
302
279
|
(auto, rich, or glow)
|
303
280
|
|
281
|
+
Configuration Options::
|
282
|
+
|
283
|
+
--config [CONFIG] Path to a custom config file or, if no value provided, enter interactive
|
284
|
+
configuration mode to create a new config
|
285
|
+
--config-index CONFIG_INDEX Index of the configuration to use or edit (default: 0)
|
286
|
+
--provider PROVIDER Provider name to identify the configuration to use
|
287
|
+
--remove Remove the configuration at the specified index (requires --config and
|
288
|
+
--config-index or --provider)
|
289
|
+
--show-config Show the current configuration(s) and exit
|
290
|
+
--all Show details for all configurations (requires --show-config)
|
291
|
+
--list-models List all available models for the current configuration and exit
|
292
|
+
--list-renderers Show available markdown renderers for use with --prettify
|
293
|
+
--cli-config [COMMAND ...] Manage CLI configuration (set, get, unset, list, help)
|
294
|
+
--role-config [ACTION ...] Manage custom roles (help, create, show, edit, list, remove) [role_name]
|
295
|
+
|
304
296
|
Output Display Options (mutually exclusive)::
|
305
297
|
|
306
298
|
--no-stream Return the whole response without streaming or formatting
|
@@ -328,10 +320,6 @@ Rewrite Mode Options::
|
|
328
320
|
--humanize Transform AI-generated text into human-like content that passes AI detection
|
329
321
|
tools
|
330
322
|
|
331
|
-
Interactive Mode Options::
|
332
|
-
|
333
|
-
--multiline Enable multiline text input with the "ml" command in interactive mode
|
334
|
-
|
335
323
|
Modes (mutually exclusive)::
|
336
324
|
|
337
325
|
-i, --interactive Start an interactive chat session
|
@@ -418,37 +406,36 @@ CLI Configuration Help:
|
|
418
406
|
ngpt --cli-config get OPTION - Get the current value of OPTION
|
419
407
|
ngpt --cli-config get - Show all CLI configuration settings
|
420
408
|
ngpt --cli-config unset OPTION - Remove OPTION from configuration
|
421
|
-
ngpt --cli-config list - List all available options
|
409
|
+
ngpt --cli-config list - List all available options with types and defaults
|
422
410
|
|
423
411
|
Available options:
|
424
412
|
General options (all modes):
|
425
|
-
config-index - int (default: 0)
|
426
|
-
log - str
|
427
|
-
max_tokens - int
|
428
|
-
no-stream - bool (default: False)
|
429
|
-
preprompt - str
|
430
|
-
prettify - bool (default: False)
|
431
|
-
provider - str
|
432
|
-
renderer - str (default: auto)
|
433
|
-
stream-prettify - bool (default:
|
434
|
-
temperature - float (default: 0.7)
|
435
|
-
top_p - float (default: 1.0)
|
436
|
-
web-search - bool (default: False)
|
437
|
-
|
438
|
-
|
439
|
-
language - str (default: python)
|
440
|
-
|
441
|
-
|
442
|
-
analyses-chunk-size - int (default: 200)
|
443
|
-
chunk-size - int (default: 200)
|
444
|
-
diff - str
|
445
|
-
max-msg-lines - int (default: 20)
|
446
|
-
max-recursion-depth - int (default: 3)
|
447
|
-
rec-chunk - bool (default: False)
|
413
|
+
config-index - Type: int (default: 0)
|
414
|
+
log - Type: str (default: None)
|
415
|
+
max_tokens - Type: int (default: None)
|
416
|
+
no-stream - Type: bool (default: False)
|
417
|
+
preprompt - Type: str (default: None)
|
418
|
+
prettify - Type: bool (default: False)
|
419
|
+
provider - Type: str (default: None)
|
420
|
+
renderer - Type: str (default: auto)
|
421
|
+
stream-prettify - Type: bool (default: True)
|
422
|
+
temperature - Type: float (default: 0.7)
|
423
|
+
top_p - Type: float (default: 1.0)
|
424
|
+
web-search - Type: bool (default: False)
|
425
|
+
|
426
|
+
Code mode options (-c/--code):
|
427
|
+
language - Type: str (default: python)
|
428
|
+
|
429
|
+
Git commit message options (-g/--gitcommsg):
|
430
|
+
analyses-chunk-size - Type: int (default: 200)
|
431
|
+
chunk-size - Type: int (default: 200)
|
432
|
+
diff - Type: str (default: None)
|
433
|
+
max-msg-lines - Type: int (default: 20)
|
434
|
+
max-recursion-depth - Type: int (default: 3)
|
435
|
+
rec-chunk - Type: bool (default: False)
|
448
436
|
|
449
437
|
Example usage:
|
450
438
|
ngpt --cli-config set language java - Set default language to java for code generation
|
451
|
-
ngpt --cli-config set provider Gemini - Set Gemini as your default provider
|
452
439
|
ngpt --cli-config set temperature 0.9 - Set default temperature to 0.9
|
453
440
|
ngpt --cli-config set no-stream true - Disable streaming by default
|
454
441
|
ngpt --cli-config set recursive-chunk true - Enable recursive chunking for git commit messages
|
@@ -146,46 +146,21 @@ You can set configuration options directly via command-line arguments:
|
|
146
146
|
|
147
147
|
|
148
148
|
```console
|
149
|
-
|
150
|
-
|
151
|
-
usage: ngpt [-h] [-v] [--config [CONFIG]] [--config-index CONFIG_INDEX] [--provider PROVIDER] [--remove] [--show-config]
|
152
|
-
[--all] [--list-models] [--list-renderers] [--cli-config [COMMAND ...]] [--role-config [ACTION ...]]
|
153
|
-
[--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search] [--pipe]
|
149
|
+
usage: ngpt [-h] [-v] [--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search] [--pipe]
|
154
150
|
[--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
|
155
|
-
[--preprompt PREPROMPT | --role ROLE] [--
|
151
|
+
[--preprompt PREPROMPT | --role ROLE] [--config [CONFIG]] [--config-index CONFIG_INDEX]
|
152
|
+
[--provider PROVIDER] [--remove] [--show-config] [--all] [--list-models] [--list-renderers]
|
153
|
+
[--cli-config [COMMAND ...]] [--role-config [ACTION ...]] [--no-stream | --prettify | --stream-prettify]
|
156
154
|
[--renderer {auto,rich,glow}] [--language LANGUAGE] [--rec-chunk] [--diff [FILE]] [--chunk-size CHUNK_SIZE]
|
157
155
|
[--analyses-chunk-size ANALYSES_CHUNK_SIZE] [--max-msg-lines MAX_MSG_LINES]
|
158
|
-
[--max-recursion-depth MAX_RECURSION_DEPTH] [--humanize] [
|
159
|
-
[prompt]
|
156
|
+
[--max-recursion-depth MAX_RECURSION_DEPTH] [--humanize] [-i | -s | -c | -t | -r | -g]
|
160
157
|
|
161
158
|
nGPT - Interact with AI language models via OpenAI-compatible APIs
|
162
159
|
|
163
|
-
|
164
|
-
|
165
|
-
[PROMPT] The prompt to send
|
166
|
-
|
167
|
-
options::
|
160
|
+
Global Options::
|
168
161
|
|
169
162
|
-h, --help show this help message and exit
|
170
163
|
-v, --version Show version information and exit
|
171
|
-
|
172
|
-
Configuration Options::
|
173
|
-
|
174
|
-
--config [CONFIG] Path to a custom config file or, if no value provided, enter interactive
|
175
|
-
configuration mode to create a new config
|
176
|
-
--config-index CONFIG_INDEX Index of the configuration to use or edit (default: 0)
|
177
|
-
--provider PROVIDER Provider name to identify the configuration to use
|
178
|
-
--remove Remove the configuration at the specified index (requires --config and
|
179
|
-
--config-index or --provider)
|
180
|
-
--show-config Show the current configuration(s) and exit
|
181
|
-
--all Show details for all configurations (requires --show-config)
|
182
|
-
--list-models List all available models for the current configuration and exit
|
183
|
-
--list-renderers Show available markdown renderers for use with --prettify
|
184
|
-
--cli-config [COMMAND ...] Manage CLI configuration (set, get, unset, list, help)
|
185
|
-
--role-config [ACTION ...] Manage custom roles (help, create, show, edit, list, remove) [role_name]
|
186
|
-
|
187
|
-
Global Options::
|
188
|
-
|
189
164
|
--api-key API_KEY API key for the service
|
190
165
|
--base-url BASE_URL Base URL for the API
|
191
166
|
--model MODEL Model to use
|
@@ -205,6 +180,21 @@ Global Options::
|
|
205
180
|
--renderer {auto,rich,glow} Select which markdown renderer to use with --prettify or --stream-prettify
|
206
181
|
(auto, rich, or glow)
|
207
182
|
|
183
|
+
Configuration Options::
|
184
|
+
|
185
|
+
--config [CONFIG] Path to a custom config file or, if no value provided, enter interactive
|
186
|
+
configuration mode to create a new config
|
187
|
+
--config-index CONFIG_INDEX Index of the configuration to use or edit (default: 0)
|
188
|
+
--provider PROVIDER Provider name to identify the configuration to use
|
189
|
+
--remove Remove the configuration at the specified index (requires --config and
|
190
|
+
--config-index or --provider)
|
191
|
+
--show-config Show the current configuration(s) and exit
|
192
|
+
--all Show details for all configurations (requires --show-config)
|
193
|
+
--list-models List all available models for the current configuration and exit
|
194
|
+
--list-renderers Show available markdown renderers for use with --prettify
|
195
|
+
--cli-config [COMMAND ...] Manage CLI configuration (set, get, unset, list, help)
|
196
|
+
--role-config [ACTION ...] Manage custom roles (help, create, show, edit, list, remove) [role_name]
|
197
|
+
|
208
198
|
Output Display Options (mutually exclusive)::
|
209
199
|
|
210
200
|
--no-stream Return the whole response without streaming or formatting
|
@@ -232,10 +222,6 @@ Rewrite Mode Options::
|
|
232
222
|
--humanize Transform AI-generated text into human-like content that passes AI detection
|
233
223
|
tools
|
234
224
|
|
235
|
-
Interactive Mode Options::
|
236
|
-
|
237
|
-
--multiline Enable multiline text input with the "ml" command in interactive mode
|
238
|
-
|
239
225
|
Modes (mutually exclusive)::
|
240
226
|
|
241
227
|
-i, --interactive Start an interactive chat session
|
@@ -171,6 +171,12 @@ The CLI configuration system enforces these rules to prevent incompatible combin
|
|
171
171
|
|--------|------|---------|-------------|
|
172
172
|
| `language` | string | python | Programming language for code generation |
|
173
173
|
|
174
|
+
#### Interactive Mode
|
175
|
+
|
176
|
+
| Option | Type | Default | Description |
|
177
|
+
|--------|------|---------|-------------|
|
178
|
+
| `interactive-multiline` | bool | false | Enable multiline text input with the "ml" command in interactive mode |
|
179
|
+
|
174
180
|
#### Git Commit Message Mode
|
175
181
|
|
176
182
|
| Option | Type | Default | Description |
|
@@ -197,6 +203,16 @@ ngpt --cli-config set prettify true
|
|
197
203
|
ngpt --cli-config set temperature 0.3
|
198
204
|
```
|
199
205
|
|
206
|
+
### Setting Up for Interactive Chat
|
207
|
+
|
208
|
+
```bash
|
209
|
+
# Enable multiline input in interactive mode by default
|
210
|
+
ngpt --cli-config set interactive-multiline true
|
211
|
+
|
212
|
+
# Set a custom system prompt for interactive sessions
|
213
|
+
ngpt --cli-config set preprompt "You are a helpful coding assistant specializing in Python"
|
214
|
+
```
|
215
|
+
|
200
216
|
### Setting Up a Creative Writing Environment
|
201
217
|
|
202
218
|
```bash
|
@@ -39,44 +39,21 @@ You can set configuration options directly via command-line arguments:
|
|
39
39
|
```console
|
40
40
|
❯ ngpt -h
|
41
41
|
|
42
|
-
usage: ngpt [-h] [-v] [--
|
43
|
-
[--all] [--list-models] [--list-renderers] [--cli-config [COMMAND ...]] [--role-config [ACTION ...]]
|
44
|
-
[--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search] [--pipe]
|
42
|
+
usage: ngpt [-h] [-v] [--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search] [--pipe]
|
45
43
|
[--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
|
46
|
-
[--preprompt PREPROMPT | --role ROLE] [--
|
44
|
+
[--preprompt PREPROMPT | --role ROLE] [--config [CONFIG]] [--config-index CONFIG_INDEX]
|
45
|
+
[--provider PROVIDER] [--remove] [--show-config] [--all] [--list-models] [--list-renderers]
|
46
|
+
[--cli-config [COMMAND ...]] [--role-config [ACTION ...]] [--no-stream | --prettify | --stream-prettify]
|
47
47
|
[--renderer {auto,rich,glow}] [--language LANGUAGE] [--rec-chunk] [--diff [FILE]] [--chunk-size CHUNK_SIZE]
|
48
48
|
[--analyses-chunk-size ANALYSES_CHUNK_SIZE] [--max-msg-lines MAX_MSG_LINES]
|
49
|
-
[--max-recursion-depth MAX_RECURSION_DEPTH] [--humanize] [
|
50
|
-
[prompt]
|
49
|
+
[--max-recursion-depth MAX_RECURSION_DEPTH] [--humanize] [-i | -s | -c | -t | -r | -g]
|
51
50
|
|
52
51
|
nGPT - Interact with AI language models via OpenAI-compatible APIs
|
53
52
|
|
54
|
-
|
55
|
-
|
56
|
-
[PROMPT] The prompt to send
|
57
|
-
|
58
|
-
options::
|
53
|
+
Global Options::
|
59
54
|
|
60
55
|
-h, --help show this help message and exit
|
61
56
|
-v, --version Show version information and exit
|
62
|
-
|
63
|
-
Configuration Options::
|
64
|
-
|
65
|
-
--config [CONFIG] Path to a custom config file or, if no value provided, enter interactive
|
66
|
-
configuration mode to create a new config
|
67
|
-
--config-index CONFIG_INDEX Index of the configuration to use or edit (default: 0)
|
68
|
-
--provider PROVIDER Provider name to identify the configuration to use
|
69
|
-
--remove Remove the configuration at the specified index (requires --config and
|
70
|
-
--config-index or --provider)
|
71
|
-
--show-config Show the current configuration(s) and exit
|
72
|
-
--all Show details for all configurations (requires --show-config)
|
73
|
-
--list-models List all available models for the current configuration and exit
|
74
|
-
--list-renderers Show available markdown renderers for use with --prettify
|
75
|
-
--cli-config [COMMAND ...] Manage CLI configuration (set, get, unset, list, help)
|
76
|
-
--role-config [ACTION ...] Manage custom roles (help, create, show, edit, list, remove) [role_name]
|
77
|
-
|
78
|
-
Global Options::
|
79
|
-
|
80
57
|
--api-key API_KEY API key for the service
|
81
58
|
--base-url BASE_URL Base URL for the API
|
82
59
|
--model MODEL Model to use
|
@@ -96,6 +73,21 @@ Global Options::
|
|
96
73
|
--renderer {auto,rich,glow} Select which markdown renderer to use with --prettify or --stream-prettify
|
97
74
|
(auto, rich, or glow)
|
98
75
|
|
76
|
+
Configuration Options::
|
77
|
+
|
78
|
+
--config [CONFIG] Path to a custom config file or, if no value provided, enter interactive
|
79
|
+
configuration mode to create a new config
|
80
|
+
--config-index CONFIG_INDEX Index of the configuration to use or edit (default: 0)
|
81
|
+
--provider PROVIDER Provider name to identify the configuration to use
|
82
|
+
--remove Remove the configuration at the specified index (requires --config and
|
83
|
+
--config-index or --provider)
|
84
|
+
--show-config Show the current configuration(s) and exit
|
85
|
+
--all Show details for all configurations (requires --show-config)
|
86
|
+
--list-models List all available models for the current configuration and exit
|
87
|
+
--list-renderers Show available markdown renderers for use with --prettify
|
88
|
+
--cli-config [COMMAND ...] Manage CLI configuration (set, get, unset, list, help)
|
89
|
+
--role-config [ACTION ...] Manage custom roles (help, create, show, edit, list, remove) [role_name]
|
90
|
+
|
99
91
|
Output Display Options (mutually exclusive)::
|
100
92
|
|
101
93
|
--no-stream Return the whole response without streaming or formatting
|
@@ -123,10 +115,6 @@ Rewrite Mode Options::
|
|
123
115
|
--humanize Transform AI-generated text into human-like content that passes AI detection
|
124
116
|
tools
|
125
117
|
|
126
|
-
Interactive Mode Options::
|
127
|
-
|
128
|
-
--multiline Enable multiline text input with the "ml" command in interactive mode
|
129
|
-
|
130
118
|
Modes (mutually exclusive)::
|
131
119
|
|
132
120
|
-i, --interactive Start an interactive chat session
|
@@ -195,6 +183,40 @@ ngpt --code --log "function to calculate prime numbers"
|
|
195
183
|
ngpt --shell --log "find large files in current directory"
|
196
184
|
```
|
197
185
|
|
186
|
+
#### Multiline Text Input in Interactive Mode
|
187
|
+
|
188
|
+
Enable multiline input in interactive chat mode:
|
189
|
+
|
190
|
+
```bash
|
191
|
+
ngpt -i
|
192
|
+
```
|
193
|
+
|
194
|
+
In interective mode you can:
|
195
|
+
- Use the "ml" command to enter multiline text mode
|
196
|
+
- Type or paste complex, multi-paragraph prompts
|
197
|
+
- Press Ctrl+D (or Ctrl+Z on Windows) to submit the multiline input
|
198
|
+
- Exit multiline mode anytime by typing ".exit" on a new line
|
199
|
+
|
200
|
+
This is especially useful when:
|
201
|
+
- Providing code samples for the AI to analyze
|
202
|
+
- Entering complex contexts or scenarios
|
203
|
+
- Pasting error logs or output for debugging help
|
204
|
+
- Composing detailed questions with multiple parts
|
205
|
+
|
206
|
+
Example usage:
|
207
|
+
```
|
208
|
+
> ml
|
209
|
+
(multiline mode - press Ctrl+D to submit)
|
210
|
+
Here's the error I'm getting:
|
211
|
+
|
212
|
+
TypeError: cannot convert 'NoneType' object to int
|
213
|
+
File "app.py", line 45, in process_data
|
214
|
+
result = data['count'] + 5
|
215
|
+
|
216
|
+
Can you help me understand what's wrong?
|
217
|
+
^D
|
218
|
+
```
|
219
|
+
|
198
220
|
#### Combining with Other Options
|
199
221
|
|
200
222
|
Interactive mode can be combined with other options for enhanced functionality:
|
@@ -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)')
|
@@ -37,7 +37,7 @@ def show_cli_config_help():
|
|
37
37
|
print(f" {COLORS['yellow']}ngpt --cli-config get OPTION{COLORS['reset']} - Get the current value of OPTION")
|
38
38
|
print(f" {COLORS['yellow']}ngpt --cli-config get{COLORS['reset']} - Show all CLI configuration settings")
|
39
39
|
print(f" {COLORS['yellow']}ngpt --cli-config unset OPTION{COLORS['reset']} - Remove OPTION from configuration")
|
40
|
-
print(f" {COLORS['yellow']}ngpt --cli-config list{COLORS['reset']} - List all available options")
|
40
|
+
print(f" {COLORS['yellow']}ngpt --cli-config list{COLORS['reset']} - List all available options with types and defaults")
|
41
41
|
|
42
42
|
print(f"\n {COLORS['cyan']}Available options:{COLORS['reset']}")
|
43
43
|
|
@@ -51,8 +51,10 @@ def show_cli_config_help():
|
|
51
51
|
"gitcommsg": [] # Add gitcommsg context
|
52
52
|
}
|
53
53
|
|
54
|
-
|
55
|
-
|
54
|
+
# Get option details from list_cli_config_options instead of CLI_CONFIG_OPTIONS
|
55
|
+
for option_details in list_cli_config_options():
|
56
|
+
option = option_details["name"]
|
57
|
+
for context in option_details["context"]:
|
56
58
|
if context in context_groups:
|
57
59
|
if context == "all":
|
58
60
|
context_groups[context].append(option)
|
@@ -63,25 +65,57 @@ def show_cli_config_help():
|
|
63
65
|
# Print general options (available in all contexts)
|
64
66
|
print(f" {COLORS['yellow']}General options (all modes):{COLORS['reset']}")
|
65
67
|
for option in sorted(context_groups["all"]):
|
66
|
-
|
68
|
+
# Get option details
|
69
|
+
option_detail = next((o for o in list_cli_config_options() if o["name"] == option), None)
|
70
|
+
if option_detail:
|
71
|
+
option_type = option_detail["type"]
|
72
|
+
default = option_detail["default"]
|
73
|
+
default_str = f"(default: {default})" if default is not None else "(default: None)"
|
74
|
+
print(f" {option} - {COLORS['cyan']}Type: {option_type}{COLORS['reset']} {default_str}")
|
75
|
+
else:
|
76
|
+
print(f" {option}")
|
67
77
|
|
68
78
|
# Print code options
|
69
79
|
if context_groups["code"]:
|
70
80
|
print(f"\n {COLORS['yellow']}Code mode options (-c/--code):{COLORS['reset']}")
|
71
81
|
for option in sorted(context_groups["code"]):
|
72
|
-
|
82
|
+
# Get option details
|
83
|
+
option_detail = next((o for o in list_cli_config_options() if o["name"] == option), None)
|
84
|
+
if option_detail:
|
85
|
+
option_type = option_detail["type"]
|
86
|
+
default = option_detail["default"]
|
87
|
+
default_str = f"(default: {default})" if default is not None else "(default: None)"
|
88
|
+
print(f" {option} - {COLORS['cyan']}Type: {option_type}{COLORS['reset']} {default_str}")
|
89
|
+
else:
|
90
|
+
print(f" {option}")
|
73
91
|
|
74
92
|
# Print interactive mode options
|
75
93
|
if context_groups["interactive"]:
|
76
94
|
print(f"\n {COLORS['yellow']}Interactive mode options (-i/--interactive):{COLORS['reset']}")
|
77
95
|
for option in sorted(context_groups["interactive"]):
|
78
|
-
|
96
|
+
# Get option details
|
97
|
+
option_detail = next((o for o in list_cli_config_options() if o["name"] == option), None)
|
98
|
+
if option_detail:
|
99
|
+
option_type = option_detail["type"]
|
100
|
+
default = option_detail["default"]
|
101
|
+
default_str = f"(default: {default})" if default is not None else "(default: None)"
|
102
|
+
print(f" {option} - {COLORS['cyan']}Type: {option_type}{COLORS['reset']} {default_str}")
|
103
|
+
else:
|
104
|
+
print(f" {option}")
|
79
105
|
|
80
106
|
# Print gitcommsg options
|
81
107
|
if context_groups["gitcommsg"]:
|
82
108
|
print(f"\n {COLORS['yellow']}Git commit message options (-g/--gitcommsg):{COLORS['reset']}")
|
83
109
|
for option in sorted(context_groups["gitcommsg"]):
|
84
|
-
|
110
|
+
# Get option details
|
111
|
+
option_detail = next((o for o in list_cli_config_options() if o["name"] == option), None)
|
112
|
+
if option_detail:
|
113
|
+
option_type = option_detail["type"]
|
114
|
+
default = option_detail["default"]
|
115
|
+
default_str = f"(default: {default})" if default is not None else "(default: None)"
|
116
|
+
print(f" {option} - {COLORS['cyan']}Type: {option_type}{COLORS['reset']} {default_str}")
|
117
|
+
else:
|
118
|
+
print(f" {option}")
|
85
119
|
|
86
120
|
print(f"\n {COLORS['cyan']}Example usage:{COLORS['reset']}")
|
87
121
|
print(f" {COLORS['yellow']}ngpt --cli-config set language java{COLORS['reset']} - Set default language to java for code generation")
|
@@ -111,13 +145,18 @@ def handle_cli_config(action, option=None, value=None):
|
|
111
145
|
if action == "list":
|
112
146
|
# List all available options
|
113
147
|
print(f"{COLORS['green']}{COLORS['bold']}Available CLI configuration options:{COLORS['reset']}")
|
114
|
-
for
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
148
|
+
for option_details in list_cli_config_options():
|
149
|
+
option = option_details["name"]
|
150
|
+
option_type = option_details["type"]
|
151
|
+
default = option_details["default"]
|
152
|
+
contexts = option_details["context"]
|
153
|
+
|
154
|
+
default_str = f"(default: {default})" if default is not None else "(default: None)"
|
155
|
+
contexts_str = ', '.join(contexts)
|
156
|
+
if "all" in contexts:
|
157
|
+
contexts_str = "all modes"
|
158
|
+
|
159
|
+
print(f" {COLORS['cyan']}{option}{COLORS['reset']} - {COLORS['yellow']}Type: {option_type}{COLORS['reset']} {default_str} - Available in: {contexts_str}")
|
121
160
|
return
|
122
161
|
|
123
162
|
if action == "get":
|
@@ -539,8 +578,7 @@ def main():
|
|
539
578
|
prettify=args.prettify,
|
540
579
|
renderer=args.renderer,
|
541
580
|
stream_prettify=args.stream_prettify,
|
542
|
-
logger=logger
|
543
|
-
multiline_enabled=args.multiline
|
581
|
+
logger=logger
|
544
582
|
)
|
545
583
|
elif args.shell:
|
546
584
|
# Apply CLI config for shell mode
|
@@ -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:
|
@@ -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:
|
@@ -288,6 +282,19 @@ def apply_cli_config(args: Any, mode: str) -> Any:
|
|
288
282
|
|
289
283
|
return args
|
290
284
|
|
291
|
-
def list_cli_config_options() -> List[str]:
|
292
|
-
"""List all available CLI configuration options.
|
293
|
-
|
285
|
+
def list_cli_config_options() -> List[Dict[str, Any]]:
|
286
|
+
"""List all available CLI configuration options with their types and default values.
|
287
|
+
|
288
|
+
Returns:
|
289
|
+
List of dictionaries containing option details
|
290
|
+
"""
|
291
|
+
options_list = []
|
292
|
+
for option, details in sorted(CLI_CONFIG_OPTIONS.items()):
|
293
|
+
options_list.append({
|
294
|
+
"name": option,
|
295
|
+
"type": details["type"],
|
296
|
+
"default": details["default"],
|
297
|
+
"context": details["context"],
|
298
|
+
"exclusive": details.get("exclusive", [])
|
299
|
+
})
|
300
|
+
return options_list
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "ngpt"
|
3
|
-
version = "
|
3
|
+
version = "4.0.0"
|
4
4
|
description = "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
|
authors = [
|
6
6
|
{name = "nazDridoy", email = "nazdridoy399@gmail.com"},
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|