Skip to main content
Only the slurp CLI is required. Everything else on this page is optional. The Choosing components table lists what each piece covers.

The compiler

The crate is slurp-compiler and the binary it installs is slurp. That one binary does everything: build, validate, dev and gitignore.
Requires a Rust toolchain, 1.88 or newer. Slurp is on edition 2024, and its dependency tree pushes the floor from 1.85 up to 1.88. An older toolchain fails with feature "edition2024" is required rather than a version message, so run rustup update stable if you see that.

Verify it

A version number only proves the binary runs. Point it at a project to prove it works:
validate exits 0 on success and 1 if anything failed, so it is safe to put in a script or a pre-commit hook.

Choosing components

The dev server

The crate is slurp-dev-server and the binary is slurp-dev. It watches a theme, rebuilds on change and pushes a reload over a WebSocket. slurp dev is a launcher, not a second implementation: it looks for a slurp-dev binary next to the slurp binary, falls back to PATH, and forwards only --port and --fixtures. Without slurp-dev-server installed, slurp dev has nothing to launch. Invoke slurp-dev directly for the flags the launcher does not forward, such as --theme-dir, --globals or --backend-url.
The dev server binds 127.0.0.1 unconditionally and is not hardened for network exposure. It is a local tool.
See Dev server.

The image service

An HTTP service that resizes and transcodes images on demand. It is required only when a template uses the <Image> component, which emits URLs pointing at it. A plain <img> tag involves no service. It binds loopback and sends no CORS headers by default, because it fetches URLs an attacker may influence. See Images for running it and for what it refuses.

The browser runtime

slurp build produces plain HTML and injects no script tag, so a page that does not need client navigation or {fetch} refetching ships no JavaScript from Slurp. A theme that wants the runtime loads it explicitly:
ESM only, and no CommonJS build.
Read runtime/README.md before depending on any of it. Several runtime features are implemented and unit-tested but bind to markup the 0.1.0 compiler does not emit, so against the shipped compiler they attach to nothing and silently do no work. Those entry points are published under an experimental/ prefix to say so.

The MCP server

An MCP server that gives a coding agent tools to validate, render, lint and inspect templates, plus the language reference. It runs the real compiler in-process through @bytesell/slurp-compiler-wasm, so it needs no slurp binary on PATH. Requires Node 20 or newer. Most clients can fetch it on demand rather than installing it:
See Working with agents.

Editor tooling

Prettier

Formats .slurp files. Prettier 3 is a peer dependency.
.prettierrc

VS Code

The extension gives syntax highlighting, completions, hover docs, go to definition and formatting. Build and install the .vsix from a clone:
Requires VS Code 1.85 or newer, and Node 20 or newer to build.
Diagnostics do not work in 0.1.0, and they fail silently. slurp.validateOnType and slurp.validateOnSave default to true, so the feature looks live, but a file full of parse errors shows no squiggles and logs nothing. Highlighting, completions, hover and go to definition are fine. Until it is fixed, validate from the command line with slurp validate --dir . --warnings.
See Editor setup.

Embedding the compiler

To render templates from your own program rather than from the CLI:
The Rust library does not minify; only the CLI does. See Embedding with Rust and the JavaScript API.

Building from a clone

The three binaries land in target/release/ as slurp, slurp-dev and slurp-image. slurp dev prefers a slurp-dev sitting beside it, so a workspace build yields a working slurp dev with nothing installed. The JavaScript packages are a separate build, and they need Node 22 or newer, pnpm 9 or newer, and wasm-pack:
pnpm build is what produces @bytesell/slurp-compiler-wasm, which the MCP server and the compiler integration tests both import, so run it before pnpm test on a fresh clone. CONTRIBUTING.md has the full gate list.

Next

Quickstart

Build and render a real page in about five minutes.

Project structure

Special directories, output paths, and static assets.

CLI

Every subcommand and flag.

Images

The <Image> component and the image service.