CLI & Offline HTML
Build standalone offline HTML notes and complete Standard Gardens directly from the terminal with no web server.
Standard Garden ships a dedicated product CLI (@stnd/garden) for publishing, unpublishing, syncing, and compiling local Markdown files — with or without Obsidian.
Installation
# Product CLI (publish, unpublish, sync, offline HTML)
npm install -g @stnd/garden
# or run without installing:
npx @stnd/garden help
# Framework CLI (Astro scaffolding & vertical-slice checks)
npm install -g @stnd/cli
Publish & Manage Live Notes (garden push / unpublish / sync)
Authenticate once using your Standard Garden API key (STANDARD_GARDEN_API_KEY or --key), or run inside an Obsidian vault where the Standard Garden plugin is already connected (reads .obsidian/plugins/standard-garden/data.json automatically).
# Publish or update one or more notes (respects frontmatter permalink, publish, visibility, theme)
garden push path/to/note.md
garden push notes/*.md --key sg_your_api_key
# Unpublish a note by file path or slug
garden unpublish path/to/note.md
garden unpublish my-note-slug
# Inspect local vault vs online sync status
garden sync ~/Documents/MyVault
| Flag | Purpose |
|---|---|
--key <api_key> |
Standard Garden API key (falls back to STANDARD_GARDEN_API_KEY or plugin data.json) |
--url <api_url> |
API base URL (default: https://standard.garden/api) |
--vault <path> |
Explicit Obsidian vault path when reading plugin credentials |
Build Offline HTML (garden <file.md | dir>)
Powered by @stnd/press, @stnd/styles, and @stnd/themes, garden also compiles any local Markdown file or folder into self-contained, book-typeset HTML completely offline — no Astro build and no web server.
Single Note (.md → standalone .html)
garden note.md
garden essay.md --theme editorial -o essay.html
Produces a single self-contained .html file (CSS and theme variables inlined) you can double-click locally, attach to an email, or host anywhere.
Full Folder / Vault (dir → offline HTML site)
garden ./notes -o ./dist
garden ./docs --theme documentation --mode manual -o ./site
stnd press ./vault --strict --inline -o ./export
Directory builds generate index.html (with an instant offline search filter), per-page .html files with relative links that work over file://, search-index.json, and copy local images and PDFs automatically.
| Flag | Purpose |
|---|---|
-o, --out <path> |
Output .html file or directory (default: ./dist) |
-t, --theme <name|path> |
Built-in theme from @stnd/themes or path to a custom theme .md file |
--title <string> |
Site title for directory builds |
--mode <auto|manual|garden> |
Layout mode: flat garden index (garden) or sidebar chapters (manual) |
--strict |
Only compile pages with publish: true in frontmatter |
--inline |
Inline CSS inside every page instead of linking assets/standard.css |
--no-search |
Skip generating search-index.json |
--config <path> |
Load chapters/title/theme from a manual.json file |
Export Directly From Standard Garden
You can also generate the exact same portable HTML straight from any live garden without touching the terminal:
- Single note HTML: append
.htmlor/htmlto any note URL (or run::export-htmlin the command palette). - Full garden offline website (ZIP): run
::export-garden-htmlin the command palette (or hit/api/export/garden-htmlwhile signed in) to download a ZIP containingindex.html, every note page,assets/, andsearch-index.json.
Project Scaffolding (stnd)
When you want a full Astro + Cloudflare Workers application instead of static HTML:
stnd new my-garden # Scaffold a new project (garden, landing, blog, photo)
stnd module my-feature # Add a vertical-slice module inside modules/
stnd check # Audit markup and CSS tokens against Standard rules
See Also
- Frontmatter Schema Reference – Complete guide to note metadata and token overrides
- Themes – Available classical temperaments
- Command Palette – Keyboard shortcuts and
::export-html/::export-garden-html - API Documentation – REST API reference