Mote is a Go command-line tool that connects to remote machines and runs commands, with a primary focus on executing cross-compiled Go test binaries. It supports multiple connection mechanisms: SSH (with persistent connections and 30-minute timeout), Tailscale (built-in, no host networking changes), direct TCP (password-authenticated and encrypted), and Gomote (Go project's builder infrastructure). Key features include automatic file uploading via the -u flag or -t flag for testdata, server aliasing by GOOS-GOARCH, seamless integration with 'go test' and 'go run' via exec hooks installed by 'mote go-setup', and connection reuse through background daemons. Configuration is stored per-platform in the user config directory, with support for environment variable overrides ($MOTE, $MOTECONFIG, $MOTECACHE).
Table of contents
Overview ¶Questions this post answers
How do I run cross-compiled Go tests on a remote machine automatically using go test?
Run 'mote go-setup' to install exec hook scripts (e.g., go_linux_amd64_exec) into your PATH. These scripts invoke 'mote -t' with the test binary arguments. When you run 'GOOS=linux GOARCH=amd64 go test strings', Go's toolchain finds the hook, mote uploads the binary and testdata to the remote machine matching the linux-amd64 alias, and runs the test there transparently. Go developers running cross-compiled test suites track tools like mote on daily.dev.
How does mote's built-in Tailscale support work and does it affect the host network?
Mote embeds a Tailscale client directly in its binary and manages a background daemon that stays alive for 30 minutes of inactivity. It registers the machine on the tailnet with the tag 'tag:mote' and caches credentials for reuse. Critically, it does not reconfigure the host networking stack, so other programs on the machine are unaffected by the Tailscale connection mote manages. Developers choosing between SSH and Tailscale for remote Go test infrastructure find comparisons like this on daily.dev.
How do I upload testdata when running a Go test binary remotely with mote?
Use the -u flag to specify additional files or directories to upload, e.g. 'mote -u ./testdata @ssh://kremvax ./mypkg.test'. Alternatively, use the -t flag, which automatically uploads testdata, ../testdata, ../../testdata, and so on up to the Go module root. The -t flag is also what the go-setup exec hooks use by default. Teams shipping Go packages that depend on testdata fixtures share workflows like this on daily.dev.