Skip to content

dotnet tool execute 2dog

2dog scaffolds .NET host projects around a Godot project, keeps them healthy, and updates them. The project directory becomes the solution root; hosts live in nested folders Godot ignores. It creates files and edits *.csproj, project.godot, the solution and Directory.Build.props in place. Nothing is moved, renamed or deleted, except two announced opt-ins: the .sln.slnx migration and the --rename fix.

The tool and the matching dotnet new template ship together in the 2dog NuGet package.

Installation

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

Commands

CommandUse it to
2dog newCreate a Godot project with 2dog hosts
2dog addAdd hosts to an existing Godot project (2dog convert is an alias)
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 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; any host flag, --yes or a pipe turns the prompts off.

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.

FlagHost
--desktop [folder]Generic desktop host with your own Main()
--web [folder]Browser (WebAssembly) host
--webxr [folder]WebXR host; opt-in
--tests [folder]xUnit test project
--winforms [folder]WinForms host; Windows-only, opt-in
--winui [folder]WinUI 3 host; Windows-only, builds only on Windows, opt-in
--avalonia [folder]Avalonia host; opt-in
--blazor [folder]Blazor Web App host; opt-in, needs wasm-tools
--no-desktop, --no-web, --no-testsLeave a host out of the default set (every kind has a --no-<host> form; opt-in kinds are never in the set)

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 under dnx

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 (CI, GITHUB_ACTIONS, TF_BUILD, GITLAB_CI, TEAMCITY_VERSION, BUILD_NUMBER) nothing prompts or animates and the markers are ASCII; a wanted prompt falls back to the default with a note:. CLICOLOR_FORCE or FORCE_COLOR keeps colour in a pipe.

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
130Cancelled with Ctrl+C

Versions

Scaffolded projects keep every package version in the root Directory.Build.props (TwoDogVersion, TwoDogNativesVersion, TwoDogGodotVersion and the companion versions); host csprojs reference $(TwoDogVersion) and friends. 2dog update rewrites that block; 2dog version prints what it would write.

Under dnx

dnx 2dog --version never reaches the tool: --version <VERSION> is dnx's own option and selects which 2dog package version to run. Use dnx 2dog version to print versions and dnx 2dog@4.7.2.82 to run a specific tool version.