5.2 CLI Reference
“Manual initialization guarantees human error.” — Standard Technical Directives, 2026
The @stnd/cli package enforces strict project scaffolding and module generation. Bypassing the CLI to manually copy directories or configure files introduces systemic deviations and is expressly forbidden.
1. Initialization (create-stnd)
The core command to bootstrap a new application adhering to the Standard Framework.
npm create stnd@latest my-project
Execution Protocol:
- Initializes an Astro environment.
- Configures strict dependency boundaries.
- Injects the
stnd.config.tsconfiguration file. - Establishes the
modules/directory to enforce Vertical Slice Architecture.
2. Module Generation (stnd generate)
To ensure structural uniformity, all new feature slices must be generated via the CLI.
npx stnd generate module <module-name>
Execution Protocol:
- Creates a dedicated directory under
modules/<module-name>/. - Scaffolds the mandatory
index.module.jsmanifest. - Generates empty
ui/,api/, andmodels/subdirectories. - Validates the module ID against existing configurations to prevent namespace collisions.
3. Cache Invalidation (stnd clean)
During development, aggressive caching strategies (Vite, Cloudflare Miniflare) may cause state discrepancies.
npx stnd clean
Execution Protocol:
- Purges local
.astrocache. - Purges local
.wranglerstate storage. - Restores the development environment to absolute zero.
Directive: Run this command prior to opening any architectural bug reports.