@stnd/cli
The stnd scaffolding CLI — bootstrap a new Standard garden, or scaffold a vertical slice inside an existing one.
Commands
stnd new <name> # Bootstrap a new garden (a full Standard project)
stnd module <name> # Scaffold a vertical slice in the current garden
stnd help # Show usage
# aliases: create → new, slice → module
Names are normalized to a safe kebab-case directory/id ("My Garden" → my-garden), while the raw name is kept for the project title.
What it produces
stnd new copies templates/garden/ (skipping node_modules, .astro, .turbo, dist, .git), hydrates {{PROJECT_NAME}}, and writes a .gitignore. The result is a working garden:
my-garden/
astro.config.mjs # output: "server" + Cloudflare adapter + standard()
package.json # real published version ranges (no workspace:*)
tsconfig.json
modules/pages/ # a starter vertical slice
index.module.js # routes generated from Markdown
routes/[...slug].astro
content/index.md # permalink: "/"
content/about.md # → /about (slug from path)
stnd module reads moduleFolder from the garden’s Astro config (default modules) and scaffolds templates/plugin/ as modules/<name>/, hydrating {{id}} / {{name}}. The manifest ships with every hook and route commented out, so a fresh module loads cleanly with zero extra files.
Why
output: "server"+ Cloudflare? The framework’s Astro 7 workarounds
(in@stnd/core) target the server/prerender/client build paths that the
real apps use. A pure-static garden trips the Astro 7 + Rollupindex.html
resolution bug.pnpm devandpnpm buildwork locally with no Cloudflare
account; deploy is a separate, opt-in step.
Verified
stnd new → stnd module → astro build produces a garden that prerenders its Markdown pages (/, /about) with Standard typography, a sitemap, and Cloudflare headers. Verified by linking a built app’s node_modules (the @stnd/* packages are not published to npm yet).
What’s next — open
Part of the Road to Public Release. Rolls up into the project board.
- [ ] Desert test in CI (Phase 3/4) — once the
@stnd/*packages are
published,npx @stnd/cli new my-garden && pnpm install && pnpm buildmust pass on a machine outside this monorepo. Freeze it astest/desert.test.js. Until publish, the version ranges intemplates/garden/package.jsoncan’t resolve from npm. - [ ] Keep template versions in sync —
templates/garden/package.jsonpins
@stnd/core ^0.22.1,astro 7.0.3,@astrojs/cloudflare 14.0.1,svelte 5.56.4,wrangler ^4.105.0. The release pipeline (Phase 4) should bump these automatically so the CLI never scaffolds stale versions. - [ ]
prepublishOnlyruns a real scaffold test, not juststnd help.
Layout
bin/stnd.js # entrypoint — command dispatch + help
src/commands/
create-garden.js # stnd new
create-module.js # stnd module
templates/garden/ # the scaffolded project
templates/plugin/ # the scaffolded vertical slice
Publishing
npm version patch # or minor/major
npm publish # publishConfig.access is public; `files` includes templates/