ngpt 2.16.7__tar.gz → 3.0.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 (58) hide show
  1. {ngpt-2.16.7 → ngpt-3.0.1}/COMMIT_GUIDELINES.md +2 -1
  2. {ngpt-2.16.7 → ngpt-3.0.1}/PKG-INFO +202 -156
  3. {ngpt-2.16.7 → ngpt-3.0.1}/README.md +200 -154
  4. {ngpt-2.16.7 → ngpt-3.0.1}/docs/README.md +1 -1
  5. {ngpt-2.16.7 → ngpt-3.0.1}/docs/api/cli.md +11 -9
  6. {ngpt-2.16.7 → ngpt-3.0.1}/docs/api/cli_config.md +2 -3
  7. {ngpt-2.16.7 → ngpt-3.0.1}/docs/configuration.md +12 -12
  8. {ngpt-2.16.7 → ngpt-3.0.1}/docs/examples/basic.md +11 -9
  9. {ngpt-2.16.7 → ngpt-3.0.1}/docs/overview.md +1 -1
  10. {ngpt-2.16.7 → ngpt-3.0.1}/docs/usage/README.md +3 -3
  11. {ngpt-2.16.7 → ngpt-3.0.1}/docs/usage/cli_config.md +9 -9
  12. {ngpt-2.16.7 → ngpt-3.0.1}/docs/usage/cli_framework.md +12 -12
  13. {ngpt-2.16.7 → ngpt-3.0.1}/docs/usage/cli_usage.md +62 -70
  14. {ngpt-2.16.7 → ngpt-3.0.1}/docs/usage/gitcommsg.md +60 -40
  15. {ngpt-2.16.7 → ngpt-3.0.1}/docs/usage/library_usage.md +2 -2
  16. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/cli/args.py +6 -8
  17. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/cli/main.py +3 -3
  18. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/cli/modes/chat.py +2 -2
  19. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/cli/modes/gitcommsg.py +55 -54
  20. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/utils/cli_config.py +1 -2
  21. {ngpt-2.16.7 → ngpt-3.0.1}/pyproject.toml +2 -2
  22. {ngpt-2.16.7 → ngpt-3.0.1}/uv.lock +1 -1
  23. {ngpt-2.16.7 → ngpt-3.0.1}/wiki.md +1 -1
  24. {ngpt-2.16.7 → ngpt-3.0.1}/.github/workflows/python-publish.yml +0 -0
  25. {ngpt-2.16.7 → ngpt-3.0.1}/.gitignore +0 -0
  26. {ngpt-2.16.7 → ngpt-3.0.1}/.python-version +0 -0
  27. {ngpt-2.16.7 → ngpt-3.0.1}/CONTRIBUTING.md +0 -0
  28. {ngpt-2.16.7 → ngpt-3.0.1}/LICENSE +0 -0
  29. {ngpt-2.16.7 → ngpt-3.0.1}/docs/CONTRIBUTING.md +0 -0
  30. {ngpt-2.16.7 → ngpt-3.0.1}/docs/LICENSE.md +0 -0
  31. {ngpt-2.16.7 → ngpt-3.0.1}/docs/_config.yml +0 -0
  32. {ngpt-2.16.7 → ngpt-3.0.1}/docs/api/README.md +0 -0
  33. {ngpt-2.16.7 → ngpt-3.0.1}/docs/api/client.md +0 -0
  34. {ngpt-2.16.7 → ngpt-3.0.1}/docs/api/config.md +0 -0
  35. {ngpt-2.16.7 → ngpt-3.0.1}/docs/api/logging.md +0 -0
  36. {ngpt-2.16.7 → ngpt-3.0.1}/docs/assets/css/style.scss +0 -0
  37. {ngpt-2.16.7 → ngpt-3.0.1}/docs/examples/README.md +0 -0
  38. {ngpt-2.16.7 → ngpt-3.0.1}/docs/examples/advanced.md +0 -0
  39. {ngpt-2.16.7 → ngpt-3.0.1}/docs/examples/cli_components.md +0 -0
  40. {ngpt-2.16.7 → ngpt-3.0.1}/docs/examples/integrations.md +0 -0
  41. {ngpt-2.16.7 → ngpt-3.0.1}/docs/installation.md +0 -0
  42. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/__init__.py +0 -0
  43. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/__main__.py +0 -0
  44. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/cli/__init__.py +0 -0
  45. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/cli/config_manager.py +0 -0
  46. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/cli/formatters.py +0 -0
  47. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/cli/interactive.py +0 -0
  48. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/cli/modes/__init__.py +0 -0
  49. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/cli/modes/code.py +0 -0
  50. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/cli/modes/rewrite.py +0 -0
  51. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/cli/modes/shell.py +0 -0
  52. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/cli/modes/text.py +0 -0
  53. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/cli/renderers.py +0 -0
  54. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/cli/ui.py +0 -0
  55. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/client.py +0 -0
  56. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/utils/__init__.py +0 -0
  57. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/utils/config.py +0 -0
  58. {ngpt-2.16.7 → ngpt-3.0.1}/ngpt/utils/log.py +0 -0
