Rust vs. Go for CLI tools: pick the trade-off, not the tribe
Rust and Go both build fast, single-binary command-line tools. The choice comes down to error handling, concurrency, and how much the compiler should argue with you.

On this page
In brief
- Both languages compile to a single native binary with no interpreter to install, so the distribution story is nearly identical.
- Binary size follows the tool, not the language: four real release binaries measured 22 to 59 MB, with the Go and Rust ranges overlapping.
- Rust makes error handling a compile-time rule with Result and the ? operator; Go makes it a convention, error values returned alongside results with nothing enforcing the check.
- Go ships goroutines and channels in the language; Rust checks concurrency at compile time, but its async runtimes are third-party crates.
- Pick Go for networked glue and fast cross-platform shipping, Rust for CPU-heavy work and precise control, and if you already know one, that settles it.
Pick a language for a new command-line tool and the room splits in two. Rust or Go, and everyone has a favorite, usually the one they already know. The argument usually stays tribal. It does not have to: the two languages make different trade-offs, and the trade-offs are concrete enough to decide on.
The evidence is already on your machine if you read grep.tips. Gitleaks, the secret scanner, is written in Go, and so is Headscale, the self-hosted Tailscale control plane. Atuin, which turns shell history into a database, is written in Rust, and so is Yazi, the terminal file manager, still in public beta. Four tools, two languages, and no pattern in which one won. That is the point. The choice is about the work, and the work decides.
One binary, no interpreter
Both languages compile to a single native binary. There is no interpreter to install, no runtime to ship, no virtual environment to activate. The user downloads a file and runs it. That is the distribution story for most CLI tools, and it is the reason both languages keep showing up in the same places: package managers, GitHub releases, and a curl pipe to a binary.
The difference starts one layer down, in what the binary carries with it.
What the binary actually costs
Ask which language makes smaller binaries and you will get confident answers in both directions. The release pages say neither side is right. I downloaded the Linux x86_64 release builds of the four tools above and measured them: Gitleaks, in Go, is 22 MB; Yazi, in Rust, is 24 MB; Headscale, in Go, is 53 MB; Atuin, in Rust, is 59 MB. The Go tools span 22 to 53 MB and the Rust tools 24 to 59 MB. The ranges overlap almost entirely.

The size follows the tool, not the language. Headscale carries a whole control plane; Atuin carries a database, a sync client, and a recorder for AI agent sessions. A small tool stays small in either language, and a large one stays large.
One real difference hides in the linking. The Go binaries are statically linked: everything they need is inside the file. The Rust builds above are dynamically linked against the system C library, so they need that library present on the target machine. Rust can build a fully static binary too, through the musl target, and both Yazi and Atuin ship musl builds alongside the standard ones. It is one more step, and one more thing to remember at release time.
Errors: the compiler checks, or the convention does
This is the sharpest difference, and the one that decides most arguments.
In Rust, a function that can fail returns a Result, a value that is either the answer or the error. The compiler will not let you use the answer without handling the error first, and the ? operator passes the error up to the caller in a single character. Error handling is a rule the compiler enforces, and the cost is paid up front: the borrow checker and the type system argue with you while you write the code.
In Go, a function that can fail returns the answer and an error value side by side, and the caller checks the error with an if statement. Nothing in the language forces the check. The convention is strong and the standard library follows it everywhere, but it is still a convention: a missed check compiles, runs, and fails quietly later. Go reserves panic, which stops the program, for errors the program cannot continue from.
So the question is where you want the argument. Rust argues with you at compile time and leaves little to remember at 2 a.m. Go stays out of your way and trusts you to remember the check every time. A tool with many failure modes, parsing untrusted input or talking to flaky services, benefits from the compiler doing the remembering. A small tool with three system calls does not need it.
Doing two things at once
Most CLI tools do one thing at a time and never notice. The ones that do, a file manager previewing images while you browse, a scanner walking a repository, face a second split.
Go builds concurrency into the language. A goroutine is a cheap, lightweight thread the runtime multiplexes onto operating system threads, and channels pass messages between them. You write go before a function call and it runs concurrently. The runtime and the garbage collector do the scheduling and the cleanup.
Rust checks concurrency at compile time instead. Its ownership rules, one owner per value, no two mutable references at once, turn many data races into compile errors: incorrect code refuses to compile rather than failing in production. The language gives you threads and message-passing channels, and async code runs on runtimes provided by third-party crates, not the standard library. You choose the runtime; you also choose the dependency.
For a CLI tool, the practical gap is smaller than the philosophy suggests. A scanner that walks files in parallel and a file manager that previews in the background both work in either language. Go gets there with less code and less to learn. Rust gets there with stronger guarantees about what cannot go wrong, and a steeper climb to the first working version.
Getting it onto other machines
Shipping to Linux, macOS, and Windows is where Go's design shows. Two environment variables, GOOS and GOARCH, retarget the build, and with CGO_ENABLED=0 the result is a static binary that runs anywhere. One command per platform, no cross-compiler, no sysroot.
Rust cross-compiles through targets installed with rustup, cargo build --target, and the musl target for a static binary. It works, and the release pages of the Rust tools above prove it, but it is more machinery: targets to install, a linker to configure for some platforms, and a second build for the static variant. If the tool ships to five platforms on every release, that machinery is a weekly tax. If it ships to one, it is a one-time setup.
The ecosystem and the learning curve
Rust's crates are published to crates.io, one central registry, and Cargo resolves versions and locks them in Cargo.lock. Go's modules are decentralized by design: any repository can be a module, fetched through a proxy or directly from version control, with checksums recorded in go.sum. Both work. The central registry makes discovery easier; the decentralized model makes publishing trivial.
The standard libraries differ in reach, too. Go ships a broad one, including an HTTP server in the standard library. Rust's stops earlier: an HTTP server or an async runtime comes from a crate, which is also how the ecosystem stays flexible and how a new project accumulates dependencies before it does anything.
The learning curve is the honest asymmetry. Go was designed to be small enough to hold in your head: the language is short, and a competent programmer in another language is productive in a week. Rust asks more up front. Ownership, borrowing, and lifetimes are a new way of thinking about memory, and the compiler is a strict teacher for the first month. The payoff is that the same strictness catches whole classes of bugs before the program runs.
That trade is why the two languages keep meeting in the same place: they both serve the same job, and the job does not care which one you picked. The team does. A tool maintained by people who already know Rust should be written in Rust. A tool whose contributors will arrive from Python or JavaScript should probably be written in Go, where the first contribution does not require a month of fighting the compiler.
How to choose
Three questions settle it.
First, what does the tool spend its time doing? Parsing, transforming, and CPU-heavy work favors Rust. Calling APIs, moving files, and gluing services together favors Go.
Second, how many failure modes does it have? A dozen ways to fail, any of them in production, favors Rust's compiler-enforced errors. A handful of system calls favors Go's lighter touch.
Third, who is going to maintain it? The team's existing skill decides more arguments than any benchmark, and a language nobody on the team knows is a cost paid on every change.
If the answers point different ways, take the third question. A CLI tool lives or dies on maintenance, and the best language for a tool is the one its maintainer will still enjoy writing in a year.


