Renovate Bot fb1c9d32e2
All checks were successful
PR / test-coverage (pull_request) Successful in 22s
PR / lint (pull_request) Successful in 30s
Update https://github.com/actions/upload-artifact action to v7
2026-03-04 18:03:07 +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-21 22:19:21 -05: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-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 uses an Ollama LLM server to create dungeon content, proofreads and refines it, then formats it into 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
  • Easy to integrate with a local Ollama server

Requirements

  • Node.js 22+
  • Ollama server running and accessible
  • Gitea Releases (optional) for PDF uploads
  • .env file with:
OLLAMA_API_URL=http://localhost:3000/api/chat/completions
OLLAMA_API_KEY=your_api_key_here
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=http://localhost:3000/api/chat/completions
OLLAMA_API_KEY=your_open_webui_api_key

Note: The API type is automatically inferred from the endpoint URL. If the URL contains /api/chat/completions, it uses Open WebUI API. If it contains /api/generate, it uses direct Ollama API. No OLLAMA_API_TYPE environment variable is required.


Usage

  1. Make sure your Ollama server is running and .env is configured.
  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: loads env, initializes the Ollama model, runs dungeon generation, image generation, and PDF output.
  • 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

  • Make sure your Ollama server is accessible and API key is valid.
  • Dungeon generation can take a few minutes depending on your LLM response time.

License

PROPRIETARY

Description
No description provided
Readme 651 KiB
2026-03-01 Latest
2026-03-01 10:47:47 +00:00
Languages
JavaScript 100%