@stnd/cli
v0.3.1
Published
Standard Garden CLI — scaffold a new garden or a vertical slice
Maintainers
Readme
title: "@stnd/cli" aliases: [] created: 2026-07-04 20:58 modified: 2026-08-10T12:12:45.499Z last_audited: 2026-07-14 audit_interval_days: 90 next_audit: 2026-10-12 audit_priority: 3 maturity: sprout mode: read publish: true status: active tags:
- package
- stnd theme: kernel type: package visibility: public garden-url: https://francisfontaine.com/readme garden-short: https://stnd.gd/sVwiaF
@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 → moduleNames 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.htmlresolution 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 [priority:: 3] [token_scale:: 3] [created:: 2026-07-14] [area:: framework] 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 [priority:: 3] [token_scale:: 3] [created:: 2026-07-14] [area:: framework] exact versions forastro,@astrojs/cloudflare,svelte, andwrangler(manually re-synced 2026-09-05 against the monorepo's own pins). Nothing enforces this — the release pipeline (Phase 4) should bump them automatically so the CLI never silently drifts back to scaffolding stale versions. - [ ]
prepublishOnlyruns a real scaffold test, not juststnd help. [priority:: 3] [token_scale:: 3] [created:: 2026-07-14] [area:: framework]
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 slicePublishing
npm version patch # or minor/major
npm publish # publishConfig.access is public; `files` includes templates/