CLI commands
Five commands. Every one that reads a project takes a project name as its first argument, and adds .project.json for you.
Naming a project
roflux serve -- default.project.json
roflux serve game -- game.project.json
roflux serve lobby -- lobby.project.json
The argument is resolved like this, in order:
| You write | RoFlux uses |
|---|---|
| nothing | default.project.json in the current folder |
game | game.project.json in the current folder |
places/lobby | places/lobby.project.json |
game.project.json | that exact file |
| a folder name | default.project.json inside it |
The project root is the folder holding the project file, so that is what gets watched and scanned. If the file is not there, RoFlux stops and tells you to run roflux init rather than quietly building nothing.
serve
Watch the project and stream changes into Studio. This is the one you leave running.
roflux serve [project] [--port 34872] [--quiet]
It compiles once at startup, writes the sourcemap, starts watching the folder, and listens on 127.0.0.1. Any change on disk causes a rebuild, and only the difference is sent to connected plugins.
| Option | Meaning |
|---|---|
-p, --port | Port to listen on. Defaults to 34872. |
-q, --quiet | Silence all output. |
Stop it with Ctrl+C.
compile
Compile once and exit. Useful in a pre commit hook, in CI, or any time you just want a fresh sourcemap.
roflux compile [project] [--quiet]
This writes sourcemap.json, refreshes types.d.luau and .vscode/settings.json, and reports any problems it found in the project. It does not need Studio and does not open a port.
build
Write the project out as a real Roblox file.
roflux build [project] --output Game.rbxl
| Extension | Format |
|---|---|
.rbxl | Binary place file. |
.rbxlx | XML place file. |
.rbxm | Binary model file. |
.rbxmx | XML model file. |
Properties are given real Roblox types here, looked up in a reflection database rather than guessed. If a property name is not real for its class, RoFlux warns and leaves it out of the file rather than writing something broken.
Reference nodes are skipped, since they describe content that already exists in a place rather than content RoFlux owns.
This is how you build each place of a multi place game:
roflux build lobby -o build/Lobby.rbxl
roflux build main -o build/Main.rbxl
plugin
Install the Studio plugin, which is compiled into the server binary.
roflux plugin [--output path.rbxm] [--to folder]
With no options it writes RoFlux.rbxm into your local Studio plugins folder, replacing any copy already there. Restart Studio to pick it up.
| Option | Meaning |
|---|---|
-o, --output | Write the model to this exact path instead of installing it. |
-t, --to | Install into a different plugins folder. |
Because the plugin source lives in the binary, the installed plugin always matches the server. There is no separate download to keep in step.
init
Set up a new project.
roflux init [project]
Creates the folder if it is not there yet, along with a default.project.json if there is not one, and an empty scripts/ folder. It never overwrites a project file that already exists.
types.d.luau and .vscode/settings.json are rewritten every time you run it, so running roflux init in a project you already have is how you refresh them after updating RoFlux.
Shared options
| Option | Applies to | Meaning |
|---|---|---|
[project] | serve, compile, build | Project name. Defaults to default. |
--quiet | serve, compile, build | No output at all. |
--help | everything | Usage for that command. |
--version | top level | Server version. |
Colour is used when the output is a terminal. Set NO_COLOR to turn it off, or pipe the output somewhere and it turns itself off.
Reading the output
info loaded 2 hook scripts
ok MyGame loaded, 24 instances, 3 scripts
info watching C:\dev\MyGame
ok listening on http://127.0.0.1:34872
sync studio connected (1 total)
sync +1 ~1 -0 (25 instances, 3 scripts)
+ ReplicatedStorage/Shared/Inventory [ModuleScript]
~ StarterPlayer/StarterPlayerScripts/Client (Source)
| Tag | Meaning |
|---|---|
info | Something normal happened. |
ok | A step finished. |
sync | Traffic with Studio, or a patch going out. |
hook | Output from one of your hook scripts. |
warn | Something in the project looks wrong, but the build carried on. |
error | A step failed. |
A sync line shows counts first, then up to 25 of the actual changes. + is created, ~ is edited with the changed fields in brackets, and - is deleted.