ngpt 3.11.3__tar.gz → 3.12.1__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.
Files changed (67) hide show
  1. {ngpt-3.11.3 → ngpt-3.12.1}/PKG-INFO +41 -22
  2. {ngpt-3.11.3 → ngpt-3.12.1}/README.md +40 -21
  3. {ngpt-3.11.3 → ngpt-3.12.1}/docs/configuration.md +81 -58
  4. {ngpt-3.11.3 → ngpt-3.12.1}/docs/usage/cli_usage.md +80 -58
  5. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/cli/args.py +10 -3
  6. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/cli/main.py +21 -24
  7. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/cli/modes/interactive.py +22 -2
  8. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/utils/cli_config.py +6 -0
  9. {ngpt-3.11.3 → ngpt-3.12.1}/pyproject.toml +1 -1
  10. {ngpt-3.11.3 → ngpt-3.12.1}/uv.lock +1 -1
  11. {ngpt-3.11.3 → ngpt-3.12.1}/.github/banner.svg +0 -0
  12. {ngpt-3.11.3 → ngpt-3.12.1}/.github/workflows/aur-publish.yml +0 -0
  13. {ngpt-3.11.3 → ngpt-3.12.1}/.github/workflows/python-publish.yml +0 -0
  14. {ngpt-3.11.3 → ngpt-3.12.1}/.github/workflows/repo-mirror.yml +0 -0
  15. {ngpt-3.11.3 → ngpt-3.12.1}/.gitignore +0 -0
  16. {ngpt-3.11.3 → ngpt-3.12.1}/.python-version +0 -0
  17. {ngpt-3.11.3 → ngpt-3.12.1}/COMMIT_GUIDELINES.md +0 -0
  18. {ngpt-3.11.3 → ngpt-3.12.1}/CONTRIBUTING.md +0 -0
  19. {ngpt-3.11.3 → ngpt-3.12.1}/LICENSE +0 -0
  20. {ngpt-3.11.3 → ngpt-3.12.1}/PKGBUILD +0 -0
  21. {ngpt-3.11.3 → ngpt-3.12.1}/docs/CONTRIBUTING.md +0 -0
  22. {ngpt-3.11.3 → ngpt-3.12.1}/docs/LICENSE.md +0 -0
  23. {ngpt-3.11.3 → ngpt-3.12.1}/docs/_config.yml +0 -0
  24. {ngpt-3.11.3 → ngpt-3.12.1}/docs/_sass/custom/custom.scss +0 -0
  25. {ngpt-3.11.3 → ngpt-3.12.1}/docs/examples/advanced.md +0 -0
  26. {ngpt-3.11.3 → ngpt-3.12.1}/docs/examples/basic.md +0 -0
  27. {ngpt-3.11.3 → ngpt-3.12.1}/docs/examples/role_gallery.md +0 -0
  28. {ngpt-3.11.3 → ngpt-3.12.1}/docs/examples/specialized_tools.md +0 -0
  29. {ngpt-3.11.3 → ngpt-3.12.1}/docs/examples.md +0 -0
  30. {ngpt-3.11.3 → ngpt-3.12.1}/docs/index.md +0 -0
  31. {ngpt-3.11.3 → ngpt-3.12.1}/docs/installation.md +0 -0
  32. {ngpt-3.11.3 → ngpt-3.12.1}/docs/overview.md +0 -0
  33. {ngpt-3.11.3 → ngpt-3.12.1}/docs/usage/cli_config.md +0 -0
  34. {ngpt-3.11.3 → ngpt-3.12.1}/docs/usage/gitcommsg.md +0 -0
  35. {ngpt-3.11.3 → ngpt-3.12.1}/docs/usage/roles.md +0 -0
  36. {ngpt-3.11.3 → ngpt-3.12.1}/docs/usage/web_search.md +0 -0
  37. {ngpt-3.11.3 → ngpt-3.12.1}/docs/usage.md +0 -0
  38. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/__init__.py +0 -0
  39. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/__main__.py +0 -0
  40. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/cli/__init__.py +0 -0
  41. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/cli/config_manager.py +0 -0
  42. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/cli/formatters.py +0 -0
  43. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/cli/modes/__init__.py +0 -0
  44. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/cli/modes/chat.py +0 -0
  45. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/cli/modes/code.py +0 -0
  46. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/cli/modes/gitcommsg.py +0 -0
  47. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/cli/modes/rewrite.py +0 -0
  48. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/cli/modes/shell.py +0 -0
  49. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/cli/modes/text.py +0 -0
  50. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/cli/renderers.py +0 -0
  51. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/cli/roles.py +0 -0
  52. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/cli/ui.py +0 -0
  53. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/client.py +0 -0
  54. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/utils/__init__.py +0 -0
  55. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/utils/config.py +0 -0
  56. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/utils/log.py +0 -0
  57. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/utils/pipe.py +0 -0
  58. {ngpt-3.11.3 → ngpt-3.12.1}/ngpt/utils/web_search.py +0 -0
  59. {ngpt-3.11.3 → ngpt-3.12.1}/previews/icon.png +0 -0
  60. {ngpt-3.11.3 → ngpt-3.12.1}/previews/ngpt-g.png +0 -0
  61. {ngpt-3.11.3 → ngpt-3.12.1}/previews/ngpt-i.png +0 -0
  62. {ngpt-3.11.3 → ngpt-3.12.1}/previews/ngpt-s-c.png +0 -0
  63. {ngpt-3.11.3 → ngpt-3.12.1}/previews/ngpt-sh-c-a.png +0 -0
  64. {ngpt-3.11.3 → ngpt-3.12.1}/previews/ngpt-w-self.png +0 -0
  65. {ngpt-3.11.3 → ngpt-3.12.1}/previews/ngpt-w.png +0 -0
  66. {ngpt-3.11.3 → ngpt-3.12.1}/previews/social-preview.png +0 -0
  67. {ngpt-3.11.3 → ngpt-3.12.1}/wiki.md +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngpt
