ngpt 3.8.3__tar.gz → 3.9.0__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.8.3 → ngpt-3.9.0}/PKG-INFO +50 -6
- {ngpt-3.8.3 → ngpt-3.9.0}/README.md +49 -5
- {ngpt-3.8.3 → ngpt-3.9.0}/docs/configuration.md +69 -6
- {ngpt-3.8.3 → ngpt-3.9.0}/docs/usage/cli_config.md +1 -1
- {ngpt-3.8.3 → ngpt-3.9.0}/docs/usage/cli_usage.md +31 -8
- ngpt-3.9.0/docs/usage/roles.md +561 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/docs/usage/web_search.md +1 -1
- {ngpt-3.8.3 → ngpt-3.9.0}/docs/usage.md +2 -1
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/cli/args.py +43 -2
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/cli/main.py +17 -1
- ngpt-3.9.0/ngpt/cli/roles.py +265 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/cli/ui.py +17 -4
- {ngpt-3.8.3 → ngpt-3.9.0}/pyproject.toml +1 -1
- {ngpt-3.8.3 → ngpt-3.9.0}/uv.lock +1 -1
- {ngpt-3.8.3 → ngpt-3.9.0}/.github/workflows/aur-publish.yml +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/.github/workflows/python-publish.yml +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/.gitignore +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/.python-version +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/COMMIT_GUIDELINES.md +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/CONTRIBUTING.md +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/LICENSE +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/PKGBUILD +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/docs/CONTRIBUTING.md +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/docs/LICENSE.md +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/docs/_config.yml +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/docs/_sass/custom/custom.scss +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/docs/examples/advanced.md +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/docs/examples/basic.md +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/docs/examples.md +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/docs/index.md +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/docs/installation.md +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/docs/overview.md +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/docs/usage/gitcommsg.md +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/__init__.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/__main__.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/cli/__init__.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/cli/config_manager.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/cli/formatters.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/cli/modes/__init__.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/cli/modes/chat.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/cli/modes/code.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/cli/modes/gitcommsg.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/cli/modes/interactive.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/cli/modes/rewrite.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/cli/modes/shell.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/cli/modes/text.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/cli/renderers.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/client.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/utils/__init__.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/utils/cli_config.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/utils/config.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/utils/log.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/utils/pipe.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/ngpt/utils/web_search.py +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/previews/ngpt-g.png +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/previews/ngpt-i.png +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/previews/ngpt-s-c.png +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/previews/ngpt-sh-c-a.png +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/previews/ngpt-w-self.png +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/previews/ngpt-w.png +0 -0
- {ngpt-3.8.3 → ngpt-3.9.0}/wiki.md +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ngpt
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.9.0
|
4
4
|
Summary: Swiss army knife for LLMs: powerful CLI and interactive chatbot 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.
|
5
5
|
Project-URL: Homepage, https://github.com/nazdridoy/ngpt
|
6
6
|
Project-URL: Repository, https://github.com/nazdridoy/ngpt
|
@@ -75,6 +75,7 @@ Description-Content-Type: text/markdown
|
|
75
75
|
- 📝 **Rich Multiline Editor**: Interactive multiline text input with syntax highlighting and intuitive controls
|
76
76
|
- 📑 **Git Commit Messages**: AI-powered generation of conventional, detailed commit messages from git diffs
|
77
77
|
- 🎭 **System Prompts**: Customize model behavior with custom system prompts
|
78
|
+
- 🤖 **Custom Roles**: Create and use reusable AI roles for specialized tasks
|
78
79
|
- 📃 **Conversation Logging**: Save your conversations to text files for later reference
|
79
80
|
- 🔌 **Modular Architecture**: Well-structured codebase with clean separation of concerns
|
80
81
|
- 🔄 **Provider Switching**: Easily switch between different LLM providers with a single parameter
|
@@ -164,6 +165,12 @@ What is the best way to learn Golang?
|
|
164
165
|
Provide simple hello world example.
|
165
166
|
EOF
|
166
167
|
|
168
|
+
# Create a custom role for specialized tasks
|
169
|
+
ngpt --role-config create json_generator
|
170
|
+
|
171
|
+
# Use a custom role for specific tasks
|
172
|
+
ngpt --role json_generator "Generate user data with name, email, and address"
|
173
|
+
|
167
174
|
# Rewrite text to improve quality while preserving tone and meaning
|
168
175
|
echo "your text" | ngpt -r
|
169
176
|
|
@@ -267,10 +274,11 @@ For more examples and detailed usage, visit the [CLI Usage Guide](https://nazdri
|
|
267
274
|
|
268
275
|
usage: ngpt [-h] [-v] [--language LANGUAGE] [--config [CONFIG]] [--config-index CONFIG_INDEX] [--provider PROVIDER]
|
269
276
|
[--remove] [--show-config] [--all] [--list-models] [--list-renderers] [--cli-config [COMMAND ...]]
|
270
|
-
[--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search]
|
271
|
-
[--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
|
272
|
-
[--no-stream | --prettify | --stream-prettify]
|
273
|
-
[--
|
277
|
+
[--role-config [ACTION ...]] [--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search]
|
278
|
+
[--pipe] [--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
|
279
|
+
[--preprompt PREPROMPT | --role ROLE] [--no-stream | --prettify | --stream-prettify]
|
280
|
+
[--renderer {auto,rich,glow}] [--rec-chunk] [--diff [FILE]] [--chunk-size CHUNK_SIZE]
|
281
|
+
[--analyses-chunk-size ANALYSES_CHUNK_SIZE] [--max-msg-lines MAX_MSG_LINES]
|
274
282
|
[--max-recursion-depth MAX_RECURSION_DEPTH] [-i | -s | -c | -t | -r | -g]
|
275
283
|
[prompt]
|
276
284
|
|
@@ -297,6 +305,7 @@ Configuration Options::
|
|
297
305
|
--list-models List all available models for the current configuration and exit
|
298
306
|
--list-renderers Show available markdown renderers for use with --prettify
|
299
307
|
--cli-config [COMMAND ...] Manage CLI configuration (set, get, unset, list, help)
|
308
|
+
--role-config [ACTION ...] Manage custom roles (help, create, show, edit, list, remove) [role_name]
|
300
309
|
|
301
310
|
Global Options::
|
302
311
|
|
@@ -310,6 +319,7 @@ Global Options::
|
|
310
319
|
--max_tokens MAX_TOKENS Set max response length in tokens
|
311
320
|
--log [FILE] Set filepath to log conversation to, or create a temporary log file if no path provided
|
312
321
|
--preprompt PREPROMPT Set custom system prompt to control AI behavior
|
322
|
+
--role ROLE Use a predefined role to set system prompt (mutually exclusive with --preprompt)
|
313
323
|
--renderer {auto,rich,glow} Select which markdown renderer to use with --prettify or --stream-prettify (auto, rich, or glow)
|
314
324
|
|
315
325
|
Output Display Options (mutually exclusive)::
|
@@ -325,7 +335,7 @@ Git Commit Message Options::
|
|
325
335
|
--chunk-size CHUNK_SIZE Number of lines per chunk when chunking is enabled (default: 200)
|
326
336
|
--analyses-chunk-size ANALYSES_CHUNK_SIZE Number of lines per chunk when recursively chunking analyses (default: 200)
|
327
337
|
--max-msg-lines MAX_MSG_LINES Maximum number of lines in commit message before condensing (default: 20)
|
328
|
-
--max-recursion-depth MAX_RECURSION_DEPTH
|
338
|
+
--max-recursion-depth MAX_RECURSION_DEPTH Maximum recursion depth for commit message condensing (default: 3)
|
329
339
|
|
330
340
|
Modes (mutually exclusive)::
|
331
341
|
|
@@ -601,6 +611,40 @@ This is a huge time-saver. nGPT analyzes your git diff and generates a properly
|
|
601
611
|
|
602
612
|

|
603
613
|
|
614
|
+
#### Custom AI Roles
|
615
|
+
|
616
|
+
```bash
|
617
|
+
# Create a specialized role for JSON generation
|
618
|
+
ngpt --role-config create json_generator
|
619
|
+
|
620
|
+
# Use the custom role to generate structured data
|
621
|
+
ngpt --role json_generator "Generate random user profile data"
|
622
|
+
```
|
623
|
+
```json
|
624
|
+
{
|
625
|
+
"id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
|
626
|
+
"firstName": "Aurora",
|
627
|
+
"lastName": "Reynolds",
|
628
|
+
"email": "aurora.reynolds@example.com",
|
629
|
+
"phone": "+1-555-0101",
|
630
|
+
"address": {
|
631
|
+
"street": "123 Main St",
|
632
|
+
"city": "Anytown",
|
633
|
+
"state": "CA",
|
634
|
+
"zipCode": "90210"
|
635
|
+
},
|
636
|
+
"birthDate": "1990-07-15",
|
637
|
+
"registrationDate": "2022-01-20",
|
638
|
+
"isActive": true,
|
639
|
+
"roles": [
|
640
|
+
"user",
|
641
|
+
"premium"
|
642
|
+
]
|
643
|
+
}
|
644
|
+
```
|
645
|
+
|
646
|
+
Custom roles let you define specialized AI personas that you can reuse across different prompts, making it easy to get consistent responses for specific tasks.
|
647
|
+
|
604
648
|
#### Web Search Integration
|
605
649
|
|
606
650
|
```bash
|
@@ -38,6 +38,7 @@
|
|
38
38
|
- 📝 **Rich Multiline Editor**: Interactive multiline text input with syntax highlighting and intuitive controls
|
39
39
|
- 📑 **Git Commit Messages**: AI-powered generation of conventional, detailed commit messages from git diffs
|
40
40
|
- 🎭 **System Prompts**: Customize model behavior with custom system prompts
|
41
|
+
- 🤖 **Custom Roles**: Create and use reusable AI roles for specialized tasks
|
41
42
|
- 📃 **Conversation Logging**: Save your conversations to text files for later reference
|
42
43
|
- 🔌 **Modular Architecture**: Well-structured codebase with clean separation of concerns
|
43
44
|
- 🔄 **Provider Switching**: Easily switch between different LLM providers with a single parameter
|
@@ -127,6 +128,12 @@ What is the best way to learn Golang?
|
|
127
128
|
Provide simple hello world example.
|
128
129
|
EOF
|
129
130
|
|
131
|
+
# Create a custom role for specialized tasks
|
132
|
+
ngpt --role-config create json_generator
|
133
|
+
|
134
|
+
# Use a custom role for specific tasks
|
135
|
+
ngpt --role json_generator "Generate user data with name, email, and address"
|
136
|
+
|
130
137
|
# Rewrite text to improve quality while preserving tone and meaning
|
131
138
|
echo "your text" | ngpt -r
|
132
139
|
|
@@ -230,10 +237,11 @@ For more examples and detailed usage, visit the [CLI Usage Guide](https://nazdri
|
|
230
237
|
|
231
238
|
usage: ngpt [-h] [-v] [--language LANGUAGE] [--config [CONFIG]] [--config-index CONFIG_INDEX] [--provider PROVIDER]
|
232
239
|
[--remove] [--show-config] [--all] [--list-models] [--list-renderers] [--cli-config [COMMAND ...]]
|
233
|
-
[--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search]
|
234
|
-
[--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
|
235
|
-
[--no-stream | --prettify | --stream-prettify]
|
236
|
-
[--
|
240
|
+
[--role-config [ACTION ...]] [--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search]
|
241
|
+
[--pipe] [--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
|
242
|
+
[--preprompt PREPROMPT | --role ROLE] [--no-stream | --prettify | --stream-prettify]
|
243
|
+
[--renderer {auto,rich,glow}] [--rec-chunk] [--diff [FILE]] [--chunk-size CHUNK_SIZE]
|
244
|
+
[--analyses-chunk-size ANALYSES_CHUNK_SIZE] [--max-msg-lines MAX_MSG_LINES]
|
237
245
|
[--max-recursion-depth MAX_RECURSION_DEPTH] [-i | -s | -c | -t | -r | -g]
|
238
246
|
[prompt]
|
239
247
|
|
@@ -260,6 +268,7 @@ Configuration Options::
|
|
260
268
|
--list-models List all available models for the current configuration and exit
|
261
269
|
--list-renderers Show available markdown renderers for use with --prettify
|
262
270
|
--cli-config [COMMAND ...] Manage CLI configuration (set, get, unset, list, help)
|
271
|
+
--role-config [ACTION ...] Manage custom roles (help, create, show, edit, list, remove) [role_name]
|
263
272
|
|
264
273
|
Global Options::
|
265
274
|
|
@@ -273,6 +282,7 @@ Global Options::
|
|
273
282
|
--max_tokens MAX_TOKENS Set max response length in tokens
|
274
283
|
--log [FILE] Set filepath to log conversation to, or create a temporary log file if no path provided
|
275
284
|
--preprompt PREPROMPT Set custom system prompt to control AI behavior
|
285
|
+
--role ROLE Use a predefined role to set system prompt (mutually exclusive with --preprompt)
|
276
286
|
--renderer {auto,rich,glow} Select which markdown renderer to use with --prettify or --stream-prettify (auto, rich, or glow)
|
277
287
|
|
278
288
|
Output Display Options (mutually exclusive)::
|
@@ -288,7 +298,7 @@ Git Commit Message Options::
|
|
288
298
|
--chunk-size CHUNK_SIZE Number of lines per chunk when chunking is enabled (default: 200)
|
289
299
|
--analyses-chunk-size ANALYSES_CHUNK_SIZE Number of lines per chunk when recursively chunking analyses (default: 200)
|
290
300
|
--max-msg-lines MAX_MSG_LINES Maximum number of lines in commit message before condensing (default: 20)
|
291
|
-
--max-recursion-depth MAX_RECURSION_DEPTH
|
301
|
+
--max-recursion-depth MAX_RECURSION_DEPTH Maximum recursion depth for commit message condensing (default: 3)
|
292
302
|
|
293
303
|
Modes (mutually exclusive)::
|
294
304
|
|
@@ -564,6 +574,40 @@ This is a huge time-saver. nGPT analyzes your git diff and generates a properly
|
|
564
574
|
|
565
575
|

|
566
576
|
|
577
|
+
#### Custom AI Roles
|
578
|
+
|
579
|
+
```bash
|
580
|
+
# Create a specialized role for JSON generation
|
581
|
+
ngpt --role-config create json_generator
|
582
|
+
|
583
|
+
# Use the custom role to generate structured data
|
584
|
+
ngpt --role json_generator "Generate random user profile data"
|
585
|
+
```
|
586
|
+
```json
|
587
|
+
{
|
588
|
+
"id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
|
589
|
+
"firstName": "Aurora",
|
590
|
+
"lastName": "Reynolds",
|
591
|
+
"email": "aurora.reynolds@example.com",
|
592
|
+
"phone": "+1-555-0101",
|
593
|
+
"address": {
|
594
|
+
"street": "123 Main St",
|
595
|
+
"city": "Anytown",
|
596
|
+
"state": "CA",
|
597
|
+
"zipCode": "90210"
|
598
|
+
},
|
599
|
+
"birthDate": "1990-07-15",
|
600
|
+
"registrationDate": "2022-01-20",
|
601
|
+
"isActive": true,
|
602
|
+
"roles": [
|
603
|
+
"user",
|
604
|
+
"premium"
|
605
|
+
]
|
606
|
+
}
|
607
|
+
```
|
608
|
+
|
609
|
+
Custom roles let you define specialized AI personas that you can reuse across different prompts, making it easy to get consistent responses for specific tasks.
|
610
|
+
|
567
611
|
#### Web Search Integration
|
568
612
|
|
569
613
|
```bash
|
@@ -147,12 +147,15 @@ You can set configuration options directly via command-line arguments:
|
|
147
147
|
```
|
148
148
|
usage: ngpt [-h] [-v] [--language LANGUAGE] [--config [CONFIG]] [--config-index CONFIG_INDEX] [--provider PROVIDER]
|
149
149
|
[--remove] [--show-config] [--all] [--list-models] [--list-renderers] [--cli-config [COMMAND ...]]
|
150
|
-
[--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search]
|
151
|
-
[--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
|
152
|
-
[--no-stream | --prettify | --stream-prettify]
|
153
|
-
[--
|
150
|
+
[--role-config [ACTION ...]] [--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search]
|
151
|
+
[--pipe] [--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
|
152
|
+
[--preprompt PREPROMPT | --role ROLE] [--no-stream | --prettify | --stream-prettify]
|
153
|
+
[--renderer {auto,rich,glow}] [--rec-chunk] [--diff [FILE]] [--chunk-size CHUNK_SIZE]
|
154
|
+
[--analyses-chunk-size ANALYSES_CHUNK_SIZE] [--max-msg-lines MAX_MSG_LINES]
|
154
155
|
[--max-recursion-depth MAX_RECURSION_DEPTH] [-i | -s | -c | -t | -r | -g]
|
155
156
|
[prompt]
|
157
|
+
|
158
|
+
nGPT - Interact with AI language models via OpenAI-compatible APIs
|
156
159
|
```
|
157
160
|
|
158
161
|
### Positional Arguments
|
@@ -176,6 +179,7 @@ usage: ngpt [-h] [-v] [--language LANGUAGE] [--config [CONFIG]] [--config-index
|
|
176
179
|
- `--list-models`: List all available models for the current configuration and exit
|
177
180
|
- `--list-renderers`: Show available markdown renderers for use with --prettify
|
178
181
|
- `--cli-config <[COMMAND ...]>`: Manage CLI configuration (set, get, unset, list, help)
|
182
|
+
- `--role-config <[ACTION ...]>`: Manage custom roles (help, create, show, edit, list, remove) [role_name]
|
179
183
|
|
180
184
|
### Global Options
|
181
185
|
|
@@ -183,11 +187,13 @@ usage: ngpt [-h] [-v] [--language LANGUAGE] [--config [CONFIG]] [--config-index
|
|
183
187
|
- `--base-url <BASE_URL>`: Base URL for the API
|
184
188
|
- `--model <MODEL>`: Model to use
|
185
189
|
- `--web-search`: Enable web search capability using DuckDuckGo to enhance prompts with relevant information
|
190
|
+
- `--pipe`: Read from stdin and use content with prompt. Use {} in prompt as placeholder for stdin content. Can be used with any mode option except --text and --interactive
|
186
191
|
- `--temperature <TEMPERATURE>`: Set temperature (controls randomness, default: 0.7)
|
187
192
|
- `--top_p <TOP_P>`: Set top_p (controls diversity, default: 1.0)
|
188
193
|
- `--max_tokens <MAX_TOKENS>`: Set max response length in tokens
|
189
194
|
- `--log <[FILE]>`: Set filepath to log conversation to, or create a temporary log file if no path provided
|
190
195
|
- `--preprompt <PREPROMPT>`: Set custom system prompt to control AI behavior
|
196
|
+
- `--role <ROLE>`: Use a predefined role to set system prompt (mutually exclusive with --preprompt)
|
191
197
|
- `--renderer <{auto,rich,glow}>`: Select which markdown renderer to use with --prettify or --stream-prettify (auto, rich, or glow)
|
192
198
|
|
193
199
|
### Output Display Options (mutually exclusive)
|
@@ -211,7 +217,6 @@ usage: ngpt [-h] [-v] [--language LANGUAGE] [--config [CONFIG]] [--config-index
|
|
211
217
|
- `-s, --shell`: Generate and execute shell commands
|
212
218
|
- `-c, --code`: Generate code
|
213
219
|
- `-t, --text`: Enter multi-line text input (submit with Ctrl+D)
|
214
|
-
- `--pipe`: Read from stdin and use content with prompt. Use {} in prompt as placeholder for stdin content. Can be used with any mode option except --text and --interactive.
|
215
220
|
- `-r, --rewrite`: Rewrite text from stdin to be more natural while preserving tone and meaning
|
216
221
|
- `-g, --gitcommsg`: Generate AI-powered git commit messages from staged changes or diff file
|
217
222
|
|
@@ -297,6 +302,64 @@ ngpt --list-models --provider OpenAI
|
|
297
302
|
|
298
303
|
nGPT also supports a CLI configuration system for setting default parameter values. See the [CLI Configuration Guide](usage/cli_config.md) for details.
|
299
304
|
|
305
|
+
## Role Configuration
|
306
|
+
|
307
|
+
nGPT allows you to create and manage custom roles, which are saved system prompts that define specialized AI personas. Roles are stored in the following locations:
|
308
|
+
|
309
|
+
- **Linux**: `~/.config/ngpt/ngpt_roles/`
|
310
|
+
- **macOS**: `~/Library/Application Support/ngpt/ngpt_roles/`
|
311
|
+
- **Windows**: `%APPDATA%\ngpt\ngpt_roles\`
|
312
|
+
|
313
|
+
Each role is saved as a separate JSON file with the role name as the filename.
|
314
|
+
|
315
|
+
### Managing Roles
|
316
|
+
|
317
|
+
You can manage roles using the `--role-config` option:
|
318
|
+
|
319
|
+
```bash
|
320
|
+
# Show role configuration help
|
321
|
+
ngpt --role-config help
|
322
|
+
|
323
|
+
# Create a new role
|
324
|
+
ngpt --role-config create expert_coder
|
325
|
+
|
326
|
+
# List all available roles
|
327
|
+
ngpt --role-config list
|
328
|
+
|
329
|
+
# Show details of a specific role
|
330
|
+
ngpt --role-config show expert_coder
|
331
|
+
|
332
|
+
# Edit an existing role
|
333
|
+
ngpt --role-config edit expert_coder
|
334
|
+
|
335
|
+
# Remove a role
|
336
|
+
ngpt --role-config remove expert_coder
|
337
|
+
```
|
338
|
+
|
339
|
+
When creating or editing a role, nGPT opens a multiline editor where you can enter or modify the system prompt for that role. This makes it easy to define complex instructions that guide the AI's behavior.
|
340
|
+
|
341
|
+
### Using Roles
|
342
|
+
|
343
|
+
To use a role, specify it with the `--role` parameter:
|
344
|
+
|
345
|
+
```bash
|
346
|
+
# Use a role in standard chat mode
|
347
|
+
ngpt --role expert_coder "Create a function to parse JSON data"
|
348
|
+
|
349
|
+
# Use a role with code generation
|
350
|
+
ngpt --code --role python_expert "Create a class for managing user data"
|
351
|
+
|
352
|
+
# Use a role with shell command generation
|
353
|
+
ngpt --shell --role linux_expert "Find all large log files"
|
354
|
+
|
355
|
+
# Use a role in interactive mode
|
356
|
+
ngpt -i --role writing_assistant
|
357
|
+
```
|
358
|
+
|
359
|
+
The `--role` parameter is mutually exclusive with `--preprompt` since both set the system prompt.
|
360
|
+
|
361
|
+
For detailed documentation on creating and managing roles, including examples and best practices, see the [Custom Roles Guide](usage/roles.md).
|
362
|
+
|
300
363
|
## Troubleshooting
|
301
364
|
|
302
365
|
### Common Configuration Issues
|
@@ -346,4 +409,4 @@ After configuring nGPT, explore:
|
|
346
409
|
|
347
410
|
- [CLI Usage Guide](usage/cli_usage.md) for general usage information
|
348
411
|
- [CLI Configuration Guide](usage/cli_config.md) for setting up default CLI options
|
349
|
-
- [Basic Examples](examples/basic.md) for common usage patterns
|
412
|
+
- [Basic Examples](examples/basic.md) for common usage patterns
|
@@ -2,7 +2,7 @@
|
|
2
2
|
layout: default
|
3
3
|
title: CLI Usage Guide
|
4
4
|
parent: Usage
|
5
|
-
nav_order:
|
5
|
+
nav_order: 2
|
6
6
|
permalink: /usage/cli_usage/
|
7
7
|
---
|
8
8
|
|
@@ -39,12 +39,15 @@ You can set configuration options directly via command-line arguments:
|
|
39
39
|
```
|
40
40
|
usage: ngpt [-h] [-v] [--language LANGUAGE] [--config [CONFIG]] [--config-index CONFIG_INDEX] [--provider PROVIDER]
|
41
41
|
[--remove] [--show-config] [--all] [--list-models] [--list-renderers] [--cli-config [COMMAND ...]]
|
42
|
-
[--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search]
|
43
|
-
[--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
|
44
|
-
[--no-stream | --prettify | --stream-prettify]
|
45
|
-
[--
|
42
|
+
[--role-config [ACTION ...]] [--api-key API_KEY] [--base-url BASE_URL] [--model MODEL] [--web-search]
|
43
|
+
[--pipe] [--temperature TEMPERATURE] [--top_p TOP_P] [--max_tokens MAX_TOKENS] [--log [FILE]]
|
44
|
+
[--preprompt PREPROMPT | --role ROLE] [--no-stream | --prettify | --stream-prettify]
|
45
|
+
[--renderer {auto,rich,glow}] [--rec-chunk] [--diff [FILE]] [--chunk-size CHUNK_SIZE]
|
46
|
+
[--analyses-chunk-size ANALYSES_CHUNK_SIZE] [--max-msg-lines MAX_MSG_LINES]
|
46
47
|
[--max-recursion-depth MAX_RECURSION_DEPTH] [-i | -s | -c | -t | -r | -g]
|
47
48
|
[prompt]
|
49
|
+
|
50
|
+
nGPT - Interact with AI language models via OpenAI-compatible APIs
|
48
51
|
```
|
49
52
|
|
50
53
|
### Positional Arguments
|
@@ -68,6 +71,7 @@ usage: ngpt [-h] [-v] [--language LANGUAGE] [--config [CONFIG]] [--config-index
|
|
68
71
|
- `--list-models`: List all available models for the current configuration and exit
|
69
72
|
- `--list-renderers`: Show available markdown renderers for use with --prettify
|
70
73
|
- `--cli-config <[COMMAND ...]>`: Manage CLI configuration (set, get, unset, list, help)
|
74
|
+
- `--role-config <[ACTION ...]>`: Manage custom roles (help, create, show, edit, list, remove) [role_name]
|
71
75
|
|
72
76
|
### Global Options
|
73
77
|
|
@@ -75,11 +79,13 @@ usage: ngpt [-h] [-v] [--language LANGUAGE] [--config [CONFIG]] [--config-index
|
|
75
79
|
- `--base-url <BASE_URL>`: Base URL for the API
|
76
80
|
- `--model <MODEL>`: Model to use
|
77
81
|
- `--web-search`: Enable web search capability using DuckDuckGo to enhance prompts with relevant information
|
82
|
+
- `--pipe`: Read from stdin and use content with prompt. Use {} in prompt as placeholder for stdin content. Can be used with any mode option except --text and --interactive
|
78
83
|
- `--temperature <TEMPERATURE>`: Set temperature (controls randomness, default: 0.7)
|
79
84
|
- `--top_p <TOP_P>`: Set top_p (controls diversity, default: 1.0)
|
80
85
|
- `--max_tokens <MAX_TOKENS>`: Set max response length in tokens
|
81
86
|
- `--log <[FILE]>`: Set filepath to log conversation to, or create a temporary log file if no path provided
|
82
87
|
- `--preprompt <PREPROMPT>`: Set custom system prompt to control AI behavior
|
88
|
+
- `--role <ROLE>`: Use a predefined role to set system prompt (mutually exclusive with --preprompt)
|
83
89
|
- `--renderer <{auto,rich,glow}>`: Select which markdown renderer to use with --prettify or --stream-prettify (auto, rich, or glow)
|
84
90
|
|
85
91
|
### Output Display Options (mutually exclusive)
|
@@ -103,11 +109,9 @@ usage: ngpt [-h] [-v] [--language LANGUAGE] [--config [CONFIG]] [--config-index
|
|
103
109
|
- `-s, --shell`: Generate and execute shell commands
|
104
110
|
- `-c, --code`: Generate code
|
105
111
|
- `-t, --text`: Enter multi-line text input (submit with Ctrl+D)
|
106
|
-
- `--pipe`: Read from stdin and use content with prompt. Use {} in prompt as placeholder for stdin content. Can be used with any mode option except --text and --interactive.
|
107
112
|
- `-r, --rewrite`: Rewrite text from stdin to be more natural while preserving tone and meaning
|
108
113
|
- `-g, --gitcommsg`: Generate AI-powered git commit messages from staged changes or diff file
|
109
114
|
|
110
|
-
|
111
115
|
## Mode Details
|
112
116
|
|
113
117
|
### Basic Chat
|
@@ -183,6 +187,21 @@ ngpt -i --prettify
|
|
183
187
|
ngpt -i --stream-prettify
|
184
188
|
```
|
185
189
|
|
190
|
+
### Custom Roles
|
191
|
+
|
192
|
+
nGPT supports creating and using custom roles to define specialized AI personas for different tasks. Custom roles are saved configurations that can be reused across multiple sessions.
|
193
|
+
|
194
|
+
Basic usage:
|
195
|
+
```bash
|
196
|
+
# Create a new role
|
197
|
+
ngpt --role-config create expert_coder
|
198
|
+
|
199
|
+
# Use a role
|
200
|
+
ngpt --role expert_coder "Write a function to validate email addresses"
|
201
|
+
```
|
202
|
+
|
203
|
+
For detailed documentation on creating and managing roles, including examples and best practices, see the [Custom Roles Guide](roles.md).
|
204
|
+
|
186
205
|
### Custom System Prompts
|
187
206
|
|
188
207
|
Use custom system prompts to guide the AI's behavior and responses:
|
@@ -517,6 +536,9 @@ ngpt --shell --no-stream "find all large files and create a report"
|
|
517
536
|
|
518
537
|
# Git commit message with pretty formatting
|
519
538
|
ngpt --gitcommsg --prettify
|
539
|
+
|
540
|
+
# Use a custom role with web search
|
541
|
+
ngpt --role technical_writer --web-search "Write documentation for a REST API"
|
520
542
|
```
|
521
543
|
|
522
544
|
### Provider Selection
|
@@ -657,6 +679,7 @@ Visit the [GitHub repository](https://github.com/nazdridoy/ngpt) for:
|
|
657
679
|
## Next Steps
|
658
680
|
|
659
681
|
- Learn about [CLI Configuration](cli_config.md)
|
682
|
+
- Explore [Custom Roles Guide](roles.md)
|
660
683
|
- Explore [Git Commit Message Generation](gitcommsg.md)
|
661
684
|
- Try [Basic Examples](../examples/basic.md)
|
662
|
-
- Check [Advanced Examples](../examples/advanced.md)
|
685
|
+
- Check [Advanced Examples](../examples/advanced.md)
|