Skip to content

CLI reference

python -m pyreact_forge.cli is equivalent to the installed pyreact-forge command. Use --help on any subcommand to inspect the installed version.

Command Options / behavior
init DIRECTORY Create a new/empty app directory from the template.
vendor Download the pinned Pyodide runtime to the user's cache.
vendor --output PATH Download to an explicit directory; set the runtime environment variable when using it.
dev [DIRECTORY] Build .forge-dev, serve and fully reload after source changes.
dev --host HOST --port PORT --offline Override loopback host/port and require local runtime assets.
build [DIRECTORY] Export static files into dist.
build --output PATH --offline Choose output and include a local runtime.
build --prerender --url PATH Include server-rendered initial HTML for one URL; requires Node/local runtime.
serve [DIRECTORY] Preview an existing dist, or build if output is absent.
serve --host HOST --port PORT Choose the preview bind address.
render [DIRECTORY] --mode string Server render through React DOM.
render --mode static Produce static server markup.
render --mode stream --url PATH Use the Node streaming renderer; the Python CLI currently buffers output.

Defaults: directory ., host 127.0.0.1, port 5173, rendering URL /. The host option exposes a local development/preview server; it is not a production-serving configuration.

Runtime environment variable

PYREACT_FORGE_PYODIDE points to a complete local runtime directory. If absent, the CLI checks the pinned per-user cache. Without a local runtime, ordinary builds reference the pinned CDN; --offline instead fails clearly.

The app entry belongs in forge.json, not in a CLI --entry option. See configuration for supported fields.