ngpt 2.8.0__py3-none-any.whl → 2.9.0__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngpt
3
- Version: 2.8.0
3
+ Version: 2.9.0
4
4
  Summary: A lightweight Python CLI and library for interacting with OpenAI-compatible APIs, supporting both official and self-hosted LLM endpoints.
5
5
  Project-URL: Homepage, https://github.com/nazdridoy/ngpt
6
6
  Project-URL: Repository, https://github.com/nazdridoy/ngpt
@@ -28,10 +28,9 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
28
28
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
29
29
  Classifier: Topic :: Utilities
30
30
  Requires-Python: >=3.8
31
+ Requires-Dist: prompt-toolkit>=3.0.0
31
32
  Requires-Dist: requests>=2.31.0
32
- Provides-Extra: full
33
- Requires-Dist: prompt-toolkit>=3.0.0; extra == 'full'
34
- Requires-Dist: rich>=10.0.0; extra == 'full'
33
+ Requires-Dist: rich>=10.0.0
35
34
  Description-Content-Type: text/markdown
36
35
 
37
36
  # nGPT
@@ -43,6 +42,9 @@ Description-Content-Type: text/markdown
43
42
 
44
43
  A lightweight Python CLI and library for interacting with OpenAI-compatible APIs, supporting both official and self-hosted LLM endpoints.
45
44
 
