A file-first desktop application for writers and worldbuilders, built with Electron, Preact, and Tailwind CSS.
Trama opens a folder on your machine and works directly with standard Markdown files and YAML frontmatter. Your manuscript, outline, and lore stay on disk in formats you can edit anywhere.
Project & files
- File-first workflow — Data lives in your folders; Trama reads and writes real
.mdfiles and keeps.trama.index.jsonin sync. - Section sidebar — Trees scoped to
book/,outline/, andlore/with filter, create/rename/delete, and drag-and-drop reorder. - Smart conflict handling — Detects external file changes and helps you resolve edits safely.
- Git version history — Save snapshots, browse revisions per document, preview past versions in the editor, and restore when you need to roll back. Local Git on your machine; no remote or account required.
Editing
- Rich Markdown editor — Quill-based visual editing with Markdown persistence and YAML frontmatter.
- Split workspace — Two panes side by side, draggable divider, per-pane back/forward history, and shared zoom.
- Focus mode & fullscreen — Distraction-free writing with line, sentence, or paragraph emphasis around the caret.
- Paste from Markdown — Clipboard Markdown becomes rich editor content.
- Smart typography — Common shortcuts (e.g.
--→ em dash) with undo support. - Wiki tag links — Tag index stays fresh after saves; Ctrl/Cmd+click jumps to linked documents.
- Images — Embedded images are stored under project-local
res/when you save.
Special document types
- Map documents — Image-based maps with pan/zoom and interactive markers tied to your lore.
Themes & chrome
- Appearance — Light, dark, and system themes.
- Context menu — Workspace actions (split, focus, export, and more) from the native right-click menu.
Import, export & integrations
- AI import / export — Structured clipboard import (
=== FILE: … ===) with preview and replace/append modes; export selected project files for LLM workflows, with optional frontmatter stripping. - Book export — Multi-format export (Markdown, HTML, DOCX, EPUB, PDF) with layout directives and images.
- ZuluPad import — Bring
.zulunotes into your project structure.
- Project templates — Pre-defined schemas for characters, locations, and world-building notes.
- Backend: Electron 41.x (Node.js for native FS access)
- Frontend: Preact 10.x + Vite 8.x
- Styling: Tailwind CSS 4.x
- Editor: Quill 2.x (Custom Markdown integration)
- Validation: Zod 3.x for IPC contracts
- PDF Generation: pdf-lib 1.x
- DOCX Generation: docx 9.x
- EPUB Generation: epub-gen 0.1.x
- YAML Parsing: yaml 2.x
- Node.js (Project uses
package.jsonwith ESM) - npm
- Clone the repository:
git clone https://github.com/luisoncpp/trama.git cd trama - Install dependencies:
npm install
Run the development server (starts both Vite and Electron):
npm run devRun the test suite (Vitest):
npm run testIn agent or sandboxed environments, prefer the PowerShell runner:
powershell -ExecutionPolicy Bypass -File scripts/run-tests.ps1For smoke tests (requires build):
npm run test:smokeTo create a production-ready Windows installer:
npm run dist:winTo build without packaging:
npm run pack:winelectron/: Main process, IPC handlers, and services (TypeScript).ipc/handlers/: Typed IPC handler modules (project, AI, book export, Zulu, Git history).services/: Document repository, index service, watcher, export pipelines.
src/: Preact renderer source code.features/project-editor/: Domain-driven feature modules (editor, sidebar, pane workspace).shared/: Shared IPC types and constants between main and renderer.
mds/: Design specifications, architecture docs, implementation plans, and lessons learned.tests/: Comprehensive test suite (unit, integration, and smoke tests).
If you are starting a new implementation conversation, begin with:
This entrypoint routes to the mandatory docs that are often missed:
Contributions are welcome. Please read mds/dev-workflow.md for the development workflow, testing requirements, and documentation update protocol.
GPL-3.0-or-later - see the LICENSE file for details.