3
- Version: 3.11.3
3
+ Version: 3.12.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,14 +281,14 @@ 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] [--language LANGUAGE] [--config [CONFIG]] [--config-index CONFIG_INDEX] [--provider PROVIDER]
285
- [--remove] [--show-config] [--all] [--list-models] [--list-renderers] [--cli-config [COMMAND ...]]
286
- [--role-config [ACTION ...]] [--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search]
287
- [--pipe] [--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
284
+ usage: ngpt [-h] [-v] [--config [CONFIG]] [--config-index CONFIG_INDEX] [--provider PROVIDER] [--remove] [--show-config]
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]
287
+ [--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
288
288
  [--preprompt PREPROMPT | --role ROLE] [--no-stream | --prettify | --stream-prettify]
289
- [--renderer {auto,rich,glow}] [--rec-chunk] [--diff [FILE]] [--chunk-size CHUNK_SIZE]
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] [-i | -s | -c | -t | -r | -g] [--humanize]
291
+ [--max-recursion-depth MAX_RECURSION_DEPTH] [--humanize] [--multiline] [-i | -s | -c | -t | -r | -g]
292
292
  [prompt]
293
293
 
294
294
  nGPT - Interact with AI language models via OpenAI-compatible APIs
@@ -301,14 +301,15 @@ options::
301
301
 
302
302
  -h, --help show this help message and exit
303
303
  -v, --version Show version information and exit
304
- --language LANGUAGE Programming language to generate code in (for code mode)
305
304
 
306
305
  Configuration Options::
307
306
 
308
- --config [CONFIG] Path to a custom config file or, if no value provided, enter interactive configuration mode to create a new config
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
309
  --config-index CONFIG_INDEX Index of the configuration to use or edit (default: 0)
310
310
  --provider PROVIDER Provider name to identify the configuration to use
311
- --remove Remove the configuration at the specified index (requires --config and --config-index or --provider)
311
+ --remove Remove the configuration at the specified index (requires --config and
312
+ --config-index or --provider)
312
313
  --show-config Show the current configuration(s) and exit
313
314
  --all Show details for all configurations (requires --show-config)
314
315
  --list-models List all available models for the current configuration and exit
@@ -321,15 +322,21 @@ Global Options::
321
322
  --api-key API_KEY API key for the service
322
323
  --base-url BASE_URL Base URL for the API
323
324
  --model MODEL Model to use
324
- --web-search Enable web search capability using DuckDuckGo to enhance prompts with relevant information
325
- --pipe Read from stdin and use content with prompt. Use {} in prompt as placeholder for stdin content. Can be used with any mode option except --text and --interactive
325
+ --web-search Enable web search capability using DuckDuckGo to enhance prompts with relevant
326
+ information
327
+ --pipe Read from stdin and use content with prompt. Use {} in prompt as placeholder
328
+ for stdin content. Can be used with any mode option except --text and
329
+ --interactive
326
330
  --temperature TEMPERATURE Set temperature (controls randomness, default: 0.7)
327
331
  --top_p TOP_P Set top_p (controls diversity, default: 1.0)
328
332
  --max_tokens MAX_TOKENS Set max response length in tokens
329
- --log [FILE] Set filepath to log conversation to, or create a temporary log file if no path provided
333
+ --log [FILE] Set filepath to log conversation to, or create a temporary log file if no path
334
+ provided
330
335
  --preprompt PREPROMPT Set custom system prompt to control AI behavior
331
- --role ROLE Use a predefined role to set system prompt (mutually exclusive with --preprompt)
332
- --renderer {auto,rich,glow} Select which markdown renderer to use with --prettify or --stream-prettify (auto, rich, or glow)
336
+ --role ROLE Use a predefined role to set system prompt (mutually exclusive with
337
+ --preprompt)
338
+ --renderer {auto,rich,glow} Select which markdown renderer to use with --prettify or --stream-prettify
339
+ (auto, rich, or glow)
333
340
 
334
341
  Output Display Options (mutually exclusive)::
335
342
 
@@ -337,14 +344,30 @@ Output Display Options (mutually exclusive)::
337
344
  --prettify Render complete response with markdown and code formatting (non-streaming)
338
345
  --stream-prettify Stream response with real-time markdown rendering (default)
339
346
 
