codegen-init
gumcli codegen-init <project.gumj> [--force] [--csproj <path>]Auto-configures code generation settings for a Gum project by locating the nearest .csproj file above the .gumj directory. Writes a ProjectCodeSettings.codsj settings file next to the .gumj.
Options
<project.gumj>— Path to the.gumjor.gumxproject file--force— Overwrite an existingProjectCodeSettings.codsjwithout prompting--csproj <path>: Use this.csprojinstead of searching for one. Gum records it asCsprojPathin the settings, socodegenreads this.csprojto detect the Gum runtime version and the C# version. Use it when the.csprojis not above the.gumj, or when a folder has several and the game is notAssembly-CSharp.csprojor the shortest name.
What It Detects
Walks up from the
.gumjdirectory to find the nearest.csprojIf that folder has several
.csprojfiles, usesAssembly-CSharp.csproj, then the shortest nameDerives
CodeProjectRootas a relative path from the.gumjdirectory to the.csprojdirectoryExtracts
RootNamespacefrom the.csproj, falling back to the.csprojfilename (with.,-, and spaces replaced by_)Sets
OutputLibrarytoGumForms(shown as Gum Forms in the Code tab), the preferred output for every runtime including MonoGame, KNI, FNA, Skia, and RaylibFor a Unity project (
Assembly-CSharp.csprojnext to anAssetsfolder), setsGeneratedCodeFoldertoAssets/, because Unity compiles only code underAssets
Examples
Output on success:
Exit Codes
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?

