Skip to content

CLI

The astro-slides CLI drives every stage of a deck’s life: developing, building, exporting, and serving the MCP server. Run it through pnpm (pnpm astro-slides <command>) or via the bin if the package is installed globally.

Terminal window
astro-slides <command> [root] [flags]

Every command takes an optional positional root — the project directory. It defaults to the current working directory.

Start the Astro dev server and watch the deck. Hot reload is scoped per slide.

Terminal window
astro-slides dev [root] [--remote[=<password>]]
FlagDescription
--remoteBind to 0.0.0.0 and stand up the mobile-remote sync gateway. The URL is open on your LAN — anyone with it can drive the deck.
--remote=<password>Same, but derives an access token from the password so only holders of the tokenized URL can connect.

With --remote, the CLI prints a QR code and the /entry URL a phone opens to become a touch remote.

While dev is running in an interactive terminal, single keypresses trigger actions. Press ? to reprint the list.

KeyAction
rrestart the dev server
oopen the deck in your browser
eopen the deck source in your editor
cclear the console
mtoggle the MCP server
qquit
?show the shortcut list

Ctrl+C also quits.

Build the deck to static output via Astro’s build. Produces a dist/ directory you can host anywhere (GitHub Pages, Netlify, etc.).

Terminal window
astro-slides build [root]

Build the deck, start a preview server, and drive headless Chromium to render an export. Supports PDF, PNG, editable PPTX, and an offline HTML bundle.

Terminal window
astro-slides export [root] --format <pdf|png|pptx|html> [flags]
FlagDefaultDescription
--format <fmt>pdfOutput format: pdf, png, pptx, or html.
--output <path>per-formatOutput file or directory (see below).
--range <spec>all slidesSubset of slides to include, e.g. "1,3-5,8".
--per-slidefalsePDF: write one file per slide instead of one combined document.
--with-clicksfalsePNG: emit one image per click step, not just per slide.
--with-tocfalsePDF: add a document outline (bookmarks) from slide titles.
--rasterizefalsePPTX: rasterize every slide to a full-slide image instead of extracting editable shapes.
--darkfalseForce the dark color scheme.
--scale <n>PNG DPR 2Render scale — PNG device-pixel-ratio / PDF page scale.
--omit-backgroundfalsePNG: transparent background.
--executable-path <path>bundledUse a custom Chromium binary.

Output paths. When --output is omitted, PDF writes <deck>.pdf, PPTX writes <deck>.pptx, PNG writes into a <deck>-png/ directory, and HTML writes dist.zip. For --per-slide PDF the --output value is treated as a directory.

Terminal window
# Combined PDF of the whole deck
astro-slides export --format pdf --output talk.pdf
# One PNG per slide, only slides 1, 3-5 and 8, at 3x DPR
astro-slides export --format png --range "1,3-5,8" --scale 3
# Editable PowerPoint
astro-slides export --format pptx --output talk.pptx
# Offline HTML bundle (zipped dist/)
astro-slides export --format html --output talk.zip

Run the astro-slides MCP server so an MCP-aware client (Claude Code, Cursor, Windsurf, custom agents) can read, write, navigate, and export decks. Defaults to stdio transport; use --transport http for Streamable HTTP.

Terminal window
astro-slides mcp-server [root] [--transport <stdio|http>] [flags]
FlagDefaultDescription
--transport <t>stdioTransport: stdio or http (Streamable HTTP).
--host <ip>127.0.0.1Bind host (HTTP only).
--port <n>4444Port (HTTP only).
--token <secret>Bearer token. Also read from ASTRO_SLIDES_MCP_TOKEN. Required for HTTP over a non-loopback host.
--read-onlyfalseDisable the write tools (read/navigate/export only).
--sync-gateway <url>URL of a running dev sync gateway, so navigate tools can drive a live deck.
--sync-token <token>Token for the sync gateway.
Terminal window
# stdio (for a local agent that spawns the process)
astro-slides mcp-server
# HTTP with a bearer token
astro-slides mcp-server --transport http --port 4444 --token "$(openssl rand -hex 16)"
  • packages/cli/src/main.ts — every command, flag, and the in-TTY shortcut map (SHORTCUTS).
  • docs/architecture/cli.md — the CLI surface design spec.