explaingit

mitchellh/gox

4,584GoAudience · developerComplexity · 1/5Setup · easy

TLDR

A Go command-line tool that builds your program for every platform, Windows, macOS, Linux, and more, in one command, running all the builds in parallel so it finishes as fast as your slowest single target.

Mindmap

mindmap
  root((Gox))
    What it does
      Cross-compile Go
      Parallel builds
      Single command
    Target platforms
      Windows
      macOS Linux
      FreeBSD others
    Filtering options
      By operating system
      By architecture
      OS and arch combined
    Workflow
      Run in project folder
      Get one binary per platform
      No enforced folder structure
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Run a single Gox command in your Go project to produce ready-to-ship binaries for Windows, macOS, and Linux at the same time.

USE CASE 2

Speed up a release build by letting Gox compile all platform targets in parallel across your CPU cores.

USE CASE 3

Narrow the output to only the OS and architecture pairs you care about by passing flags on the command line.

Tech stack

Go

Getting it running

Difficulty · easy Time to first run · 5min
No license information is stated in the explanation.

In plain English

Gox is a small command-line tool for Go developers who want to build their program for many operating systems and processor types at once. Normally, compiling a Go program produces a single executable that only works on the computer you built it on. Gox lets you produce executables for Windows, macOS, Linux, FreeBSD, and several other platforms in a single command, without needing a separate machine for each. The tool is intentionally minimal. It works almost identically to Go's built-in build command, so anyone already familiar with building Go programs can use Gox immediately. You run it in your project folder, optionally specify which operating systems or processor architectures you care about, and Gox handles the rest. By default it targets every platform Go supports. One practical advantage is that Gox runs multiple builds at the same time, using as many CPU cores as your machine has available. If you need binaries for eight platforms, it does not build them one after the other, it runs them in parallel and finishes faster. The output is a set of separate executable files, one per platform, with no enforced folder structure imposed on you. You can narrow the output in straightforward ways. Passing a flag for a specific operating system produces only those binaries. Passing a combined operating system and architecture value gives you exactly one build. The tool has a help flag that lists all available options. Gox is squarely aimed at situations where you want the simplest possible cross-compilation without extra features like package uploading, changelog generation, or installer creation. If you need those extras, other tools in the Go ecosystem cover them. Gox just compiles and stops there.

Copy-paste prompts

Prompt 1
I have a Go CLI tool and want to release it on GitHub for Windows amd64, macOS arm64, and Linux amd64. Show me the exact Gox command and how to name the output files by platform.
Prompt 2
How do I add Gox to a Makefile so running `make release` builds binaries for all supported platforms and puts them in a dist/ folder?
Prompt 3
My Gox cross-compilation is failing for arm64 Linux but working for amd64. How do I limit Gox to only the architectures that build successfully?
Prompt 4
What is the difference between using Gox and Go's built-in GOOS/GOARCH environment variables? When should I use Gox instead?
Open on GitHub → Explain another repo

← mitchellh on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.