Goose
Ready GOOSE_SHELL env var Windows macOS Linux Difficulty Easy
One env var: on Windows the shell tool spawns GOOSE_SHELL and passes -c to any name that is not cmd/PowerShell — point it at niu.exe and done.
PowerShell · persist GOOSE_SHELL to the user environment
[Environment]::SetEnvironmentVariable('GOOSE_SHELL', "$env:LOCALAPPDATA\Programs\Niubash\niu.exe", 'User') Steps
- Run the persistence command above, reopen the terminal, then start goose
- Have goose run any command (say ls) and confirm the output is bash dialect, not cmd
Verify
echo "SHELL=$SHELL"; uname -s — expect MSYS_NT- (goose's shell tool goes through niu -c at this point)
Rollback
[Environment]::SetEnvironmentVariable('GOOSE_SHELL', $null, 'User') Notes & pitfalls
- Source-verified (2026-10-21 HEAD, block/goose crates/goose/src/agents/platform_extensions/developer/shell.rs): windows_shell() reads GOOSE_SHELL, defaulting to cmd; argument style dispatches by file name — pwsh/powershell → -Command, cmd → /C, everything else → -c. niu.exe lands in the -c branch, exactly niu's one-shot syntax
- This entry is a read-the-release-source conclusion, not machine-tested; agents.md previously listed Goose under "Not verified here" — added via this code read
- Goose's desktop app has separate login-shell logic (ui/desktop loginShellPath); the CLI behavior is authoritative
Sources
block/goose shell.rs(windows_shell / 参数分派,源码核实)agents.md#goose- agents.md (the complete probe-mechanism document) ↗
Chinese edition of this page: /agents/goose/