MCPcopy Index your code
hub / github.com/BigJk/snd

github.com/BigJk/snd @v1.3.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.3.1 ↗ · + Follow
1,115 symbols 2,876 edges 251 files 222 documented · 20% updated 1d agov1.3.1 · 2026-07-06★ 6622 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

S&D Header


Sales & Dungeons Sales & Dungeons

Discord GitHub Discussions GitHub release (latest by date)

Sales & Dungeons — Thermal Printer as D&D Utility.

With Sales & Dungeons you can create highly customizable handouts, quick reference and much more for your Dungeons and Dragons (or other PnP) Sessions. Most Thermal Printer are small in size and can be taken with you and kept right at the gaming table. Use-cases range from printing out magic items, spells or a letter that the group found to little character sheets of your players to use as DM note. The possibilities are nearly endless!

Printer SetupTested PrinterWiki

Important: If you have trouble getting this to work it's best to drop by our Discord.

Screenshot

Screenshot Generator

Screenshot AI

Features

  • Works on
  • Windows
  • Mac (Intel, M1)
  • Linux (x64, ARM64)
  • Raspberry Pi (ARMv6, ARMv7)
  • Android (Experimental)
  • Anything else go can be compiled on
  • Extensive templating system through Nunjucks
  • Extensive random generator system
  • Various connection methods
  • Windows Direct Printing
  • Raw USB Printing
  • CUPS (Linux, Mac)
  • Serial
  • Android USB Printing
  • Import & Export templates and data sources
  • Fast access to external data sources like Open5e (instant access to SRD monsters, spells and more)
  • Import data from other sources:
  • CSV
  • FoundryVTT Modules
  • Fight Club 5e XML Format
  • 5eTools
  • Access Community Templates, Generators & Data Sources from within the App
  • AI LLM Support (OpenAI, OpenRouter, Custom Local)
  • Generate entries by prompt using the power of AI
  • Translate entries by prompt
  • Execute AI prompts in your templates and generators
  • Support for using Local LLMs (for example via LM Studio) or any custom endpoints that are compatible with OpenAI API
  • Cloud sync for templates, generators and data sources

🖨️ Examples

Some example prints

image

📁 Download

You can find the latest version on the release page:

  • https://github.com/BigJk/snd/releases

:apple: Mac

The mac bundles are not signed at the moment so you might face the following problems when opening the application:

It's not opening because it's from a unverified developer

If your mac is telling you that this app is from a unverified developer you can allow it via the "Privacy & Security" settings. More info: Open a Mac app from an unidentified developer

It's not opening because the app "is damaged"

On M1, M2, etc. it can happen that the app is reported as damaged. Just copy Sales & Dungeons into your Applications folder and execute the following command to allow it to run:

xattr -d com.apple.quarantine "/Applications/Sales & Dungeons.app/"

:whale: Docker

The headless version of Sales & Dungeons (using LibUSB) is also available via a docker container:

  1. docker pull ghcr.io/bigjk/snd:master (container)
  2. docker run -p 7123:7123 --device=/dev/bus/usb --group-add uucp -v /some/place/to/persist:/app/userdata ghcr.io/bigjk/snd:master
  3. change /some/place/to/persist to a folder where the user data should be persisted to
  4. replace /dev/bus/usb with the device of your usb/serial printer
  5. replace uucp with a group (or gid) allowed to read the device file (use $(stat -c "%g" /dev/bus/usb) to get the right group)
  6. Open http://127.0.0.1:7123 in your favorite browser

Docker Compose Example

version: "3"
services:
  snd:
    image: ghcr.io/bigjk/snd:master
    ports:
      - "7123:7123"
    devices:
      - "/dev/bus/usb"
    group_add:
      - uucp
    volumes:
      - "/some/place/to/persist:/app/userdata"

Printer Requirements

At the moment Sales & Dungeons only supports the ESC/POS (Epson Standard Code) control codes, which is still one of the most used control code set. Check if a thermal printer you are interested in mentions ESC/POS or Epson in the description or manual.

In general the rule of thumb is:

  • Most cheap chinese thermal printer found on Amazon or AliExpress support it
  • Most epson thermal printer obviously support it
  • A lot of older Serial printer (like Metapace T-1) also support it

More specific information about tested printers can be found in the wiki: Printer-Settings

How It Works

Sales & Dungeons

Templates: Templates are created in HTML (and CSS) in combination with the Nunjucks templating language. You can imagine the templates as little websites. That makes it possible to use all the nice and convenient layout options that HTML and CSS has to offer and even include any common framework you might need (e.g. Fontawesome for Icons).

Rendered HTML: After creating a template you can create entries with the data you want and print them. Nunjucks will create the rendered HTML from the data you want to print.

Rendered Image: Then this HTML get's converted to an image. Currently this conversion is done by Chrome via the Chrome Debug Protocol. Although Chrome seems like a huge overkill for just HTML-To-Image conversion it's the standard solution at the moment because it supports most of the modern HTML and CSS features.

ESC / POS Commands: The last step before our awesome template hits the Printer is the conversion from the rendered image to the "draw image" command of the printer.

Printer: The generated command will then be sent to the printer and printed. Now your template is ready to be used!

:tada: :tada: :tada:

Printers, Templating & Building

If you want to see what printers were already tested, which settings they need, how the templates work or how you can build Sales & Dungeons yourself please visit the wiki.

Thanks to all contributors ❤

Found the project useful? :smiling_face_with_three_hearts:

ko-fi

Credits

Icons used in the Sales & Dungeons Logo were made by Smashicons, Good Ware from www.flaticon.com

Extension points exported contracts — how you extend this code

Printer (Interface)
Printer represents the interface a printer should implement to be use-able in S&D. [13 implementers]
printing/printer.go
ImportReader (Interface)
ImportReader represents an arbitrary file reader that can be used to import templates and sources. [5 implementers]
imexport/imexport.go
Database (Interface)
Database represents all database functions that are needed for S&D to work. [3 implementers]
database/database.go
Option (FuncType)
Option represent an configuration option for the server.
server/server.go
GeneratorImportFunc (FuncType)
GeneratorImportFunc is a function that imports a generator from a given set of arguments.
rpc/imexport/generator_import.go
FilePicker (Interface)
(no doc)
rpc/file_browser.go
PostHandler (Interface)
(no doc)
rpc/bind/bind.go
Bridge (Interface)
(no doc)
printing/androidusb/androidusb.go

Core symbols most depended-on inside this repo

MustBind
called by 82
rpc/bind/bind.go
_make_request
called by 76
sdk/python/snd_sdk.py
Close
called by 51
database/database.go
buildId
called by 44
frontend/src/js/types/basic-info.ts
ID
called by 34
template.go
Arg
called by 26
rpc/imexport/imexport.go
Write
called by 25
rpc/cache.go
NewImExport
called by 25
rpc/imexport/imexport.go

Shape

Function 629
Method 373
Struct 78
Interface 15
Class 10
FuncType 7
TypeAlias 3

Languages

Go49%
TypeScript39%
Python7%
Kotlin5%

Modules by API surface

sdk/python/snd_sdk.py79 symbols
database/cloud/cloud.go35 symbols
database/database.go31 symbols
database/badger/badger.go31 symbols
database/storm/storm.go30 symbols
database/memory/memory.go30 symbols
mobile/mobile.go20 symbols
frontend/src/js/ui/views/settings.ts19 symbols
frontend/src/js/core/store.ts17 symbols
android/app/src/main/java/app/salesanddungeons/AndroidFilePickerBridge.kt17 symbols
server/server.go16 symbols
imexport/zip.go16 symbols

For agents

$ claude mcp add snd \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact