npcsh 1.0.16__py3-none-any.whl → 1.0.18__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.
- npcsh/_state.py +1541 -78
- npcsh/corca.py +709 -0
- npcsh/guac.py +1433 -596
- npcsh/mcp_server.py +64 -60
- npcsh/npc.py +5 -4
- npcsh/npcsh.py +27 -1334
- npcsh/pti.py +195 -215
- npcsh/routes.py +99 -26
- npcsh/spool.py +138 -144
- npcsh-1.0.18.dist-info/METADATA +483 -0
- npcsh-1.0.18.dist-info/RECORD +21 -0
- {npcsh-1.0.16.dist-info → npcsh-1.0.18.dist-info}/entry_points.txt +1 -1
- npcsh/mcp_npcsh.py +0 -822
- npcsh-1.0.16.dist-info/METADATA +0 -825
- npcsh-1.0.16.dist-info/RECORD +0 -21
- {npcsh-1.0.16.dist-info → npcsh-1.0.18.dist-info}/WHEEL +0 -0
- {npcsh-1.0.16.dist-info → npcsh-1.0.18.dist-info}/licenses/LICENSE +0 -0
- {npcsh-1.0.16.dist-info → npcsh-1.0.18.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: npcsh
|
|
3
|
+
Version: 1.0.18
|
|
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: thefuzz
|
|
20
|
+
Requires-Dist: imagehash
|
|
21
|
+
Requires-Dist: requests
|
|
22
|
+
Requires-Dist: chroptiks
|
|
23
|
+
Requires-Dist: matplotlib
|
|
24
|
+
Requires-Dist: markdown
|
|
25
|
+
Requires-Dist: networkx
|
|
26
|
+
Requires-Dist: PyYAML
|
|
27
|
+
Requires-Dist: PyMuPDF
|
|
28
|
+
Requires-Dist: pyautogui
|
|
29
|
+
Requires-Dist: pydantic
|
|
30
|
+
Requires-Dist: pygments
|
|
31
|
+
Requires-Dist: sqlalchemy
|
|
32
|
+
Requires-Dist: termcolor
|
|
33
|
+
Requires-Dist: rich
|
|
34
|
+
Requires-Dist: colorama
|
|
35
|
+
Requires-Dist: Pillow
|
|
36
|
+
Requires-Dist: python-dotenv
|
|
37
|
+
Requires-Dist: pandas
|
|
38
|
+
Requires-Dist: beautifulsoup4
|
|
39
|
+
Requires-Dist: duckduckgo-search
|
|
40
|
+
Requires-Dist: flask
|
|
41
|
+
Requires-Dist: flask_cors
|
|
42
|
+
Requires-Dist: redis
|
|
43
|
+
Requires-Dist: psycopg2-binary
|
|
44
|
+
Requires-Dist: flask_sse
|
|
45
|
+
Requires-Dist: wikipedia
|
|
46
|
+
Requires-Dist: mcp
|
|
47
|
+
Provides-Extra: lite
|
|
48
|
+
Requires-Dist: anthropic; extra == "lite"
|
|
49
|
+
Requires-Dist: openai; extra == "lite"
|
|
50
|
+
Requires-Dist: google-generativeai; extra == "lite"
|
|
51
|
+
Requires-Dist: google-genai; extra == "lite"
|
|
52
|
+
Provides-Extra: local
|
|
53
|
+
Requires-Dist: sentence_transformers; extra == "local"
|
|
54
|
+
Requires-Dist: opencv-python; extra == "local"
|
|
55
|
+
Requires-Dist: ollama; extra == "local"
|
|
56
|
+
Requires-Dist: kuzu; extra == "local"
|
|
57
|
+
Requires-Dist: chromadb; extra == "local"
|
|
58
|
+
Requires-Dist: diffusers; extra == "local"
|
|
59
|
+
Requires-Dist: nltk; extra == "local"
|
|
60
|
+
Requires-Dist: torch; extra == "local"
|
|
61
|
+
Requires-Dist: darts; extra == "local"
|
|
62
|
+
Provides-Extra: yap
|
|
63
|
+
Requires-Dist: pyaudio; extra == "yap"
|
|
64
|
+
Requires-Dist: gtts; extra == "yap"
|
|
65
|
+
Requires-Dist: playsound==1.2.2; extra == "yap"
|
|
66
|
+
Requires-Dist: pygame; extra == "yap"
|
|
67
|
+
Requires-Dist: faster_whisper; extra == "yap"
|
|
68
|
+
Requires-Dist: pyttsx3; extra == "yap"
|
|
69
|
+
Provides-Extra: all
|
|
70
|
+
Requires-Dist: anthropic; extra == "all"
|
|
71
|
+
Requires-Dist: openai; extra == "all"
|
|
72
|
+
Requires-Dist: google-generativeai; extra == "all"
|
|
73
|
+
Requires-Dist: google-genai; extra == "all"
|
|
74
|
+
Requires-Dist: sentence_transformers; extra == "all"
|
|
75
|
+
Requires-Dist: opencv-python; extra == "all"
|
|
76
|
+
Requires-Dist: ollama; extra == "all"
|
|
77
|
+
Requires-Dist: kuzu; extra == "all"
|
|
78
|
+
Requires-Dist: chromadb; extra == "all"
|
|
79
|
+
Requires-Dist: diffusers; extra == "all"
|
|
80
|
+
Requires-Dist: nltk; extra == "all"
|
|
81
|
+
Requires-Dist: torch; extra == "all"
|
|
82
|
+
Requires-Dist: darts; extra == "all"
|
|
83
|
+
Requires-Dist: pyaudio; extra == "all"
|
|
84
|
+
Requires-Dist: gtts; extra == "all"
|
|
85
|
+
Requires-Dist: playsound==1.2.2; extra == "all"
|
|
86
|
+
Requires-Dist: pygame; extra == "all"
|
|
87
|
+
Requires-Dist: faster_whisper; extra == "all"
|
|
88
|
+
Requires-Dist: pyttsx3; extra == "all"
|
|
89
|
+
Dynamic: author
|
|
90
|
+
Dynamic: author-email
|
|
91
|
+
Dynamic: classifier
|
|
92
|
+
Dynamic: description
|
|
93
|
+
Dynamic: description-content-type
|
|
94
|
+
Dynamic: home-page
|
|
95
|
+
Dynamic: license-file
|
|
96
|
+
Dynamic: provides-extra
|
|
97
|
+
Dynamic: requires-dist
|
|
98
|
+
Dynamic: requires-python
|
|
99
|
+
Dynamic: summary
|
|
100
|
+
|
|
101
|
+
<p align="center">
|
|
102
|
+
<a href= "https://github.com/npc-worldwide/npcsh/blob/main/docs/npcsh.md">
|
|
103
|
+
<img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/npcsh/npcsh.png" alt="npcsh logo" width=250></a>
|
|
104
|
+
</p>
|
|
105
|
+
|
|
106
|
+
# NPC Shell
|
|
107
|
+
|
|
108
|
+
The NPC shell is the toolkit for tomorrow, providing a suite of programs to make use of multi-modal LLMs and agents in novel interactive modes. `npcsh` is a command-line program, and so can be used wherever you work. `npcsh` is developed to work relibly with small models and performs excellently with the state-of-the-art models from major model providers.
|
|
109
|
+
|
|
110
|
+
To get started:
|
|
111
|
+
```bash
|
|
112
|
+
# for users who want to mainly use models through APIs (e.g. , gemini, grok, deepseek, anthropic, openai, mistral, , any others provided by litellm ):
|
|
113
|
+
pip install 'npcsh[lite]'
|
|
114
|
+
# for users who want to use local models (these install diffusers/transformers/torch stack so it is big.):
|
|
115
|
+
pip install 'npcsh[local]'
|
|
116
|
+
# for users who want to use the voice mode `yap`, see also the OS-specific installation instructions for installing needed system audio libraries
|
|
117
|
+
pip install 'npcsh[yap]'
|
|
118
|
+
```
|
|
119
|
+
Once installed: run
|
|
120
|
+
```bash
|
|
121
|
+
npcsh
|
|
122
|
+
```
|
|
123
|
+
and you will enter the NPC shell. Additionally, the pip installation includes making the following CLI tools available in bash: `corca`, `guac`, `npc` cli, `pti`, `spool`, `wander`, and`yap`.
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
# Usage
|
|
127
|
+
- Get help with a task:
|
|
128
|
+
```bash
|
|
129
|
+
npcsh:🤖sibiji:gemini-2.5-flash>can you help me identify what process is listening on port 5337?
|
|
130
|
+
```
|
|
131
|
+
<p align="center">
|
|
132
|
+
<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>
|
|
133
|
+
</p>
|
|
134
|
+
|
|
135
|
+
- Edit files
|
|
136
|
+
```bash
|
|
137
|
+
npcsh>please read through the markdown files in the docs folder and suggest changes based on the current implementation in the src folder
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
- **Ask a Generic Question**
|
|
141
|
+
```bash
|
|
142
|
+
npcsh> has there ever been a better pasta shape than bucatini?
|
|
143
|
+
```
|
|
144
|
+
```
|
|
145
|
+
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
|
|
146
|
+
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!
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
- **Search the Web**
|
|
151
|
+
```bash
|
|
152
|
+
/search "cal golden bears football schedule" -sp perplexity
|
|
153
|
+
```
|
|
154
|
+
<p align="center">
|
|
155
|
+
<img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/test_data/search_example.png" alt="example of search results", width=600>
|
|
156
|
+
</p>
|
|
157
|
+
|
|
158
|
+
- **Computer Use**
|
|
159
|
+
```bash
|
|
160
|
+
/plonk 'find out the latest news on cnn'
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
- **Generate Image**
|
|
164
|
+
```bash
|
|
165
|
+
/vixynt 'generate an image of a rabbit eating ham in the brink of dawn' model='gpt-image-1' provider='openai'
|
|
166
|
+
```
|
|
167
|
+
<p align="center">
|
|
168
|
+
<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>
|
|
169
|
+
</p>
|
|
170
|
+
- **Generate Video**
|
|
171
|
+
```bash
|
|
172
|
+
/roll 'generate a video of a hat riding a dog'
|
|
173
|
+
```
|
|
174
|
+
<!--
|
|
175
|
+
<p align="center">
|
|
176
|
+
<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>
|
|
177
|
+
</p> -->
|
|
178
|
+
|
|
179
|
+
- **Serve an NPC Team**
|
|
180
|
+
```bash
|
|
181
|
+
/serve --port 5337 --cors='http://localhost:5137/'
|
|
182
|
+
```
|
|
183
|
+
- **Screenshot Analysis**: select an area on your screen and then send your question to the LLM
|
|
184
|
+
```bash
|
|
185
|
+
/ots
|
|
186
|
+
```
|
|
187
|
+
- **Use an mcp server**: make use of NPCs with MCP servers.
|
|
188
|
+
```bash
|
|
189
|
+
/corca --mcp-server-path /path.to.server.py
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
# NPC Data Layer
|
|
194
|
+
|
|
195
|
+
The core of npcsh's capabilities is powered by the NPC Data Layer. Upon initialization, a user will be prompted to make a team in the current directory or to use a global team stored in `~/.npcsh/` which houses the NPC team with its jinxs, models, contexts, assembly lines. By implementing these components as simple data structures, users can focus on tweaking the relevant parts of their multi-agent systems.
|
|
196
|
+
|
|
197
|
+
## Creating Custom Components
|
|
198
|
+
|
|
199
|
+
Users can extend NPC capabilities through simple YAML files:
|
|
200
|
+
|
|
201
|
+
- **NPCs** (.npc): are defined with a name, primary directive, and optional model specifications
|
|
202
|
+
- **Jinxs** (.jinx): specify function-like capabilities with preprocessing, execution, and postprocessing steps
|
|
203
|
+
- **Context** (.ctx): Specify contextual information, team preferences, MCP server paths, database connections, and other environment variables that are loaded for the team. Teams are specified by their path and the team name in the `<team>.ctx` file. Teams organize collections of NPCs with shared context and specify a coordinator within the team context
|
|
204
|
+
|
|
205
|
+
The NPC Shell system integrates the capabilities of `npcpy` to maintain conversation history, track command execution, and provide intelligent autocomplete through an extensible command routing system. State is preserved between sessions, allowing for continuous knowledge building over time.
|
|
206
|
+
|
|
207
|
+
This architecture enables complex AI workflows while maintaining a simple, declarative syntax that abstracts away implementation complexity. By organizing AI capabilities as composable data structures rather than code, npcsh creates a more accessible and adaptable framework for AI automation.
|
|
208
|
+
|
|
209
|
+
# Macros
|
|
210
|
+
- 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,
|
|
211
|
+
|
|
212
|
+
- `/alicanto` - Conduct deep research with multiple perspectives, identifying gold insights and cliff warnings. Usage: `/alicanto 'query to be researched' --num-npcs <int> --depth <int>`
|
|
213
|
+
- `/brainblast` - Execute an advanced chunked search on command history. Usage: `/brainblast 'query' --top_k 10`
|
|
214
|
+
- `/breathe` - Condense context on a regular cadence. Usage: `/breathe -p <provider: NPCSH_CHAT_PROVIDER> -m <model: NPCSH_CHAT_MODEL>`
|
|
215
|
+
- `/compile` - Compile NPC profiles. Usage: `/compile <path_to_npc> `
|
|
216
|
+
- `/corca` - Enter the Corca MCP-powered agentic shell. Usage: `/corca [--mcp-server-path path]`
|
|
217
|
+
- `/flush` - Flush the last N messages. Usage: `/flush N=10`
|
|
218
|
+
- `/guac` - Enter guac mode. Usage: `/guac`
|
|
219
|
+
- `/help` - Show help for commands, NPCs, or Jinxs. Usage: `/help`
|
|
220
|
+
- `/init` - Initialize NPC project. Usage: `/init`
|
|
221
|
+
- `/jinxs` - Show available jinxs for the current NPC/Team. Usage: `/jinxs`
|
|
222
|
+
- `/<jinx_name>` - Run a jinx with specified command line arguments. `/<jinx_name> jinx_arg1 jinx_arg2`
|
|
223
|
+
- `/npc-studio` - Start npc studio. Pulls NPC Studio github to `~/.npcsh/npc-studio` and launches it in development mode after installing necessary NPM dependencies.Usage: `/npc-studio`
|
|
224
|
+
- `/ots` - Take screenshot and analyze with vision model. Usage: `/ots filename=<output_file_name_for_screenshot>` then select an area, and you will be prompted for your request.
|
|
225
|
+
- `/plan` - Execute a plan command. Usage: `/plan 'idea for a cron job to be set up to accomplish'`
|
|
226
|
+
- `/plonk` - Use vision model to interact with GUI. Usage: `/plonk '<task description>' `
|
|
227
|
+
- `/pti` - Use pardon-the-interruption mode to interact with reasoning model LLM. Usage: `/pti`
|
|
228
|
+
- `/rag` - Execute a RAG command using ChromaDB embeddings with optional file input (-f/--file). Usage: `/rag '<query_to_rag>' --emodel <NPCSH_EMBEDDING_MODEL> --eprovider <NPCSH_EMBEDDING_PROVIDER>`
|
|
229
|
+
- `/roll` - generate a video with video generation model. Usage: `/roll '<description_for_a_movie>' --vgmodel <NPCSH_VIDEO_GEN_MODEL> --vgprovider <NPCSH_VIDEO_GEN_PROVIDER>`
|
|
230
|
+
- `/sample` - Send a context-free prompt to an LLM, letting you get fresh answers without needing to start a separate conversation/shell. Usage: `/sample -m <NPCSH_CHAT_MODEL> 'question to sample --temp <float> --top_k int`
|
|
231
|
+
- `/search` - Execute a web search command. Usage: `/search 'search query' --sprovider <provider>` where provider is currently limited to DuckDuckGo and Perplexity. Wikipedia integration ongoing.
|
|
232
|
+
- `/serve` - Serve an NPC Team server.
|
|
233
|
+
- `/set` - Set configuration values.
|
|
234
|
+
- Usage:
|
|
235
|
+
- `/set model gemma3:4b`,
|
|
236
|
+
- `/set provider ollama`,
|
|
237
|
+
- `/set NPCSH_VIDEO_GEN_PROVIDER diffusers`
|
|
238
|
+
- `/sleep` - Evolve knowledge graph with options for dreaming. Usage: `/sleep --ops link_facts,deepen`
|
|
239
|
+
- `/spool` - Enter interactive chat (spool) mode with an npc with fresh context or files for rag. Usage: `/spool --attachments 'path1,path2,path3' -n <npc_name> -m <modell> -p <provider>`
|
|
240
|
+
- `/trigger` - Execute a trigger command. Usage: `/trigger 'a description of a trigger to implement with system daemons/file system listeners.' -m gemma3:27b -p ollama`
|
|
241
|
+
- `/vixynt` - Generate and edit images from text descriptions using local models, openai, gemini.
|
|
242
|
+
- Usage:
|
|
243
|
+
- Gen Image: `/vixynt -igp <NPCSH_IMAGE_GEN_PROVIDER> --igmodel <NPCSH_IMAGE_GEN_MODEL> --output_file <path_to_file> width=<int:1024> height =<int:1024> 'description of image`
|
|
244
|
+
- Edit Image: `/vixynt 'edit this....' --attachments '/path/to/image.png,/path/to/image.jpeg'`
|
|
245
|
+
|
|
246
|
+
- `/wander` - A method for LLMs to think on a problem by switching between states of high temperature and low temperature. Usage: `/wander 'query to wander about' --provider "ollama" --model "deepseek-r1:32b" environment="a vast dark ocean" interruption-likelihood=.1`
|
|
247
|
+
- `/yap` - Enter voice chat (yap) mode. Usage: `/yap -n <npc_to_chat_with>`
|
|
248
|
+
|
|
249
|
+
## Common Command-Line Flags:
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
Flag Shorthand | Flag Shorthand | Flag Shorthand | Flag Shorthand
|
|
253
|
+
------------------------------ | ------------------------------ | ------------------------------ | ------------------------------
|
|
254
|
+
--attachments (-a) | --height (-h) | --num_npcs (-num_n) | --team (-tea)
|
|
255
|
+
--config_dir (-con) | --igmodel (-igm) | --output_file (-o) | --temperature (-t)
|
|
256
|
+
--cors (-cor) | --igprovider (-igp) | --plots_dir (-pl) | --top_k
|
|
257
|
+
--creativity (-cr) | --lang (-l) | --port (-po) | --top_p
|
|
258
|
+
--depth (-d) | --max_tokens (-ma) | --provider (-pr) | --vmodel (-vm)
|
|
259
|
+
--emodel (-em) | --messages (-me) | --refresh_period (-re) | --vprovider (-vp)
|
|
260
|
+
--eprovider (-ep) | --model (-mo) | --rmodel (-rm) | --width (-w)
|
|
261
|
+
--exploration (-ex) | --npc (-np) | --rprovider (-rp) |
|
|
262
|
+
--format (-f) | --num_frames (-num_f) | --sprovider (-s) |
|
|
263
|
+
```
|
|
264
|
+
'
|
|
265
|
+
|
|
266
|
+
## Read the Docs
|
|
267
|
+
To see more about how to use the macros and modes in the NPC Shell, read the docs at [npc-shell.readthedocs.io](https://npc-shell.readthedocs.io/en/latest/)
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
## Inference Capabilities
|
|
271
|
+
- `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.
|
|
272
|
+
|
|
273
|
+
## NPC Studio
|
|
274
|
+
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).
|
|
275
|
+
|
|
276
|
+
## Mailing List
|
|
277
|
+
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)!
|
|
278
|
+
|
|
279
|
+
## Support
|
|
280
|
+
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 .
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
## Installation
|
|
284
|
+
`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.
|
|
285
|
+
|
|
286
|
+
### Linux install
|
|
287
|
+
<details> <summary> Toggle </summary>
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
|
|
291
|
+
# these are for audio primarily, skip if you dont need tts
|
|
292
|
+
sudo apt-get install espeak
|
|
293
|
+
sudo apt-get install portaudio19-dev python3-pyaudio
|
|
294
|
+
sudo apt-get install alsa-base alsa-utils
|
|
295
|
+
sudo apt-get install libcairo2-dev
|
|
296
|
+
sudo apt-get install libgirepository1.0-dev
|
|
297
|
+
sudo apt-get install ffmpeg
|
|
298
|
+
|
|
299
|
+
# for triggers
|
|
300
|
+
sudo apt install inotify-tools
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
#And if you don't have ollama installed, use this:
|
|
304
|
+
curl -fsSL https://ollama.com/install.sh | sh
|
|
305
|
+
|
|
306
|
+
ollama pull llama3.2
|
|
307
|
+
ollama pull llava:7b
|
|
308
|
+
ollama pull nomic-embed-text
|
|
309
|
+
pip install npcsh
|
|
310
|
+
# if you want to install with the API libraries
|
|
311
|
+
pip install 'npcsh[lite]'
|
|
312
|
+
# if you want the full local package set up (ollama, diffusers, transformers, cuda etc.)
|
|
313
|
+
pip install 'npcsh[local]'
|
|
314
|
+
# if you want to use tts/stt
|
|
315
|
+
pip install 'npcsh[yap]'
|
|
316
|
+
# if you want everything:
|
|
317
|
+
pip install 'npcsh[all]'
|
|
318
|
+
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
</details>
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
### Mac install
|
|
325
|
+
|
|
326
|
+
<details> <summary> Toggle </summary>
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
#mainly for audio
|
|
330
|
+
brew install portaudio
|
|
331
|
+
brew install ffmpeg
|
|
332
|
+
brew install pygobject3
|
|
333
|
+
|
|
334
|
+
# for triggers
|
|
335
|
+
brew install inotify-tools
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
brew install ollama
|
|
339
|
+
brew services start ollama
|
|
340
|
+
ollama pull llama3.2
|
|
341
|
+
ollama pull llava:7b
|
|
342
|
+
ollama pull nomic-embed-text
|
|
343
|
+
pip install npcsh
|
|
344
|
+
# if you want to install with the API libraries
|
|
345
|
+
pip install npcsh[lite]
|
|
346
|
+
# if you want the full local package set up (ollama, diffusers, transformers, cuda etc.)
|
|
347
|
+
pip install npcsh[local]
|
|
348
|
+
# if you want to use tts/stt
|
|
349
|
+
pip install npcsh[yap]
|
|
350
|
+
|
|
351
|
+
# if you want everything:
|
|
352
|
+
pip install npcsh[all]
|
|
353
|
+
```
|
|
354
|
+
</details>
|
|
355
|
+
|
|
356
|
+
### Windows Install
|
|
357
|
+
|
|
358
|
+
<details> <summary> Toggle </summary>
|
|
359
|
+
Download and install ollama exe.
|
|
360
|
+
|
|
361
|
+
Then, in a powershell. Download and install ffmpeg.
|
|
362
|
+
|
|
363
|
+
```powershell
|
|
364
|
+
ollama pull llama3.2
|
|
365
|
+
ollama pull llava:7b
|
|
366
|
+
ollama pull nomic-embed-text
|
|
367
|
+
pip install npcsh
|
|
368
|
+
# if you want to install with the API libraries
|
|
369
|
+
pip install 'npcsh[lite]'
|
|
370
|
+
# if you want the full local package set up (ollama, diffusers, transformers, cuda etc.)
|
|
371
|
+
pip install 'npcsh[local]'
|
|
372
|
+
# if you want to use tts/stt
|
|
373
|
+
pip install 'npcsh[yap]'
|
|
374
|
+
|
|
375
|
+
# if you want everything:
|
|
376
|
+
pip install 'npcsh[all]'
|
|
377
|
+
```
|
|
378
|
+
As of now, npcsh appears to work well with some of the core functionalities like /ots and /yap.
|
|
379
|
+
|
|
380
|
+
</details>
|
|
381
|
+
|
|
382
|
+
### Fedora Install (under construction)
|
|
383
|
+
|
|
384
|
+
<details> <summary> Toggle </summary>
|
|
385
|
+
|
|
386
|
+
```bash
|
|
387
|
+
python3-dev #(fixes hnswlib issues with chroma db)
|
|
388
|
+
xhost + (pyautogui)
|
|
389
|
+
python-tkinter (pyautogui)
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
</details>
|
|
393
|
+
|
|
394
|
+
## Startup Configuration and Project Structure
|
|
395
|
+
To initialize the NPC shell environment parameters correctly, first start the NPC shell:
|
|
396
|
+
```bash
|
|
397
|
+
npcsh
|
|
398
|
+
```
|
|
399
|
+
When initialized, `npcsh` will generate a `.npcshrc` file in your home directory that stores your npcsh settings.
|
|
400
|
+
Here is an example of what the `.npcshrc` file might look like after this has been run.
|
|
401
|
+
```bash
|
|
402
|
+
# NPCSH Configuration File
|
|
403
|
+
export NPCSH_INITIALIZED=1
|
|
404
|
+
export NPCSH_DB_PATH='~/npcsh_history.db'
|
|
405
|
+
export NPCSH_CHAT_MODEL=gemma3:4b
|
|
406
|
+
export NPCSH_CHAT_PROVIDER=ollama
|
|
407
|
+
export NPCSH_DEFAULT_MODE=agent
|
|
408
|
+
export NPCSH_EMBEDDING_MODEL=nomic-embed-text
|
|
409
|
+
export NPCSH_EMBEDDING_PROVIDER=ollama
|
|
410
|
+
export NPCSH_IMAGE_GEN_MODEL=gpt-image-1
|
|
411
|
+
export NPCSH_IMAGE_GEN_PROVIDER=openai
|
|
412
|
+
export NPCSH_INITIALIZED=1
|
|
413
|
+
export NPCSH_REASONING_MODEL=deepseek-r1
|
|
414
|
+
export NPCSH_REASONING_PROVIDER=deepseek
|
|
415
|
+
export NPCSH_SEARCH_PROVIDER=duckduckgo
|
|
416
|
+
export NPCSH_STREAM_OUTPUT=1
|
|
417
|
+
export NPCSH_VECTOR_DB_PATH=~/npcsh_chroma.db
|
|
418
|
+
export NPCSH_VIDEO_GEN_MODEL=runwayml/stable-diffusion-v1-5
|
|
419
|
+
export NPCSH_VIDEO_GEN_PROVIDER=diffusers
|
|
420
|
+
export NPCSH_VISION_MODEL=gpt-4o-mini
|
|
421
|
+
export NPCSH_VISION_PROVIDER=openai
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
`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.
|
|
425
|
+
|
|
426
|
+
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`:
|
|
427
|
+
|
|
428
|
+
```bash
|
|
429
|
+
# Source NPCSH configuration
|
|
430
|
+
if [ -f ~/.npcshrc ]; then
|
|
431
|
+
. ~/.npcshrc
|
|
432
|
+
fi
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
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.
|
|
436
|
+
|
|
437
|
+
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:
|
|
438
|
+
|
|
439
|
+
```bash
|
|
440
|
+
export OPENAI_API_KEY="your_openai_key"
|
|
441
|
+
export ANTHROPIC_API_KEY="your_anthropic_key"
|
|
442
|
+
export DEEPSEEK_API_KEY='your_deepseek_key'
|
|
443
|
+
export GEMINI_API_KEY='your_gemini_key'
|
|
444
|
+
export PERPLEXITY_API_KEY='your_perplexity_key'
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
Individual npcs can also be set to use different models and providers by setting the `model` and `provider` keys in the npc files.
|
|
449
|
+
|
|
450
|
+
Once initialized and set up, you will find the following in your `~/.npcsh` directory:
|
|
451
|
+
```bash
|
|
452
|
+
~/.npcsh/
|
|
453
|
+
├── npc_team/ # Global NPCs
|
|
454
|
+
│ ├── jinxs/ # Global tools
|
|
455
|
+
│ └── assembly_lines/ # Workflow pipelines
|
|
456
|
+
│ └── sibiji.npc # globally available npc
|
|
457
|
+
│ └── npcsh.ctx # global context file
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
```
|
|
462
|
+
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:
|
|
463
|
+
```bash
|
|
464
|
+
./npc_team/ # Project-specific NPCs
|
|
465
|
+
├── jinxs/ # Project jinxs #example jinx next
|
|
466
|
+
│ └── example.jinx
|
|
467
|
+
└── assembly_lines/ # Agentic Workflows
|
|
468
|
+
└── example.line
|
|
469
|
+
└── models/ # Project workflows
|
|
470
|
+
└── example.model
|
|
471
|
+
└── example1.npc # Example NPC
|
|
472
|
+
└── example2.npc # Example NPC
|
|
473
|
+
└── team.ctx # Example ctx
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
## Contributing
|
|
479
|
+
Contributions are welcome! Please submit issues and pull requests on the GitHub repository.
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
## License
|
|
483
|
+
This project is licensed under the MIT License.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
npcsh/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
npcsh/_state.py,sha256=b9wJoa0y50AH4T3J2pOOowbwf3fsnnFUV8n-cnSnOws,90039
|
|
3
|
+
npcsh/alicanto.py,sha256=-muGqd0O2m8xcFBctEavSEizWbQmzuPSdcT-3YqYBhY,45043
|
|
4
|
+
npcsh/corca.py,sha256=2KoYoG1hwbUmMI2YlQ1RrrfkW5bXAYz2EIPRNMMTt1g,31569
|
|
5
|
+
npcsh/guac.py,sha256=7DoRzEY4HrHGDzxehLJUBfM7C6rbNLP71Mnn28D6Ylo,65141
|
|
6
|
+
npcsh/mcp_helpers.py,sha256=Ktd2yXuBnLL2P7OMalgGLj84PXJSzaucjqmJVvWx6HA,12723
|
|
7
|
+
npcsh/mcp_server.py,sha256=htQBSN6y3g3zVCy2ADsdBuQT9PhqaOCSQG_RS9IinWI,5853
|
|
8
|
+
npcsh/npc.py,sha256=elJ494nl_pv8iDrDvBFAlmFvBdci0_CZBjZwbOjVj0c,9113
|
|
9
|
+
npcsh/npcsh.py,sha256=rGcl3h6BMGPwv0fJhA_ekCcJSA1B5s7tGyHKV73fJ5s,8253
|
|
10
|
+
npcsh/plonk.py,sha256=7w7J2bht5QXOyV2UK045nAPDmrSrTGLX-sh56KQ3-k0,14653
|
|
11
|
+
npcsh/pti.py,sha256=UciiiH2Kz4ERQFy0-FX6BQEU2VxYQEUril-_Cvj76Y0,7853
|
|
12
|
+
npcsh/routes.py,sha256=BOa3w8xGKa4MqUv3BzIrbGiqU3bZ1YpWKyy55hB6A_0,46637
|
|
13
|
+
npcsh/spool.py,sha256=r0-oXkrNDbxQ5ZNHr1vSJcdmVj3jdWbz7qYcEDoSrj8,10354
|
|
14
|
+
npcsh/wander.py,sha256=BiN6eYyFnEsFzo8MFLRkdZ8xS9sTKkQpjiCcy9chMcc,23225
|
|
15
|
+
npcsh/yap.py,sha256=ipkY3uMDw8gNrPSZ9qJFWVQ_fXtLmQ2oz_6_WZt2hew,21097
|
|
16
|
+
npcsh-1.0.18.dist-info/licenses/LICENSE,sha256=IKBvAECHP-aCiJtE4cHGCE5Yl0tozYz02PomGeWS3y4,1070
|
|
17
|
+
npcsh-1.0.18.dist-info/METADATA,sha256=3H4JJKHTi6HLI0OVmJNmi-4CFZg6sJ7sZw343nbW1l4,23040
|
|
18
|
+
npcsh-1.0.18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
19
|
+
npcsh-1.0.18.dist-info/entry_points.txt,sha256=S5yIuGm8ZXQ4siHYgN5gs0J7bxgobSEULXf8L5HaW5o,206
|
|
20
|
+
npcsh-1.0.18.dist-info/top_level.txt,sha256=kHSNgKMCkfjV95-DH0YSp1LLBi0HXdF3w57j7MQON3E,6
|
|
21
|
+
npcsh-1.0.18.dist-info/RECORD,,
|