renovate-bot 0aedf5eecf
renovate/stability-days Updates have met minimum release age requirement
PR / test-coverage (pull_request) Successful in 18s
PR / lint (pull_request) Successful in 49s
chore(deps): update github artifact actions
2026-05-06 19:02:14 +00:00
2026-02-21 22:19:21 -05:00
2026-02-21 22:19:21 -05:00
2026-02-21 22:19:21 -05:00
2026-02-22 03:26:50 +00:00
2026-02-21 22:19:21 -05:00
2026-02-21 22:19:21 -05:00

Scrollsmith

status-badge

Scrollsmith is a Node.js tool for generating Dungeons & Dragons one-page dungeon PDFs automatically. It calls an LLM (Open WebUI /api/chat/completions or Ollama /api/generate, inferred from OLLAMA_API_URL), proofreads and refines the result, then builds a structured PDF with maps, rooms, encounters, treasure, and NPCs.


Features

  • Three-pass dungeon generation:
    1. Draft: initial dungeon ideas
    2. Refine: proofread, add flavor, fill in vague details
    3. JSON conversion: output strictly valid JSON for PDF generation
  • Automatically generates a PDF named after the dungeon title
  • PDF layout includes three columns: map & hooks, rooms, encounters & treasure & NPCs
  • Open WebUI or Ollama

Requirements

  • Node.js 22+
  • LLM endpoint (see below)
  • Gitea Releases (optional) for PDF uploads
  • .env file with:
OLLAMA_API_URL=https://your-openwebui-host/api/chat/completions
OLLAMA_API_KEY=your_api_key_here
OLLAMA_MODEL=qwen3.5-122b-a10b
COMFYUI_URL=http://192.168.1.124:8188

Installation

git clone https://github.com/yourusername/scrollsmith.git
cd scrollsmith
npm install

API Configuration

The client automatically infers the API type from the endpoint URL, making it flexible for different deployment scenarios.

Direct Ollama API

For direct Ollama API calls, set:

OLLAMA_API_URL=http://localhost:11434/api/generate

Open WebUI API

For Open WebUI API calls, set:

OLLAMA_API_URL=https://your-openwebui-host/api/chat/completions
OLLAMA_API_KEY=your_open_webui_api_key
OLLAMA_MODEL=qwen3.5-122b-a10b

Note: The API type is inferred from the URL (/api/chat/completions vs /api/generate); no OLLAMA_API_TYPE variable.


Usage

  1. Configure .env and ensure the LLM endpoint is reachable.
  2. Run:
npm start
  1. A PDF will be generated automatically. The filename matches the dungeon title.

Optional: update the map path in index.js if you have a local dungeon map.


Project structure

  • index.js Entry point: env, model init, dungeon + image + PDF.
  • src/ Application modules:
    • dungeonGenerator.js LLM-backed dungeon content generation and validation.
    • dungeonTemplate.js HTML template and layout for the PDF.
    • ollamaClient.js Ollama/Open WebUI API client and text cleaning.
    • imageGenerator.js Map image generation (Ollama + optional ComfyUI).
    • generatePDF.js Puppeteer-based PDF generation from the template.
  • test/ Unit tests (test/unit/) and integration tests (test/integration/).

Example Output

  • the-tomb-of-shadows.pdf

  • Three-column layout:

    • Column 1: Map, Adventure Hooks, Rumors
    • Column 2: Rooms
    • Column 3: Encounters, Treasure, NPCs

Notes

  • Open WebUI needs a valid OLLAMA_API_KEY when the server requires it.
  • Dungeon generation can take a few minutes depending on your LLM response time.

License

PROPRIETARY

S
Description
No description provided
Readme 1.1 MiB
2026-04-30 Latest
2026-04-30 00:03:38 +00:00
Languages
JavaScript 100%