CLI (safi)
The safi CLI lets you create standalone game projects that use the engine without cloning the full engine repository. The engine is installed once to ~/.safi-engine/, and each game project contains only your game code.
Install the Engine
Run this once from the engine repository root:
This builds the engine and copies everything to ~/.safi-engine/:
After install, the safi command is available globally via /usr/local/bin/safi.
Create a New Project
This scaffolds a game project:
The starter Game.cs includes a sun light, ground plane, and a red box with camera controls — a working scene out of the box.
Commands
safi run
Compiles your game code against the installed engine and launches it:
Behind the scenes:
- Symlinks engine libraries, shaders, and fonts into
build/ - Compiles
game_logic/**/*.cs+Viewer.csagainstEngine.dll - Runs with
monousing the correctDYLD_LIBRARY_PATHand Vulkan ICD
safi dev
Hot reload mode — edit game_logic/ files and see changes live without restarting:
This uses the same three-assembly split as make dev in the engine repo:
Save any .cs file in game_logic/ and the engine auto-recompiles and reloads your game code.
safi build
Creates a macOS .app bundle named after your project:
The bundle includes all engine libraries, shaders, fonts, and models — self-contained and ready to distribute.
safi clean
Removes the build/ directory and all compiled artifacts:
How It Works
The CLI avoids modifying the C++ renderer by using symlinks. When you run safi run or safi dev, it creates symlinks from your project's build/ directory to the installed engine resources:
The renderer loads shaders and fonts from relative paths (build/shaders/, assets/fonts/), so symlinks make everything resolve correctly with zero C++ changes.
IDE IntelliSense
Each generated project includes a GameLogic.csproj that references the symlinked Engine.dll. For C# autocomplete in your editor:
Engine Updates
When you update the engine, re-run make install from the engine repo. All existing projects will pick up the new engine automatically since they symlink to ~/.safi-engine/.
If a project was created with an older engine version, safi run will print a warning:
Engine Repo Still Works
The CLI is additive — all existing make commands (make run, make dev, make app) continue to work from the engine repository as before.