Skip to main content

npcsh logo

npcsh

The agentic shell for building and running AI teams from the command line.

License PyPI Python Docs


npcsh makes the most of LLMs and agents through slash commands and interactive modes, all from the command line. Build teams of agents, schedule them on jobs, engineer context, and design custom Jinja Execution templates (Jinxes) for you and your agents to invoke.

To get started, view the latest release in the sidebar on github, and download the executable binary for your system. Once downloaded, ensure that it is executable.

#linux
chmod +x npcsh-binary-path

Then run the executable

./npcsh-binary-path

Alternatively, you can install with brew or pip.

brew install npcsh
pip install 'npcsh[lite]'

Once installed, run npcsh to enter the NPC shell. Also provides the CLI tools npc and npcsh-bench.

.npc files are directly executable with shebangs (#!/usr/bin/env npc):

npc ./myagent.npc "summarize this repo"     # run an NPC with a prompt
./myagent.npc "hello"                       # or just execute it (with shebang)

Benchmark Results

How well can a model drive npcsh as an agentic shell? 125 tasks across 15 categories — from basic shell commands to multi-step workflows, code debugging, and tool chaining — scored pass/fail. Comparisons with other agent coders coming soon. For a more comprehensive view of npcsh's capabilities and the advantages of the NPC Context-Agent-Tool data layer, check out ALARA for Agents: Least-Privilege Context Engineering Through Portable Composable Multi-Agent Teams

FamilyModelScore
Kimik2.5121/125 (97%)
Qwen3.50.8b31/125 (24%)
2b81/125 (65%)
4b77/125 (62%)
9b100/125 (80%)
35b111/125 (88%)
397b120/125 (96%)
Qwen30.6b—
1.7b42/125 (34%)
4b94/125 (75%)
8b85/125 (68%)
30b103/125 (82%)
Gemma4e4b34/125 (27%)
31b105/125 (84%)
Gemma31b—
4b37/125 (30%)
12b77/125 (62%)
27b73/125 (58%)
Llama3.2:1b—
3.2:3b26/125 (20%)
3.1:8b60/125 (48%)
Mistralsmall3.272/125 (57%)
ministral-351/125 (40%)
large-359/125 (47%)
Devstral260/125 (48%)
MiniMaxM2.7120/125 (96%)
Phiphi458/125 (46%)
GPT-OSS20b94/125 (75%)
OLMo27b13/125 (10%)
13b47/125 (38%)
Cogito3b10/125 (8%)
GLM4.7-flash102/125 (82%)
5120/125 (96%)
Nemotron3-super49/125 (39%)
Gemini2.5-flash—
3.1-flash—
3.1-pro—
Claude4.6-sonnet—
4.5-haiku—
GPT5-mini—
DeepSeekv4-flash99/125 (79%)
chat—
reasoner—
Category breakdown (completed models)
Category Qwen3.5 Qwen3 Gemma4 Gemma3 Llama Mistral Phi GPT-OSS Cogito GLM Kimi Qwen3.5 MiniMax Devstral Nemotron DeepSeek
0.8b2b9b35b 1.7b4b8b30b0.6b e4b31b 4b12b27b 3.2:3b small3.2ministral-3large-3 phi4 20b 3b 4.75 k2.5 397b M2.7 2 3-super v4-flash
shell (10)5610108899—6106696107891001010101010978
file-ops (10)891010810910—5869102610810100109101091059
python (10)039100566—1100310366410010101010106510
data (10)02462456—09157059546059999449
system (10)2891079710—610597296106901010101010869
text (10)176821067—0839817004807101010100010
debug (10)26101004210—4003004020909101010100310
git (10)08692998—2946948406805101099019
multi-step (10)06760637—09355230054058999204
scripting (10)158100726—0902103163708109910825
image-gen (5)55555555—55353551525555555550
audio-gen (5)54555555—55455451555555555555
web-search (5)15451545—05155045003055555025
delegation (5)02330224—04020000300034444231
tool-chain (5)15442525—04133001100055555115
Total (125)3181100111429476103—3410537777326725159589410102120121120120604999
python -m npcsh.benchmark.local_runner --model qwen3:4b --provider ollama

Usage

  • Get help with a task:

    npcsh>can you help me identify what process is listening on port 5337?
    
  • Edit files:

    npcsh>please read through the markdown files in the docs folder and suggest changes
    
  • Search & Knowledge

    /web_search "cerulean city"            # Web search
    /db_search "query"                     # Database search
    /file_search "pattern"                 # File search
    /memories                              # Interactive memory browser TUI
    

    Web search results

  • Computer Use

    /computer_use
    

    Plonk GUI automation TUI Plonk GUI automation — completed task

  • Multi-Agent Discussions

    /convene "Is the universe a simulation?" npcs=alicanto,corca,guac rounds=3
    

    Convene — multi-NPC discussion


Agent Formats

npcsh supports multiple ways to define agents inside your npc_team/ directory. You can mix all three formats — .npc files take precedence if names collide.

.npc files — Full-featured YAML agent definitions with model, provider, jinxes, and more:

#!/usr/bin/env npc
name: analyst
primary_directive: You analyze data and provide insights.
model: qwen3:8b
provider: ollama
jinxes:
  - skills/data-analysis

agents.md — Define multiple agents in a single markdown file. Each ## heading = agent name, body = directive:

## summarizer
You summarize long documents into concise bullet points.

## fact_checker
You verify claims against reliable sources and flag inaccuracies.

agents/ directory — One .md file per agent. Filename (minus .md) = agent name. Supports YAML frontmatter:

---
model: gemini-2.5-flash
provider: gemini
---
You translate content between languages while preserving tone and idiom.

All three formats are supported by both the Python and Rust editions of npcsh. Agents from agents.md and agents/ inherit the team's default model/provider from team.ctx.

The full team structure:

npc_team/
├── team.ctx           # Team config (model, provider, forenpc, context)
├── coordinator.npc    # YAML agent definitions
├── analyst.npc
├── agents.md          # Markdown-defined agents
├── agents/            # One .md file per agent
│   └── translator.md
├── jinxes/            # Workflows and tools
│   ├── research.jinx
│   └── skills/        # Knowledge-content skills
└── tools/             # Custom tool functions

This means you can bring agents from other ecosystems — if you already have an agents.md or an agents/ directory from Claude Code, Codex, Amp, or any other tool, just drop them into your npc_team/ and npcsh will pick them up alongside your .npc files.


Launching AI Coding Tools with NPC Teams

Your npc_team/ works beyond npcsh — you can launch any major AI coding tool as an NPC from your team using the CLI launchers from npcpy. Each tool gets the NPC's persona injected and gains awareness of the other team members.

pip install npcpy   # if not already installed

# Launch Claude Code as an NPC (interactive picker)
npc-claude

# Launch as a specific NPC
npc-claude --npc corca

# Same for other coding tools
npc-codex --npc researcher
npc-gemini --npc analyst
npc-opencode --npc coder
npc-aider --npc reviewer
npc-amp --npc writer

# Point to a specific team directory
npc-claude --team ./my_project/npc_team

The launcher discovers your team from ./npc_team or ~/.npcsh/npc_team, lets you pick an NPC, and starts the tool with that NPC's directive. For Claude Code, it also passes the other NPCs as sub-agents via --agents.

For deeper integration (jinxes exposed as MCP tools, team switching mid-conversation), register the NPC plugin:

npc-plugin claude    # install MCP server + hooks
npc-plugin codex     # same for Codex
npc-plugin gemini    # same for Gemini CLI

Features

  • Agents (NPCs) — AI agents with personas, directives, and tool sets
  • Team Orchestration — Delegation, review loops, multi-NPC discussions
  • Jinxes — Jinja Execution templates — reusable tools for users and agents
  • Skills — Knowledge-content jinxes with progressive section disclosure
  • NQL — SQL models with embedded AI functions (Snowflake, BigQuery, Databricks, SQLite)
  • Knowledge Graphs — Build and evolve knowledge graphs from conversations
  • Deep Research — Multi-agent hypothesis generation, persona sub-agents, paper writing
  • Computer Use — GUI automation with vision
  • Image, Audio & Video — Generation via Ollama, diffusers, OpenAI, Gemini
  • MCP Integration — Full MCP server support with agentic shell TUI
  • API Server — Serve teams via OpenAI-compatible REST API
  • Self-updating — /update checks pip/cargo/brew and tells you the command to upgrade
  • Self-healing — /doctor auto-fixes stale permissions, broken configs, and DB corruption

Works with all major LLM providers through LiteLLM: ollama, openai, anthropic, gemini, deepseek, openai-like, and more.


Installation

pip install 'npcsh[lite]'        # API providers (ollama, gemini, anthropic, openai, etc.)
pip install 'npcsh[local]'       # Local models (diffusers/transformers/torch)
pip install 'npcsh[yap]'         # Voice mode
pip install 'npcsh[all]'         # Everything
System dependencies

Linux:

sudo apt-get install espeak portaudio19-dev python3-pyaudio ffmpeg libcairo2-dev libgirepository1.0-dev
curl -fsSL https://ollama.com/install.sh | sh
ollama pull qwen3.5:2b

macOS:

brew install portaudio ffmpeg pygobject3 ollama
brew services start ollama
ollama pull qwen3.5:2b

Windows: Install Ollama and ffmpeg, then ollama pull qwen3.5:2b.

API keys go in a .env file:

export OPENAI_API_KEY="your_key"
export ANTHROPIC_API_KEY="your_key"
export GEMINI_API_KEY="your_key"

Rust Edition (experimental)

A native Rust build of npcsh is available — same shell, same DB, same team files, faster startup. Still experimental.

cd npcsh/rust && cargo build --release
cp target/release/npcrsh ~/.local/bin/npc   # or wherever you want

Both editions share ~/npcsh_history.db and ~/.npcsh/npc_team/ and can be used interchangeably.

Read the Docs

Full documentation, guides, and API reference at npc-shell.readthedocs.io.

Research

  • Quantum-like nature of natural language interpretation: arxiv, accepted at QNLP 2025
  • Simulating hormonal cycles for AI: arxiv

Community & Support

Discord | Monthly donation | Merch | Consulting: info@npcworldwi.de

Contributing

Contributions welcome! Submit issues and pull requests on the GitHub repository.

License

MIT License.

Star History

Star History Chart

Metadata

Release files for npcsh 2.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for npcsh 2.1.1
File Size Uploaded
npcsh-2.1.1.tar.gz 20.0 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for npcsh 2.1.1
File
npcsh-2.1.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
npcsh-2.1.1-py3-none-manylinux_2_35_x86_64.whl Python 3 none Linux glibc 2.35+ x86-64 Details
npcsh-2.1.1-py3-none-macosx_14_0_arm64.whl Python 3 none macOS 14.0+ ARM64 Details
npcsh-2.1.1-py3-none-macosx_13_0_x86_64.whl Python 3 none macOS 13.0+ x86-64 Details

Total release size: 133.2 MB

Release files / npcsh-2.1.1.tar.gz

Download URL npcsh-2.1.1.tar.gz
Size 20.0 MB
Tags Source
SHA-256 checksum
How to use checksums
38eae1793abeecbea957dce7a15b1e9669fdeb00ba611e06fe996cf7ee316c08
BLAKE2b-256 checksum
How to use checksums
cb8c85684b58a3d150a598a9e503b3787aba1b9bbd69c6b1a88273e342f7eb7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / npcsh-2.1.1-py3-none-win_amd64.whl

Download URL npcsh-2.1.1-py3-none-win_amd64.whl
Size 27.6 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
f830a24d050d08510e568554b196031e86bc325d1c45714b98eee70eb84037b3
BLAKE2b-256 checksum
How to use checksums
e95b6fa74229353bbf9a900277c48ab447fd298fd39ce8da97afa41a9afa61df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / npcsh-2.1.1-py3-none-manylinux_2_35_x86_64.whl

Download URL npcsh-2.1.1-py3-none-manylinux_2_35_x86_64.whl
Size 29.1 MB
Tags Linux glibc 2.35+ x86-64 Python 3
SHA-256 checksum
How to use checksums
32159c30ff9439d5cedf96288d039ff58e78ed29a5fcc7daf504a5b1dc42a2bf
BLAKE2b-256 checksum
How to use checksums
e709d790d8de2471f035d4fc1ce0783886ea62384978d8f9c4ebc414a355aa78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / npcsh-2.1.1-py3-none-macosx_14_0_arm64.whl

Download URL npcsh-2.1.1-py3-none-macosx_14_0_arm64.whl
Size 28.0 MB
Tags Python 3 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
ec3833a336163ee15f1c1c0e31f6fcd943750fb81fae79cb9a5b4f1b728ac6fb
BLAKE2b-256 checksum
How to use checksums
6be9dd7de36ca06012b766d7bd0bfb75b908ee195e0dcf7abd2a26f8f14095db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / npcsh-2.1.1-py3-none-macosx_13_0_x86_64.whl

Download URL npcsh-2.1.1-py3-none-macosx_13_0_x86_64.whl
Size 28.5 MB
Tags Python 3 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
2804242a8b0da3b15d139c54999c788bd1760da15066a83d05bb8ed211bfc981
BLAKE2b-256 checksum
How to use checksums
a5671df574b28c664116fd2ed48847e8ecd88e5b06adc1fc27bb90904a083c8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

2.1.1 This release

5 release files

1.2.30

5 release files

1.2.29

5 release files

1.2.28

5 release files

1.2.27

5 release files

1.2.26

5 release files

1.2.25

5 release files

1.2.24

5 release files

1.2.23

5 release files

1.2.21

5 release files

1.2.20

5 release files

1.2.16

5 release files

1.2.15

5 release files

1.2.12

5 release files

1.2.11

5 release files

1.2.10

5 release files

1.2.9

5 release files

1.2.8

5 release files

1.2.7

5 release files

1.2.6

5 release files

1.2.5

5 release files

1.2.4

4 release files

1.2.3

4 release files

1.2.2

4 release files

1.2.1

4 release files

1.1.35

2 release files

1.1.33

2 release files

1.1.32

2 release files

1.1.31

2 release files

1.1.30

2 release files

1.1.27

2 release files

1.1.26

2 release files

1.1.25

2 release files

1.1.24

2 release files

1.1.21

2 release files

1.1.20

2 release files

1.1.19

2 release files

1.1.18

2 release files

1.1.17

2 release files

1.1.16

2 release files

1.1.15

2 release files

1.1.13

2 release files

1.1.12

2 release files

1.1.11

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.0.37

2 release files

1.0.36

2 release files

1.0.35

2 release files

1.0.34

2 release files

1.0.33

2 release files

1.0.32

2 release files

1.0.31

2 release files

1.0.30

2 release files

1.0.29

2 release files

1.0.25

2 release files

1.0.24

2 release files

1.0.23

2 release files

1.0.22

2 release files

1.0.21

2 release files

1.0.20

2 release files

1.0.19

2 release files

1.0.18

2 release files

1.0.17

2 release files

1.0.16

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.31

2 release files

0.3.30

2 release files

0.3.29

2 release files

0.3.28

2 release files

0.3.27

2 release files

0.3.26

2 release files

0.3.25

2 release files

0.3.24

2 release files

0.3.23

2 release files

0.3.22

2 release files

0.3.21

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.2.31

2 release files

0.2.29

2 release files

0.2.28

2 release files

0.2.27

2 release files

0.2.26

2 release files

0.2.25

2 release files

0.2.24

2 release files

0.2.23

2 release files

0.2.22

2 release files

0.2.21

2 release files

0.2.20

2 release files

0.2.14

2 release files

0.2.12

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.37

2 release files

0.1.36

2 release files

0.1.35

2 release files

0.1.34

2 release files

0.1.33

2 release files

0.1.32

2 release files

0.1.31

2 release files

0.1.29

2 release files

0.1.28

2 release files

0.1.27

2 release files

0.1.26

2 release files

0.1.25

2 release files

0.1.24

2 release files

0.1.23

2 release files

0.1.22

2 release files

0.1.21

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.13

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page