Installation & Usage
Zolt can be used in two primary ways: as a Command Line Interface (CLI) or as a library integrated into your TypeScript/JavaScript projects.
Using the CLI
The CLI is the easiest way to build your Zolt documents. You can run it immediately using a package runner (npx, bunx, etc.).
Quick Start with Package Runners
If you have a JavaScript package manager installed, you can build a Zolt file without installing anything globally:
bunx @marmotz/zolt build your-file.zlt -o output.html
npx @marmotz/zolt build your-file.zlt -o output.html
pnpm dlx @marmotz/zolt build your-file.zlt -o output.html
yarn dlx @marmotz/zolt build your-file.zlt -o output.html
Live Preview
Zolt includes a built-in live preview mode with automatic page reloading (LiveReload). This is the recommended way to work on your documents:
bunx @marmotz/zolt build index.zlt --server
This will build your project, start a live preview server at http://127.0.0.1:1302 , and automatically rebuild and refresh your browser whenever you save a file.
CLI Commands Reference
For a complete list of commands and options, see the CLI Commands Reference .
Programmatic Usage (API)
You can integrate Zolt directly into your Node.js applications by using it as a library.
Installation
Install the package in your project:
bun add @marmotz/zolt
npm install --save @marmotz/zolt
pnpm add @marmotz/zolt
yarn add @marmotz/zolt
Usage
Import the high-level functions to build Zolt content programmatically:
import { buildFile, buildString, buildFileToString } from '@marmotz/zolt';
// Option A: Build a file to a specific output path
await buildFile('input.zlt', 'output.html', {
variables: { author: 'Zolt User' }
});
// Option B: Build a string and get the resulting HTML
const html = await buildString('# Hello {$name}', {
variables: { name: 'World' }
});
console.log(html); // "<h1>Hello World</h1>"
// Option C: Build a file and get the resulting HTML as a string
const htmlFromFile = await buildFileToString('input.zlt', {
variables: { author: 'Zolt User' }
});
Creating Your First Document
Create a file named hello.zlt and add some Zolt syntax:
---
title: "Hello Zolt"
author: "Your Name"
---
# Welcome to Zolt!
This is a **bold** statement and this is //italic//.
:::info [Note]
Zolt is awesome!
:::
Current date: {{ Date.buildTime() }}
Then build it:
bunx @marmotz/zolt build hello.zlt -o hello.html
npx @marmotz/zolt build hello.zlt -o hello.html
pnpm dlx @marmotz/zolt build hello.zlt -o hello.html
yarn dlx @marmotz/zolt build hello.zlt -o hello.html
© 2026 Marmotz