Formlabs Developers
Download PreForm Insider to start developing with the PreForm API.

CLI & command-line options

PreFormServer is a command-line application. It serves the PreForm API on the port you pass, and --help lists its options.

Options#

PreForm Server accepts the following options:

OptionEffect
-p, --port <port>The port to serve the PreForm API on. Required.
--scene-cache-size <size>The maximum number of scenes the server keeps. When the limit is exceeded, the server deletes the least recently used scene. The default is 30, and the maximum is 10000.
--export-support-bundleBundle the structured diagnostic logs and text logs into one archive for Formlabs support, then exit.
-v, --versionPrint the version.
-h, --helpPrint the options.

Start the server#

Start the server on port 44388:

Terminal
/Applications/PreFormServer.app/Contents/MacOS/PreFormServer --port 44388
PowerShell
C:\PreFormServer\PreFormServer.exe --port 44388

The server prints READY FOR INPUT when it accepts requests. The SDK's launch() method passes --port and waits for that line.

Environment variables#

PreForm Server reads the following variable:

VariableEffect
DISABLE_PREFORMSERVER_TELEMETRYSet to 1 to turn off telemetry. The server reports the telemetry state on its first line of output.

To pass variables to a server the SDK starts, use the env argument of launch().

What's next#

Feedback & Bug Reports