CLI · Agentic AI · Open World

Your Terminal
is Now a
Dungeon

QuestCode.sh is a command-line Dungeon Master powered by agentic AI. Drop in your lore files, roll initiative, and let the DM take it from there — tool calls, world state, and all.

Source Available
Lightweight
Any LLM
questcode — dungeon session
$ questcode start --world ./blackmoor
⟳ Loading world context...
✓ 3 lore files · 1 save · party of 2
The iron gate groans as you push it open.
Torchlight flickers across moss-slicked stone.
Something breathes in the dark ahead.
> I draw my blade and call out a warning.
[tool: roll_dice d20+4 → 17]
[tool: update_world_state encounter:goblin]
A goblin scout stumbles into the light, hands raised.
It croaks: "Not here to fight — bring warning."
>

From Files to
Living World

QuestCode reads your context files before every session — then the AI takes over as DM, calling tools to manage state, dice, NPCs, and narrative.

01

Write Your World

Drop Markdown or plain text files into your world directory. Lore, characters, maps, items — anything the DM should know. Use world.md, npcs.md, inventory.md or your own structure.

02

Start Your Session

Run questcode start --world ./myworld. The agent loads all context files, builds a DM persona, and opens the session prompt. No config ceremony needed.

03

The DM Takes the Wheel

Type your actions in plain English. The AI narrates, makes decisions, rolls dice, updates world state files, and tracks encounters — all autonomously via tool calls.

04

State Persists Between Sessions

After each session, world state is written back to disk. Return tomorrow and the DM remembers exactly where things stand — who's dead, what you've found, what changed.

📁 ./blackmoor/
blackmoor/
├── world.md ← DM context
├── npcs.md ← character memory
├── party.md ← player stats
├── inventory.md ← items & gold
├── lore/
│ ├── factions.md
│ └── history.md
├── sessions/
│ ├── session-01.log
│ └── session-02.log
└── state.json ← live world state
state.json writes after every exchange.
Tracked: time, weather, NPCs alive/dead,
quests, economy, faction rep, party HP.

Built for Depth,
Not Demos

Agentic Dungeon Master

The AI doesn't just respond — it acts. It calls tools autonomously to roll dice, update lore, manage NPCs, and drive the story forward without hand-holding.

📜

File-First Context

Your world lives in plain text files you control. Edit lore between sessions, version control everything with git, share worlds with other players trivially.

🎲

Real Dice, Real Stakes

Rolls are cryptographically random and logged. The DM interprets results narratively — success, failure, and critical moments feel earned, not scripted.

🧠

Persistent World Memory

State is written to disk after each exchange. NPCs remember you. Doors you've opened stay open. Consequences ripple through the world across sessions.

🔌

Model Agnostic

Works with Claude, GPT-4o, Gemini, or any local model via Ollama. Swap the engine without touching your world files or losing your save state.

🛠

Professional Architecture

This is not another RAM hungry AI tool. It is carefully architected Rust CLI program that uses Bevy as it's core and Ratatui as it's renderer.

The DM Has
Real Agency

QuestCode exposes a set of tools to the underlying AI. The model chooses when and how to call them — you just play.

roll_dice
Any die, any modifier. Results logged, shown inline.
update_state
Writes to state.json — HP, items, flags, time of day.
read_lore
Fetches from your lore files for accurate world recall.
spawn_npc
Generates and tracks new characters mid-session.
end_session
Writes a session log and summarizes events to disk.
create_quest
Manages quests, tracked and managed all int persistent files.
tool trace — verbose mode
> I try to persuade the merchant to lower his price.
── tool calls ──────────────────────
→ read_lore("merchant_baros")
← "Suspicious of outsiders. Greedy."
→ roll_dice("d20", modifier=+2)
← result: 14 (total: 16)
→ update_state("baros_rep", -1)
← state.json written ✓
── narrative ───────────────────────
Baros squints at you. A long pause.
Then: "Ten silver. Final offer."
He doesn't look pleased about it.
[ reputation: Baros → cautious ]
"The best DM you've ever had
never needed a screen."

Ready in 60 Seconds

No dependencies. No account. No cloud required. Just a terminal and an API key.

Linux / MacOS
Windows
Cargo
$ curl -fsSL https://questcode.sh/install.sh | sh
$ questcode start
Requires any POSIX shell. Works with Claude, OpenAI, Gemini, or Ollama (local).