Stone.jsDocs
Paradigm

Reference

CLI reference

One command line drives every project type. It reads the same Blueprint your app does, so the commands available reflect the adapters you stacked, not a fixed list.

#Commands

CommandAliasWhat it does
stone servedevStart the development server with hot reload.
stone buildprodProduce the production build for your configured target.
stone previewpServe the production build locally.
stone exporteEmit the static output (SSG) to disk.
stone listlsList the routes and commands the Blueprint resolves.
stone initiScaffold a new project into the current directory.
stone typingstGenerate the .stone/ type declarations (add --watch).
stone cache-clearccClear the build cache.
stone <custom>·Run a handler exposed as a CLI command (node-cli-adapter).

Names and aliases are interchangeable: stone dev is stone serve, stone prod is stone build. The list is not fixed. It grows with the adapters you stack, because each command is itself a handler the CLI adapter resolves from the Blueprint.

#Flags

FlagOnWhat it does
--ssgbuild, exportForce static generation, regardless of the configured rendering mode.
--rendering, -rserve, buildPick the rendering mode for this run: csr, ssr or ssg.
--lazybuildBuild lazily: emit only what the entry actually reaches.
--imperative, -iserveRun against the imperative entry instead of the decorated one.
--language, -langserve, buildTarget language for the build (ts or js).
--target, -tpreviewWhich built target to preview.
--starters, -sinitPick a starter template for the new project.
--yes, -y / --force, -finitSkip prompts / overwrite an existing directory.
--watch, -wtypingsRegenerate declarations on change.

A flag is a shortcut over the Blueprint: --ssg is the same decision as stone.builder.rendering = 'ssg', taken for one run instead of written into config.

#Typical flow

terminalbash
npm create @stone-js@latest my-app   # scaffold
cd my-app && npm install
npm run dev                          # stone dev
npm run build                        # stone build
npm run preview                      # stone preview

#The codegen directory

The CLI generates a .stone/ directory during a build: the entry that discovers your modules, and the wiring for the chosen target. It is derived output, safe to delete, and regenerated on the next build. Do not edit it or commit it.


Stone.js

Your app exists in every runtime. Until you run it.

An open-source project by Stone Foundation
Created by Mr. Stone (Evens Pierre)