npcsh 1.0.13__tar.gz → 1.0.16__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 (27) hide show
  1. {npcsh-1.0.13 → npcsh-1.0.16}/PKG-INFO +108 -58
  2. {npcsh-1.0.13 → npcsh-1.0.16}/README.md +104 -57
  3. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh/_state.py +23 -41
  4. npcsh-1.0.16/npcsh/npc.py +242 -0
  5. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh/npcsh.py +124 -77
  6. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh/routes.py +16 -28
  7. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh/yap.py +115 -106
  8. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh.egg-info/PKG-INFO +108 -58
  9. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh.egg-info/requires.txt +3 -0
  10. {npcsh-1.0.13 → npcsh-1.0.16}/setup.py +4 -1
  11. npcsh-1.0.13/npcsh/npc.py +0 -216
  12. {npcsh-1.0.13 → npcsh-1.0.16}/LICENSE +0 -0
  13. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh/__init__.py +0 -0
  14. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh/alicanto.py +0 -0
  15. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh/guac.py +0 -0
  16. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh/mcp_helpers.py +0 -0
  17. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh/mcp_npcsh.py +0 -0
  18. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh/mcp_server.py +0 -0
  19. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh/plonk.py +0 -0
  20. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh/pti.py +0 -0
  21. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh/spool.py +0 -0
  22. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh/wander.py +0 -0
  23. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh.egg-info/SOURCES.txt +0 -0
  24. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh.egg-info/dependency_links.txt +0 -0
  25. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh.egg-info/entry_points.txt +0 -0
  26. {npcsh-1.0.13 → npcsh-1.0.16}/npcsh.egg-info/top_level.txt +0 -0
  27. {npcsh-1.0.13 → npcsh-1.0.16}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: npcsh
3
- Version: 1.0.13
3
+ Version: 1.0.16
4
4
  Summary: npcsh is a command-line toolkit for using AI agents in novel ways.
5
5
  Home-page: https://github.com/NPC-Worldwide/npcsh
6
6
  Author: Christopher Agostino
@@ -16,6 +16,8 @@ Requires-Dist: litellm
16
16
  Requires-Dist: docx
17
17
  Requires-Dist: scipy
18
18
  Requires-Dist: numpy
19
+ Requires-Dist: thefuzz
20
+ Requires-Dist: imagehash
19
21
  Requires-Dist: requests
20
22
  Requires-Dist: matplotlib
21
23
  Requires-Dist: markdown
@@ -39,6 +41,7 @@ Requires-Dist: flask_cors
39
41
  Requires-Dist: redis
40
42
  Requires-Dist: psycopg2-binary
41
43
  Requires-Dist: flask_sse
44
+ Requires-Dist: wikipedia
42
45
  Provides-Extra: lite
43
46
  Requires-Dist: anthropic; extra == "lite"
44
47
  Requires-Dist: openai; extra == "lite"
@@ -121,14 +124,15 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
121
124
  npcsh:🤖sibiji:gemini-2.5-flash>can you help me identify what process is listening on port 5337?
122
125
  ```
123
126
  <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>
127
+ <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=600>
125
128
  </p>
126
129
  - Edit files
127
130
 
128
131
  - **Ask a Generic Question**
129
132
  ```bash
130
- npc 'has there ever been a better pasta shape than bucatini?'
133
+ npcsh> has there ever been a better pasta shape than bucatini?
131
134
  ```
135
+
132
136
  ```
133
137
  .Loaded .env file...
134
138
  Initializing database schema...
@@ -147,12 +151,12 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
147
151
  /search "cal golden bears football schedule" -sp perplexity
148
152
  ```
149
153
  <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>
154
+ <img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/test_data/search_example.png" alt="example of search results", width=600>
155
+ </p>
152
156
 
153
157
  - **Computer Use**
154
158
  ```bash
155
- /plonk -n 'npc_name' -sp 'task for plonk to carry out'
159
+ /plonk 'find out the latest news on cnn'
156
160
  ```
157
161
 
158
162
  - **Generate Image**
@@ -166,9 +170,10 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
166
170
  ```bash
167
171
  /roll 'generate a video of a hat riding a dog'
168
172
  ```
173
+ <!--
169
174
  <p align="center">
170
175
  <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>
176
+ </p> -->
172
177
 
173
178
  - **Serve an NPC Team**
174
179
  ```bash
@@ -194,7 +199,8 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
194
199
  - `/init` - Initialize NPC project
195
200
  - `/jinxs` - Show available jinxs for the current NPC/Team