347
+ Code Mode Options::
348
+
349
+ --language LANGUAGE Programming language to generate code in (for code mode)
350
+
340
351
  Git Commit Message Options::
341
352
 
342
353
  --rec-chunk Process large diffs in chunks with recursive analysis if needed
343
- --diff [FILE] Use diff from specified file instead of staged changes. If used without a path, uses the path from CLI config.
354
+ --diff [FILE] Use diff from specified file instead of staged changes. If used without a path,
355
+ uses the path from CLI config.
344
356
  --chunk-size CHUNK_SIZE Number of lines per chunk when chunking is enabled (default: 200)
345
- --analyses-chunk-size ANALYSES_CHUNK_SIZE Number of lines per chunk when recursively chunking analyses (default: 200)
357
+ --analyses-chunk-size ANALYSES_CHUNK_SIZE
358
+ Number of lines per chunk when recursively chunking analyses (default: 200)
346
359
  --max-msg-lines MAX_MSG_LINES Maximum number of lines in commit message before condensing (default: 20)
347
- --max-recursion-depth MAX_RECURSION_DEPTH Maximum recursion depth for commit message condensing (default: 3)
360
+ --max-recursion-depth MAX_RECURSION_DEPTH
361
+ Maximum recursion depth for commit message condensing (default: 3)
362
+
363
+ Rewrite Mode Options::
364
+
365
+ --humanize Transform AI-generated text into human-like content that passes AI detection
366
+ tools
367
+
368
+ Interactive Mode Options::
369
+
370
+ --multiline Enable multiline text input with the "ml" command in interactive mode
348
371
 
349
372
  Modes (mutually exclusive)::
350
373
 
@@ -355,10 +378,6 @@ Modes (mutually exclusive)::
355
378
  -r, --rewrite Rewrite text from stdin to be more natural while preserving tone and meaning
356
379
  -g, --gitcommsg Generate AI-powered git commit messages from staged changes or diff file
357
380
 
