Skip to content

dotnet tool execute 2dog ​

2dog scaffolds .NET host projects around a Godot project, keeps them healthy, and updates them.

Illus. Moritz Voss: a white anthro dog in a hacker hoodie getting pulled on the leash by their blue robot dog"Everything at my pawtips!"

Your project directory stays the solution root; added hosts live in nested folders that Godot ignores.

Installation ​

bash
dnx 2dog add                  # run latest from nuget
dotnet tool install -g 2dog   # or install it globally

dnx 2dog creates files and edits *.csproj, project.godot, and if needed, the solution and Directory.Build.props in place.

Only two changes rename files, and the tool asks before either:

  • .sln → .slnx migration (renames the .sln to .sln.old)
  • --rename, which renames the .NET project, its csproj and assembly_name to a name without spaces

The tool ships as 2dog. The matching dotnet new template ships separately as 2dog.templates.

Commands ​

CommandUse it to
2dog newCreate a Godot project with 2dog hosts
2dog addAdd hosts to an existing Godot project
2dog doctorCheck the project and this machine, fix what can be fixed, explain build failures
2dog updateBring the project's 2dog packages to this tool's versions
2dog packList a .pck's contents
2dog replAttach to a running REPL host, or run code in it from scripts and agents (--session, --timeout, --pipe)
2dog skillWrite the REPL working guide for coding agents (--claude, --codex)
2dog versionPrint the tool and package versions
2dog helpShow the usage, or the help for one verb

2dog alone prints the version info and the usage. new, add and doctor prompt on a terminal when no deciding flag is given. Host flags skip the project wizard; a missing workload (wasm-tools, android) can still be offered for newly selected hosts before restore. --yes, pipes, and CI skip workload offers. Use --install-wasm-tools or --install-android-workload to request installation explicitly, or 2dog update --update-workloads to update workloads.

Host flags ​

new and add take one flag per host. The folder is optional; a repeated flag adds a second host of the same kind. Test hosts are opt-in: choose --xunit, --gdunit or --nunit, or select a framework in the interactive picker.

FlagHost
--generic [folder]2dog (generic .NET) with your own Main()
--web [folder]Web host
--webxr [folder]WebXR host
--xunit [folder]xUnit test project
--repl [folder]C# REPL host
--gdunit [folder]GdUnit GDScript test project
--nunit [folder]NUnit test project
--winforms [folder]WinForms host; Windows-only
--winui [folder]WinUI 3 host; builds only on Windows
--avalonia [folder]Avalonia host
--blazor [folder]Blazor Web App host; needs wasm-tools
--maui [folder]MAUI host; Windows and Android, needs MAUI workloads
--android [folder]Android host; experimental, needs the android workload
--no-generic, --no-webLeave a host out of the default set (every kind has a --no-<host> form)

All hosts except --generic and --web are opt-in: an unattended run never adds them.

Build options ​

new and add offer build option toggles after the host picker. Flags use the same settings without a prompt:

FlagEffect
--double-precision [true|false]Use matching .double engine, bindings and native packages across the game and all hosts
--web-threads [true|false]Enable experimental multithreading for Web and Blazor clients

New projects default to single precision and single-threaded web builds. Omitting these flags on add preserves the project's settings. Pass false to disable a setting. Double precision needs a matching double precision Godot editor. Threaded browser builds need cross-origin isolation headers: Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Embedder-Policy: require-corp. See web multithreading for serving requirements.

Global options ​

Valid under every verb, also before it (2dog --json add).

OptionEffect
-y, --yesDo not prompt; take the flags and defaults (also --non-interactive, --no-input)
-h, --helpShow help; after a verb, the help for that verb
--versionSame as 2dog version; see choosing a tool version

Values attach or follow: --name Foo, --name=Foo. -- ends option parsing. Mistyped options and verbs get a suggestion.

Output ​

OptionEffect
--jsonOne JSON document on stdout, nothing on stderr, also on failure ("ok": false); implies --yes
-q, --quietResults and problems only: no header, plan, progress or next steps
--plainNo colour, no cursor movement, ASCII markers (also TERM=dumb)
--no-colorNo colour; cursor movement stays (also NO_COLOR)
--accessibleNumbered yes/no questions instead of lists, no spinners (also TWODOG_ACCESSIBLE=1)
-v, --verboseExtra detail on stderr: subprocess command lines and output, stack traces

The report goes to stdout, diagnostics (error:, warning:, note:, hint:, verbose:, spinners) to stderr: 2dog add --json | jq . and 2dog doctor 2>errors.log both work. In a pipe or a CI environment nothing prompts or animates and the markers are ASCII; a wanted prompt falls back to the default with a note:. See CLI environment variables for the CI indicators and colour overrides.

Exit codes ​

CodeMeaning
0Success, including --dry-run, "Nothing to do", and a declined plan
1Usage error: unknown option or verb, missing value, wrong positional count; the error names the verb's --help
2Tool error: project state, I/O, invalid XML, a failed subprocess, a plan that stopped half-way (the report says which steps stand), an unexpected exception (--verbose adds the stack trace)
3doctor: findings remain after the fixes (errors; warnings too under --strict), or the --build failed; repl exec: a submission failed
124repl exec: --timeout cancelled a submission
130Cancelled with Ctrl+C

Versions ​

The Version guide explains how to run a specific tool release, print its version, and keep your project's package versions fixed.

2dog is Free and Libre Open Source under the MIT License.
2dog is not affiliated with or endorsed by the Godot Foundation.
Godot is licensed under the MIT License. @icons made by Voxy under the MIT License.
Continuous Integration compute graciously supported by RunsOn.