196
201
  - `/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>
202
+ - `/plan` - Execute a plan command
203
+ - `/plonk` - Use vision model to interact with GUI. Usage: /plonk <task description>
198
204
  - `/pti` - Use pardon-the-interruption mode to interact with reasoning model LLM
199
205
  - `/rag` - Execute a RAG command using ChromaDB embeddings with optional file input (-f/--file)
200
206
  - `/roll` - generate a video with video generation model
@@ -203,19 +209,19 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
203
209
  - `/serve` - Serve an NPC Team server.
204
210
  - `/set` - Set configuration values
205
211
  - `/sleep` - Evolve knowledge graph with options for dreaming.
206
- - `/spool` - Enter interactive chat (spool) mode
212
+ - `/spool` - Enter interactive chat (spool) mode with an npc with fresh context or files for rag
207
213
  - `/trigger` - Execute a trigger command
208
- - `/vixynt` - Generate images from text descriptions
209
- - `/wander` - Enter wander mode (experimental)
214
+ - `/vixynt` - Generate and edit images from text descriptions using local models, openai, gemini
215
+ - `/wander` - A method for LLMs to think on a problem by switching between states of high temperature and low temperature
210
216
  - `/yap` - Enter voice chat (yap) mode
211
217
 
212
- ## Common Command-Line Flags\n\nThe shortest unambiguous prefix works (e.g., `-t` for `--temperature`).
218
+ ## Common Command-Line Flags:
213
219
 
214
220
  ```
215
221
  Flag Shorthand | Flag Shorthand | Flag Shorthand | Flag Shorthand
216
222
  ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------
217
223
  --attachments (-a) | --height (-h) | --num_npcs (-num_n) | --team (-tea)
218
- --config_dir (-con) | --igmodel (-igm) | --output_file (-o) | --temperature (-tem)
224
+ --config_dir (-con) | --igmodel (-igm) | --output_file (-o) | --temperature (-t)
219
225
  --cors (-cor) | --igprovider (-igp) | --plots_dir (-pl) | --top_k
220
226
  --creativity (-cr) | --lang (-l) | --port (-po) | --top_p
221
227
  --depth (-d) | --max_tokens (-ma) | --provider (-pr) | --vmodel (-vm)
@@ -226,7 +232,7 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
226
232
  ```
227
233
  '
228
234
 
229
- - ## alicanto: a research exploration agent flow.
235
+ - ## `/alicanto`: a research exploration agent flow.
230
236
 
231
237
  <p align="center"><a href ="https://github.com/npc-worldwide/npcsh/blob/main/docs/alicanto.md">
232
238
  <img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/npcsh/npc_team/alicanto.png" alt="logo for deep research", width=250></a>
@@ -243,41 +249,44 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
243
249
  # bash
244
250
  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
251
 
246
- npc alicanto "What is the future of remote work?" --format report
252
+ npc alicanto "What is the future of remote work?" --format report # NOTE: Report generation and formatting requires latex installed.
247
253
  ```
248
- - ## Brainblast: searching through past messages:
254
+ - ## `/brainblast`: searching through past messages (soon to incorporate options for knowledge graph)
249
255
  ```bash
250
256
  # npcsh
251
257
  /brainblast 'subtle summer winds' --top_k 10
252
258
  ```
253
259
  ```bash
254
260
  # bash
255
- npc brainblast 'python dictionaries'
261
+ npc brainblast 'executing a mirror in the wonderous moon'
256
262
  ```
257
- - ## Breathe: Condense conversation context (shell only):
263
+ - ## `/breathe`: Condense conversation context (shell only):
258
264
  ```bash
259
265
  # npcsh
260
266
  /breathe
261
267
  /breathe -p ollama -m qwen3:latest
262
268
  ```
263
- - ## Compile: render npcs for use without re-loading npcsh
269
+ - ## `/compile`: render npcs for use without re-loading npcsh
264
270
  ```bash
265
271
  # npcsh
266
- /compile /path/to/npc
272
+ /compile ./npc_team/sibiji.npc
267
273
  ```
268
- - ## flush: flush context (shell only):
274
+ - ## `/flush`: flush context (shell only):
275
+ If you're in the NPC shell and have been in a conversation thats going nowhere and you want to start over... just flush theh contexf.
269
276
  ```bash
270
277
  /flush
271
278
  ```
272
279
 
273
280
 
274
- - ## `guac`
281
+ - ## `/guac`
275
282
 
276
283
  <p align="center"><a href ="https://github.com/npc-worldwide/npcsh/blob/main/docs/guac.md">
277
284
  <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
285
  </p>
279
286
 
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.
287
+ - a replacement shell for interpreters like python/r/node/julia with an avocado input marker 🥑 that brings a pomodoro-like approach to interactive coding.
288
+ - available as a standalone program runnable via the `guac` command after `npcsh` has been installed via pip.
289
+
281
290
  - Simulation:
282
291
  `🥑 Make a markov chain simulation of a random walk in 2D space with 1000 steps and visualize`
283
292
  ```
@@ -340,13 +349,61 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
340
349
  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
350
 
342
351
 
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
352
+ - ## `/help`: Show help for commands, NPCs, or Jinxs.
353
+ ```bash
354
+ /help
355
+ ```
356
+ ```
357
+ npc help
358
+ ```
359
+ - ## `/init` - Initialize NPC project
360
+ -set up bare bones infra for an npc team
361
+ ```bash
362
+ # npcsh
363
+ /init
364
+ ```
365
+ ```bash
366
+ # bash
367
+ npc init
368
+ ```
369
+
370
+
371
+ - ## `/jinxs` : show available jinxs for team
372
+ Jinxs are Jinja execution templates that let users develop small programs that can build on each other and reference each other through jinja templating. Jinx methods allow us to give smaller LLMs the scaffolding to perform `tool calling`, so to speak, reliably
373
+ ```bash
374
+ # npcsh
375
+ /jinxs
376
+ # bash
377
+ npc jinxs
378
+ ```
379
+
380
+ ```python
381
+ Available Jinxs:
382
+ --- Jinxs for NPC: sibiji ---
383
+
384
+ • /bash_executor: Execute bash queries.
385
+
386
+ • /calc: A jinx to simplify and evaluate mathematical expressions (/calc 1+5, /calc 47233*234234)
387
+
388
+ • /data_pull: Execute queries on the ~/npcsh_history.db to pull data. The database contains only information about conversations and other user-provided data. It does not store any information about individual files (/data_pull 'select * from conversation_history limit 10')
389
+
390
+
391
+ • /file_editor: Examines a file, determines what changes are needed, and applies those changes. (/file_editor filename.py 'instructions for carrying out the editing')
392
+
393
+ • /image_generation_jinx: Generates images based on a text prompt. (/image_generation_jinx 'prompt for llm' output_name )
394
+
395
+ • /internet_search: Searches the web for information based on a query in order to verify timiely details (e.g. current events) or to corroborate information in uncertain situations. Should be mainly only used when users
396
+ specifically request a search, otherwise an LLMs basic knowledge should be sufficient. ( /internet_search 'cost of cubs tickets' )
397
+ • /local_search: Searches files in current and downstream directories to find items related to the users query using fuzzy matching. (/local_search 'class NPC')
398
+ Returns only relevant snippets (10 lines around matches) to avoid including too much irrelevant content. Intended for fuzzy searches, not for understanding file sizes.
399
+
400
+ • /python_executor: Execute scripts with python. Set the ultimate result as the "output" variable. It must be a string. Do not add unnecessary print statements. (/python_executor 'import numpy as np; print(np.arange(1000))')
401
+ • /screen_capture_analysis_jinx: Captures the whole screen and sends the image for analysis (mostly redundant with /ots.)
402
+ ```
403
+
404
+
405
+
406
+ - ## `/ots`: Over-the-shoulder screen shot analysis
350
407
  - Screenshot analysis:
351
408
  ```bash
352
409
  #npcsh
@@ -357,17 +414,17 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
357
414
  #bash
358
415
  npc ots ...
359
416
  ```
360
- - ## `plan`: set up cron jobs:
417
+ - ## `/plan`: set up cron jobs:
361
418
  ```bash
362
419
  # npcsh
363
- /plan 'a description of a cron job to implement' -m gemma3:27b -p ollama
420
+ /plan 'set up a cron job that reminds me to stretch every thirty minutes' -m gemma3:27b -p ollama
364
421
  ```
365
422
  ```bash
366
423
  # bash
367
- npc plan
424
+ npc plan 'record my cpu usage percentage every 45 minutes'
368
425
  ```
369
426
 
370
- - ## `plonk`: Computer use:
427
+ - ## `/plonk`: Computer use:
371
428
  ```bash
372
429
  # npcsh
373
430
  /plonk -n 'npc_name' -sp 'task for plonk to carry out '
@@ -375,7 +432,7 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
375
432
  #bash
376
433
  npc plonk
377
434
  ```
378
- - ## `pti`: a reasoning REPL loop with interruptions
435
+ - ## `/pti`: a reasoning REPL loop with interruptions
379
436
 
380
437
  ```npcsh
381
438
  /pti -n frederic -m qwen3:latest -p ollama
@@ -389,14 +446,14 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
389
446
  <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
447
  </p>
391
448
 
