meld

modular prompt scripting for
people tired of repeating themselves

Meld is a document templating language designed for creating modular prompts and dynamic text content. It processes special directives while preserving the rest of your document exactly as written.

Simple & Predictable

Clear syntax boundaries that don't interfere with your markdown. No complex programming knowledge required.

Modular by Design

Import and embed external files. Define reusable commands. Create templates with variable interpolation.

Dynamic Content

Execute shell commands and capture their output. Access environment variables. Process data from various sources.

How It Works

Meld processes special directives in your documents while preserving all other content exactly as written. This makes it perfect for building modular prompts and templates.

Example: Template with Variables
---
! Define some variables
@define name = "World"
@define greeting = "Hello"

! Use the variables in text
{{ greeting }}, {{ name }}!

! Execute a command and capture its output
@run date
Today is: {{ output }}
Example: Importing Content
---
! Include content from other files
@import intro.md
@import examples/basic.md

! Only import a section from another file
@import examples/advanced.md#section2

! Add dynamic data
@data users = [
  { "name": "Alice", "role": "Admin" },
  { "name": "Bob", "role": "User" }
]


{{#each users}}
- {{name}}: {{role}}
{{/each}}

Use Cases

  • LLM Prompting - Build complex, modular prompts for AI systems
  • Documentation - Create documentation with dynamic examples and content
  • Content Generation - Generate template-based content with variable substitution
  • Data Transformation - Transform structured data into readable documents

Meld provides both a command-line interface for simple file processing and a JavaScript/TypeScript SDK for integration into your applications.