npcsh 1.0.11__tar.gz → 1.0.13__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 (31) hide show
  1. npcsh-1.0.13/PKG-INFO +775 -0
  2. npcsh-1.0.13/README.md +679 -0
  3. {npcsh-1.0.11 → npcsh-1.0.13}/npcsh/_state.py +89 -1
  4. {npcsh-1.0.11 → npcsh-1.0.13}/npcsh/alicanto.py +22 -7
  5. {npcsh-1.0.11 → npcsh-1.0.13}/npcsh/npcsh.py +434 -492
  6. npcsh-1.0.13/npcsh/plonk.py +342 -0
  7. {npcsh-1.0.11 → npcsh-1.0.13}/npcsh/routes.py +367 -162
  8. npcsh-1.0.13/npcsh/spool.py +259 -0
  9. npcsh-1.0.13/npcsh.egg-info/PKG-INFO +775 -0
  10. {npcsh-1.0.11 → npcsh-1.0.13}/npcsh.egg-info/requires.txt +1 -0
  11. {npcsh-1.0.11 → npcsh-1.0.13}/setup.py +3 -2
  12. npcsh-1.0.11/PKG-INFO +0 -596
  13. npcsh-1.0.11/README.md +0 -501
  14. npcsh-1.0.11/npcsh/plonk.py +0 -409
  15. npcsh-1.0.11/npcsh/spool.py +0 -318
  16. npcsh-1.0.11/npcsh.egg-info/PKG-INFO +0 -596
  17. {npcsh-1.0.11 → npcsh-1.0.13}/LICENSE +0 -0
  18. {npcsh-1.0.11 → npcsh-1.0.13}/npcsh/__init__.py +0 -0
  19. {npcsh-1.0.11 → npcsh-1.0.13}/npcsh/guac.py +0 -0
  20. {npcsh-1.0.11 → npcsh-1.0.13}/npcsh/mcp_helpers.py +0 -0
  21. {npcsh-1.0.11 → npcsh-1.0.13}/npcsh/mcp_npcsh.py +0 -0
  22. {npcsh-1.0.11 → npcsh-1.0.13}/npcsh/mcp_server.py +0 -0
  23. {npcsh-1.0.11 → npcsh-1.0.13}/npcsh/npc.py +0 -0
  24. {npcsh-1.0.11 → npcsh-1.0.13}/npcsh/pti.py +0 -0
  25. {npcsh-1.0.11 → npcsh-1.0.13}/npcsh/wander.py +0 -0
  26. {npcsh-1.0.11 → npcsh-1.0.13}/npcsh/yap.py +0 -0
  27. {npcsh-1.0.11 → npcsh-1.0.13}/npcsh.egg-info/SOURCES.txt +0 -0
  28. {npcsh-1.0.11 → npcsh-1.0.13}/npcsh.egg-info/dependency_links.txt +0 -0
  29. {npcsh-1.0.11 → npcsh-1.0.13}/npcsh.egg-info/entry_points.txt +0 -0
  30. {npcsh-1.0.11 → npcsh-1.0.13}/npcsh.egg-info/top_level.txt +0 -0
  31. {npcsh-1.0.11 → npcsh-1.0.13}/setup.cfg +0 -0
