codegen-init
Last updated
Was this helpful?
gumcli codegen-init <project.gumx> [--force]Auto-configures code generation settings for a Gum project by locating the nearest .csproj file above the .gumx directory. Writes a ProjectCodeSettings.codsj settings file next to the .gumx.
Most projects do not need to run codegen-init explicitly. The codegen command auto-detects settings and writes them automatically if they are missing. Run codegen-init when you want to review or confirm the detected configuration before running codegen.
<project.gumx> — Path to the .gumx project file
--force — Overwrite an existing ProjectCodeSettings.codsj without prompting
Walks up from the .gumx directory to find the nearest .csproj
Derives CodeProjectRoot as a relative path from the .gumx directory to the .csproj directory
Extracts RootNamespace from the .csproj, falling back to the .csproj filename (with ., -, and spaces replaced by _)
Detects MonoGame or KNI package references and sets the output library accordingly. A Raylib-cs package reference sets OutputLibrary to Raylib.
Raylib-cs detection is available in the Gum July 2026 release and newer.
gumcli codegen-init MyProject/MyProject.gumx
gumcli codegen-init MyProject/MyProject.gumx --forceOutput on success:
0
Settings written successfully
2
.csproj not found, settings file already exists (without --force), or the project file was not found
Last updated
Was this helpful?
Was this helpful?
Code generation settings initialized successfully.
CodeProjectRoot : ../
RootNamespace : MyGame
OutputLibrary : MonoGameForms
Settings saved to: /full/path/to/MyProject/ProjectCodeSettings.codsj
