Skip to main content

Quill & Dice

A single-player fantasy roleplaying game in your terminal, made for new players but also welcomes experienced players as well, with Claude or Gemini as the Game Master.

quill_and_dice

The idea

Tabletop roleplaying games are a lot of fun, but getting started is hard. You need a group, a time that suits everyone, and someone willing to be the Game Master (the GM: the person who describes the world, plays everyone you meet and decides what happens). Then there's a thick rulebook, and the worry of slowing everyone down while you look things up.

Quill & Dice takes all of that away, so you can learn by playing:

  • No group needed. Play on your own, whenever you like, for as long as you like. Your game saves itself.
  • No pressure. Nobody is waiting on you. Take your time, try things out, and ask as many questions as you want.
  • No rulebook first. The game rolls the dice and does the maths. The GM explains a rule in a sentence when it first matters, and a tips panel shows a hint that fits what's happening.
  • Just say what you do. Type it in your own words, like "I sneak up and shoot the goblin", and the GM takes it from there.

Pick one of five ready-made heroes (a goliath fighter, a wood elf ranger, a halfling rogue, a gnome wizard or a dwarf cleric) or build your own one question at a time, give them a name, and the adventure begins.

How does the GM stay honest?

At a real table you trust the GM not to fudge the dice. Here the GM is an AI, and an AI can get numbers wrong or be talked into things. So the GM never touches the numbers:

  • The game does every roll and every sum, on your computer: attacks, damage, HP, spell slots, gold, XP and every monster's turn.
  • The GM can only ask the game to do things, through a small set of actions, such as ask for a DC 13 Perception check or start a fight with two goblins. The game carries them out, within limits: no fight far beyond what your hero can survive, no mountain of loot in one go.
  • Difficulty is fair. How hard a task is (its DC) depends on the task, never on your character's bonus, so your strengths really feel strong.
  • Rewards are earned in the story. Asking the GM for 1,000 gold, or telling it you rolled a 20, won't work.

The rules

The game uses the 2024 fifth edition rules from the free System Reference Document 5.2.1 (the SRD). If you'd like to read more about the rules themselves, the SRD is available at https://www.dndbeyond.com/srd.

A few things are simpler than at a real table, which experienced players may want to know:

  • One hero, plus any companions who join you in the story. The game plays their turns.
  • No battle map. Each enemy is either close (within reach) or far (about 30 feet away).
  • Five classes (fighter, ranger, rogue, wizard and cleric), and spells up to 3rd level.

Stuck?

Forgot what something means? Type /rules and the thing, for example /rules advantage, /rules prone or /rules vex. /rules on its own lists every topic, and /help (or F1) shows every command.

Still not sure? Ask the GM, like you would at a real table: "GM, help me understand how grappling works." It explains, then carries on with the story.

Getting started

Install

  1. Install uv, a free tool that installs Python programs. It also fetches Python itself if your computer doesn't have a recent enough one.
    • Linux and Mac: curl -LsSf https://astral.sh/uv/install.sh | sh
    • Windows (PowerShell): powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  2. Install the game:
    uv tool install quill-and-dice
    
  3. Start it by typing quill. If your terminal can't find quill, open a new terminal window, or run uv tool update-shell once.

Using git instead. use the source command each time you want to start the game, then type quill (Python 3.10 or newer):

git clone https://github.com/reveler-hub/Quill-and-Dice
cd Quill-and-Dice
python3 -m venv .venv
source .venv/bin/activate        # fish: source .venv/bin/activate.fish   Windows: .venv\Scripts\activate
pip install -r requirements.txt
quill

Choose your GM

The first time you start the game, it asks which GM you want: Claude, Gemini or a local model. You can change it later with the backend setting (see Settings).

