ngpt 3.0.0__tar.gz → 3.0.2__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 (60) hide show
  1. ngpt-3.0.2/.github/workflows/aur-publish.yml +40 -0
  2. {ngpt-3.0.0 → ngpt-3.0.2}/COMMIT_GUIDELINES.md +2 -1
  3. {ngpt-3.0.0 → ngpt-3.0.2}/PKG-INFO +188 -142
  4. ngpt-3.0.2/PKGBUILD +24 -0
  5. {ngpt-3.0.0 → ngpt-3.0.2}/README.md +187 -141
  6. {ngpt-3.0.0 → ngpt-3.0.2}/docs/examples/basic.md +2 -0
  7. {ngpt-3.0.0 → ngpt-3.0.2}/docs/usage/cli_usage.md +2 -0
  8. {ngpt-3.0.0 → ngpt-3.0.2}/docs/usage/gitcommsg.md +20 -0
  9. {ngpt-3.0.0 → ngpt-3.0.2}/pyproject.toml +1 -1
  10. {ngpt-3.0.0 → ngpt-3.0.2}/uv.lock +1 -1
  11. {ngpt-3.0.0 → ngpt-3.0.2}/.github/workflows/python-publish.yml +0 -0
  12. {ngpt-3.0.0 → ngpt-3.0.2}/.gitignore +0 -0
  13. {ngpt-3.0.0 → ngpt-3.0.2}/.python-version +0 -0
  14. {ngpt-3.0.0 → ngpt-3.0.2}/CONTRIBUTING.md +0 -0
  15. {ngpt-3.0.0 → ngpt-3.0.2}/LICENSE +0 -0
  16. {ngpt-3.0.0 → ngpt-3.0.2}/docs/CONTRIBUTING.md +0 -0
  17. {ngpt-3.0.0 → ngpt-3.0.2}/docs/LICENSE.md +0 -0
  18. {ngpt-3.0.0 → ngpt-3.0.2}/docs/README.md +0 -0
  19. {ngpt-3.0.0 → ngpt-3.0.2}/docs/_config.yml +0 -0
  20. {ngpt-3.0.0 → ngpt-3.0.2}/docs/api/README.md +0 -0
  21. {ngpt-3.0.0 → ngpt-3.0.2}/docs/api/cli.md +0 -0
  22. {ngpt-3.0.0 → ngpt-3.0.2}/docs/api/cli_config.md +0 -0
  23. {ngpt-3.0.0 → ngpt-3.0.2}/docs/api/client.md +0 -0
  24. {ngpt-3.0.0 → ngpt-3.0.2}/docs/api/config.md +0 -0
  25. {ngpt-3.0.0 → ngpt-3.0.2}/docs/api/logging.md +0 -0
  26. {ngpt-3.0.0 → ngpt-3.0.2}/docs/assets/css/style.scss +0 -0
  27. {ngpt-3.0.0 → ngpt-3.0.2}/docs/configuration.md +0 -0
  28. {ngpt-3.0.0 → ngpt-3.0.2}/docs/examples/README.md +0 -0
  29. {ngpt-3.0.0 → ngpt-3.0.2}/docs/examples/advanced.md +0 -0
  30. {ngpt-3.0.0 → ngpt-3.0.2}/docs/examples/cli_components.md +0 -0
  31. {ngpt-3.0.0 → ngpt-3.0.2}/docs/examples/integrations.md +0 -0
  32. {ngpt-3.0.0 → ngpt-3.0.2}/docs/installation.md +0 -0
  33. {ngpt-3.0.0 → ngpt-3.0.2}/docs/overview.md +0 -0
  34. {ngpt-3.0.0 → ngpt-3.0.2}/docs/usage/README.md +0 -0
  35. {ngpt-3.0.0 → ngpt-3.0.2}/docs/usage/cli_config.md +0 -0
  36. {ngpt-3.0.0 → ngpt-3.0.2}/docs/usage/cli_framework.md +0 -0
  37. {ngpt-3.0.0 → ngpt-3.0.2}/docs/usage/library_usage.md +0 -0
  38. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/__init__.py +0 -0
  39. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/__main__.py +0 -0
  40. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/__init__.py +0 -0
  41. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/args.py +0 -0
  42. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/config_manager.py +0 -0
  43. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/formatters.py +0 -0
  44. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/interactive.py +0 -0
  45. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/main.py +0 -0
  46. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/modes/__init__.py +0 -0
  47. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/modes/chat.py +0 -0
  48. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/modes/code.py +0 -0
  49. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/modes/gitcommsg.py +0 -0
  50. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/modes/rewrite.py +0 -0
  51. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/modes/shell.py +0 -0
  52. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/modes/text.py +0 -0
  53. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/renderers.py +0 -0
  54. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/ui.py +0 -0
  55. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/client.py +0 -0
  56. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/utils/__init__.py +0 -0
  57. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/utils/cli_config.py +0 -0
  58. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/utils/config.py +0 -0
  59. {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/utils/log.py +0 -0
  60. {ngpt-3.0.0 → ngpt-3.0.2}/wiki.md +0 -0
@@ -0,0 +1,40 @@
1
+ name: Publish AUR Package
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*' # Trigger on version tags
7
+
8
+ jobs:
9
+ publish-aur:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Checkout code
13
+ uses: actions/checkout@v3
14
+ with:
15
+ fetch-depth: 0 # Required for accurate versioning
16
+
17
+ - name: Update version in PKGBUILD
18
+ run: |
19
+ # Extract version from tag (remove 'v' prefix)
20
+ VERSION=${GITHUB_REF#refs/tags/v}
21
+ echo "Package version: $VERSION"
22
+
23
+ # Update version in PKGBUILD
24
+ sed -i "s/^pkgver=.*/pkgver=$VERSION/" PKGBUILD
25
+
26
+ - name: Publish AUR package
27
+ uses: KSXGitHub/github-actions-deploy-aur@v4.1.1
28
+ with:
29
+ pkgname: ngpt
30
+ pkgbuild: ./PKGBUILD
31
+ assets: |
32
+ LICENSE
33
+ README.md
34
+ commit_username: ${{ secrets.AUR_USERNAME }}
35
+ commit_email: ${{ secrets.AUR_EMAIL }}
36
+ ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
37
+ commit_message: "Update to version ${{ github.ref_name }}"
38
+ ssh_keyscan_types: rsa,ecdsa,ed25519
39
+ updpkgsums: true # Let the action update checksums automatically
40
+ test: true # Verify the PKGBUILD can be built
@@ -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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngpt
3
- Version: 3.0.0
3
+ Version: 3.0.2
4
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
@@ -36,20 +36,52 @@ Description-Content-Type: text/markdown
36
36
 
37
37
  # nGPT
38
38
 
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
+
39
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)
@@ -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, Gemini, 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
- | `-p, --pipe` | Read from stdin and use content with prompt. Use {} in prompt as placeholder for stdin content |
446
- | `-r, --rewrite` | Rewrite text to improve quality while preserving original tone and meaning |
447
- | `-g, --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.
ngpt-3.0.2/PKGBUILD ADDED
@@ -0,0 +1,24 @@
1
+ # Maintainer: nazdridoy <nazdridoy399@gmail.com>
2
+ pkgname=ngpt
3
+ pkgver=0.0.0 # Automatically updated by CI on release
4
+ pkgrel=1
5
+ pkgdesc="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."
6
+ arch=('any')
7
+ url="https://github.com/nazdridoy/ngpt"
8
+ license=('MIT')
9
+ depends=('python' 'python-requests>=2.31.0' 'python-rich>=10.0.0' 'python-prompt_toolkit>=3.0.0' 'python-pyperclip>=1.8.0')
10
+ makedepends=('python-build' 'python-installer' 'python-wheel' 'python-hatchling')
11
+ source=("${pkgname}-${pkgver}.tar.gz::https://github.com/nazdridoy/${pkgname}/archive/v${pkgver}.tar.gz")
12
+ sha256sums=('SKIP') # Automatically updated by CI on release
13
+
14
+ build() {
15
+ cd "$pkgname-$pkgver"
16
+ python -m build --wheel --no-isolation
17
+ }
18
+
19
+ package() {
20
+ cd "$pkgname-$pkgver"
21
+ python -m installer --destdir="$pkgdir" dist/*.whl
22
+ install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
23
+ install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
24
+ }
@@ -1,19 +1,51 @@
1
1
  # nGPT
2
2
 
3
+ <p align="center">
4
+ <a href="https://pypi.org/project/ngpt/"><img src="https://img.shields.io/pypi/v/ngpt.svg" alt="PyPI version"></a>
5
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
6
+ <a href="https://nazdridoy.github.io/ngpt/"><img src="https://img.shields.io/badge/docs-available-brightgreen.svg" alt="Documentation"></a>
7
+ </p>
8
+
9
+ <p align="center">
10
+ <a href="https://nazdridoy.github.io/ngpt/installation.html"><img src="https://img.shields.io/badge/Linux-support-blue?logo=linux" alt="Linux"></a>
11
+ <a href="https://nazdridoy.github.io/ngpt/installation.html"><img src="https://img.shields.io/badge/Windows-support-blue?logo=windows" alt="Windows"></a>
12
+ <a href="https://nazdridoy.github.io/ngpt/installation.html"><img src="https://img.shields.io/badge/macOS-support-blue?logo=apple" alt="macOS"></a>
13
+ <a href="https://nazdridoy.github.io/ngpt/installation.html"><img src="https://img.shields.io/badge/Android-Termux-blue?logo=android" alt="Android"></a>
14
+ </p>
15
+
3
16
  🤖 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.
4
17
 
5
- [![PyPI version](https://img.shields.io/pypi/v/ngpt.svg)](https://pypi.org/project/ngpt/)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
- [![Documentation](https://img.shields.io/badge/docs-available-brightgreen.svg)](https://nazdridoy.github.io/ngpt/)
8
- [![Linux](https://img.shields.io/badge/Linux-support-blue?logo=linux)](https://nazdridoy.github.io/ngpt/installation.html)
9
- [![Windows](https://img.shields.io/badge/Windows-support-blue?logo=windows)](https://nazdridoy.github.io/ngpt/installation.html)
10
- [![macOS](https://img.shields.io/badge/macOS-support-blue?logo=apple)](https://nazdridoy.github.io/ngpt/installation.html)
11
- [![Android](https://img.shields.io/badge/Android-Termux-blue?logo=android)](https://nazdridoy.github.io/ngpt/installation.html)
12
- [![Python Versions](https://img.shields.io/pypi/pyversions/ngpt.svg)](https://pypi.org/project/ngpt/)
13
18
 
14
19
  ![2025-04-23_16-18-01](https://github.com/user-attachments/assets/b8e58926-5165-4352-b48b-9f4a982da86e)
15
20
 
16
21
 
22
+ ## Features
23
+
24
+ - ✅ **Versatile**: Use as a CLI tool, Python library, or CLI framework for building custom tools
25
+ - 🪶 **Lightweight**: Minimal dependencies with everything you need included
26
+ - 🔄 **API Flexibility**: Works with OpenAI, Ollama, Groq, Claude, Gemini, and any compatible endpoint
27
+ - 💬 **Interactive Chat**: Continuous conversation with memory in modern UI
28
+ - 📊 **Streaming Responses**: Real-time output for better user experience
29
+ - 🔍 **Web Search**: Integrated with compatible API endpoints
30
+ - 📥 **Stdin Processing**: Process piped content by using `{}` placeholder in prompts
31
+ - 🎨 **Markdown Rendering**: Beautiful formatting of markdown and code with syntax highlighting
32
+ - ⚡ **Real-time Markdown**: Stream responses with live updating syntax highlighting and formatting
33
+ - ⚙️ **Multiple Configurations**: Cross-platform config system supporting different profiles
34
+ - 💻 **Shell Command Generation**: OS-aware command execution
35
+ - 🧠 **Text Rewriting**: Improve text quality while maintaining original tone and meaning
36
+ - 🧩 **Clean Code Generation**: Output code without markdown or explanations
37
+ - 📝 **Rich Multiline Editor**: Interactive multiline text input with syntax highlighting and intuitive controls
38
+ - 📑 **Git Commit Messages**: AI-powered generation of conventional, detailed commit messages from git diffs
39
+ - 🎭 **System Prompts**: Customize model behavior with custom system prompts
40
+ - 📃 **Conversation Logging**: Save your conversations to text files for later reference
41
+ - 🧰 **CLI Components**: Reusable components for building custom AI-powered command-line tools
42
+ - 🔌 **Modular Architecture**: Well-structured codebase with clean separation of concerns
43
+ - 🔄 **Provider Switching**: Easily switch between different LLM providers with a single parameter
44
+ - 🚀 **Performance Optimized**: Fast response times and minimal resource usage
45
+
46
+ See the [Feature Overview](https://nazdridoy.github.io/ngpt/overview.html) for more details.
47
+
48
+
17
49
  ## Table of Contents
18
50
  - [Quick Start](#quick-start)
19
51
  - [Features](#features)
@@ -136,32 +168,6 @@ ngpt --provider Ollama "Explain quantum physics" > ollama_response.txt
136
168
 
137
169
  For more examples and detailed usage, visit the [CLI Usage Guide](https://nazdridoy.github.io/ngpt/usage/cli_usage.html).
138
170
 
139
- ## Features
140
-
141
- - ✅ **Versatile**: Use as a CLI tool, Python library, or CLI framework for building custom tools
142
- - 🪶 **Lightweight**: Minimal dependencies with everything you need included
143
- - 🔄 **API Flexibility**: Works with OpenAI, Ollama, Groq, Claude, Gemini, and any compatible endpoint
144
- - 💬 **Interactive Chat**: Continuous conversation with memory in modern UI
145
- - 📊 **Streaming Responses**: Real-time output for better user experience
146
- - 🔍 **Web Search**: Integrated with compatible API endpoints
147
- - 📥 **Stdin Processing**: Process piped content by using `{}` placeholder in prompts
148
- - 🎨 **Markdown Rendering**: Beautiful formatting of markdown and code with syntax highlighting
149
- - ⚡ **Real-time Markdown**: Stream responses with live updating syntax highlighting and formatting
150
- - ⚙️ **Multiple Configurations**: Cross-platform config system supporting different profiles
151
- - 💻 **Shell Command Generation**: OS-aware command execution
152
- - 🧠 **Text Rewriting**: Improve text quality while maintaining original tone and meaning
153
- - 🧩 **Clean Code Generation**: Output code without markdown or explanations
154
- - 📝 **Rich Multiline Editor**: Interactive multiline text input with syntax highlighting and intuitive controls
155
- - 📑 **Git Commit Messages**: AI-powered generation of conventional, detailed commit messages from git diffs
156
- - 🎭 **System Prompts**: Customize model behavior with custom system prompts
157
- - 📃 **Conversation Logging**: Save your conversations to text files for later reference
158
- - 🧰 **CLI Components**: Reusable components for building custom AI-powered command-line tools
159
- - 🔌 **Modular Architecture**: Well-structured codebase with clean separation of concerns
160
- - 🔄 **Provider Switching**: Easily switch between different LLM providers with a single parameter
161
- - 🚀 **Performance Optimized**: Fast response times and minimal resource usage
162
-
163
- See the [Feature Overview](https://nazdridoy.github.io/ngpt/overview.html) for more details.
164
-
165
171
  ## Documentation
166
172
 
167
173
  Comprehensive documentation, including API reference, usage guides, and examples, is available at:
@@ -396,120 +402,160 @@ For detailed information about building CLI tools with nGPT, see the [CLI Framew
396
402
 
397
403
  ### Command Line Options
398
404
 
399
- You can configure nGPT using the following options:
400
-
401
- #### Mode Options (Mutually Exclusive)
402
-
403
- | Option | Description |
404
- |--------|-------------|
405
- | `-i, --interactive` | Start an interactive chat session with conversation memory and special commands |
406
- | `-s, --shell` | Generate and execute shell commands appropriate for your operating system |
407
- | `-c, --code` | Generate clean code without markdown formatting or explanations |
408
- | `-t, --text` | Open interactive multiline editor for complex prompts with syntax highlighting |
409
- | `-p, --pipe` | Read from stdin and use content with prompt. Use {} in prompt as placeholder for stdin content |
410
- | `-r, --rewrite` | Rewrite text to improve quality while preserving original tone and meaning |
411
- | `-g, --gitcommsg` | Generate AI-powered git commit messages from staged changes or diff files |
412
-
413
- #### Global Options
414
-
415
- | Option | Description |
416
- |--------|-------------|
417
- | `--api-key KEY` | API key for the service |
418
- | `--base-url URL` | Base URL for the API |
419
- | `--model MODEL` | Model to use |
420
- | `--web-search` | Enable web search capability (if your API endpoint supports it) |
421
- | `--temperature VALUE` | Set temperature (controls randomness, default: 0.7) |
422
- | `--top_p VALUE` | Set top_p (controls diversity, default: 1.0) |
423
- | `--max_tokens NUMBER` | Set maximum response length in tokens |
424
- | `--preprompt TEXT` | Set custom system prompt to control AI behavior |
425
- | `--language LANG` | Programming language to generate code in (for code mode, default: python) |
426
- | `--no-stream` | Return the whole response without streaming |
427
- | `--prettify` | Render markdown responses and code with syntax highlighting and formatting |
428
- | `--stream-prettify` | Enable streaming with markdown rendering (automatically uses Rich renderer) |
429
- | `--renderer {auto,rich,glow}` | Select which markdown renderer to use with --prettify (default: auto) |
430
- | `--log [FILE]` | Set filepath to log conversation to, or create a temporary log file if no path provided |
431
-
432
- #### Configuration Options
433
-
434
- | Option | Description |
435
- |--------|-------------|
436
- | `--config [PATH]` | Path to a custom config file or, if no value provided, enter interactive configuration mode |
437
- | `--config-index INDEX` | Index of the configuration to use or edit (default: 0) |
438
- | `--provider NAME` | Provider name to identify the configuration to use |
439
- | `--remove` | Remove the configuration at the specified index (requires --config and --config-index or --provider) |
440
- | `--show-config` | Show the current configuration(s) and exit |
441
- | `--all` | Show details for all configurations (requires --show-config) |
442
- | `--list-models` | List all available models for the current configuration and exit |
443
- | `--list-renderers` | Show available markdown renderers for use with --prettify |
444
- | `--cli-config [COMMAND]` | Manage CLI configuration (set, get, unset, list, help) |
445
- | `-v, --version` | Show version information and exit |
405
+ ```console
406
+ ❯ ngpt -h
407
+ usage: ngpt [-h] [-v] [--language LANGUAGE] [--config [CONFIG]] [--config-index CONFIG_INDEX] [--provider PROVIDER]
408
+ [--remove] [--show-config] [--all] [--list-models] [--list-renderers] [--cli-config [COMMAND ...]]
409
+ [--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search] [--temperature TEMPERATURE]
410
+ [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]] [--preprompt PREPROMPT] [--no-stream] [--prettify]
411
+ [--stream-prettify] [--renderer {auto,rich,glow}] [--rec-chunk] [--diff [FILE]] [--chunk-size CHUNK_SIZE]
412
+ [--analyses-chunk-size ANALYSES_CHUNK_SIZE] [--max-msg-lines MAX_MSG_LINES]
413
+ [--max-recursion-depth MAX_RECURSION_DEPTH] [-i | -s | -c | -t | -p | -r | -g]
414
+ [prompt]
415
+
416
+ nGPT - Interact with AI language models via OpenAI-compatible APIs
417
+
418
+ positional arguments::
419
+
420
+ [PROMPT] The prompt to send
421
+
422
+ options::
423
+
424
+ -h, --help show this help message and exit
425
+ -v, --version Show version information and exit
426
+ --language LANGUAGE Programming language to generate code in (for code mode)
427
+
428
+ Configuration Options::
429
+
430
+ --config [CONFIG] Path to a custom config file or, if no value provided, enter interactive
431
+ configuration mode to create a new config
432
+ --config-index CONFIG_INDEX Index of the configuration to use or edit (default: 0)
433
+ --provider PROVIDER Provider name to identify the configuration to use
434
+ --remove Remove the configuration at the specified index (requires --config and
435
+ --config-index or --provider)
436
+ --show-config Show the current configuration(s) and exit
437
+ --all Show details for all configurations (requires --show-config)
438
+ --list-models List all available models for the current configuration and exit
439
+ --list-renderers Show available markdown renderers for use with --prettify
440
+ --cli-config [COMMAND ...] Manage CLI configuration (set, get, unset, list, help)
441
+
442
+ Global Options::
443
+
444
+ --api-key API_KEY API key for the service
445
+ --base-url BASE_URL Base URL for the API
446
+ --model MODEL Model to use
447
+ --web-search Enable web search capability (Note: Your API endpoint must support this
448
+ feature)
449
+ --temperature TEMPERATURE Set temperature (controls randomness, default: 0.7)
450
+ --top_p TOP_P Set top_p (controls diversity, default: 1.0)
451
+ --max_tokens MAX_TOKENS Set max response length in tokens
452
+ --log [FILE] Set filepath to log conversation to, or create a temporary log file if no path
453
+ provided
454
+ --preprompt PREPROMPT Set custom system prompt to control AI behavior
455
+ --no-stream Return the whole response without streaming
456
+ --prettify Render markdown responses and code with syntax highlighting and formatting
457
+ --stream-prettify Enable streaming with markdown rendering (automatically uses Rich renderer)
458
+ --renderer {auto,rich,glow} Select which markdown renderer to use with --prettify (auto, rich, or glow)
459
+
460
+ Git Commit Message Options::
461
+
462
+ --rec-chunk Process large diffs in chunks with recursive analysis if needed
463
+ --diff [FILE] Use diff from specified file instead of staged changes. If used without a path,
464
+ uses the path from CLI config.
465
+ --chunk-size CHUNK_SIZE Number of lines per chunk when chunking is enabled (default: 200)
466
+ --analyses-chunk-size ANALYSES_CHUNK_SIZE
467
+ Number of lines per chunk when recursively chunking analyses (default: 200)
468
+ --max-msg-lines MAX_MSG_LINES Maximum number of lines in commit message before condensing (default: 20)
469
+ --max-recursion-depth MAX_RECURSION_DEPTH
470
+ Maximum recursion depth for commit message condensing (default: 3)
471
+
472
+ Modes (mutually exclusive)::
473
+
474
+ -i, --interactive Start an interactive chat session
475
+ -s, --shell Generate and execute shell commands
476
+ -c, --code Generate code
477
+ -t, --text Enter multi-line text input (submit with Ctrl+D)
478
+ -p, --pipe Read from stdin and use content with prompt. Use {} in prompt as placeholder
479
+ for stdin content
480
+ -r, --rewrite Rewrite text from stdin to be more natural while preserving tone and meaning
481
+ -g, --gitcommsg Generate AI-powered git commit messages from staged changes or diff file
482
+ ```
483
+
484
+ > **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.
446
485
 
447
486
  For a complete reference of all available options, see the [CLI Usage Guide](https://nazdridoy.github.io/ngpt/usage/cli_usage.html).
448
487
 
449
488
  ### CLI Configuration
450
489
 
451
- NGPT offers a CLI configuration system that allows you to set default values for command-line options:
452
-
453
- ```bash
454
- # Set default options
455
- ngpt --cli-config set language typescript
456
- ngpt --cli-config set temperature 0.9
457
- ngpt --cli-config set prettify true
458
-
459
- # View current settings
460
- ngpt --cli-config get
461
-
462
- # Get a specific setting
463
- ngpt --cli-config get language
464
-
465
- # Remove a setting
466
- ngpt --cli-config unset prettify
490
+ NGPT offers a CLI configuration system that allows you to set default values for command-line options. This is especially useful when you:
491
+
492
+ - Repeatedly use the same provider or model
493
+ - Have preferred settings for specific tasks
494
+ - Want to create different workflows based on context
495
+
496
+ For example, setting your preferred language for code generation or temperature value means you won't have to specify these parameters each time:
497
+
498
+ ```console
499
+
500
+ ❯ ngpt --cli-config help
501
+
502
+ CLI Configuration Help:
503
+ Command syntax:
504
+ ngpt --cli-config help - Show this help message
505
+ ngpt --cli-config set OPTION VALUE - Set a default value for OPTION
506
+ ngpt --cli-config get OPTION - Get the current value of OPTION
507
+ ngpt --cli-config get - Show all CLI configuration settings
508
+ ngpt --cli-config unset OPTION - Remove OPTION from configuration
509
+ ngpt --cli-config list - List all available options
510
+
511
+ Available options:
512
+ General options (all modes):
513
+ config-index - int (default: 0) [exclusive with: provider]
514
+ log - str
515
+ max_tokens - int
516
+ no-stream - bool (default: False) [exclusive with: prettify, stream-prettify]
517
+ preprompt - str
518
+ prettify - bool (default: False) [exclusive with: no-stream, stream-prettify]
519
+ provider - str [exclusive with: config-index]
520
+ renderer - str (default: auto)
521
+ stream-prettify - bool (default: False) [exclusive with: no-stream, prettify]
522
+ temperature - float (default: 0.7)
523
+ top_p - float (default: 1.0)
524
+ web-search - bool (default: False)
525
+
526
+ Options for Code generation mode:
527
+ language - str (default: python)
528
+
529
+ Options for Git commit message mode:
530
+ analyses-chunk-size - int (default: 200)
531
+ chunk-size - int (default: 200)
532
+ diff - str
533
+ max-msg-lines - int (default: 20)
534
+ max-recursion-depth - int (default: 3)
535
+ rec-chunk - bool (default: False)
536
+
537
+ Example usage:
538
+ ngpt --cli-config set language java - Set default language to java for code generation
539
+ ngpt --cli-config set provider Gemini - Set Gemini as your default provider
540
+ ngpt --cli-config set temperature 0.9 - Set default temperature to 0.9
541
+ ngpt --cli-config set no-stream true - Disable streaming by default
542
+ ngpt --cli-config set recursive-chunk true - Enable recursive chunking for git commit messages
543
+ ngpt --cli-config set diff /path/to/file.diff - Set default diff file for git commit messages
544
+ ngpt --cli-config get temperature - Check the current temperature setting
545
+ ngpt --cli-config get - Show all current CLI settings
546
+ ngpt --cli-config unset language - Remove language setting
547
+
548
+ Notes:
549
+ - CLI configuration is stored in:
550
+ • Linux: ~/.config/ngpt/ngpt-cli.conf
551
+ • macOS: ~/Library/Application Support/ngpt/ngpt-cli.conf
552
+ • Windows: %APPDATA%\ngpt\ngpt-cli.conf
553
+ - Settings are applied based on context (e.g., language only applies to code generation mode)
554
+ - Command-line arguments always override CLI configuration
555
+ - Some options are mutually exclusive and will not be applied together
467
556
 
468
- # List all available options
469
- ngpt --cli-config list
470
-
471
- # Show help information
472
- ngpt --cli-config help
473
- ```
474
-
475
- Key features of CLI configuration:
476
- - **Context-Aware**: Settings are applied based on the current command mode (e.g., `language` only applies in code generation mode `-c`).
477
- - **Priority**: When determining option values, NGPT uses the following priority order (highest to lowest):
478
- 1. Command-line arguments
479
- 2. Environment variables
480
- 3. CLI configuration (ngpt-cli.conf)
481
- 4. Main configuration file (ngpt.conf)
482
- 5. Default values
483
- - **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.
484
- - **Smart Selection**: The `provider` setting is used to select which configuration profile to use, offering a persistent way to select your preferred API.
485
-
486
- Available options include:
487
- - General options (all modes): `provider`, `temperature`, `top_p`, `max_tokens`, `preprompt`, `renderer`, `config-index`, `web-search`
488
- - Mode-specific options: `language` (code mode only), `log` (interactive and text modes)
489
- - Mutually exclusive options: `no-stream`, `prettify`, `stream-prettify`
490
-
491
- #### Practical Examples
492
-
493
- ```bash
494
- # Set Gemini as your default provider
495
- ngpt --cli-config set provider Gemini
496
- # Now you can run commands without specifying --provider
497
- ngpt "Explain quantum computing"
498
-
499
- # Configure code generation for TypeScript
500
- ngpt --cli-config set language typescript
501
- # Now in code mode, TypeScript will be used by default
502
- ngpt -c "Write a function to sort an array"
503
-
504
- # Set a higher temperature for more creative responses
505
- ngpt --cli-config set temperature 0.9
506
557
  ```
