For the complete documentation index, see llms.txt. This page is also available as Markdown.

codegen-init

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.

Options

  • <project.gumx> — Path to the .gumx project file

  • --force — Overwrite an existing ProjectCodeSettings.codsj without prompting

What It Detects

  • 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.

Examples

gumcli codegen-init MyProject/MyProject.gumx
gumcli codegen-init MyProject/MyProject.gumx --force

Output on success:

Exit Codes

Code
Meaning

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?