Type to search pages and rules.

Browse pages

Initialize Consumer

litespec init starts a consumer repository from a ready-made preset.

Markdown

Name#

litespec init starts a consumer repository from a ready-made preset.

Synopsis#

Shell
litespec init --preset <name> --size <small|large> [--root <path>] [--name <project>] [--help]

Description#

This command writes litespec.project.json into the consumer root. It reads the consumer template and the named preset from the LiteSpec checkout. It overlays the preset's shape, stacks, and frontends, then stamps the project size, name, and reviewed release. It refuses to overwrite an existing project file.

Three presets ship with the release. dotnet-react selects shape server, stacks dotnet and react, and one react frontend web at apps/web. dotnet-svelte selects the same shape with stacks dotnet and svelte, and one svelte frontend web at apps/web. blazor-client selects shape client-only, stack blazor, and one blazor frontend app at apps/app.

Run it once in an empty folder, then run litespec consumer to validate the new project.

Arguments#

None. Everything passes through options.

Options#

OptionDefaultEffect
--preset <name>requiredSelects the preset: blazor-client, dotnet-react, or dotnet-svelte.
--size <size>requiredSets the project size: small or large.
--root <path>the working directorySelects the consumer repository to write into.
--name <project>the root folder's nameSets the project name.
--helpoffPrints the synopsis, the options, and the exit codes, then exits zero.

Exit codes#

CodeMeaning
0The project file was written.
1The checkout holds no readable template, preset or version.
2The project file exists, the preset or size is invalid, or an option is unknown.

Examples#

Start a small React consumer in a new folder:

Shell
litespec init --preset dotnet-react --size small --root ./shop

Start a large Blazor client and name the project:

Shell
litespec init --preset blazor-client --size large --name shop

Underneath#

This command merges templates/consumer/litespec.project.json with templates/presets/<name>.json from the LiteSpec checkout and writes the result. Nothing beneath it is separately runnable. Validate the written file with litespec consumer.