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.
- ngpt-3.0.2/.github/workflows/aur-publish.yml +40 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/COMMIT_GUIDELINES.md +2 -1
- {ngpt-3.0.0 → ngpt-3.0.2}/PKG-INFO +188 -142
- ngpt-3.0.2/PKGBUILD +24 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/README.md +187 -141
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/examples/basic.md +2 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/usage/cli_usage.md +2 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/usage/gitcommsg.md +20 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/pyproject.toml +1 -1
- {ngpt-3.0.0 → ngpt-3.0.2}/uv.lock +1 -1
- {ngpt-3.0.0 → ngpt-3.0.2}/.github/workflows/python-publish.yml +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/.gitignore +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/.python-version +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/CONTRIBUTING.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/LICENSE +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/CONTRIBUTING.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/LICENSE.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/README.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/_config.yml +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/api/README.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/api/cli.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/api/cli_config.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/api/client.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/api/config.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/api/logging.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/assets/css/style.scss +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/configuration.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/examples/README.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/examples/advanced.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/examples/cli_components.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/examples/integrations.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/installation.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/overview.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/usage/README.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/usage/cli_config.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/usage/cli_framework.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/docs/usage/library_usage.md +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/__init__.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/__main__.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/__init__.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/args.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/config_manager.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/formatters.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/interactive.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/main.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/modes/__init__.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/modes/chat.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/modes/code.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/modes/gitcommsg.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/modes/rewrite.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/modes/shell.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/modes/text.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/renderers.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/cli/ui.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/client.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/utils/__init__.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/utils/cli_config.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/utils/config.py +0 -0
- {ngpt-3.0.0 → ngpt-3.0.2}/ngpt/utils/log.py +0 -0
- {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.
|
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
|
-
[](https://pypi.org/project/ngpt/)
|
42
|
-
[](https://opensource.org/licenses/MIT)
|
43
|
-
[](https://nazdridoy.github.io/ngpt/)
|
44
|
-
[](https://nazdridoy.github.io/ngpt/installation.html)
|
45
|
-
[](https://nazdridoy.github.io/ngpt/installation.html)
|
46
|
-
[](https://nazdridoy.github.io/ngpt/installation.html)
|
47
|
-
[](https://nazdridoy.github.io/ngpt/installation.html)
|
48
|
-
[](https://pypi.org/project/ngpt/)
|
49
54
|
|
50
55
|

|
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
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
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
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
ngpt --cli-config
|
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
|
-
[](https://pypi.org/project/ngpt/)
|
6
|
-
[](https://opensource.org/licenses/MIT)
|
7
|
-
[](https://nazdridoy.github.io/ngpt/)
|
8
|
-
[](https://nazdridoy.github.io/ngpt/installation.html)
|
9
|
-
[](https://nazdridoy.github.io/ngpt/installation.html)
|
10
|
-
[](https://nazdridoy.github.io/ngpt/installation.html)
|
11
|
-
[](https://nazdridoy.github.io/ngpt/installation.html)
|
12
|
-
[](https://pypi.org/project/ngpt/)
|
13
18
|
|
14
19
|

|
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
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
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
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
ngpt --cli-config
|
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.
|
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"},
|
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
|