507
558
 
508
- The CLI configuration is stored in:
509
- - Linux: `~/.config/ngpt/ngpt-cli.conf`
510
- - macOS: `~/Library/Application Support/ngpt/ngpt-cli.conf`
511
- - Windows: `%APPDATA%\ngpt\ngpt-cli.conf`
512
-
513
559
  For more details, see the [CLI Configuration Guide](https://nazdridoy.github.io/ngpt/usage/cli_config.html).
514
560
 
515
561
  ### Interactive Configuration
@@ -606,4 +652,4 @@ Please check the [CONTRIBUTING.md](CONTRIBUTING.md) file for detailed guidelines
606
652
 
607
653
  ## License
608
654
 
609
- This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
655
+ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
@@ -283,6 +283,8 @@ ngpt -g --diff changes.diff
283
283
  ngpt -g --log commit_debug.log
284
284
  ```
285
285
 
286
+ > **Tip**: 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.
287
+
286
288
  ## Using CLI Config
287
289
 
288
290
  nGPT supports persistent CLI configuration for setting default values:
@@ -450,6 +450,8 @@ When a commit message is successfully generated, the tool attempts to copy it to
450
450
 
451
451
  For detailed documentation on git commit message generation, see the [Git Commit Message Guide](gitcommsg.md).
452
452
 
453
+ > **Tip**: 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.
454
+
453
455
  ### Generating Code
454
456
 
455
457
  Generate clean code without markdown or explanations:
@@ -352,6 +352,26 @@ The generated commit messages include:
352
352
  3. Brief summary
353
353
  4. Detailed bullet points with file and function references
354
354
 
355
+ ## GitHub Visualization
356
+
357
+ The conventional commit messages generated by `--gitcommsg` work great with GitHub, but you can enhance the visualization further with the **GitHub Commit Labels** userscript.
358
+
359
+ This userscript automatically adds beautiful colored labels for conventional commit types, making your commit history more readable and visually appealing.
360
+
361
+ ### Installation and Features
362
+
363
+ 1. Install a userscript manager like Tampermonkey for your browser
364
+ 2. Install the [GitHub Commit Labels](https://greasyfork.org/en/scripts/526153-github-commit-labels) userscript
365
+
366
+ Key features:
367
+ - Adds colored labels to conventional commit messages
368
+ - Supports all standard commit types (feat, fix, docs, etc.)
369
+ - Works with GitHub's light, dark, and dark dimmed themes
370
+ - Adds helpful tooltips showing detailed descriptions
371
+ - Highlights breaking changes using `type!:` or `type(scope)!:`
372
+
373
+ The userscript automatically detects the conventional commit format produced by `ngpt --gitcommsg`, enhancing the readability of your commit history on GitHub.
374
+
355
375
  ## Logging
356
376
 
357
377
  To debug issues or review the AI's analysis process, use the `--log` option:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ngpt"
3
- version = "3.0.0"
3
+ version = "3.0.2"
4
4
  description = "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
  authors = [
6
6
  {name = "nazDridoy", email = "nazdridoy399@gmail.com"},
@@ -134,7 +134,7 @@ wheels = [
134
134
 
135
135
  [[package]]
136
136
  name = "ngpt"
137
- version = "3.0.0"
137
+ version = "3.0.2"
138
138
  source = { editable = "." }
139
139
  dependencies = [
140
140
  { name = "prompt-toolkit" },
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