Stormy CLI
Run commands with npx @stormycms/cli, or use pnpm exec stormy inside the starter.
stormy init
Creates a project from the bundled Next.js starter, writes environment files, installs dependencies, and initializes Git.
npx @stormycms/cli init --name my-site --target ./my-site| Option | Behavior |
|---|---|
-n, --name <name> | Lowercase kebab-case name. Prompts if omitted. |
-t, --target <path> | Empty or nonexistent directory. Prompts with ./<name> if omitted. |
--skip-env | Writes .env files with example values without prompting. |
--skip-install | Skips pnpm install. |
See Getting started for credentials and the first page.
stormy generate
Reads React .tsx files in one directory and writes CMS component registrations. It does not scan subdirectories.
pnpm exec stormy generate --components packages/components/src/lib --output packages/components/draft.ts --framework react| Option | Default |
|---|---|
-c, --components <path> | packages/components/src/lib |
-o, --output <path> | packages/components/src/index.ts |
-f, --framework <name> | Detects dependencies in the current directory |
Output overwrites the target file. The current React generator emits a legacy
stormycmsimport,componentIdmetadata, and component-name import paths. Use@stormycms/react/cms, removecomponentId, fix paths to match filenames, and merge registrations into your default export map. Review fields, defaults, and placement rules.
React is the included framework plugin. It must resolve as @stormycms/react/plugin from the current project. Detecting another framework does not install a plugin for it.
Configuration
CLI flags override stormy.config.ts values:
import type { StormyConfig } from '@stormycms/cli';
export default { framework: 'react', components: 'packages/components/src/lib', output: 'packages/components/draft.ts',} satisfies StormyConfig;Prop mappings
| Type | Generated field |
|---|---|
string, number | input |
boolean | checkbox |
Date | dateTime |
LongString | textarea |
Markdown | markdown |
ImageAsset | image |
| String literal union | radio for up to three options, otherwise select |
string[], number[], boolean[] | textList, numberList, checkboxList |
LongString[] | textareaList |
ImageAsset[], Markdown[] | list with the corresponding field type |
Record | keyValueList |
| Object array with local type definition | complexList |
LongString, Markdown, and ImageAsset come from @stormycms/core. The parser reads syntax in each file, so imported prop definitions may need manual registration. Object props can produce object, which is not a supported CMSField variant.
Last updated: 10/20/26, 1:09 AM