Skip to content

Command reference ​

Every command and option in WinBridge 0.4.0, with the config file, environment variables, file locations and exit codes.

Global options ​

These go with any command, for example winbridge --verbose build.

OptionWhat it does
-v, --verbosePrints every command, resolved path and tool line.
--versionPrints the WinBridge version.
-h, --helpPrints help. winbridge help <command> shows help for one command.

Commands at a glance ​

CommandWhat it does
winbridge buildBuilds a project for Windows.
winbridge detectReports the project type found in a folder.
winbridge doctorChecks which toolchains are available; installs components.
winbridge runRuns a Windows executable on Linux.
winbridge prefixLists, deletes and adds runtimes to per-app prefixes.
winbridge packageBuilds a Windows installer from built files.
winbridge desktopAdds or removes desktop launcher entries.
winbridge recipeLooks up and applies compatibility recipes.
winbridge reportPrints a hardware and compatibility report.
winbridge vmChecks the Windows VM, runs VM apps, lists USB devices.

build ​

text
winbridge build [directory] [-- extra tool arguments]

Builds the project in directory (default: the current folder).

OptionWhat it doesDefault
-o, --outputFolder the result is written to.build/winbridge/<target> in the project
--targetWindows architecture: windows-x64 or windows-arm64.windows-x64
--toolchainForces a toolchain by id instead of the first one that claims the project.Automatic
--debugBuilds unoptimized, with debug information.Off

Everything after -- is passed to the underlying compiler unchanged.

Every .exe and .dll that a build reports is checked for a valid 64-bit x86 Windows (PE32+) header. A build whose output fails that check is reported as failed.

Toolchain ids ​

IdBuildsNeeds
goGogo
rustRustcargo, x86_64-w64-mingw32-gcc; rustup is optional
dotnet.NETdotnet
cC/C++, MinGW ABIzig, or x86_64-w64-mingw32-gcc / x86_64-w64-mingw32-g++
msvcC/C++, MSVC ABIclang, lld-link, and the msvc component
vmFlutterssh, rsync, and a configured Windows VM

Naming a toolchain that cannot build the project type is an error, not a silent fallback.

How a project is detected ​

WinBridge looks at the given folder only. The first match in this order wins.