@@ -113,4 +113,5 @@ Also fixed that other bug people were complaining about.
113
113
 
114
114
  - [Conventional Commits](https://www.conventionalcommits.org/)
115
115
  - [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/)
116
- - [A Note About Git Commit Messages](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
116
+ - [A Note About Git Commit Messages](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
117
+ - [GitHub Commit Labels](https://greasyfork.org/en/scripts/526153-github-commit-labels) - A userscript that adds colorful labels to conventional commits on GitHub
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngpt
3
- Version: 2.16.7
4
- Summary: Swiss army knife for LLMs: powerful CLI, interactive chatbot, and flexible Python library. Works with OpenAI, Ollama, Groq, Claude, and any OpenAI-compatible API.
3
+ Version: 3.0.1
4
+ Summary: Swiss army knife for LLMs: powerful CLI, interactive chatbot, and flexible Python library. Works with OpenAI, Ollama, Groq, Claude, Gemini, and any OpenAI-compatible API.
5
5
  Project-URL: Homepage, https://github.com/nazdridoy/ngpt
6
6
  Project-URL: Repository, https://github.com/nazdridoy/ngpt
7
7
  Project-URL: Bug Tracker, https://github.com/nazdridoy/ngpt/issues
@@ -36,20 +36,52 @@ Description-Content-Type: text/markdown
36
36
 
37
37
  # nGPT
38
38
 
39
- 🤖 nGPT: A Swiss army knife for LLMs: powerful CLI, interactive chatbot, and flexible library all in one package. Seamlessly work with OpenAI, Ollama, Groq, Claude, or any OpenAI-compatible API to generate code, craft git commits, rewrite text, and execute shell commands. Fast, lightweight, and designed for both casual users and developers.
39
+ <p align="center">
40
+ <a href="https://pypi.org/project/ngpt/"><img src="https://img.shields.io/pypi/v/ngpt.svg" alt="PyPI version"></a>
41
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
42
+ <a href="https://nazdridoy.github.io/ngpt/"><img src="https://img.shields.io/badge/docs-available-brightgreen.svg" alt="Documentation"></a>
43
+ </p>
44
+
45
+ <p align="center">
46
+ <a href="https://nazdridoy.github.io/ngpt/installation.html"><img src="https://img.shields.io/badge/Linux-support-blue?logo=linux" alt="Linux"></a>
47
+ <a href="https://nazdridoy.github.io/ngpt/installation.html"><img src="https://img.shields.io/badge/Windows-support-blue?logo=windows" alt="Windows"></a>
48
+ <a href="https://nazdridoy.github.io/ngpt/installation.html"><img src="https://img.shields.io/badge/macOS-support-blue?logo=apple" alt="macOS"></a>
49
+ <a href="https://nazdridoy.github.io/ngpt/installation.html"><img src="https://img.shields.io/badge/Android-Termux-blue?logo=android" alt="Android"></a>
50
+ </p>
51
+
52
+ 🤖 nGPT: A Swiss army knife for LLMs: powerful CLI, interactive chatbot, and flexible library all in one package. Seamlessly work with OpenAI, Ollama, Groq, Claude, Gemini, or any OpenAI-compatible API to generate code, craft git commits, rewrite text, and execute shell commands. Fast, lightweight, and designed for both casual users and developers.
40
53
 
41
- [![PyPI version](https://img.shields.io/pypi/v/ngpt.svg)](https://pypi.org/project/ngpt/)
42
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
43
- [![Documentation](https://img.shields.io/badge/docs-available-brightgreen.svg)](https://nazdridoy.github.io/ngpt/)
44
- [![Linux](https://img.shields.io/badge/Linux-support-blue?logo=linux)](https://nazdridoy.github.io/ngpt/installation.html)
45
- [![Windows](https://img.shields.io/badge/Windows-support-blue?logo=windows)](https://nazdridoy.github.io/ngpt/installation.html)
46
- [![macOS](https://img.shields.io/badge/macOS-support-blue?logo=apple)](https://nazdridoy.github.io/ngpt/installation.html)
47
- [![Android](https://img.shields.io/badge/Android-Termux-blue?logo=android)](https://nazdridoy.github.io/ngpt/installation.html)
48
- [![Python Versions](https://img.shields.io/pypi/pyversions/ngpt.svg)](https://pypi.org/project/ngpt/)
49
54
 
50
55
  ![2025-04-23_16-18-01](https://github.com/user-attachments/assets/b8e58926-5165-4352-b48b-9f4a982da86e)
51
56
 
52
57
 
58
+ ## Features
59
+
60
+ - ✅ **Versatile**: Use as a CLI tool, Python library, or CLI framework for building custom tools
61
+ - 🪶 **Lightweight**: Minimal dependencies with everything you need included
62
+ - 🔄 **API Flexibility**: Works with OpenAI, Ollama, Groq, Claude, Gemini, and any compatible endpoint
63
+ - 💬 **Interactive Chat**: Continuous conversation with memory in modern UI
64
+ - 📊 **Streaming Responses**: Real-time output for better user experience
65
+ - 🔍 **Web Search**: Integrated with compatible API endpoints
66
+ - 📥 **Stdin Processing**: Process piped content by using `{}` placeholder in prompts
67
+ - 🎨 **Markdown Rendering**: Beautiful formatting of markdown and code with syntax highlighting
68
+ - ⚡ **Real-time Markdown**: Stream responses with live updating syntax highlighting and formatting
69
+ - ⚙️ **Multiple Configurations**: Cross-platform config system supporting different profiles
70
+ - 💻 **Shell Command Generation**: OS-aware command execution
71
+ - 🧠 **Text Rewriting**: Improve text quality while maintaining original tone and meaning
72
+ - 🧩 **Clean Code Generation**: Output code without markdown or explanations
73
+ - 📝 **Rich Multiline Editor**: Interactive multiline text input with syntax highlighting and intuitive controls
74
+ - 📑 **Git Commit Messages**: AI-powered generation of conventional, detailed commit messages from git diffs
75
+ - 🎭 **System Prompts**: Customize model behavior with custom system prompts
76
+ - 📃 **Conversation Logging**: Save your conversations to text files for later reference
77
+ - 🧰 **CLI Components**: Reusable components for building custom AI-powered command-line tools
78
+ - 🔌 **Modular Architecture**: Well-structured codebase with clean separation of concerns
79
+ - 🔄 **Provider Switching**: Easily switch between different LLM providers with a single parameter
80
+ - 🚀 **Performance Optimized**: Fast response times and minimal resource usage
81
+
82
+ See the [Feature Overview](https://nazdridoy.github.io/ngpt/overview.html) for more details.
83
+
84
+
53
85
  ## Table of Contents
54
86
  - [Quick Start](#quick-start)
55
87
  - [Features](#features)
@@ -109,34 +141,34 @@ ngpt --code --stream-prettify "function to calculate the Fibonacci sequence"
109
141
  ngpt --shell "list all files in the current directory"
110
142
 
111
143
  # Read from stdin and use the content in your prompt
112
- echo "What is this text about?" | ngpt --stdin "Analyze the following text: {}"
144
+ echo "What is this text about?" | ngpt -p "Analyze the following text: {}"
113
145
 
114
146
  # Rewrite text to improve quality while preserving tone and meaning
115
- echo "your text" | ngpt --rewrite
147
+ echo "your text" | ngpt -r
116
148
 
117
149
  # Rewrite text from a command-line argument
118
- ngpt --rewrite "your text to rewrite"
150
+ ngpt -r "your text to rewrite"
119
151
 
120
152
  # Rewrite text from a file
121
- cat file.txt | ngpt --rewrite
153
+ cat file.txt | ngpt -r
122
154
 
123
155
  # Generate AI-powered git commit messages for staged changes
124
- ngpt --gitcommsg
156
+ ngpt -g
125
157
 
126
- # Generate commit message with context
127
- ngpt --gitcommsg -m "type:feat"
158
+ # Generate commit message from staged changes with a context directive
159
+ ngpt -g --preprompt "type:feat"
128
160
 
129
161
  # Process large diffs in chunks with recursive analysis
130
- ngpt --gitcommsg -r
162
+ ngpt -g --rec-chunk
131
163
 
132
164
  # Process a diff file instead of staged changes
133
- ngpt --gitcommsg --diff /path/to/changes.diff
165
+ ngpt -g --diff /path/to/changes.diff
134
166
 
135
167
  # Generate a commit message with logging for debugging
136
- ngpt --gitcommsg --log commit_log.txt
168
+ ngpt -g --log commit_log.txt
137
169
 
138
170
  # Use interactive multiline editor to enter text to rewrite
139
- ngpt --rewrite
171
+ ngpt -r
140
172
 
141
173
  # Display markdown responses with beautiful formatting
142
174
  ngpt --prettify "Explain markdown syntax with examples"
@@ -160,7 +192,7 @@ ngpt --interactive --log conversation.log
160
192
  ngpt --log "Tell me about quantum computing"
161
193
 
162
194
  # Process text from stdin using the {} placeholder
163
- cat README.md | ngpt --stdin "Summarize this document: {}"
195
+ cat README.md | ngpt -p "Summarize this document: {}"
164
196
 
165
197
  # Use different model providers by specifying the provider name
166
198
  ngpt --provider Groq "Explain quantum computing"
@@ -172,32 +204,6 @@ ngpt --provider Ollama "Explain quantum physics" > ollama_response.txt
172
204
 
173
205
  For more examples and detailed usage, visit the [CLI Usage Guide](https://nazdridoy.github.io/ngpt/usage/cli_usage.html).
174
206
 
175
- ## Features
176
-
177
- - ✅ **Versatile**: Use as a CLI tool, Python library, or CLI framework for building custom tools
178
- - 🪶 **Lightweight**: Minimal dependencies with everything you need included
179
- - 🔄 **API Flexibility**: Works with OpenAI, Ollama, Groq, Claude, and any compatible endpoint
180
- - 💬 **Interactive Chat**: Continuous conversation with memory in modern UI
181
- - 📊 **Streaming Responses**: Real-time output for better user experience
182
- - 🔍 **Web Search**: Integrated with compatible API endpoints
183
- - 📥 **Stdin Processing**: Process piped content by using `{}` placeholder in prompts
184
- - 🎨 **Markdown Rendering**: Beautiful formatting of markdown and code with syntax highlighting
185
- - ⚡ **Real-time Markdown**: Stream responses with live updating syntax highlighting and formatting
186
- - ⚙️ **Multiple Configurations**: Cross-platform config system supporting different profiles
187
- - 💻 **Shell Command Generation**: OS-aware command execution
188
- - 🧠 **Text Rewriting**: Improve text quality while maintaining original tone and meaning
189
- - 🧩 **Clean Code Generation**: Output code without markdown or explanations
190
- - 📝 **Rich Multiline Editor**: Interactive multiline text input with syntax highlighting and intuitive controls
191
- - 📑 **Git Commit Messages**: AI-powered generation of conventional, detailed commit messages from git diffs
192
- - 🎭 **System Prompts**: Customize model behavior with custom system prompts
193
- - 📃 **Conversation Logging**: Save your conversations to text files for later reference
194
- - 🧰 **CLI Components**: Reusable components for building custom AI-powered command-line tools
195
- - 🔌 **Modular Architecture**: Well-structured codebase with clean separation of concerns
196
- - 🔄 **Provider Switching**: Easily switch between different LLM providers with a single parameter
197
- - 🚀 **Performance Optimized**: Fast response times and minimal resource usage
198
-
199
- See the [Feature Overview](https://nazdridoy.github.io/ngpt/overview.html) for more details.
200
-
201
207
  ## Documentation
202
208
 
203
209
  Comprehensive documentation, including API reference, usage guides, and examples, is available at:
@@ -432,120 +438,160 @@ For detailed information about building CLI tools with nGPT, see the [CLI Framew
432
438
 
433
439
  ### Command Line Options
434
440
 
435
- You can configure nGPT using the following options:
436
-
437
- #### Mode Options (Mutually Exclusive)
438
-
439
- | Option | Description |
440
- |--------|-------------|
441
- | `-i, --interactive` | Start an interactive chat session with conversation memory and special commands |
442
- | `-s, --shell` | Generate and execute shell commands appropriate for your operating system |
443
- | `-c, --code` | Generate clean code without markdown formatting or explanations |
444
- | `-t, --text` | Open interactive multiline editor for complex prompts with syntax highlighting |
445
- | `--stdin` | Read from stdin and use content with prompt. Use {} in prompt as placeholder for stdin content |
446
- | `--rewrite` | Rewrite text to improve quality while preserving original tone and meaning |
447
- | `--gitcommsg` | Generate AI-powered git commit messages from staged changes or diff files |
448
-
449
- #### Global Options
450
-
451
- | Option | Description |
452
- |--------|-------------|
453
- | `--api-key KEY` | API key for the service |
454
- | `--base-url URL` | Base URL for the API |
455
- | `--model MODEL` | Model to use |
456
- | `--web-search` | Enable web search capability (if your API endpoint supports it) |
457
- | `--temperature VALUE` | Set temperature (controls randomness, default: 0.7) |
458
- | `--top_p VALUE` | Set top_p (controls diversity, default: 1.0) |
459
- | `--max_tokens NUMBER` | Set maximum response length in tokens |
460
- | `--preprompt TEXT` | Set custom system prompt to control AI behavior |
461
- | `--language LANG` | Programming language to generate code in (for code mode, default: python) |
462
- | `--no-stream` | Return the whole response without streaming |
463
- | `--prettify` | Render markdown responses and code with syntax highlighting and formatting |
464
- | `--stream-prettify` | Enable streaming with markdown rendering (automatically uses Rich renderer) |
465
- | `--renderer {auto,rich,glow}` | Select which markdown renderer to use with --prettify (default: auto) |
466
- | `--log [FILE]` | Set filepath to log conversation to, or create a temporary log file if no path provided |
467
-
468
- #### Configuration Options
469
-
470
- | Option | Description |
471
- |--------|-------------|
472
- | `--config [PATH]` | Path to a custom config file or, if no value provided, enter interactive configuration mode |
473
- | `--config-index INDEX` | Index of the configuration to use or edit (default: 0) |
474
- | `--provider NAME` | Provider name to identify the configuration to use |
475
- | `--remove` | Remove the configuration at the specified index (requires --config and --config-index or --provider) |
476
- | `--show-config` | Show the current configuration(s) and exit |
477
- | `--all` | Show details for all configurations (requires --show-config) |
478
- | `--list-models` | List all available models for the current configuration and exit |
479
- | `--list-renderers` | Show available markdown renderers for use with --prettify |
480
- | `--cli-config [COMMAND]` | Manage CLI configuration (set, get, unset, list, help) |
481
- | `-v, --version` | Show version information and exit |
441
+ ```console
442
+ ❯ ngpt -h
443
+ usage: ngpt [-h] [-v] [--language LANGUAGE] [--config [CONFIG]] [--config-index CONFIG_INDEX] [--provider PROVIDER]
444
+ [--remove] [--show-config] [--all] [--list-models] [--list-renderers] [--cli-config [COMMAND ...]]
445
+ [--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search] [--temperature TEMPERATURE]
446
+ [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]] [--preprompt PREPROMPT] [--no-stream] [--prettify]
447
+ [--stream-prettify] [--renderer {auto,rich,glow}] [--rec-chunk] [--diff [FILE]] [--chunk-size CHUNK_SIZE]
448
+ [--analyses-chunk-size ANALYSES_CHUNK_SIZE] [--max-msg-lines MAX_MSG_LINES]
449
+ [--max-recursion-depth MAX_RECURSION_DEPTH] [-i | -s | -c | -t | -p | -r | -g]
450
+ [prompt]
451
+
452
+ nGPT - Interact with AI language models via OpenAI-compatible APIs
453
+
454
+ positional arguments::
455
+
456
+ [PROMPT] The prompt to send
457
+
458
+ options::
459
+
460
+ -h, --help show this help message and exit
461
+ -v, --version Show version information and exit
462
+ --language LANGUAGE Programming language to generate code in (for code mode)
463
+
464
+ Configuration Options::
465
+
466
+ --config [CONFIG] Path to a custom config file or, if no value provided, enter interactive
467
+ configuration mode to create a new config
468
+ --config-index CONFIG_INDEX Index of the configuration to use or edit (default: 0)
469
+ --provider PROVIDER Provider name to identify the configuration to use
470
+ --remove Remove the configuration at the specified index (requires --config and
471
+ --config-index or --provider)
472
+ --show-config Show the current configuration(s) and exit
473
+ --all Show details for all configurations (requires --show-config)
474
+ --list-models List all available models for the current configuration and exit
475
+ --list-renderers Show available markdown renderers for use with --prettify
476
+ --cli-config [COMMAND ...] Manage CLI configuration (set, get, unset, list, help)
477
+
478
+ Global Options::
479
+
480
+ --api-key API_KEY API key for the service
481
+ --base-url BASE_URL Base URL for the API
482
+ --model MODEL Model to use
483
+ --web-search Enable web search capability (Note: Your API endpoint must support this
484
+ feature)
485
+ --temperature TEMPERATURE Set temperature (controls randomness, default: 0.7)
486
+ --top_p TOP_P Set top_p (controls diversity, default: 1.0)
487
+ --max_tokens MAX_TOKENS Set max response length in tokens
488
+ --log [FILE] Set filepath to log conversation to, or create a temporary log file if no path
489
+ provided
490
+ --preprompt PREPROMPT Set custom system prompt to control AI behavior
491
+ --no-stream Return the whole response without streaming
492
+ --prettify Render markdown responses and code with syntax highlighting and formatting
493
+ --stream-prettify Enable streaming with markdown rendering (automatically uses Rich renderer)
494
+ --renderer {auto,rich,glow} Select which markdown renderer to use with --prettify (auto, rich, or glow)
495
+
496
+ Git Commit Message Options::
497
+
498
+ --rec-chunk Process large diffs in chunks with recursive analysis if needed
499
+ --diff [FILE] Use diff from specified file instead of staged changes. If used without a path,
500
+ uses the path from CLI config.
501
+ --chunk-size CHUNK_SIZE Number of lines per chunk when chunking is enabled (default: 200)
502
+ --analyses-chunk-size ANALYSES_CHUNK_SIZE
503
+ Number of lines per chunk when recursively chunking analyses (default: 200)
504
+ --max-msg-lines MAX_MSG_LINES Maximum number of lines in commit message before condensing (default: 20)
505
+ --max-recursion-depth MAX_RECURSION_DEPTH
506
+ Maximum recursion depth for commit message condensing (default: 3)
507
+
508
+ Modes (mutually exclusive)::
509
+
510
+ -i, --interactive Start an interactive chat session
511
+ -s, --shell Generate and execute shell commands
512
+ -c, --code Generate code
513
+ -t, --text Enter multi-line text input (submit with Ctrl+D)
514
+ -p, --pipe Read from stdin and use content with prompt. Use {} in prompt as placeholder
515
+ for stdin content
516
+ -r, --rewrite Rewrite text from stdin to be more natural while preserving tone and meaning
517
+ -g, --gitcommsg Generate AI-powered git commit messages from staged changes or diff file
518
+ ```
519
+
520
+ > **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.
482
521
 
483
522
  For a complete reference of all available options, see the [CLI Usage Guide](https://nazdridoy.github.io/ngpt/usage/cli_usage.html).
484
523
 
485
524
  ### CLI Configuration
486
525
 
487
- NGPT offers a CLI configuration system that allows you to set default values for command-line options:
488
-
489
- ```bash
490
- # Set default options
491
- ngpt --cli-config set language typescript
492
- ngpt --cli-config set temperature 0.9
493
- ngpt --cli-config set prettify true
494
-
495
- # View current settings
496
- ngpt --cli-config get
497
-
498
- # Get a specific setting
499
- ngpt --cli-config get language
500
-
501
- # Remove a setting
502
- ngpt --cli-config unset prettify
526
+ NGPT offers a CLI configuration system that allows you to set default values for command-line options. This is especially useful when you:
527
+
528
+ - Repeatedly use the same provider or model
529
+ - Have preferred settings for specific tasks
530
+ - Want to create different workflows based on context
531
+
532
+ For example, setting your preferred language for code generation or temperature value means you won't have to specify these parameters each time:
533
+
534
+ ```console
535
+
536
+ ❯ ngpt --cli-config help
537
+
538
+ CLI Configuration Help:
539
+ Command syntax:
540
+ ngpt --cli-config help - Show this help message
541
+ ngpt --cli-config set OPTION VALUE - Set a default value for OPTION
542
+ ngpt --cli-config get OPTION - Get the current value of OPTION
543
+ ngpt --cli-config get - Show all CLI configuration settings
544
+ ngpt --cli-config unset OPTION - Remove OPTION from configuration
545
+ ngpt --cli-config list - List all available options
546
+
547
+ Available options:
548
+ General options (all modes):
549
+ config-index - int (default: 0) [exclusive with: provider]
550
+ log - str
551
+ max_tokens - int
552
+ no-stream - bool (default: False) [exclusive with: prettify, stream-prettify]
553
+ preprompt - str
554
+ prettify - bool (default: False) [exclusive with: no-stream, stream-prettify]
555
+ provider - str [exclusive with: config-index]
556
+ renderer - str (default: auto)
557
+ stream-prettify - bool (default: False) [exclusive with: no-stream, prettify]
558
+ temperature - float (default: 0.7)
559
+ top_p - float (default: 1.0)
560
+ web-search - bool (default: False)
561
+
562
+ Options for Code generation mode:
563
+ language - str (default: python)
564
+
565
+ Options for Git commit message mode:
566
+ analyses-chunk-size - int (default: 200)
567
+ chunk-size - int (default: 200)
568
+ diff - str
569
+ max-msg-lines - int (default: 20)
570
+ max-recursion-depth - int (default: 3)
571
+ rec-chunk - bool (default: False)
572
+
573
+ Example usage:
574
+ ngpt --cli-config set language java - Set default language to java for code generation
575
+ ngpt --cli-config set provider Gemini - Set Gemini as your default provider
576
+ ngpt --cli-config set temperature 0.9 - Set default temperature to 0.9
577
+ ngpt --cli-config set no-stream true - Disable streaming by default
578
+ ngpt --cli-config set recursive-chunk true - Enable recursive chunking for git commit messages
579
+ ngpt --cli-config set diff /path/to/file.diff - Set default diff file for git commit messages
580
+ ngpt --cli-config get temperature - Check the current temperature setting
581
+ ngpt --cli-config get - Show all current CLI settings
582
+ ngpt --cli-config unset language - Remove language setting
583
+
584
+ Notes:
585
+ - CLI configuration is stored in:
586
+ • Linux: ~/.config/ngpt/ngpt-cli.conf
587
+ • macOS: ~/Library/Application Support/ngpt/ngpt-cli.conf
588
+ • Windows: %APPDATA%\ngpt\ngpt-cli.conf
589
+ - Settings are applied based on context (e.g., language only applies to code generation mode)
590
+ - Command-line arguments always override CLI configuration
591
+ - Some options are mutually exclusive and will not be applied together
503
592
 
504
- # List all available options
505
- ngpt --cli-config list
506
-
507
- # Show help information
508
- ngpt --cli-config help
509
- ```
510
-
511
- Key features of CLI configuration:
512
- - **Context-Aware**: Settings are applied based on the current command mode (e.g., `language` only applies in code generation mode `-c`).
513
- - **Priority**: When determining option values, NGPT uses the following priority order (highest to lowest):
514
- 1. Command-line arguments
515
- 2. Environment variables
516
- 3. CLI configuration (ngpt-cli.conf)
517
- 4. Main configuration file (ngpt.conf)
518
- 5. Default values
519
- - **Mutual Exclusivity**: For options like `no-stream`, `prettify`, and `stream-prettify`, setting one to `True` automatically sets the others to `False` in the configuration file, ensuring consistency.
520
- - **Smart Selection**: The `provider` setting is used to select which configuration profile to use, offering a persistent way to select your preferred API.
521
-
522
- Available options include:
523
- - General options (all modes): `provider`, `temperature`, `top_p`, `max_tokens`, `preprompt`, `renderer`, `config-index`, `web-search`
524
- - Mode-specific options: `language` (code mode only), `log` (interactive and text modes)
525
- - Mutually exclusive options: `no-stream`, `prettify`, `stream-prettify`
526
-
527
- #### Practical Examples
528
-
529
- ```bash
530
- # Set Gemini as your default provider
531
- ngpt --cli-config set provider Gemini
532
- # Now you can run commands without specifying --provider
533
- ngpt "Explain quantum computing"
534
-
535
- # Configure code generation for TypeScript
536
- ngpt --cli-config set language typescript
537
- # Now in code mode, TypeScript will be used by default
538
- ngpt -c "Write a function to sort an array"
539
-
540
- # Set a higher temperature for more creative responses
541
- ngpt --cli-config set temperature 0.9
542
593
  ```
543
594
 
544
- The CLI configuration is stored in:
545
- - Linux: `~/.config/ngpt/ngpt-cli.conf`
546
- - macOS: `~/Library/Application Support/ngpt/ngpt-cli.conf`
547
- - Windows: `%APPDATA%\ngpt\ngpt-cli.conf`
548
-
549
595
  For more details, see the [CLI Configuration Guide](https://nazdridoy.github.io/ngpt/usage/cli_config.html).
550
596
 
551
597
  ### Interactive Configuration
@@ -642,4 +688,4 @@ Please check the [CONTRIBUTING.md](CONTRIBUTING.md) file for detailed guidelines
642
688
 
643
689
  ## License
644
690
 
645
- This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
691
+ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.