StaticgenerateInternalStaticgeneratecalled under the hood when provisioning both psychic and dream applications.
StaticloadStarts the Dream console
Staticprovideuse this method for initializing a standalone dream application. If using Psychic and Dream together,
a different pattern is used, which leverages the generateDreamCli method instead.
StaticspawnRun a developer-authored CLI command. Always runs in argv form (the
underlying child_process spawn is called with shell: false):
command is exec'd literally and opts.args are passed as separate
argv elements. Shell-form invocation is intentionally not supported —
there is no caller that needs &&-chaining, globs, or other shell
features that can't be expressed as argv.
For backward compatibility, command may contain implicit args
separated by whitespace (e.g. 'pnpm psy sync'); the leading token
becomes the program and the rest are split out and prepended to any
opts.args so the original argument order is preserved:
DreamCLI.spawn('pnpm psy sync')
→ spawn('pnpm', ['psy', 'sync'])
DreamCLI.spawn('pnpm psy', { args: ['sync', '--flag'] })
→ spawn('pnpm', ['psy', 'sync', '--flag'])
For dev-time CLI glue only (scaffolding, doc generation, type sync). No runtime HTTP request input ever reaches this function. Inputs are constant literals or composed from developer-supplied config (package.json scripts, CLI argv, scaffold templates) — never from runtime request input or any other untrusted external source.
Argv-form is the safe choice for any caller that interpolates a
config value, path, or credential: a database password containing
$ or backticks is passed literally to the child rather than
interpreted by a shell.
Primary gate: every caller restricts spawn use to dev/test code paths
(CLI commands, the dev watcher, scaffold-time code generators,
generated cli:sync initializers wrapped in
if (AppEnv.isDevelopmentOrTest)).
Backstop: throws SspawnRequiresDevelopmentOrTest when NODE_ENV is
anything other than development or test. Checking
!isDevelopmentOrTest (rather than isProduction) means staging-style
envs and any unforeseen NODE_ENV value also fail closed.
Optionalopts: SpawnOptions
Called by Psychic (and other consumers) to programmatically generate a Dream model with all associated files.