OrderMarkerType
1pubspec.yaml with a Flutter dependencyFlutter
2go.modGo
3Cargo.tomlRust
4*.csproj or *.fsproj.NET
5CMakeLists.txt, a Makefile, or *.c/*.cpp filesC/C++

detect ​

text
winbridge detect [directory]

Prints the project name, type, folder, the file that decided the type, and the toolchain that would build it. Builds nothing.

doctor ​

text
winbridge doctor
winbridge doctor --install <component>

Without options, lists the tool search path, the runtime for winbridge run, the installable components and every toolchain's requirements. Exits with code 1 when a required tool is missing.

MarkerMeaning
okFound. The path follows.
absentAn optional tool is not present.
MISSINGA required tool is not present.

Installable components ​

ComponentDownloadWhat it is
go67 MBGo toolchain, for Go projects.
zig56 MBZig, used as the C/C++ cross-compiler.
nsis2 MBNSIS, used by winbridge package.
msvc3 MB, then about 1–2 GBxwin, plus the Microsoft CRT and Windows SDK it downloads.

In the Installable components list, managed means WinBridge downloaded and verified the component, system means a copy already on your machine is being used, partial means an unfinished install, and absent means it is not installed.

Where tools are searched ​

First match wins:

  1. The folder named by WINBRIDGE_TOOLCHAIN_DIR.
  2. WinBridge's managed installs in ~/.cache/winbridge/toolchains/.
  3. Your PATH, in its own order. Relative PATH entries are skipped.

run ​

text
winbridge run <app.exe> [-- arguments for the app]
OptionWhat it doesDefault
--prefixWhich app prefix to use.The file name without .exe
--dxvkRenders Direct3D through Vulkan. Remembered for the prefix.Off
--no-dxvkTurns DXVK off again for the prefix.

The exit code of winbridge run is the app's exit code.

prefix ​

CommandWhat it does
winbridge prefix listLists prefixes with their DXVK version and path.
winbridge prefix delete <name>Deletes a prefix and everything in it, without asking.
winbridge prefix tricks <name> <verb> [verb...]Runs winetricks verbs against a prefix.

package ​

text
winbridge package [directory]
OptionWhat it doesDefault
-o, --outputInstaller file to write.<app>-<version>-setup.exe in the artifacts folder
--artifactsFolder holding the built files.build/winbridge/windows-x64 in the project
--scriptNSIS script to use instead of the generated one.None
--app-versionVersion recorded in the installer.0.0.0
--signPKCS#12 certificate (.pfx) to sign the installer with.None

desktop ​

CommandWhat it does
winbridge desktop add <app.exe>Adds a launcher entry. --name sets the display name, --prefix the prefix; both default to the file name without .exe.
winbridge desktop listLists the entries WinBridge created.
winbridge desktop remove <name>Removes one entry that WinBridge created.

recipe ​

CommandWhat it does
winbridge recipe listLists bundled and user recipes.
winbridge recipe show <file.exe>Fingerprints an installer and shows which recipe matches.
winbridge recipe apply <file.exe>Applies the matching recipe. --prefix names the prefix.

report ​

text
winbridge report

Prints a filled-in hardware report: operating system and kernel, CPU, GPU, Vulkan, the Wine runtime and prefix state, and which toolchains are ready. The command sends nothing anywhere. It leaves out your host name, user name and paths under your home folder. Paste it into a hardware report issue if you choose to share it.

vm ​

CommandWhat it does
winbridge vm statusChecks that the VM answers and has Flutter. Accepts --accept-new.
winbridge vm doctorChecks local ssh and rsync, the config, connectivity, and Flutter and rsync on the VM. Accepts --accept-new.
winbridge vm app <remote-exe-path>Shows a program installed on the VM as a window, through FreeRDP. --sound redirects audio.
winbridge vm usb listLists USB devices on this machine. --all includes hubs.
winbridge vm usb passthrough <vendor:product>Prints VM configuration for passing one USB device through. Changes nothing.

--accept-new trusts a VM host key seen for the first time. It never accepts a key that changed.

The VM config file ​

~/.config/winbridge/vm.json:

json
{
  "host": "localhost",
  "port": 2222,
  "user": "winbridge",
  "identityFile": "~/.ssh/id_winbridge_vm",
  "remoteWorkspace": "C:/winbridge"
}
FieldRequiredDefaultRules
hostYesLetters, digits, ., _, -
portNo221 to 65535
userYesLetters, digits, ., _, -
identityFileNoSSH's own defaultNo spaces; ~ is expanded
remoteWorkspaceYesLetters, digits, :, /, _, ., -; no ..; must exist on the VM
flutterPathNoflutter on the VM's PATHSame as remoteWorkspace

Environment variables ​

VariableWhat it does
WINBRIDGE_WINEFull path to a wine binary to use instead of the managed runtime.
WINBRIDGE_TOOLCHAIN_DIRFolder of toolchains searched before everything else, laid out as <dir>/<toolchain>/bin/.
WINBRIDGE_VM_CONFIGPath to a VM config file, used instead of vm.json.
WINBRIDGE_SIGN_PASSPHRASECertificate passphrase for package --sign.
WINBRIDGE_RECIPES_DIRFolder of bundled recipes.
WINBRIDGE_RDP_ASKReserved. vm app stops with an error while it is set.
WINEDLLOVERRIDESYour own Wine DLL overrides. They are kept and take priority over the ones WinBridge adds for DXVK.
XDG_CACHE_HOME, XDG_DATA_HOME, XDG_CONFIG_HOMEMove the cache, data and config folders below.

File locations ​

WhatWhereSafe to delete?
Build outputbuild/winbridge/<target>/ in the projectYes
Compiler caches~/.cache/winbridge/build/Yes
Managed compilers~/.cache/winbridge/toolchains/Yes; reinstall with doctor --install
Wine, DXVK, winetricks, NSIS~/.cache/winbridge/runtimes/Yes; downloaded again when needed
Microsoft CRT and Windows SDK~/.cache/winbridge/xwin/Yes; a 1–2 GB download to restore
App prefixes~/.local/share/winbridge/prefixes/Only if you no longer need the app's data
Your recipes~/.local/share/winbridge/recipes/They are your files
Launcher entries~/.local/share/applications/winbridge-*.desktopUse winbridge desktop remove
VM config~/.config/winbridge/vm.jsonIt is your file

Pinned component versions ​

WinBridge 0.4.0 downloads these exact versions and checks each against a built-in SHA-256 checksum.

ComponentVersion
Wine11.14 (64-bit, wow64 build)
DXVK3.0.2
winetricks20260125
Go1.26.5
Zig0.16.0
NSIS3.12
xwin0.9.0

The Microsoft CRT and Windows SDK are not pinned. They come from Microsoft at the version xwin selects.

Exit codes ​

CodeMeaning
0Success.
1A build, tool or check failed. Also returned by doctor, vm status and vm doctor when they find a problem.
2The command line was wrong: unknown option, missing argument, a folder that does not exist.
141The program reading WinBridge's output closed the pipe, as with winbridge doctor piped into head.
Otherwinbridge run returns the exit code of the Windows app. winbridge vm app returns the FreeRDP client's.

Next steps ​