358
- Rewrite Mode Options::
359
-
360
- --humanize Transform AI-generated text into human-like content that passes AI detection tools
361
-
362
381
  ```
363
382
 
364
383
  > **Note**: For better visualization of conventional commit messages on GitHub, you can use the [GitHub Commit Labels](https://greasyfork.org/en/scripts/526153-github-commit-labels) userscript, which adds colorful labels to your commits.
@@ -244,14 +244,14 @@ 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] [--language LANGUAGE] [--config [CONFIG]] [--config-index CONFIG_INDEX] [--provider PROVIDER]
248
- [--remove] [--show-config] [--all] [--list-models] [--list-renderers] [--cli-config [COMMAND ...]]
249
- [--role-config [ACTION ...]] [--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search]
250
- [--pipe] [--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
247
+ usage: ngpt [-h] [-v] [--config [CONFIG]] [--config-index CONFIG_INDEX] [--provider PROVIDER] [--remove] [--show-config]
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]
250
+ [--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
251
251
  [--preprompt PREPROMPT | --role ROLE] [--no-stream | --prettify | --stream-prettify]
252
- [--renderer {auto,rich,glow}] [--rec-chunk] [--diff [FILE]] [--chunk-size CHUNK_SIZE]
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] [-i | -s | -c | -t | -r | -g] [--humanize]
254
+ [--max-recursion-depth MAX_RECURSION_DEPTH] [--humanize] [--multiline] [-i | -s | -c | -t | -r | -g]
255
255
  [prompt]
256
256
 
257
257
  nGPT - Interact with AI language models via OpenAI-compatible APIs
@@ -264,14 +264,15 @@ options::
264
264
 
265
265
  -h, --help show this help message and exit
266
266
  -v, --version Show version information and exit
267
- --language LANGUAGE Programming language to generate code in (for code mode)
268
267
 
269
268
  Configuration Options::
270
269
 
271
- --config [CONFIG] Path to a custom config file or, if no value provided, enter interactive configuration mode to create a new config
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
272
  --config-index CONFIG_INDEX Index of the configuration to use or edit (default: 0)
273
273
  --provider PROVIDER Provider name to identify the configuration to use
274
- --remove Remove the configuration at the specified index (requires --config and --config-index or --provider)
274
+ --remove Remove the configuration at the specified index (requires --config and
275
+ --config-index or --provider)
275
276
  --show-config Show the current configuration(s) and exit
276
277
  --all Show details for all configurations (requires --show-config)
277
278
  --list-models List all available models for the current configuration and exit
@@ -284,15 +285,21 @@ Global Options::
284
285
  --api-key API_KEY API key for the service
285
286
  --base-url BASE_URL Base URL for the API
286
287
  --model MODEL Model to use
287
- --web-search Enable web search capability using DuckDuckGo to enhance prompts with relevant information
288
- --pipe Read from stdin and use content with prompt. Use {} in prompt as placeholder for stdin content. Can be used with any mode option except --text and --interactive
288
+ --web-search Enable web search capability using DuckDuckGo to enhance prompts with relevant
289
+ information
290
+ --pipe Read from stdin and use content with prompt. Use {} in prompt as placeholder
291
+ for stdin content. Can be used with any mode option except --text and
292
+ --interactive
289
293
  --temperature TEMPERATURE Set temperature (controls randomness, default: 0.7)
290
294
  --top_p TOP_P Set top_p (controls diversity, default: 1.0)
291
295
  --max_tokens MAX_TOKENS Set max response length in tokens
292
- --log [FILE] Set filepath to log conversation to, or create a temporary log file if no path provided
296
+ --log [FILE] Set filepath to log conversation to, or create a temporary log file if no path
297
+ provided
293
298
  --preprompt PREPROMPT Set custom system prompt to control AI behavior
294
- --role ROLE Use a predefined role to set system prompt (mutually exclusive with --preprompt)
295
- --renderer {auto,rich,glow} Select which markdown renderer to use with --prettify or --stream-prettify (auto, rich, or glow)
299
+ --role ROLE Use a predefined role to set system prompt (mutually exclusive with
300
+ --preprompt)
301
+ --renderer {auto,rich,glow} Select which markdown renderer to use with --prettify or --stream-prettify
302
+ (auto, rich, or glow)
296
303
 
297
304
  Output Display Options (mutually exclusive)::
298
305
 
@@ -300,14 +307,30 @@ Output Display Options (mutually exclusive)::
300
307
  --prettify Render complete response with markdown and code formatting (non-streaming)
301
308
  --stream-prettify Stream response with real-time markdown rendering (default)
302
309
 
310
+ Code Mode Options::
311
+
312
+ --language LANGUAGE Programming language to generate code in (for code mode)
313
+
303
314
  Git Commit Message Options::
304
315
 
305
316
  --rec-chunk Process large diffs in chunks with recursive analysis if needed
306
- --diff [FILE] Use diff from specified file instead of staged changes. If used without a path, uses the path from CLI config.
317
+ --diff [FILE] Use diff from specified file instead of staged changes. If used without a path,
318
+ uses the path from CLI config.
307
319
  --chunk-size CHUNK_SIZE Number of lines per chunk when chunking is enabled (default: 200)
308
- --analyses-chunk-size ANALYSES_CHUNK_SIZE Number of lines per chunk when recursively chunking analyses (default: 200)
320
+ --analyses-chunk-size ANALYSES_CHUNK_SIZE
321
+ Number of lines per chunk when recursively chunking analyses (default: 200)
309
322
  --max-msg-lines MAX_MSG_LINES Maximum number of lines in commit message before condensing (default: 20)
310
- --max-recursion-depth MAX_RECURSION_DEPTH Maximum recursion depth for commit message condensing (default: 3)
323
+ --max-recursion-depth MAX_RECURSION_DEPTH
324
+ Maximum recursion depth for commit message condensing (default: 3)
325
+
326
+ Rewrite Mode Options::
327
+
328
+ --humanize Transform AI-generated text into human-like content that passes AI detection
329
+ tools
330
+
331
+ Interactive Mode Options::
332
+
333
+ --multiline Enable multiline text input with the "ml" command in interactive mode
311
334
 
312
335
  Modes (mutually exclusive)::
313
336
 
@@ -318,10 +341,6 @@ Modes (mutually exclusive)::
318
341
  -r, --rewrite Rewrite text from stdin to be more natural while preserving tone and meaning
319
342
  -g, --gitcommsg Generate AI-powered git commit messages from staged changes or diff file
320
343
 
321
- Rewrite Mode Options::
322
-
323
- --humanize Transform AI-generated text into human-like content that passes AI detection tools
324
-
325
344
  ```
326
345
 
