Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/pompom454/tea/llms.txt

Use this file to discover all available pages before exploring further.

Tea is a free (gratis and libre) story format for Twine and Twee, forked from the widely-used SugarCube 2 engine. It gives interactive fiction authors a powerful macro language, robust state and save management, audio playback, and a JavaScript-based scripting layer — all in a single self-contained format file.

Installation

Add Tea to Twine 2, Tweego, or Twine 1/Twee in minutes

Quickstart

Write your first interactive story with Tea’s macro language

Macro Reference

Browse all 50+ built-in macros for display, control, audio, and more

API Reference

Explore the full JavaScript API for Config, State, Save, and more

Why Tea?

Tea builds on the SugarCube 2 foundation with a rich feature set for modern interactive fiction:
  • Rich macro language — 50+ built-in macros covering variables, control flow, interactive UI, DOM manipulation, audio, and more
  • TwineScript — full JavaScript-based scripting with story variables, temporary variables, and expression support
  • State & history — configurable history depth, PRNG support, and per-save metadata
  • Comprehensive saves — browser auto-saves, slot saves, disk export/import, and base64 encoded saves
  • SimpleAudio — tracks, groups, and playlists for rich soundscapes
  • Custom macros — extend Tea with your own macros using the Macro and MacroContext APIs

Core Language

Learn Tea’s markup syntax and TwineScript expressions

Guides

Deep-dive guides on saving, audio, localization, and custom macros

Build docs developers (and LLMs) love