|
| 1 | +# TAGLINE |
| 2 | + |
| 3 | +CLI for deterministic NPC agents that run without an LLM |
| 4 | + |
| 5 | +# TLDR |
| 6 | + |
| 7 | +Install the framework from a **git clone** (user-space, not root) |
| 8 | + |
| 9 | +```git clone [https://github.com/gioblu/NPC-Forge.git] && cd NPC-Forge && chmod +x setup.sh && ./setup.sh``` |
| 10 | + |
| 11 | +Install the bundled **TERMy** assistant |
| 12 | + |
| 13 | +```npc-forge install [npcs/termy]``` |
| 14 | + |
| 15 | +Install an NPC in **editable** developer mode |
| 16 | + |
| 17 | +```npc-forge install [./npcs/termy] --dev``` |
| 18 | + |
| 19 | +**List** installed NPCs |
| 20 | + |
| 21 | +```npc-forge list``` |
| 22 | + |
| 23 | +**Start**, **stop**, or **restart** the user systemd service |
| 24 | + |
| 25 | +```npc-forge start``` |
| 26 | + |
| 27 | +```npc-forge stop``` |
| 28 | + |
| 29 | +```npc-forge restart``` |
| 30 | + |
| 31 | +Follow the **service log** |
| 32 | + |
| 33 | +```npc-forge logs``` |
| 34 | + |
| 35 | +Run the **test suite** |
| 36 | + |
| 37 | +```npc-forge test``` |
| 38 | + |
| 39 | +# SYNOPSIS |
| 40 | + |
| 41 | +**npc-forge** _command_ [_options_] |
| 42 | + |
| 43 | +# PARAMETERS |
| 44 | + |
| 45 | +**-h**, **--help** |
| 46 | +> Print the command list and exit. Also shown when **npc-forge** is invoked with no arguments (that path exits 1). |
| 47 | +
|
| 48 | +**--dev** |
| 49 | +> With **install** only. Passes **--dev** to the NPC's **setup.sh** hook (symlinks / editable install). Ignored on other commands. |
| 50 | +
|
| 51 | +# COMMANDS |
| 52 | + |
| 53 | +**serve**, **start** |
| 54 | +> **systemctl --user start npc-forge.service**. The unit runs **server.py** from **~/.local/share/npc-forge** (Flask on **127.0.0.1:5000**). |
| 55 | +
|
| 56 | +**stop** |
| 57 | +> **systemctl --user stop npc-forge.service**. |
| 58 | +
|
| 59 | +**restart**, **reboot** |
| 60 | +> **systemctl --user restart npc-forge.service**. Use this after editing an NPC dataset so the gateway reloads intents. |
| 61 | +
|
| 62 | +**logs**, **watch** |
| 63 | +> If the unit is inactive, start it, then **tail -n 20 -f** **~/.local/share/npc-forge/npc_forge.log**. Ctrl+C leaves the service running. |
| 64 | +
|
| 65 | +**list** |
| 66 | +> Print each directory under **~/.local/share/npc-forge/npcs/** with creator, intent count, vocabulary size, dataset size, and whether any intent declares tools. |
| 67 | +
|
| 68 | +**install** _path_ [**--dev**] |
| 69 | +> Copy _path_ into **~/.local/share/npc-forge/npcs/**_name_ (_name_ is the directory basename, lowercased) and run **setup.sh** in the source tree if present. If the source already resolves to the target (dev symlink), the copy is skipped. |
| 70 | +
|
| 71 | +**test**, **tests** |
| 72 | +> Run **tests/run_tests.py** with the framework venv Python, or **unittest discover** if that runner is missing. |
| 73 | +
|
| 74 | +# DESCRIPTION |
| 75 | + |
| 76 | +**npc-forge** administers **NPC-Forge**, a Python framework for CPU-only conversational agents (NPCs) that do not use embeddings, machine learning, or LLMs. Intents live in JSON datasets (NDF 0.0). FlintParser matches prompts with exact, template, and probabilistic steps; FlintNPC then returns a message and optional tool calls. The same engine is exposed over HTTP so editors and LLM harnesses can treat an NPC as an OpenAI-compatible model. |
| 77 | + |
| 78 | +The **npc-forge** wrapper on **PATH** is a short script written by **./setup.sh** into **~/.local/bin/npc-forge**. It runs **cli.main** inside **~/.local/share/npc-forge/venv**. The installer also copies or symlinks the Python sources, creates that virtualenv (**pip install** the **pyproject.toml** package, Python **3.8+**), and, when **systemctl** exists, installs a user unit **npc-forge.service**. **./setup.sh --dev** symlinks sources for live editing. **./setup.sh --uninstall** stops the unit and deletes the wrapper and data directory. Do not run the installer as root. |
| 79 | + |
| 80 | +The gateway listens on **http://127.0.0.1:5000**. Native routes include **POST /api/chat/**_npc_ and **GET /**_npc_**/chat/** (compiled HTML). OpenAI-shaped routes include **GET /api/v1/models** and **POST /api/v1/chat/completions**, which is how TERMy is wired into Copilot-style clients. **termy** is a separate binary installed with **npc-forge install npcs/termy**. |
| 81 | + |
| 82 | +The README currently limits this experimental release to **Linux** and **WSL**. |
| 83 | + |
| 84 | +# CONFIGURATION |
| 85 | + |
| 86 | +**~/.local/share/npc-forge/** |
| 87 | +> Framework prefix: Python modules, **venv/**, **npcs/**, **tests/**, and **npc_forge.log**. |
| 88 | +
|
| 89 | +**~/.local/share/npc-forge/npcs/** |
| 90 | +> One subdirectory per installed NPC. **list** and the HTTP registry read this tree. |
| 91 | +
|
| 92 | +**~/.local/bin/npc-forge** |
| 93 | +> User-space launcher. **setup.sh** appends **~/.local/bin** to **PATH** in **~/.bashrc** or **~/.zshrc** when it is missing. |
| 94 | +
|
| 95 | +**~/.config/systemd/user/npc-forge.service** |
| 96 | +> User unit. **WorkingDirectory** is the framework prefix; **ExecStart** is the venv Python running **server.py**; stdout/stderr append to **npc_forge.log**; **Restart=always**. |
| 97 | +
|
| 98 | +# CAVEATS |
| 99 | + |
| 100 | +Experimental **1.0.0** release, licensed **AGPL-3.0**, distributed **AS IS**. There is no **npc-forge uninstall**; use **./setup.sh --uninstall** from a checkout. |
| 101 | + |
| 102 | +**serve** / **start** / **stop** / **restart** / **logs** all call **systemctl --user**. They fail if systemd is unavailable (including typical macOS). The Flask app is the development server bound to localhost; the API docs recommend gunicorn for anything public. |
| 103 | + |
| 104 | +**install** needs a real directory path. The CLI has no package registry or download step. **--dev** is only meaningful with **install**. |
| 105 | + |
| 106 | +Requires **python3**, the **venv** module, and write access to **~/.local**. **~/.local/bin** must be on **PATH** after install. |
| 107 | + |
| 108 | +# HISTORY |
| 109 | + |
| 110 | +**NPC-Forge** is written by **Giovanni Blu Mitolo** (known for the **PJON** protocol). The public repository was created on **18 July 2026**. The first Python package version is **1.0.0**. The **npc-forge** CLI, systemd user service, OpenAI-compatible gateway, and bundled **termy** NPC were the experimental Linux/WSL surface shown on Hacker News in **September 2026**. License: **GNU Affero GPL v3**. |
| 111 | + |
| 112 | +# SEE ALSO |
| 113 | + |
| 114 | +[termy](/man/termy)(1), [systemctl](/man/systemctl)(1), [python3](/man/python3)(1), [flask](/man/flask)(1), [aichat](/man/aichat)(1), [copilot](/man/copilot)(1) |
| 115 | + |
| 116 | +# RESOURCES |
| 117 | + |
| 118 | +```[Source code](https://github.com/gioblu/NPC-Forge)``` |
| 119 | + |
| 120 | +```[Documentation](https://github.com/gioblu/NPC-Forge/blob/main/docs/NPC-Forge-cli.md)``` |
| 121 | + |
| 122 | +<!-- verified: 2026-09-04 --> |
0 commit comments