392
- - ## `rag`: embedding search through chroma db, optional file input
393
- - ## `roll`: your video generation assistant
449
+ - ## `/rag`: embedding search through chroma db, optional file input
450
+ - ## `/roll`: your video generation assistant
394
451
  -
395
452
  ```npcsh
396
453
  /roll --provider ollama --model llama3
397
454
  ```
398
455
 
399
- - ## sample: one-shot sampling from LLMs with specific parameters
456
+ - ## `/sample`: one-shot sampling from LLMs with specific parameters
400
457
  ```bash
401
458
  # npcsh
402
459
  /sample 'prompt'
@@ -415,7 +472,7 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
415
472
  npc sample model=gpt-4o-mini "What are the primary colors?" --provider openai
416
473
  ```
417
474
 
418
- - ## search: use an internet search provider
475
+ - ## `/search`: use an internet search provider
419
476
  ```npcsh
420
477
  /search -sp perplexity 'cal bears football schedule'
421
478
  /search --sprovider duckduckgo 'beef tongue'
@@ -427,7 +484,7 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
427
484
  ```
428
485
 
429
486
 
430
- - ## serve: serve an npc team
487
+ - ## `/serve`: serve an npc team
431
488
  ```bash
432
489
  /serve
433
490
  /serve ....
@@ -438,7 +495,7 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
438
495
  npc serve
439
496
  ```
440
497
 
441
- - ## set: change current model, env params
498
+ - ## `/set`: change current model, env params
442
499
  ```bash
443
500
  /set model ...
444
501
  /set provider ...
@@ -448,7 +505,7 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
448
505
  ```bash
449
506
  npc set ...
450
507
  ```
451
- - ## sleep: prune and evolve the current knowledge graph
508
+ - ## `/sleep`: prune and evolve the current knowledge graph
452
509
  ```bash
453
510
  /sleep
454
511
  /sleep --dream
@@ -458,7 +515,7 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
458
515
  ```bash
459
516
  npc sleep
460
517
  ```
461
- - ## `spool`
518
+ - ## `/spool`
462
519
  <p align="center"><a href ="https://github.com/npc-worldwide/npcsh/blob/main/docs/spool.md">
463
520
  <img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/npcsh/npc_team/spool.png" alt="logo for spool", width=250></a>
464
521
  </p>
@@ -487,7 +544,7 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
487
544
 
488
545
 
489
546
 
490
- - ## Vixynt: Image generation and editing:
547
+ - ## `/vixynt`: Image generation and editing:
491
548
  ```bash
492
549
  npcsh
493
550
  /vixynt 'an image of a dog eating a hat'
@@ -506,7 +563,7 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
506
563
 
507
564
 
508
565
 
509
- - ## `wander`: daydreaming for LLMs
566
+ - ## `/wander`: daydreaming for LLMs
510
567
 
511
568
  <p align="center"><a href ="https://github.com/npc-worldwide/npcsh/blob/main/docs/wander.md">
512
569
  <img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/npcsh/npc_team/kadiefa.png" alt="logo for wander", width=250></a>
@@ -542,7 +599,7 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
542
599
  interruption-likelihood=.1
543
600
  ```
544
601
 
545
- - ## `yap`: an agentic voice control loop
602
+ - ## `/yap`: an agentic voice control loop
546
603
 
547
604
 
548
605
  <p align="center"><a href ="https://github.com/npc-worldwide/npcsh/blob/main/docs/yap.md">
@@ -560,20 +617,9 @@ Once installed, the following CLI tools will be available: `npcsh`, `guac`, `npc
560
617
  yap
561
618
  npc yap
562
619
  ```
563
- - Show available Jinja Execution Templates:
564
- ```bash
565
- # npcsh
566
- /jinxs
567
- ```
568
- ```bash
569
- # bash
570
- npc jinxs
571
- ```
572
-
573
-
574
620
 
575
621
  ## 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.
622
+ - `npcsh` works with local and enterprise LLM providers through its LiteLLM integration, allowing users to run inference from Ollama, LMStudio, vLLM, MLX, OpenAI, Anthropic, Gemini, and Deepseek, making it a versatile tool for both simple commands and sophisticated AI-driven tasks.
577
623
 
578
624
  ## Read the Docs
579
625
 
@@ -749,6 +795,10 @@ export PERPLEXITY_API_KEY='your_perplexity_key'
749
795
  ├── npc_team/ # Global NPCs
750
796
  │ ├── jinxs/ # Global tools
751
797
  │ └── assembly_lines/ # Workflow pipelines
798
+ │ └── example.npc # globally available npc
799
+ │ └── global.ctx # global context file
800
+
801
+
752
802
 
753
803
  ```
754
804
  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: