Getting started
executable.md runs markdown documents as executable workflows using the xmd command. This page gets you from install to your first run.
Install
Install the standalone xmd binary (macOS / Linux):
curl -fsSL https://executable.md/install.sh | shOr, for Deno users, run it straight from JSR:
deno run -A jsr:@executablemd/cli run doc.mdPrebuilt binaries for every platform are on the releases page. The binary is self-contained — no Node or Deno needed to run it.
Keeping it up to date
A standalone binary on macOS or Linux replaces itself. This installs the latest published stable release, verifies its checksum, and swaps the binary you just ran:
xmd upgradeTo see what would change without downloading or replacing anything:
xmd upgrade --statusThe command prints what it is doing as it goes: the release it selected, the binary it downloaded, what it verified, and the replacement itself. Add --journal <path> to also write a diagnostic JSONL trace to a new file.
Name an exact tag — xmd upgrade v1.2.3 — to install one specific release. Installing an older version needs --allow-downgrade, and a prerelease tag needs --allow-prerelease.
Every other installation is updated by whatever installed it, and xmd upgrade says so rather than replacing files it does not own: npm installs with npm install -g @executablemd/cli@latest, Bun with bun add -g @executablemd/cli@latest, Deno by naming a newer jsr:@executablemd/cli version, and a Windows binary by running the installer again or downloading the release asset.
From npm
xmd is published to npm as @executablemd/cli:
npm install -g @executablemd/cliNo registry configuration is needed — every @executablemd package resolves from the default npm registry.
Your first document
A document is a component. Frontmatter becomes meta, capitalized JSX tags expand other markdown files, and fenced blocks marked exec run and render their output.
---
title: My Project
---
# {meta.title}
<Greeting name="world" />
```bash exec
ls ./src
```Run it:
xmd run README.mdWrite a diagnostic journal
Pass --journal to write a JSONL trace of the run to a new file for troubleshooting. The path must not already exist, and the trace is never replayed.
xmd run README.md --journal .xmd/events.jsonlUseful flags
--journal,-j— write current-run journal entries to a new JSONL file (the path must not exist).--verbose,-V— print journal entries to stderr while running.--include— add component search directories (defaults tocomponentsand.).