sitegen [flags]
Run in the folder that contains your site/ directory. With no flags, SiteGen builds the site once into public/ and exits.
Common commands
| Command | What it does |
|---|
sitegen -create | Create a starter site in ./site |
sitegen -serve | Build, serve on port 8888, and rebuild on changes |
sitegen -serve -share | Also get a public preview link |
sitegen -serve -cms | Also open the editor at /__cms |
sitegen -clean -minify | Production build |
sitegen -publish | Production build, published to altengine |
Building
| Flag | Default | Description |
|---|
-clean | off | Empty the public folder before building |
-minify | off | Minify HTML, CSS and JavaScript, and scale large images down |
-webp | off | Write WebP copies of JPEG and PNG images and use them in pages |
-base | / | Base URL path, for sites served from a subfolder |
-cmd-timeout | 120 | Seconds a serve or build command may run. 0 disables the limit |
Folders
| Flag | Default | Description |
|---|
-site | ./site | The site's root folder |
-source | src | Pages and assets, inside the site folder |
-templates | templates | Layouts and partials, inside the site folder |
-data | data | JSON data files, inside the site folder |
-public | ./public | Where the built site is written |
Dev server
| Flag | Default | Description |
|---|
-serve | off | Serve the site with live reload and rebuild on changes |
-port | 8888 | Port for the dev server |
-exclude | ^(node_modules|bower_components) | Regular expression of paths the watcher ignores |
-buildall | off | Rebuild the whole site on every change |
-share | off | Publish the dev server at a public sitegen.dev URL |
-share-auth | | Require user:pass from share visitors |
-share-server | wss://relay.sitegen.dev | Share relay to connect to |
-cms | off | Enable the editor at /__cms |
-cms-auth | | Require user:pass for the editor |
Publishing
| Flag | Default | Description |
|---|
-publish | off | Build as -clean -minify, then publish public/ to altengine. Can't be combined with -serve |
-publish-name | site/publish.json, else the folder name | The site's name. It's published as the altengine instance sitegen-<name> |
-publish-message | | A note on the deployment, up to 200 characters |
-publish-device | off | Sign in with a code entered on another device |
-publish-signout | off | Revoke this machine's altengine key, forget it, and exit |
Other
| Flag | Description |
|---|
-create | Create a starter site at -site and exit. Fails if the folder exists |
-version | Print the version and exit |
-help | List all flags |
While the dev server is running, press r to rebuild everything and q to quit.
Edit this page · Last updated 2026-11-20