327
346
  > **Note**: For better visualization of conventional commit messages on GitHub, you can use the [GitHub Commit Labels](https://greasyfork.org/en/scripts/526153-github-commit-labels) userscript, which adds colorful labels to your commits.
@@ -144,85 +144,108 @@ The interactive configuration will prompt you for values and guide you through t
144
144
 
145
145
  You can set configuration options directly via command-line arguments:
146
146
 
147
- ```
148
- usage: ngpt [-h] [-v] [--language LANGUAGE] [--config [CONFIG]] [--config-index CONFIG_INDEX] [--provider PROVIDER]
149
- [--remove] [--show-config] [--all] [--list-models] [--list-renderers] [--cli-config [COMMAND ...]]
150
- [--role-config [ACTION ...]] [--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search]
151
- [--pipe] [--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
147
+
148
+ ```console
149
+ ngpt -h
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]
154
+ [--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
152
155
  [--preprompt PREPROMPT | --role ROLE] [--no-stream | --prettify | --stream-prettify]
153
- [--renderer {auto,rich,glow}] [--rec-chunk] [--diff [FILE]] [--chunk-size CHUNK_SIZE]
156
+ [--renderer {auto,rich,glow}] [--language LANGUAGE] [--rec-chunk] [--diff [FILE]] [--chunk-size CHUNK_SIZE]
154
157
  [--analyses-chunk-size ANALYSES_CHUNK_SIZE] [--max-msg-lines MAX_MSG_LINES]
155
- [--max-recursion-depth MAX_RECURSION_DEPTH] [-i | -s | -c | -t | -r | -g] [--humanize]
158
+ [--max-recursion-depth MAX_RECURSION_DEPTH] [--humanize] [--multiline] [-i | -s | -c | -t | -r | -g]
156
159
  [prompt]
157
160
 
158
161
  nGPT - Interact with AI language models via OpenAI-compatible APIs
159
- ```
160
162
 
161
- ### Positional Arguments
163
+ positional arguments::
164
+
165
+ [PROMPT] The prompt to send
162
166
 
163
- - `[PROMPT]`: The prompt to send
167
+ options::
164
168
 
165
- ### General Options
169
+ -h, --help show this help message and exit
170
+ -v, --version Show version information and exit
166
171
 
167
- - `-h, --help`: Show help message and exit
168
- - `-v, --version`: Show version information and exit
169
- - `--language <LANGUAGE>`: Programming language to generate code in (for code mode)
172
+ Configuration Options::
170
173
 
171
- ### Configuration Options
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]
172
186
 
173
- - `--config <[CONFIG]>`: Path to a custom config file or, if no value provided, enter interactive configuration mode to create a new config
174
- - `--config-index <CONFIG_INDEX>`: Index of the configuration to use or edit (default: 0)
175
- - `--provider <PROVIDER>`: Provider name to identify the configuration to use
176
- - `--remove`: Remove the configuration at the specified index (requires --config and --config-index or --provider)
177
- - `--show-config`: Show the current configuration(s) and exit
178
- - `--all`: Show details for all configurations (requires --show-config)
179
- - `--list-models`: List all available models for the current configuration and exit
180
- - `--list-renderers`: Show available markdown renderers for use with --prettify
181
- - `--cli-config <[COMMAND ...]>`: Manage CLI configuration (set, get, unset, list, help)
182
- - `--role-config <[ACTION ...]>`: Manage custom roles (help, create, show, edit, list, remove) [role_name]
187
+ Global Options::
183
188
 
184
- ### Global Options
189
+ --api-key API_KEY API key for the service
190
+ --base-url BASE_URL Base URL for the API
191
+ --model MODEL Model to use
192
+ --web-search Enable web search capability using DuckDuckGo to enhance prompts with relevant
193
+ information
194
+ --pipe Read from stdin and use content with prompt. Use {} in prompt as placeholder
195
+ for stdin content. Can be used with any mode option except --text and
196
+ --interactive
197
+ --temperature TEMPERATURE Set temperature (controls randomness, default: 0.7)
198
+ --top_p TOP_P Set top_p (controls diversity, default: 1.0)
199
+ --max_tokens MAX_TOKENS Set max response length in tokens
200
+ --log [FILE] Set filepath to log conversation to, or create a temporary log file if no path
201
+ provided
202
+ --preprompt PREPROMPT Set custom system prompt to control AI behavior
203
+ --role ROLE Use a predefined role to set system prompt (mutually exclusive with
204
+ --preprompt)
205
+ --renderer {auto,rich,glow} Select which markdown renderer to use with --prettify or --stream-prettify
206
+ (auto, rich, or glow)
185
207
 
186
- - `--api-key <API_KEY>`: API key for the service
187
- - `--base-url <BASE_URL>`: Base URL for the API
188
- - `--model <MODEL>`: Model to use
189
- - `--web-search`: Enable web search capability using DuckDuckGo to enhance prompts with relevant information
190
- - `--pipe`: Read from stdin and use content with prompt. Use {} in prompt as placeholder for stdin content. Can be used with any mode option except --text and --interactive
191
- - `--temperature <TEMPERATURE>`: Set temperature (controls randomness, default: 0.7)
192
- - `--top_p <TOP_P>`: Set top_p (controls diversity, default: 1.0)
193
- - `--max_tokens <MAX_TOKENS>`: Set max response length in tokens
194
- - `--log <[FILE]>`: Set filepath to log conversation to, or create a temporary log file if no path provided
195
- - `--preprompt <PREPROMPT>`: Set custom system prompt to control AI behavior
196
- - `--role <ROLE>`: Use a predefined role to set system prompt (mutually exclusive with --preprompt)
197
- - `--renderer <{auto,rich,glow}>`: Select which markdown renderer to use with --prettify or --stream-prettify (auto, rich, or glow)
208
+ Output Display Options (mutually exclusive)::
198
209
 
199
- ### Output Display Options (mutually exclusive)
210
+ --no-stream Return the whole response without streaming or formatting
211
+ --prettify Render complete response with markdown and code formatting (non-streaming)
212
+ --stream-prettify Stream response with real-time markdown rendering (default)
200
213
 
201
- - `--no-stream`: Return the whole response without streaming or formatting
202
- - `--prettify`: Render complete response with markdown and code formatting (non-streaming)
203
- - `--stream-prettify`: Stream response with real-time markdown rendering (default)
214
+ Code Mode Options::
204
215
 
205
- ### Git Commit Message Options
216
+ --language LANGUAGE Programming language to generate code in (for code mode)
206
217
 
207
- - `--rec-chunk`: Process large diffs in chunks with recursive analysis if needed
208
- - `--diff <[FILE]>`: Use diff from specified file instead of staged changes. If used without a path, uses the path from CLI config.
209
- - `--chunk-size <CHUNK_SIZE>`: Number of lines per chunk when chunking is enabled (default: 200)
210
- - `--analyses-chunk-size <ANALYSES_CHUNK_SIZE>`: Number of lines per chunk when recursively chunking analyses (default: 200)
211
- - `--max-msg-lines <MAX_MSG_LINES>`: Maximum number of lines in commit message before condensing (default: 20)
212
- - `--max-recursion-depth <MAX_RECURSION_DEPTH>`: Maximum recursion depth for commit message condensing (default: 3)
218
+ Git Commit Message Options::
213
219
 
214
- ### Modes (mutually exclusive)
220
+ --rec-chunk Process large diffs in chunks with recursive analysis if needed
221
+ --diff [FILE] Use diff from specified file instead of staged changes. If used without a path,
222
+ uses the path from CLI config.
223
+ --chunk-size CHUNK_SIZE Number of lines per chunk when chunking is enabled (default: 200)
224
+ --analyses-chunk-size ANALYSES_CHUNK_SIZE
225
+ Number of lines per chunk when recursively chunking analyses (default: 200)
226
+ --max-msg-lines MAX_MSG_LINES Maximum number of lines in commit message before condensing (default: 20)
227
+ --max-recursion-depth MAX_RECURSION_DEPTH
228
+ Maximum recursion depth for commit message condensing (default: 3)
215
229
 
216
- - `-i, --interactive`: Start an interactive chat session
217
- - `-s, --shell`: Generate and execute shell commands
218
- - `-c, --code`: Generate code
219
- - `-t, --text`: Enter multi-line text input (submit with Ctrl+D)
220
- - `-r, --rewrite`: Rewrite text from stdin to be more natural while preserving tone and meaning
221
- - `-g, --gitcommsg`: Generate AI-powered git commit messages from staged changes or diff file
230
+ Rewrite Mode Options::
222
231
 
223
- ### Rewrite Mode Options
232
+ --humanize Transform AI-generated text into human-like content that passes AI detection
233
+ tools
224
234
 
225
- - `--humanize`: Transform AI-generated text into human-like content that passes AI detection tools
235
+ Interactive Mode Options::
236
+
237
+ --multiline Enable multiline text input with the "ml" command in interactive mode
238
+
239
+ Modes (mutually exclusive)::
240
+
241
+ -i, --interactive Start an interactive chat session
242
+ -s, --shell Generate and execute shell commands
243
+ -c, --code Generate code
244
+ -t, --text Enter multi-line text input (submit with Ctrl+D)
245
+ -r, --rewrite Rewrite text from stdin to be more natural while preserving tone and meaning
246
+ -g, --gitcommsg Generate AI-powered git commit messages from staged changes or diff file
247
+
248
+ ```
226
249
 
227
250
  ### Command Examples
228
251
 
@@ -36,85 +36,107 @@ Where:
36
36
 
37
37
  You can set configuration options directly via command-line arguments:
38
38
 
39
- ```
40
- usage: ngpt [-h] [-v] [--language LANGUAGE] [--config [CONFIG]] [--config-index CONFIG_INDEX] [--provider PROVIDER]
41
- [--remove] [--show-config] [--all] [--list-models] [--list-renderers] [--cli-config [COMMAND ...]]
42
- [--role-config [ACTION ...]] [--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search]
43
- [--pipe] [--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
39
+ ```console
40
+ ngpt -h
41
+
42
+ usage: ngpt [-h] [-v] [--config [CONFIG]] [--config-index CONFIG_INDEX] [--provider PROVIDER] [--remove] [--show-config]
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]
45
+ [--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
44
46
  [--preprompt PREPROMPT | --role ROLE] [--no-stream | --prettify | --stream-prettify]
45
- [--renderer {auto,rich,glow}] [--rec-chunk] [--diff [FILE]] [--chunk-size CHUNK_SIZE]
47
+ [--renderer {auto,rich,glow}] [--language LANGUAGE] [--rec-chunk] [--diff [FILE]] [--chunk-size CHUNK_SIZE]
46
48
  [--analyses-chunk-size ANALYSES_CHUNK_SIZE] [--max-msg-lines MAX_MSG_LINES]
47
- [--max-recursion-depth MAX_RECURSION_DEPTH] [-i | -s | -c | -t | -r | -g] [--humanize]
49
+ [--max-recursion-depth MAX_RECURSION_DEPTH] [--humanize] [--multiline] [-i | -s | -c | -t | -r | -g]
48
50
  [prompt]
49
51
 
50
52
  nGPT - Interact with AI language models via OpenAI-compatible APIs
51
- ```
52
53
 
53
- ### Positional Arguments
54
+ positional arguments::
55
+
56
+ [PROMPT] The prompt to send
57
+
58
+ options::
54
59
 
55
- - `[PROMPT]`: The prompt to send
60
+ -h, --help show this help message and exit
61
+ -v, --version Show version information and exit
56
62
 
57
- ### General Options
63
+ Configuration Options::
58
64
 
59
- - `-h, --help`: Show help message and exit
60
- - `-v, --version`: Show version information and exit
61
- - `--language <LANGUAGE>`: Programming language to generate code in (for code mode)
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]
62
77
 
63
- ### Configuration Options
78
+ Global Options::
64
79
 
65
- - `--config <[CONFIG]>`: Path to a custom config file or, if no value provided, enter interactive configuration mode to create a new config
66
- - `--config-index <CONFIG_INDEX>`: Index of the configuration to use or edit (default: 0)
67
- - `--provider <PROVIDER>`: Provider name to identify the configuration to use
68
- - `--remove`: Remove the configuration at the specified index (requires --config and --config-index or --provider)
69
- - `--show-config`: Show the current configuration(s) and exit
70
- - `--all`: Show details for all configurations (requires --show-config)
71
- - `--list-models`: List all available models for the current configuration and exit
72
- - `--list-renderers`: Show available markdown renderers for use with --prettify
73
- - `--cli-config <[COMMAND ...]>`: Manage CLI configuration (set, get, unset, list, help)
74
- - `--role-config <[ACTION ...]>`: Manage custom roles (help, create, show, edit, list, remove) [role_name]
80
+ --api-key API_KEY API key for the service
81
+ --base-url BASE_URL Base URL for the API
82
+ --model MODEL Model to use
83
+ --web-search Enable web search capability using DuckDuckGo to enhance prompts with relevant
84
+ information
85
+ --pipe Read from stdin and use content with prompt. Use {} in prompt as placeholder
86
+ for stdin content. Can be used with any mode option except --text and
87
+ --interactive
88
+ --temperature TEMPERATURE Set temperature (controls randomness, default: 0.7)
89
+ --top_p TOP_P Set top_p (controls diversity, default: 1.0)
90
+ --max_tokens MAX_TOKENS Set max response length in tokens
91
+ --log [FILE] Set filepath to log conversation to, or create a temporary log file if no path
92
+ provided
93
+ --preprompt PREPROMPT Set custom system prompt to control AI behavior
94
+ --role ROLE Use a predefined role to set system prompt (mutually exclusive with
95
+ --preprompt)
96
+ --renderer {auto,rich,glow} Select which markdown renderer to use with --prettify or --stream-prettify
97
+ (auto, rich, or glow)
75
98
 
76
- ### Global Options
99
+ Output Display Options (mutually exclusive)::
77
100
 
78
- - `--api-key <API_KEY>`: API key for the service
79
- - `--base-url <BASE_URL>`: Base URL for the API
80
- - `--model <MODEL>`: Model to use
81
- - `--web-search`: Enable web search capability using DuckDuckGo to enhance prompts with relevant information
82
- - `--pipe`: Read from stdin and use content with prompt. Use {} in prompt as placeholder for stdin content. Can be used with any mode option except --text and --interactive
83
- - `--temperature <TEMPERATURE>`: Set temperature (controls randomness, default: 0.7)
84
- - `--top_p <TOP_P>`: Set top_p (controls diversity, default: 1.0)
85
- - `--max_tokens <MAX_TOKENS>`: Set max response length in tokens
86
- - `--log <[FILE]>`: Set filepath to log conversation to, or create a temporary log file if no path provided
87
- - `--preprompt <PREPROMPT>`: Set custom system prompt to control AI behavior
88
- - `--role <ROLE>`: Use a predefined role to set system prompt (mutually exclusive with --preprompt)
89
- - `--renderer <{auto,rich,glow}>`: Select which markdown renderer to use with --prettify or --stream-prettify (auto, rich, or glow)
101
+ --no-stream Return the whole response without streaming or formatting
102
+ --prettify Render complete response with markdown and code formatting (non-streaming)
103
+ --stream-prettify Stream response with real-time markdown rendering (default)
90
104
 
91
- ### Output Display Options (mutually exclusive)
105
+ Code Mode Options::
92
106
 
93
- - `--no-stream`: Return the whole response without streaming or formatting
94
- - `--prettify`: Render complete response with markdown and code formatting (non-streaming)
95
- - `--stream-prettify`: Stream response with real-time markdown rendering (default)
107
+ --language LANGUAGE Programming language to generate code in (for code mode)
96
108
 
97
- ### Git Commit Message Options
109
+ Git Commit Message Options::
98
110
 
99
- - `--rec-chunk`: Process large diffs in chunks with recursive analysis if needed
100
- - `--diff <[FILE]>`: Use diff from specified file instead of staged changes. If used without a path, uses the path from CLI config.
101
- - `--chunk-size <CHUNK_SIZE>`: Number of lines per chunk when chunking is enabled (default: 200)
102
- - `--analyses-chunk-size <ANALYSES_CHUNK_SIZE>`: Number of lines per chunk when recursively chunking analyses (default: 200)
103
- - `--max-msg-lines <MAX_MSG_LINES>`: Maximum number of lines in commit message before condensing (default: 20)
104
- - `--max-recursion-depth <MAX_RECURSION_DEPTH>`: Maximum recursion depth for commit message condensing (default: 3)
111
+ --rec-chunk Process large diffs in chunks with recursive analysis if needed
112
+ --diff [FILE] Use diff from specified file instead of staged changes. If used without a path,
113
+ uses the path from CLI config.
114
+ --chunk-size CHUNK_SIZE Number of lines per chunk when chunking is enabled (default: 200)
115
+ --analyses-chunk-size ANALYSES_CHUNK_SIZE
116
+ Number of lines per chunk when recursively chunking analyses (default: 200)
117
+ --max-msg-lines MAX_MSG_LINES Maximum number of lines in commit message before condensing (default: 20)
118
+ --max-recursion-depth MAX_RECURSION_DEPTH
119
+ Maximum recursion depth for commit message condensing (default: 3)
105
120
 
106
- ### Modes (mutually exclusive)
121
+ Rewrite Mode Options::
107
122
 
108
- - `-i, --interactive`: Start an interactive chat session
109
- - `-s, --shell`: Generate and execute shell commands
110
- - `-c, --code`: Generate code
111
- - `-t, --text`: Enter multi-line text input (submit with Ctrl+D)
112
- - `-r, --rewrite`: Rewrite text from stdin to be more natural while preserving tone and meaning
113
- - `-g, --gitcommsg`: Generate AI-powered git commit messages from staged changes or diff file
123
+ --humanize Transform AI-generated text into human-like content that passes AI detection
124
+ tools
114
125
 
115
- ### Rewrite Mode Options
126
+ Interactive Mode Options::
116
127
 
117
- - `--humanize`: Transform AI-generated text into human-like content that passes AI detection tools
128
+ --multiline Enable multiline text input with the "ml" command in interactive mode
129
+
130
+ Modes (mutually exclusive)::
131
+
132
+ -i, --interactive Start an interactive chat session
133
+ -s, --shell Generate and execute shell commands
134
+ -c, --code Generate code
135
+ -t, --text Enter multi-line text input (submit with Ctrl+D)
136
+ -r, --rewrite Rewrite text from stdin to be more natural while preserving tone and meaning
137
+ -g, --gitcommsg Generate AI-powered git commit messages from staged changes or diff file
138
+
139
+ ```
118
140
 
119
141
  ## Mode Details
120
142
 
@@ -30,9 +30,6 @@ def setup_argument_parser():
30
30
  # Version flag
31
31
  parser.add_argument('-v', '--version', action=ColoredVersionAction, nargs=0,
32
32
  help='Show version information and exit')
33
- # Language option for code mode
34
- parser.add_argument('--language', default="python",
35
- help='Programming language to generate code in (for code mode)')
36
33
 
37
34
  # Prompt argument
38
35
  parser.add_argument('prompt', nargs='?', default=None,
@@ -104,6 +101,11 @@ def setup_argument_parser():
104
101
  global_group.add_argument('--renderer', choices=['auto', 'rich', 'glow'], default='auto',
105
102
  help='Select which markdown renderer to use with --prettify or --stream-prettify (auto, rich, or glow)')
106
103
 
104
+ # Code Mode Options
105
+ code_group = parser.add_argument_group('Code Mode Options')
106
+ code_group.add_argument('--language', default="python",
107
+ help='Programming language to generate code in (for code mode)')
108
+
107
109
  # GitCommit message options
108
110
  gitcommsg_group = parser.add_argument_group('Git Commit Message Options')
109
111
  gitcommsg_group.add_argument('--rec-chunk', action='store_true',
@@ -124,6 +126,11 @@ def setup_argument_parser():
124
126
  rewrite_group.add_argument('--humanize', action='store_true',
125
127
  help='Transform AI-generated text into human-like content that passes AI detection tools')
126
128
 
129
+ # Interactive mode options
130
+ 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
+
127
134
  # Mode flags (mutually exclusive)
128
135
  mode_group = parser.add_argument_group('Modes (mutually exclusive)')
129
136
  mode_exclusive_group = mode_group.add_mutually_exclusive_group()
@@ -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
- meta = CLI_CONFIG_OPTIONS[option]
67
- default = f"(default: {meta['default']})" if meta['default'] is not None else ""
68
- exclusive = f" [exclusive with: {', '.join(meta['exclusive'])}]" if "exclusive" in meta else ""
69
- print(f" {COLORS['green']}{option}{COLORS['reset']} - {meta['type']} {default}{exclusive}")
70
-
71
- # Print mode-specific options
72
- for mode, options in [
73
- ("code", "Code generation mode"),
74
- ("interactive", "Interactive mode"),
75
- ("text", "Text mode"),
76
- ("shell", "Shell mode"),
77
- ("gitcommsg", "Git commit message mode") # Add gitcommsg mode
78
- ]:
79
- if context_groups[mode]:
80
- print(f"\n {COLORS['yellow']}Options for {options}:{COLORS['reset']}")
81
- for option in sorted(context_groups[mode]):
82
- # Skip if already listed in general options
83
- if option in context_groups["all"]:
84
- continue
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
@@ -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():
@@ -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
  [project]
2
2
  name = "ngpt"
3
- version = "3.11.3"
3
+ version = "3.12.1"
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"},
@@ -148,7 +148,7 @@ wheels = [
148
148
 
149
149
  [[package]]
150
150
  name = "ngpt"
151
- version = "3.11.3"
151
+ version = "3.12.1"
152
152
  source = { editable = "." }
153
153
  dependencies = [
154
154
  { name = "beautifulsoup4" },
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