Claude. There are two ways to connect:

  • Your Claude Code login (no key needed). Install the claude command-line tool and log in with it; the game uses that, and turns count against your Claude plan's usage limits. The Claude desktop app on its own isn't enough: the game needs the claude command.

    • Linux and Mac: curl -fsSL https://claude.ai/install.sh | bash
    • Mac with Homebrew: brew install --cask claude-code
    • Windows (PowerShell): irm https://claude.ai/install.ps1 | iex

    Then open a new terminal window, run claude and log in.

  • A Claude API key. Make one in your Claude API account (https://platform.claude.com), where you pay per use. If Claude Code isn't set up, the game asks for the key: paste it in, and the GM connects. On Claude Max, Ultra or Team, your plan includes monthly API credit, so you can play with a key at no extra cost (details: https://platform.claude.com/docs/en/about-claude/api-credits-for-subscribers).

Gemini. Make an API key in Google AI Studio (https://aistudio.google.com) and paste it in when the game asks. A paid key is recommended. A free key works, but Google's free tier allows only about 20 GM requests a day for each model (roughly 8 to 10 turns), and Google may use what you send to improve its products; the game tells you if your key is a free one. The game starts with the best Gemini model your key can use, and moves down to the next one when a model is busy or its daily limit is used up.

Local models. Play with a model running on your own computer, or another one at home. It's free and private.

  1. If you don't have one yet, install a model that fits your computer or server, the way you prefer: Ollama, LM Studio or llama.cpp. With Ollama, for example: ollama pull qwen3:8b.
  2. Set these environment variables on the computer running it, then restart the program (Ollama shown):
    • OLLAMA_CONTEXT_LENGTH=16384 gives the model enough memory for the GM's instructions and your story.
    • OLLAMA_HOST=0.0.0.0, only if the model runs on another computer: it lets your network reach it (also allow port 11434 through that computer's firewall, and keep it on your home network).
  3. Start the game: the first time, pick A local model when it asks which GM you want; if you've played before, type /local in the game. Give it the address (http://localhost:11434/v1, or the other computer's, like http://192.168.1.50:11434/v1) and the model's name (like qwen3:8b).

Note: Read the Local Models wiki page for more about running this game with local models.

Your keys are each kept in their own private file (only your account can read them, and only this game uses them). Type /apikey to add or replace the key for the GM you're using (/apikey claude or /apikey gemini to pick), or /apikey forget to remove it. The top bar shows a running estimate of what you've spent.

A story keeps the GM it was started with, which remembers it. If that GM stops working (say you log out of Claude Code), the story moves to another one, and that GM gets a recap so it picks up where you left off. With no GM at all, the game still runs offline and tells you why and what to do; commands like /roll and /check still work. The GM is sandboxed: it only gets the game's own actions, never your files, shell or the web.

Playing

Anything you type without a / is what your hero says or does, and it goes to the GM. Commands start with /:

Command What it does
/help the everyday commands (/help combat for the fight shortcuts)
/rules prone explains a rule, condition or weapon trick
/check stealth, /roll 2d6 roll a check, or any dice
/attack goblin, /cast fire bolt at goblin fight
/end (or F2) end your turn in a fight
/rest short, /rest long rest to heal (the GM says if it's safe)
/newgame, /load start another hero, or switch between saved games

You can write in any language. The GM tells the story in your computer's language from the first scene, and switches if you write in another one. The game's own screens and commands stay in English.

Games are saved automatically, including the story so far, so you can stop at any time and pick up where you left off. Saves are kept in your own folder, not with the GM.

What it costs

The game keeps the GMs work small, so turns stay cheap. It handles every rule and number itself, so the GM's messages are short, and it re-reads earlier parts of the conversation from cache at a fraction of the price. It also sends each fight one round at a time, and folds a long story into a short recap.

Settings

Settings live in a file, settings.toml, which the game makes the first time it starts:

  • Linux: ~/.config/quill-and-dice/settings.toml
  • Mac: ~/Library/Application Support/quill-and-dice/settings.toml
  • Windows: AppData\Local\quill-and-dice\settings.toml

Type /settings in the game to see where it is and what each setting is now.

Every setting is explained in the file and switched off with a #. To use one, delete the # and change the value, then restart the game. If something in the file is wrong, the game still starts, and tells you which line.

Setting Default
model Claude API: claude-opus-5-5; Claude Code: your default; Gemini: gemini-4-hydrogen a cheaper model, e.g. "claude-sonnet-5-5" or "gemini-3.8-flash"
effort "low" "medium" or "high" for more considered storytelling, at a higher price
long_cache false true keeps Claude's cache for an hour instead of 5 minutes (Claude API key only): cheaper turns after long pauses, but each cache write costs 2x instead of 1.25x
language your computer's language the language the GM tells the story in, e.g. "Spanish"
backend "gemini" or "local" if you picked them; otherwise a Claude API key if there is one, then Claude Code "gemini", "local", or for Claude "cli" (Claude Code) or "api" (a key)
local_url, local_model http://localhost:11434/v1, none where your local model runs and its name (experimental; /local sets both)
saves your own saves folder (see Playing) any folder
update_check true false stops the check for new versions
dev false true turns on /gm, a developer command for calling the GM's actions by hand

Your API key isn't in the settings file, so you can share or show the Settings file safely. It's kept in its own file next to it (see Choose your GM), and /settings only ever shows its last four characters.

Updates

When the game starts, and every hour while it's open, it asks GitHub whether a newer version is out. If one is, a popup gives you three choices:

  • View changelog opens the list of what's new in your browser.
  • Update now closes the game (it's saved), installs the new version and starts it again.
  • Not now stays quiet until an even newer version comes out.

The check sends nothing about you or your game, and neither the popup nor your answer ever appears in your story or reaches the GM. To update by hand, run uv tool upgrade quill-and-dice (or, for a git copy, git pull and then pip install -r requirements.txt); on Windows, close the game first, since Windows won't let a program be replaced while it's running. That's also why, on Windows, Update now carries on in a new window: it waits for the game to close, updates it and starts it again.

Licence

The code is under the MIT License (see LICENSE). The game rules it uses come from the SRD 5.2.1 and stay under Creative Commons Attribution 4.0:

This work includes material from the System Reference Document 5.2.1 ("SRD 5.2.1") by Wizards of the Coast LLC, available at https://www.dndbeyond.com/srd. The SRD 5.2.1 is licensed under the Creative Commons Attribution 4.0 International License, available at https://creativecommons.org/licenses/by/4.0/legalcode.

Metadata

Release files for quill-and-dice 0.1.3

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

Source distribution (sdist)

Source distribution for quill-and-dice 0.1.3
File Size Uploaded Provenance Actions
quill_and_dice-0.1.3.tar.gz 190.7 kB Without provenance Details for quill_and_dice-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for quill-and-dice 0.1.3
File Interpreter ABI Platform Actions
quill_and_dice-0.1.3-py3-none-any.whl Python 3 none any Details for quill_and_dice-0.1.3-py3-none-any.whl

Total release size: 401.5 kB

Release files / quill_and_dice-0.1.3.tar.gz

Download URL quill_and_dice-0.1.3.tar.gz
Size 190.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b54a0d1f83f662bf7db0a31968701a32efc43bc8f4c4a22adce7cdeb0193249c
BLAKE2b-256 checksum
How to use checksums
be874b0201fb2021302a40b032ac021880a5834be97e7cfbf270b2651ad120c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / quill_and_dice-0.1.3-py3-none-any.whl

Download URL quill_and_dice-0.1.3-py3-none-any.whl
Size 210.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a427b1de40f3c7e5e2160dac652e6d66d89e060ff193a833d6ec21326544193e
BLAKE2b-256 checksum
How to use checksums
cc5c8c4976321cb11c6348548781edfeef63a70b0fb795a465a93033634013d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for quill-and-dice 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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