npcsh-1.0.13/PKG-INFO ADDED
@@ -0,0 +1,775 @@
1
+ Metadata-Version: 2.4
2
+ Name: npcsh
3
+ Version: 1.0.13
4
+ Summary: npcsh is a command-line toolkit for using AI agents in novel ways.
5
+ Home-page: https://github.com/NPC-Worldwide/npcsh
6
+ Author: Christopher Agostino
7
+ Author-email: info@npcworldwi.de
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: npcpy
14
+ Requires-Dist: jinja2
15
+ Requires-Dist: litellm
16
+ Requires-Dist: docx
17
+ Requires-Dist: scipy
18
+ Requires-Dist: numpy
19
+ Requires-Dist: requests
20
+ Requires-Dist: matplotlib
21
+ Requires-Dist: markdown
22
+ Requires-Dist: networkx
23
+ Requires-Dist: PyYAML
24
+ Requires-Dist: PyMuPDF
25
+ Requires-Dist: pyautogui
26
+ Requires-Dist: pydantic
27
+ Requires-Dist: pygments
28
+ Requires-Dist: sqlalchemy
29
+ Requires-Dist: termcolor
30
+ Requires-Dist: rich
31
+ Requires-Dist: colorama
32
+ Requires-Dist: Pillow
33
+ Requires-Dist: python-dotenv
34
+ Requires-Dist: pandas
35
+ Requires-Dist: beautifulsoup4
36
+ Requires-Dist: duckduckgo-search
37
+ Requires-Dist: flask
38
+ Requires-Dist: flask_cors
39
+ Requires-Dist: redis
40
+ Requires-Dist: psycopg2-binary
41
+ Requires-Dist: flask_sse
42
+ Provides-Extra: lite
43
+ Requires-Dist: anthropic; extra == "lite"
44
+ Requires-Dist: openai; extra == "lite"
45
+ Requires-Dist: google-generativeai; extra == "lite"
46
+ Requires-Dist: google-genai; extra == "lite"
47
+ Provides-Extra: local
48
+ Requires-Dist: sentence_transformers; extra == "local"
49
+ Requires-Dist: opencv-python; extra == "local"
50
+ Requires-Dist: ollama; extra == "local"
51
+ Requires-Dist: kuzu; extra == "local"
52
+ Requires-Dist: chromadb; extra == "local"
53
+ Requires-Dist: diffusers; extra == "local"
54
+ Requires-Dist: nltk; extra == "local"
55
+ Requires-Dist: torch; extra == "local"
56
+ Provides-Extra: yap
57
+ Requires-Dist: pyaudio; extra == "yap"
58
+ Requires-Dist: gtts; extra == "yap"
59
+ Requires-Dist: playsound==1.2.2; extra == "yap"
60
+ Requires-Dist: pygame; extra == "yap"
61
+ Requires-Dist: faster_whisper; extra == "yap"
62
+ Requires-Dist: pyttsx3; extra == "yap"
63
+ Provides-Extra: mcp
64
+ Requires-Dist: mcp; extra == "mcp"
65
+ Provides-Extra: all
66
+ Requires-Dist: anthropic; extra == "all"
67
+ Requires-Dist: openai; extra == "all"
68
+ Requires-Dist: google-generativeai; extra == "all"
69
+ Requires-Dist: google-genai; extra == "all"
70
+ Requires-Dist: sentence_transformers; extra == "all"
71
+ Requires-Dist: opencv-python; extra == "all"
72
+ Requires-Dist: ollama; extra == "all"
73
+ Requires-Dist: kuzu; extra == "all"
74
+ Requires-Dist: chromadb; extra == "all"
75
+ Requires-Dist: diffusers; extra == "all"
76
+ Requires-Dist: nltk; extra == "all"
77
+ Requires-Dist: torch; extra == "all"
78
+ Requires-Dist: pyaudio; extra == "all"
79
+ Requires-Dist: gtts; extra == "all"
80
+ Requires-Dist: playsound==1.2.2; extra == "all"
81
+ Requires-Dist: pygame; extra == "all"
82
+ Requires-Dist: faster_whisper; extra == "all"
83
+ Requires-Dist: pyttsx3; extra == "all"
84
+ Requires-Dist: mcp; extra == "all"
85
+ Dynamic: author
86
+ Dynamic: author-email
87
+ Dynamic: classifier
88
+ Dynamic: description
89
+ Dynamic: description-content-type
90
+ Dynamic: home-page
91
+ Dynamic: license-file
92
+ Dynamic: provides-extra
93
+ Dynamic: requires-dist
94
+ Dynamic: requires-python
95
+ Dynamic: summary
96
+
97
+ <p align="center">
98
+ <a href= "https://github.com/npc-worldwide/npcsh/blob/main/docs/npcsh.md">
99
+ <img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/npcsh/npcsh.png" alt="npcsh logo" width=250></a>
100
+ </p>
101
+
102
+ # NPC Shell
103
+
104
+ The NPC shell is a suite of executable command-line programs that allow users to easily interact with NPCs and LLMs through a command line shell.
105
+
106
+ Programs within the NPC shell use the properties defined in `~/.npcshrc`, which is generated upon installation and running of `npcsh` for the first time.
107
+
108
+ To get started:
109
+ ```
110
+ pip install 'npcsh[local]'
111
+ ```
112
+ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc` cli, `yap` `pti`, `wander`, and `spool`.
113
+
114
+
115
+ # npcsh
116
+ - An AI-powered shell that parses bash, natural language, and special macro calls, `npcsh` processes your input accordingly, agentically, and automatically.
117
+
118
+
119
+ - Get help with a task:
120
+ ```
121
+ npcsh:🤖sibiji:gemini-2.5-flash>can you help me identify what process is listening on port 5337?
122
+ ```
123
+ <p align="center">
124
+ <img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/test_data/port5337.png" alt="example of running npcsh to check what processes are listening on port 5337", width=250>
125
+ </p>
126
+ - Edit files
127
+
128
+ - **Ask a Generic Question**
129
+ ```bash
130
+ npc 'has there ever been a better pasta shape than bucatini?'
131
+ ```
132
+ ```
133
+ .Loaded .env file...
134
+ Initializing database schema...
135
+ Database schema initialization complete.
136
+ Processing prompt: 'has there ever been a better pasta shape than bucatini?' with NPC: 'sibiji'...
137
+ • Action chosen: answer_question
138
+ • Explanation given: The question is a general opinion-based inquiry about pasta shapes and can be answered without external data or jinx invocation.
139
+ ...............................................................................
140
+ Bucatini is certainly a favorite for many due to its unique hollow center, which holds sauces beautifully. Whether it's "better" is subjective and depends on the dish and personal
141
+ preference. Shapes like orecchiette, rigatoni, or trofie excel in different recipes. Bucatini stands out for its versatility and texture, making it a top contender among pasta shapes!
142
+ ```
143
+
144
+
145
+ - **Search the Web**
146
+ ```bash
147
+ /search "cal golden bears football schedule" -sp perplexity
148
+ ```
149
+ <p align="center">
150
+ <img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/test_data/search_example.png" alt="example of search results", width=250>
151
+ </p>
152
+
153
+ - **Computer Use**
154
+ ```bash
155
+ /plonk -n 'npc_name' -sp 'task for plonk to carry out'
156
+ ```
157
+
158
+ - **Generate Image**
159
+ ```bash
160
+ /vixynt 'generate an image of a rabbit eating ham in the brink of dawn' model='gpt-image-1' provider='openai'
161
+ ```
162
+ <p align="center">
163
+ <img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/test_data/rabbit.PNG" alt="a rabbit eating ham in the bring of dawn", width=250>
164
+ </p>
165
+ - **Generate Video**
166
+ ```bash
167
+ /roll 'generate a video of a hat riding a dog'
168
+ ```
169
+ <p align="center">
170
+ <img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/test_data/hat_video.mp4" alt="video of a hat riding a dog", width=250>
171
+ </p>
172
+
173
+ - **Serve an NPC Team**
174
+ ```bash
175
+ /serve --port 5337 --cors='http://localhost:5137/'
176
+ ```
177
+ - **Screenshot Analysis**
178
+ ```bash
179
+ /ots
180
+ ```
181
+
182
+
183
+ # Macros
184
+ - activated by invoking `/<command> ...` in `npcsh`, macros can be called in bash or through the `npc` CLI. In our examples, we provide both `npcsh` calls as well as bash calls with the `npc` cli where relevant. For converting any `/<command>` in `npcsh` to a bash version, replace the `/` with `npc ` and the macro command will be invoked as a positional argument. Some, like breathe, flush,
185
+
186
+ - ## TL; DR:
187
+ - `/alicanto` - Conduct deep research with multiple perspectives, identifying gold insights and cliff warnings
188
+ - `/brainblast` - Execute an advanced chunked search on command history
189
+ - `/breathe` - Condense context on a regular cadence
190
+ - `/compile` - Compile NPC profiles
191
+ - `/flush` - Flush the last N messages
192
+ - `/guac` - Enter guac mode
193
+ - `/help` - Show help for commands, NPCs, or Jinxs. Usage: /help
194
+ - `/init` - Initialize NPC project
195
+ - `/jinxs` - Show available jinxs for the current NPC/Team
196
+ - `/ots` - Take screenshot and analyze with vision model
197
+ - `/plan` - Execute a plan command\n\n/plonk - Use vision model to interact with GUI. Usage: /plonk <task description>
198
+ - `/pti` - Use pardon-the-interruption mode to interact with reasoning model LLM
199
+ - `/rag` - Execute a RAG command using ChromaDB embeddings with optional file input (-f/--file)
200
+ - `/roll` - generate a video with video generation model
201
+ - `/sample` - Send a prompt directly to the LLM
202
+ - `/search` - Execute a web search command
203
+ - `/serve` - Serve an NPC Team server.
204
+ - `/set` - Set configuration values
205
+ - `/sleep` - Evolve knowledge graph with options for dreaming.
206
+ - `/spool` - Enter interactive chat (spool) mode
207
+ - `/trigger` - Execute a trigger command
208
+ - `/vixynt` - Generate images from text descriptions
209
+ - `/wander` - Enter wander mode (experimental)
210
+ - `/yap` - Enter voice chat (yap) mode
211
+
212
+ ## Common Command-Line Flags\n\nThe shortest unambiguous prefix works (e.g., `-t` for `--temperature`).
213
+
214
+ ```
215
+ Flag Shorthand | Flag Shorthand | Flag Shorthand | Flag Shorthand
216
+ ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------
217
+ --attachments (-a) | --height (-h) | --num_npcs (-num_n) | --team (-tea)
218
+ --config_dir (-con) | --igmodel (-igm) | --output_file (-o) | --temperature (-tem)
219
+ --cors (-cor) | --igprovider (-igp) | --plots_dir (-pl) | --top_k
220
+ --creativity (-cr) | --lang (-l) | --port (-po) | --top_p
221
+ --depth (-d) | --max_tokens (-ma) | --provider (-pr) | --vmodel (-vm)
222
+ --emodel (-em) | --messages (-me) | --refresh_period (-re) | --vprovider (-vp)
223
+ --eprovider (-ep) | --model (-mo) | --rmodel (-rm) | --width (-w)
224
+ --exploration (-ex) | --npc (-np) | --rprovider (-rp) |
225
+ --format (-f) | --num_frames (-num_f) | --sprovider (-s) |
226
+ ```
227
+ '
228
+
229
+ - ## alicanto: a research exploration agent flow.
230
+
231
+ <p align="center"><a href ="https://github.com/npc-worldwide/npcsh/blob/main/docs/alicanto.md">
232
+ <img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/npcsh/npc_team/alicanto.png" alt="logo for deep research", width=250></a>
233
+ </p>
234
+
235
+ - Examples:
236
+ ```bash
237
+ # npcsh
238
+ /alicanto "What are the implications of quantum computing for cybersecurity?"
239
+ /alicanto "How might climate change impact global food security?" --num-npcs 8 --depth 5
240
+ ```
241
+
242
+ ```bash
243
+ # bash
244
+ npc alicanto "What ethical considerations should guide AI development?" --max_facts_per_chain 0.5 --max_thematic_groups 3 --max_criticisms_per_group 3 max_conceptual_combinations 3 max_experiments 10
245
+
246
+ npc alicanto "What is the future of remote work?" --format report
247
+ ```
248
+ - ## Brainblast: searching through past messages:
249
+ ```bash
250
+ # npcsh
251
+ /brainblast 'subtle summer winds' --top_k 10
252
+ ```
253
+ ```bash
254
+ # bash
255
+ npc brainblast 'python dictionaries'
256
+ ```
257
+ - ## Breathe: Condense conversation context (shell only):
258
+ ```bash
259
+ # npcsh
260
+ /breathe
261
+ /breathe -p ollama -m qwen3:latest
262
+ ```
263
+ - ## Compile: render npcs for use without re-loading npcsh
264
+ ```bash
265
+ # npcsh
266
+ /compile /path/to/npc
267
+ ```
268
+ - ## flush: flush context (shell only):
269
+ ```bash
270
+ /flush
271
+ ```
272
+
273
+
274
+ - ## `guac`
275
+
276
+ <p align="center"><a href ="https://github.com/npc-worldwide/npcsh/blob/main/docs/guac.md">
277
+ <img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/npcsh/npc_team/guac.png" alt="npcsh logo of a solarpunk sign", width=250></a>
278
+ </p>
279
+
280
+ - a replacement shell for interpreters like python/r/node/julia with an avocado input marker 🥑 that brings a pomodoro-like approach to interactive coding.
281
+ - Simulation:
282
+ `🥑 Make a markov chain simulation of a random walk in 2D space with 1000 steps and visualize`
283
+ ```
284
+ # Generated python code:
285
+ import numpy as np
286
+ import matplotlib.pyplot as plt
287
+
288
+ # Number of steps
289
+ n_steps = 1000
290
+
291
+ # Possible moves: up, down, left, right
292
+ moves = np.array([[0, 1], [0, -1], [1, 0], [-1, 0]])
293
+
294
+ # Initialize position array
295
+ positions = np.zeros((n_steps+1, 2), dtype=int)
296
+
297
+ # Generate random moves
298
+ for i in range(1, n_steps+1):
299
+ step = moves[np.random.choice(4)]
300
+ positions[i] = positions[i-1] + step
301
+
302
+ # Plot the random walk
303
+ plt.figure(figsize=(8, 8))
304
+ plt.plot(positions[:, 0], positions[:, 1], lw=1)
305
+ plt.scatter([positions[0, 0]], [positions[0, 1]], color='green', label='Start')
306
+ plt.scatter([positions[-1, 0]], [positions[-1, 1]], color='red', label='End')
307
+ plt.title('2D Random Walk - 1000 Steps (Markov Chain)')
308
+ plt.xlabel('X Position')
309
+ plt.ylabel('Y Position')
310
+ plt.legend()
311
+ plt.grid(True)
312
+ plt.axis('equal')
313
+ plt.show()
314
+ # Generated code executed successfully
315
+
316
+ ```
317
+ <p align="center">
318
+ <img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/test_data/markov_chain.png" alt="markov_chain_figure", width=250>
319
+ </p>
320
+
321
+ Access the variables created in the code:
322
+ `🥑 print(positions)`
323
+ ```
324
+ [[ 0 0]
325
+ [ 0 -1]
326
+ [ -1 -1]
327
+ ...
328
+ [ 29 -23]
329
+ [ 28 -23]
330
+ [ 27 -23]]
331
+ ```
332
+
333
+ - Run a python script:
334
+ `🥑 run file.py`
335
+ - Refresh:
336
+ `🥑 /refresh`
337
+ - Show current variables:
338
+ `🥑 /show`
339
+
340
+ A guac session progresses through a series of stages, each of equal length. Each stage adjusts the emoji input prompt. Once the stages have passed, it is time to refresh. Stage 1: `🥑`, Stage 2: `🥑🔪` Stage 3: `🥑🥣` Stage:4 `🥑🥣🧂`, `Stage 5: 🥘 TIME TO REFRESH`. At stage 5, the user is reminded to refresh with the /refresh macro. This will evaluate the session so farand suggest and implement new functions or automations that will aid in future sessions, with the ultimate approval of the user.
341
+
342
+
343
+ - ## help:/ Show help for commands, NPCs, or Jinxs.
344
+ ```bash
345
+ /help
346
+ ```
347
+ - ## init - Initialize NPC project
348
+ - ## jinxs : show available jinxs
349
+ - ## ots: Over-the-shoulder screen shot analysis
350
+ - Screenshot analysis:
351
+ ```bash
352
+ #npcsh
353
+ /ots
354
+ /ots output_filename =...
355
+ ```
356
+ ```bash
357
+ #bash
358
+ npc ots ...
359
+ ```
360
+ - ## `plan`: set up cron jobs:
361
+ ```bash
362
+ # npcsh
363
+ /plan 'a description of a cron job to implement' -m gemma3:27b -p ollama
364
+ ```
365
+ ```bash
366
+ # bash
367
+ npc plan
368
+ ```
369
+
370
+ - ## `plonk`: Computer use:
371
+ ```bash
372
+ # npcsh
373
+ /plonk -n 'npc_name' -sp 'task for plonk to carry out '
374
+
375
+ #bash
376
+ npc plonk
377
+ ```
378
+ - ## `pti`: a reasoning REPL loop with interruptions
379
+
380
+ ```npcsh
381
+ /pti -n frederic -m qwen3:latest -p ollama
382
+ ```
383
+
384
+ Or from the bash cmd line:
385
+ ```bash
386
+ pti
387
+ ```
388
+ <p align="center"><a href ="https://github.com/npc-worldwide/npcsh/blob/main/docs/pti.md">
389
+ <img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/npcsh/npc_team/frederic4.png" alt="npcsh logo of frederic the bear and the pti logo", width=250></a>
390
+ </p>
391
+
392
+ - ## `rag`: embedding search through chroma db, optional file input
393
+ - ## `roll`: your video generation assistant
394
+ -
395
+ ```npcsh
396
+ /roll --provider ollama --model llama3
397
+ ```
398
+
399
+ - ## sample: one-shot sampling from LLMs with specific parameters
400
+ ```bash
401
+ # npcsh
402
+ /sample 'prompt'
403
+ /sample -m gemini-1.5-flash "Summarize the plot of 'The Matrix' in three sentences."
404
+
405
+ /sample --model claude-3-5-haiku-latest "Translate 'good morning' to Japanese."
406
+
407
+ /sample model=qwen3:latest "tell me about the last time you went shopping."
408
+
409
+
410
+ ```
411
+ ```bash
412
+ # bash
413
+ npc sample -p ollama -m gemma3:12b --temp 1.8 --top_k 50 "Write a haiku about the command line."
414
+
415
+ npc sample model=gpt-4o-mini "What are the primary colors?" --provider openai
416
+ ```
417
+
418
+ - ## search: use an internet search provider
419
+ ```npcsh
420
+ /search -sp perplexity 'cal bears football schedule'
421
+ /search --sprovider duckduckgo 'beef tongue'
422
+ # Other search providers could be added, but we have only integrated duckduckgo and perplexity for the moment.
423
+ ```
424
+
425
+ ```bash
426
+ npc search 'when is the moon gonna go away from the earth'
427
+ ```
428
+
429
+
430
+ - ## serve: serve an npc team
431
+ ```bash
432
+ /serve
433
+ /serve ....
434
+ # Other search providers could be added, but we have only integrated duckduckgo and perplexity for the moment.
435
+ ```
436
+
437
+ ```bash
438
+ npc serve
439
+ ```
440
+
441
+ - ## set: change current model, env params
442
+ ```bash
443
+ /set model ...
444
+ /set provider ...
445
+ /set NPCSH_API_URL https://localhost:1937
446
+ ```
447
+
448
+ ```bash
449
+ npc set ...
450
+ ```
451
+ - ## sleep: prune and evolve the current knowledge graph
452
+ ```bash
453
+ /sleep
454
+ /sleep --dream
455
+ /sleep --ops link_facts,deepen
456
+ ```
457
+
458
+ ```bash
459
+ npc sleep
460
+ ```
461
+ - ## `spool`
462
+ <p align="center"><a href ="https://github.com/npc-worldwide/npcsh/blob/main/docs/spool.md">
463
+ <img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/npcsh/npc_team/spool.png" alt="logo for spool", width=250></a>
464
+ </p>
465
+
466
+ - Enter chat loop with isolated context, attachments, specified models/providers:
467
+ ```npcsh
468
+ /spool -n <npc_name>
469
+ /spool --attachments ./test_data/port5337.png,./test_data/yuan2004.pdf,./test_data/books.csv
470
+ /spool --provider ollama --model llama3
471
+ /spool -p deepseek -m deepseek-reasoner
472
+ /spool -n alicanto
473
+ ```
474
+
475
+
476
+
477
+ - ## Trigger: schedule listeners, daemons
478
+ ```bash
479
+ /trigger 'a description of a trigger to implement with system daemons/file system listeners.' -m gemma3:27b -p ollama
480
+ ```
481
+ ```bash
482
+ npc trigger
483
+ ```
484
+
485
+
486
+
487
+
488
+
489
+
490
+ - ## Vixynt: Image generation and editing:
491
+ ```bash
492
+ npcsh
493
+ /vixynt 'an image of a dog eating a hat'
494
+ /vixynt --output_file ~/Desktop/dragon.png "A terrifying dragon"
495
+ /vixynt "A photorealistic portrait of a cat wearing a wizard hat in the dungeon of the master and margarita" -w 1024. height=1024
496
+ /vixynt -igp ollama --igmodel Qwen/QwenImage --output_file /tmp/sub.png width=1024 height=512 "A detailed steampunk submarine exploring a vibrant coral reef, wide aspect ratio"
497
+ ```
498
+
499
+ ```bash
500
+ # bash
501
+ npc vixynt --attachments ./test_data/rabbit.PNG "Turn this rabbit into a fierce warrior in a snowy winter scene" -igp openai -igm gpt-image
502
+ npc vixynt --igmodel CompVis/stable-diffusion-v1-4 --igprovider diffusers "sticker of a red tree"
503
+ ```
504
+
505
+
506
+
507
+
508
+
509
+ - ## `wander`: daydreaming for LLMs
510
+
511
+ <p align="center"><a href ="https://github.com/npc-worldwide/npcsh/blob/main/docs/wander.md">
512
+ <img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/npcsh/npc_team/kadiefa.png" alt="logo for wander", width=250></a>
513
+ </p>
514
+ A system for thinking outside of the box. From our testing, it appears gpt-4o-mini and gpt-series models in general appear to wander the most through various languages and ideas with high temperatures. Gemini models and many llama ones appear more stable despite high temps. Thinking models in general appear to be worse at this task.
515
+
516
+ - Wander with an auto-generated environment
517
+ ```
518
+ npc --model "gemini-2.0-flash" --provider "gemini" wander "how does the bar of a galaxy influence the the surrounding IGM?" \
519
+ n-high-temp-streams=10 \
520
+ high-temp=1.95 \
521
+ low-temp=0.4 \
522
+ sample-rate=0.5 \
523
+ interruption-likelihood=1
524
+ ```
525
+ - Specify a custom environment
526
+ ```
527
+ npc --model "gpt-4o-mini" --provider "openai" wander "how does the goos-hanchen effect impact neutron scattering?" \
528
+ environment='a ships library in the south.' \
529
+ num-events=3 \
530
+ n-high-temp-streams=10 \
531
+ high-temp=1.95 \
532
+ low-temp=0.4 \
533
+ sample-rate=0.5 \
534
+ interruption-likelihood=1
535
+ ```
536
+ - Control event generation
537
+ ```
538
+ npc wander "what is the goos hanchen effect and does it affect water refraction?" \
539
+ --provider "ollama" \
540
+ --model "deepseek-r1:32b" \
541
+ environment="a vast, dark ocean ." \
542
+ interruption-likelihood=.1
543
+ ```
544
+
545
+ - ## `yap`: an agentic voice control loop
546
+
547
+
548
+ <p align="center"><a href ="https://github.com/npc-worldwide/npcsh/blob/main/docs/yap.md">
549
+ <img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/npcsh/npc_team/yap.png" alt="logo for yap ", width=250></a>
550
+ </p>
551
+
552
+ - an agentic voice control loop with a specified agent. When launching `yap`, the user enters the typical `npcsh` agentic loop except that the system is waiting for either text or audio input.
553
+ - voice chat:
554
+ ```bash
555
+ # npcsh
556
+ /yap
557
+ ```
558
+ ```bash
559
+ # bash
560
+ yap
561
+ npc yap
562
+ ```
563
+ - Show available Jinja Execution Templates:
564
+ ```bash
565
+ # npcsh
566
+ /jinxs
567
+ ```
568
+ ```bash
569
+ # bash
570
+ npc jinxs
571
+ ```
572
+
573
+
574
+
575
+ ## Inference Capabilities
576
+ - `npcsh` works with local and enterprise LLM providers through its LiteLLM integration, allowing users to run inference from Ollama, LMStudio, OpenAI, Anthropic, Gemini, and Deepseek, making it a versatile tool for both simple commands and sophisticated AI-driven tasks.
577
+
578
+ ## Read the Docs
579
+
580
+ Read the docs at [npcsh.readthedocs.io](https://npcsh.readthedocs.io/en/latest/)
581
+
582
+
583
+ ## NPC Studio
584
+ There is a graphical user interface that makes use of the NPC Toolkit through the NPC Studio. See the open source code for NPC Studio [here](https://github.com/npc-worldwide/npc-studio). Download the executables at [our website](https://enpisi.com/npc-studio).
585
+
586
+
587
+ ## Mailing List
588
+ Interested to stay in the loop and to hear the latest and greatest about `npcpy`, `npcsh`, and NPC Studio? Be sure to sign up for the [newsletter](https://forms.gle/n1NzQmwjsV4xv1B2A)!
589
+
590
+
591
+ ## Support
592
+ If you appreciate the work here, [consider supporting NPC Worldwide with a monthly donation](https://buymeacoffee.com/npcworldwide), [buying NPC-WW themed merch](https://enpisi.com/shop), or hiring us to help you explore how to use the NPC Toolkit and AI tools to help your business or research team, please reach out to info@npcworldwi.de .
593
+
594
+
595
+ ## Installation
596
+ `npcsh` is available on PyPI and can be installed using pip. Before installing, make sure you have the necessary dependencies installed on your system. Below are the instructions for installing such dependencies on Linux, Mac, and Windows. If you find any other dependencies that are needed, please let us know so we can update the installation instructions to be more accommodating.
597
+
598
+ ### Linux install
599
+ <details> <summary> Toggle </summary>
600
+
601
+ ```bash
602
+
603
+ # these are for audio primarily, skip if you dont need tts
604
+ sudo apt-get install espeak
605
+ sudo apt-get install portaudio19-dev python3-pyaudio
606
+ sudo apt-get install alsa-base alsa-utils
607
+ sudo apt-get install libcairo2-dev
608
+ sudo apt-get install libgirepository1.0-dev
609
+ sudo apt-get install ffmpeg
610
+
611
+ # for triggers
612
+ sudo apt install inotify-tools
613
+
614
+
615
+ #And if you don't have ollama installed, use this:
616
+ curl -fsSL https://ollama.com/install.sh | sh
617
+
618
+ ollama pull llama3.2
619
+ ollama pull llava:7b
620
+ ollama pull nomic-embed-text
621
+ pip install npcsh
622
+ # if you want to install with the API libraries
623
+ pip install 'npcsh[lite]'
624
+ # if you want the full local package set up (ollama, diffusers, transformers, cuda etc.)
625
+ pip install 'npcsh[local]'
626
+ # if you want to use tts/stt
627
+ pip install 'npcsh[yap]'
628
+ # if you want everything:
629
+ pip install 'npcsh[all]'
630
+
631
+ ```
632
+
633
+ </details>
634
+
635
+
636
+ ### Mac install
637
+
638
+ <details> <summary> Toggle </summary>
639
+
640
+ ```bash
641
+ #mainly for audio
642
+ brew install portaudio
643
+ brew install ffmpeg
644
+ brew install pygobject3
645
+
646
+ # for triggers
647
+ brew install inotify-tools
648
+
649
+
650
+ brew install ollama
651
+ brew services start ollama
652
+ ollama pull llama3.2
653
+ ollama pull llava:7b
654
+ ollama pull nomic-embed-text
655
+ pip install npcsh
656
+ # if you want to install with the API libraries
657
+ pip install npcsh[lite]
658
+ # if you want the full local package set up (ollama, diffusers, transformers, cuda etc.)
659
+ pip install npcsh[local]
660
+ # if you want to use tts/stt
661
+ pip install npcsh[yap]
662
+
663
+ # if you want everything:
664
+ pip install npcsh[all]
665
+ ```
666
+ </details>
667
+
668
+ ### Windows Install
669
+
670
+ <details> <summary> Toggle </summary>
671
+ Download and install ollama exe.
672
+
673
+ Then, in a powershell. Download and install ffmpeg.
674
+
675
+ ```powershell
676
+ ollama pull llama3.2
677
+ ollama pull llava:7b
678
+ ollama pull nomic-embed-text
679
+ pip install npcsh
680
+ # if you want to install with the API libraries
681
+ pip install 'npcsh[lite]'
682
+ # if you want the full local package set up (ollama, diffusers, transformers, cuda etc.)
683
+ pip install 'npcsh[local]'
684
+ # if you want to use tts/stt
685
+ pip install 'npcsh[yap]'
686
+
687
+ # if you want everything:
688
+ pip install 'npcsh[all]'
689
+ ```
690
+ As of now, npcsh appears to work well with some of the core functionalities like /ots and /yap.
691
+
692
+ </details>
693
+
694
+ ### Fedora Install (under construction)
695
+
696
+ <details> <summary> Toggle </summary>
697
+
698
+ ```bash
699
+ python3-dev #(fixes hnswlib issues with chroma db)
700
+ xhost + (pyautogui)
701
+ python-tkinter (pyautogui)
702
+ ```
703
+
704
+ </details>
705
+
706
+ ## Startup Configuration and Project Structure
707
+ After `npcsh` has been pip installed, `npcsh`, `guac`, `pti`, `spool`, `yap` and the `npc` CLI can be used as command line tools. To initialize these correctly, first start by starting the NPC shell:
708
+ ```bash
709
+ npcsh
710
+ ```
711
+ When initialized, `npcsh` will generate a .npcshrc file in your home directory that stores your npcsh settings.
712
+ Here is an example of what the .npcshrc file might look like after this has been run.
713
+ ```bash
714
+ # NPCSH Configuration File
715
+ export NPCSH_INITIALIZED=1
716
+ export NPCSH_CHAT_PROVIDER='ollama'
717
+ export NPCSH_CHAT_MODEL='llama3.2'
718
+ export NPCSH_DB_PATH='~/npcsh_history.db'
719
+ ```
720
+
721
+ `npcsh` also comes with a set of jinxs and NPCs that are used in processing. It will generate a folder at ~/.npcsh/ that contains the tools and NPCs that are used in the shell and these will be used in the absence of other project-specific ones. Additionally, `npcsh` records interactions and compiled information about npcs within a local SQLite database at the path specified in the .npcshrc file. This will default to ~/npcsh_history.db if not specified. When the data mode is used to load or analyze data in CSVs or PDFs, these data will be stored in the same database for future reference.
722
+
723
+ The installer will automatically add this file to your shell config, but if it does not do so successfully for whatever reason you can add the following to your .bashrc or .zshrc:
724
+
725
+ ```bash
726
+ # Source NPCSH configuration
727
+ if [ -f ~/.npcshrc ]; then
728
+ . ~/.npcshrc
729
+ fi
730
+ ```
731
+
732
+ We support inference via all providers supported by litellm. For openai-compatible providers that are not explicitly named in litellm, use simply `openai-like` as the provider. The default provider must be one of `['openai','anthropic','ollama', 'gemini', 'deepseek', 'openai-like']` and the model must be one available from those providers.
733
+
734
+ To use tools that require API keys, create an `.env` file in the folder where you are working or place relevant API keys as env variables in your ~/.npcshrc. If you already have these API keys set in a ~/.bashrc or a ~/.zshrc or similar files, you need not additionally add them to ~/.npcshrc or to an `.env` file. Here is an example of what an `.env` file might look like:
735
+
736
+ ```bash
737
+ export OPENAI_API_KEY="your_openai_key"
738
+ export ANTHROPIC_API_KEY="your_anthropic_key"
739
+ export DEEPSEEK_API_KEY='your_deepseek_key'
740
+ export GEMINI_API_KEY='your_gemini_key'
741
+ export PERPLEXITY_API_KEY='your_perplexity_key'
742
+ ```
743
+
744
+
745
+ Individual npcs can also be set to use different models and providers by setting the `model` and `provider` keys in the npc files.
746
+ Once initialized and set up, you will find the following in your ~/.npcsh directory:
747
+ ```bash
748
+ ~/.npcsh/
749
+ ├── npc_team/ # Global NPCs
750
+ │ ├── jinxs/ # Global tools
751
+ │ └── assembly_lines/ # Workflow pipelines
752
+
753
+ ```
754
+ For cases where you wish to set up a project specific set of NPCs, jinxs, and assembly lines, add a `npc_team` directory to your project and `npcsh` should be able to pick up on its presence, like so:
755
+ ```bash
756
+ ./npc_team/ # Project-specific NPCs
757
+ ├── jinxs/ # Project jinxs #example jinx next
758
+ │ └── example.jinx
759
+ └── assembly_lines/ # Project workflows
760
+ └── example.pipe
761
+ └── models/ # Project workflows
762
+ └── example.model
763
+ └── example1.npc # Example NPC
764
+ └── example2.npc # Example NPC
765
+ └── team.ctx # Example ctx
766
+
767
+
768
+ ```
769
+
770
+ ## Contributing
771
+ Contributions are welcome! Please submit issues and pull requests on the GitHub repository.
772
+
773
+
774
+ ## License
775
+ This project is licensed under the MIT License.