45
+ ![2025-04-23_16-18-01](https://github.com/user-attachments/assets/b8e58926-5165-4352-b48b-9f4a982da86e)
46
+
47
+
46
48
  ## Table of Contents
47
49
  - [Quick Start](#quick-start)
48
50
  - [Features](#features)
@@ -52,6 +54,7 @@ A lightweight Python CLI and library for interacting with OpenAI-compatible APIs
52
54
  - [Documentation](https://nazdridoy.github.io/ngpt/)
53
55
  - [CLI Tool](#as-a-cli-tool)
54
56
  - [Python Library](#as-a-library)
57
+ - [CLI Framework](#as-a-cli-framework)
55
58
  - [Configuration](#configuration)
56
59
  - [Command Line Options](#command-line-options)
57
60
  - [CLI Configuration](#cli-configuration)
@@ -64,11 +67,14 @@ A lightweight Python CLI and library for interacting with OpenAI-compatible APIs
64
67
  ## Quick Start
65
68
 
66
69
  ```bash
67
- # Install
70
+ # Install with pip
68
71
  pip install ngpt
69
72
 
70
- # Install with additional features
71
- pip install "ngpt[full]"
73
+ # Or install with uv (faster)
74
+ uv pip install ngpt
75
+
76
+ # Or install globally as a CLI tool (recommended)
77
+ uv tool install ngpt
72
78
 
73
79
  # Chat with default settings
74
80
  ngpt "Tell me about quantum computing"
@@ -114,8 +120,8 @@ For more examples and detailed usage, visit the [CLI Usage Guide](https://nazdri
114
120
 
115
121
  ## Features
116
122
 
117
- - ✅ **Dual Mode**: Use as a CLI tool or import as a Python library
118
- - 🪶 **Lightweight**: Minimal dependencies (just `requests`)
123
+ - ✅ **Versatile**: Use as a CLI tool, Python library, or CLI framework for building custom tools
124
+ - 🪶 **Lightweight**: Minimal dependencies with everything you need included
119
125
  - 🔄 **API Flexibility**: Works with OpenAI, Ollama, Groq, and any compatible endpoint
120
126
  - 💬 **Interactive Chat**: Continuous conversation with memory in modern UI
121
127
  - 📊 **Streaming Responses**: Real-time output for better user experience
@@ -128,6 +134,7 @@ For more examples and detailed usage, visit the [CLI Usage Guide](https://nazdri
128
134
  - 📝 **Rich Multiline Editor**: Interactive multiline text input with syntax highlighting and intuitive controls
129
135
  - 🎭 **System Prompts**: Customize model behavior with custom system prompts
130
136
  - 📃 **Conversation Logging**: Save your conversations to text files for later reference
137
+ - 🧰 **CLI Components**: Reusable components for building custom AI-powered command-line tools
131
138
 
132
139
  See the [Feature Overview](https://nazdridoy.github.io/ngpt/overview.html) for more details.
133
140
 
@@ -141,25 +148,25 @@ Key documentation sections:
141
148
  - [Installation Guide](https://nazdridoy.github.io/ngpt/installation.html)
142
149
  - [CLI Usage Guide](https://nazdridoy.github.io/ngpt/usage/cli_usage.html)
143
150
  - [Library Usage Guide](https://nazdridoy.github.io/ngpt/usage/library_usage.html)
151
+ - [CLI Framework Guide](https://nazdridoy.github.io/ngpt/usage/cli_framework.html)
144
152
  - [Configuration Guide](https://nazdridoy.github.io/ngpt/configuration.html)
145
153
  - [Examples & Tutorials](https://nazdridoy.github.io/ngpt/examples/basic.html)
146
154
 
147
155
  ## Installation
148
156
 
149
157
  ```bash
150
- # Basic installation (minimal dependencies)
158
+ # Installation with pip
151
159
  pip install ngpt
152
160
 
153
- # Full installation with all features (recommended)
154
- pip install "ngpt[full]"
161
+ # Or install with uv (faster installation)
162
+ uv pip install ngpt
163
+
164
+ # Or install globally as a CLI tool (recommended for command-line usage)
165
+ uv tool install ngpt
155
166
  ```
156
167
 
157
168
  Requires Python 3.8 or newer.
158
169
 
159
- The full installation includes:
160
- - Enhanced markdown rendering with syntax highlighting
161
- - Improved interactive input experience with multiline editing
162
-
163
170
  For detailed installation instructions, see the [Installation Guide](https://nazdridoy.github.io/ngpt/installation.html).
164
171
 
165
172
  ## Usage
@@ -279,6 +286,47 @@ print(code)
279
286
 
280
287
  For advanced usage patterns and integrations, check out the [Advanced Examples](https://nazdridoy.github.io/ngpt/examples/advanced.html).
281
288
 
289
+ ### As a CLI Framework
290
+
291
+ nGPT can also be used as a framework to build your own AI-powered command-line tools. You can leverage nGPT's pre-built CLI components to quickly develop sophisticated CLI applications.
292
+
293
+ ```python
294
+ from ngpt import NGPTClient, load_config
295
+ from ngpt.cli import interactive_chat_session, prettify_markdown, ColoredHelpFormatter
296
+ import argparse
297
+
298
+ # Create a custom CLI tool with colorized help
299
+ parser = argparse.ArgumentParser(
300
+ description="Specialized Code Assistant",
301
+ formatter_class=ColoredHelpFormatter
302
+ )
303
+ parser.add_argument("prompt", nargs="?", help="Code description")
304
+ parser.add_argument("--language", "-l", default="python", help="Programming language")
305
+ parser.add_argument("--interactive", "-i", action="store_true", help="Start interactive mode")
306
+ args = parser.parse_args()
307
+
308
+ # Initialize client
309
+ client = NGPTClient(**load_config())
310
+
311
+ # Use interactive session for conversation
312
+ if args.interactive:
313
+ system_prompt = f"You are an expert {args.language} developer. Provide clear, detailed answers."
314
+ interactive_chat_session(client=client, preprompt=system_prompt, prettify=True)
315
+ elif args.prompt:
316
+ # Generate and prettify code
317
+ code = client.generate_code(args.prompt, language=args.language)
318
+ print(prettify_markdown(f"```{args.language}\n{code}\n```"))
319
+ ```
320
+
321
+ This allows you to build specialized AI tools like:
322
+ - Code generators for specific languages or frameworks
323
+ - Domain-specific assistants (SQL, legal, finance, etc.)
324
+ - Documentation generators
325
+ - Translation tools
326
+ - And much more
327
+
328
+ For detailed information about building CLI tools with nGPT, see the [CLI Framework Guide](https://nazdridoy.github.io/ngpt/usage/cli_framework.html) and explore the [CLI Component Examples](https://nazdridoy.github.io/ngpt/examples/cli_components.html).
329
+
282
330
  ## Configuration
283
331
 
284
332
  ### Command Line Options
@@ -305,13 +353,15 @@ You can configure the client using the following options:
305
353
  | `--config` | Path to a custom configuration file or, when used without a value, enters interactive configuration mode |
306
354
  | `--config-index` | Index of the configuration to use (default: 0) |
307
355
  | `--provider` | Provider name to identify the configuration to use (alternative to --config-index) |
308
- | `--remove` | Remove the configuration at the specified index (requires --config and --config-index) |
356
+ | `--remove` | Remove the configuration at the specified index (requires --config and --config-index or --provider) |
309
357
  | `--show-config` | Show configuration details and exit |
310
358
  | `--all` | Used with `--show-config` to display all configurations |
311
359
  | `-i, --interactive` | Start an interactive chat session with stylish UI, conversation history, and special commands |
312
360
  | `-s, --shell` | Generate and execute shell commands |
313
361
  | `-c, --code` | Generate clean code output |
314
362
  | `-t, --text` | Open interactive multiline editor for complex prompts |
363
+ | `--language` | Programming language to generate code in (for code mode, default: python) |
364
+ | `--cli-config` | Manage CLI configuration settings (set, get, unset, list, help) |
315
365
  | `-v, --version` | Show version information |
316
366
 
317
367
  For a complete reference of all available options, see the [CLI Usage Guide](https://nazdridoy.github.io/ngpt/usage/cli_usage.html).
@@ -3,8 +3,8 @@ ngpt/cli.py,sha256=8E65ovaJE0OJ3-M6aw_FqCNSy_1-x1h4NwhnsZOlXq4,81580
3
3
  ngpt/cli_config.py,sha256=LatikOJTtohbmCfXM6AH44qplbpyAD-x1kMkmaJHRS0,9046
4
4
  ngpt/client.py,sha256=Rv-JO8RAmw1v3gdLkwaPe_PEw6p83cejO0YNT_DDjeg,15134
5
5
  ngpt/config.py,sha256=WYOk_b1eiYjo6hpV3pfXr2RjqhOnmKqwZwKid1T41I4,10363
6
- ngpt-2.8.0.dist-info/METADATA,sha256=g6KOwGut4qU6t1fbpsEaH1FPw6_PSDRRT3kZUGqO2ws,17993
7
- ngpt-2.8.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
- ngpt-2.8.0.dist-info/entry_points.txt,sha256=1cnAMujyy34DlOahrJg19lePSnb08bLbkUs_kVerqdk,39
9
- ngpt-2.8.0.dist-info/licenses/LICENSE,sha256=mQkpWoADxbHqE0HRefYLJdm7OpdrXBr3vNv5bZ8w72M,1065
10
- ngpt-2.8.0.dist-info/RECORD,,
6
+ ngpt-2.9.0.dist-info/METADATA,sha256=mA32IXz-eKDqJBnXFjdOq9miHkQc2sDUBv78zw7sWec,20277
7
+ ngpt-2.9.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
+ ngpt-2.9.0.dist-info/entry_points.txt,sha256=1cnAMujyy34DlOahrJg19lePSnb08bLbkUs_kVerqdk,39
9
+ ngpt-2.9.0.dist-info/licenses/LICENSE,sha256=mQkpWoADxbHqE0HRefYLJdm7OpdrXBr3vNv5bZ8w72M,1065
10
+ ngpt-2.9.0.dist-info/RECORD,,
File without changes