CLI Reference
Command Line Interface specifications for the Standard Framework.
The @stnd/cli package enforces strict project scaffolding, vertical-slice module generation, and automated compliance auditing. Bypassing the CLI to manually copy directories or configure ad-hoc files introduces structural deviations.
Installation & Quick Execution
You can run @stnd/cli directly using npx or install it globally via pnpm:
# Direct execution
npx @stnd/cli <command> [options]
# Global installation
pnpm add -g @stnd/cli
stnd <command> [options]
1. Project Scaffolding (stnd new)
The core command to bootstrap a new application adhering strictly to the Standard Framework, vertical-slice architecture, and Cloudflare Edge runtime.
# Interactive template picker
stnd new my-project
# Direct template specification
stnd new my-garden --template garden
stnd new my-product --template landing
stnd new my-journal --template blog
What it sets up:
- Complete Astro environment configured with
@stnd/coreand@astrojs/cloudflare. - Strict
@modules/path aliases intsconfig.json. - Minimal root
src/directory (Law 5: no business logic insrc/). - Initial vertical slice inside
modules/<feature>/with working routes and layout.
2. Vertical Slice Generation (stnd module)
To ensure structural uniformity, new feature slices are generated with their manifest and isolation boundaries intact.
stnd module <module-name>
# Alias: stnd slice <name>
Execution Protocol:
- Creates
modules/<module-name>/. - Scaffolds the mandatory
index.module.jsmanifest declaringid,name,role, androutes. - Sets up subdirectories for
routes/,components/, and pure helper models. - Guarantees zero cross-module import coupling (Law 4).
3. Compliance & Diagnostic Auditing (stnd check)
Audits components, stylesheets, and markup across .astro, .svelte, and .html files against Standard Framework invariants.
# Audit the current project
stnd check
# Ratchet mode: enforce strict zero-regression policy (used in pre-push and CI)
stnd check --ratchet
# Structured JSON output tailored for AI coding agents
stnd check --format=agent
# Compact one-line-per-violation output
stnd check --compact
# Lock in existing issues as the new baseline
stnd check --update-baseline
Rules Checked:
- Single Source of Truth: Detects and prevents redundant class styling on native semantic elements (e.g.
<main class="main">). - Zero Color Regressions: Enforces that newly authored styles consume
@stnd/stylesOKLCH tokens rather than unvetted raw color literals. - Diagnostic Links: Every failure outputs a direct clickable link to its corresponding fatal diagnostic page on
stnd.build(/manual/diagnostic/<code-name>).
4. Aliases & Help (stnd help)
| Command | Aliases | Description |
|---|---|---|
stnd new |
create |
Scaffolds a new project from a blueprint template |
stnd module |
slice |
Scaffolds a vertical-slice module in the current app |
stnd check |
doctor, audit |
Audits markup, tokens, and module boundaries |
stnd help |
-h, --help |
Displays usage instructions and available options |