Reference

CLI reference

Every sitegen command-line flag.

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

CommandWhat it does
sitegen -createCreate a starter site in ./site
sitegen -serveBuild, serve on port 8888, and rebuild on changes
sitegen -serve -shareAlso get a public preview link
sitegen -serve -cmsAlso open the editor at /__cms
sitegen -clean -minifyProduction build
sitegen -publishProduction build, published to altengine

Building

FlagDefaultDescription
-cleanoffEmpty the public folder before building
-minifyoffMinify HTML, CSS and JavaScript, and scale large images down
-webpoffWrite WebP copies of JPEG and PNG images and use them in pages
-base/Base URL path, for sites served from a subfolder
-cmd-timeout120Seconds a serve or build command may run. 0 disables the limit

Folders

FlagDefaultDescription
-site./siteThe site's root folder
-sourcesrcPages and assets, inside the site folder
-templatestemplatesLayouts and partials, inside the site folder
-datadataJSON data files, inside the site folder
-public./publicWhere the built site is written

Dev server

FlagDefaultDescription
-serveoffServe the site with live reload and rebuild on changes
-port8888Port for the dev server
-exclude^(node_modules|bower_components)Regular expression of paths the watcher ignores
-buildalloffRebuild the whole site on every change
-shareoffPublish the dev server at a public sitegen.dev URL
-share-authRequire user:pass from share visitors
-share-serverwss://relay.sitegen.devShare relay to connect to
-cmsoffEnable the editor at /__cms
-cms-authRequire user:pass for the editor

Publishing

FlagDefaultDescription
-publishoffBuild as -clean -minify, then publish public/ to altengine. Can't be combined with -serve
-publish-namesite/publish.json, else the folder nameThe site's name. It's published as the altengine instance sitegen-<name>
-publish-messageA note on the deployment, up to 200 characters
-publish-deviceoffSign in with a code entered on another device
-publish-signoutoffRevoke this machine's altengine key, forget it, and exit

Other

FlagDescription
-createCreate a starter site at -site and exit. Fails if the folder exists
-versionPrint the version and exit
-helpList 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