sitefile

Full documentation: opensource.johnhenry.me/sitefile
Docker-inspired static artifact builder. Compose immutable filesystem trees from
local and remote sources, render templates, and export a deployable directory —
no container runtime, no shell, no runtime dependencies.
# examples/hello/Sitefile
ARG TITLE = "Hello"
LET GREETING = "Welcome to ${TITLE}."
COPY ./public/ /
RENDER --escape=html ./templates/index.html TO /index.html
EXPORT / AS directory
sitefile build examples/hello --build-arg TITLE="My site"
This writes examples/hello/dist/index.html (with the title substituted) and
examples/hello/dist/style.css.
Contents
- Install
- Status
- CLI
- Variants:
sitefile bake
- Watch mode
- Profiling a build
- Images and servers
- Export formats
- Rust implementation
- Editor support
- Docs
- Development
- Adding a new plugin
- Security model
- Family
- License
Install
npm install -g @johnhenry/sitefile # the `sitefile` command (TypeScript implementation)
npx @johnhenry/sitefile build . # or without installing
Requires Node.js 26 or later; the npm package has no runtime dependencies.
Prebuilt binaries
The Rust binary is faster and is the one that provides sitefile lsp for
editors. Each GitHub Release
after v0.0.5 carries sitefile-<version>-<target>.tar.gz for
aarch64-apple-darwin, x86_64-apple-darwin, x86_64-unknown-linux-gnu
and aarch64-unknown-linux-gnu (each holds sitefile, LICENSE and
README.md), the VS Code extension sitefile-vscode-<version>.vsix, and
SHA256SUMS. Download, verify, and put the binary on PATH:
v=0.0.6 t=aarch64-apple-darwin # the release you want; a target from the list above
base=https://github.com/johnhenry/sitefile/releases/download/v$v
curl -fsSLO "$base/sitefile-$v-$t.tar.gz" -O "$base/SHA256SUMS"
shasum -a 256 -c --ignore-missing SHA256SUMS # Linux: sha256sum -c --ignore-missing SHA256SUMS
tar -xzf "sitefile-$v-$t.tar.gz"
install -m 755 "sitefile-$v-$t/sitefile" ~/.local/bin/ # any directory on PATH
Or with the GitHub CLI: gh release download v$v -R johnhenry/sitefile -p '*aarch64-apple-darwin*' -p SHA256SUMS. The macOS binaries are not signed or
notarized: if Gatekeeper blocks a downloaded one, run
xattr -d com.apple.quarantine sitefile. The Linux binaries link glibc
(built on Ubuntu 22.04, glibc 2.35). There is no Windows build yet: the Rust
port uses Unix file APIs.
From source
git clone https://github.com/johnhenry/sitefile && cd sitefile
cargo install --locked --path rust # installs ~/.cargo/bin/sitefile
Needs a stable Rust toolchain (1.85 or later) and a C compiler (ring and
the vendored Brotli encoder are C).
@johnhenry/sitefile is a new package: it was never published to npm under any
name, and 0.0.0 is its first version.
The library API is the same engine the CLI uses (import { … } from "@johnhenry/sitefile"); see docs/ARCHITECTURE.md.
Status
Milestones M0 (local vertical slice), M1 (remote inputs) and M2
(trees and stages: multi-stage builds, COPY --from, archive imports,
.sitefileignore; see examples/multistage) are implemented and tested; see docs/TASKS.md. Requires Node.js 22+,
no runtime dependencies.