Why I still write CLIs in Go
Single binaries, fast startup, and a standard library that is boring in the best way. Go remains my default for tools that ship to other people's machines.
I have written command-line tools in Rust, Python, TypeScript, and Go. Rust produces better binaries. Python is faster to write. TypeScript has the ecosystem. And yet, when a tool needs to run on a stranger’s laptop, I keep reaching for Go.
The reason is not love of the language. It is the shape of the distribution problem.
One file, no runtime
A Go CLI is a single executable. No interpreter, no virtual environment, no node_modules, no version manager. If someone can download a file and run it, they can use the tool.
That sounds like a minor convenience until you watch an install fail. A Python tool means explaining pipx versus pip versus uv. A Node tool means a minimum Node version and a package manager. A Go tool means:
curl -L https://example.com/tool_linux_amd64 -o tool
chmod +x tool
./tool --help
This is not just ergonomics. It changes who can use the tool. The best internal utility I ever wrote was a Go binary. People copied it into containers, called it from Makefiles, and ran it in CI systems I had never heard of. Nothing about it required a runtime to be installed.
Cross-compilation is a build flag
Shipping for macOS, Linux, and Windows is one matrix job:
GOOS=darwin GOARCH=arm64 go build -o dist/tool-darwin-arm64
GOOS=linux GOARCH=amd64 go build -o dist/tool-linux-amd64
GOOS=windows GOARCH=amd64 go build -o dist/tool.exe
Static binaries by default, no libc issues, no container needed for the build. For most tools, this is the entire release pipeline.
The standard library covers the boring parts
A useful CLI needs flags, HTTP, JSON, file walking, hashing, and process execution. Go’s standard library has all of it, and the APIs are stable. I rarely need dependencies, which means I rarely need to think about supply-chain risk or upgrade churn.
The gaps are real: argument parsing is spartan, and anything involving terminal UI needs a library. But the gaps are small enough to fill deliberately instead of inheriting a framework.
Where Go is the wrong choice
I would not write a parser in Go. Tree-sitter and Rust’s ecosystem are better there. I would not write a data-crunching script in Go: Python’s REPL and libraries are better for exploration. And I would not write a system-level tool that needs precise memory control.
The point is that Go is not the best language for every tool. It is the best language for shipping a tool whose logic is simple and whose distribution is not.
The boring choice wins
Startup time is a few milliseconds. Memory use is predictable. The binary is small. The language is small enough that a contributor can read the whole codebase in an afternoon.
None of that is exciting, and for command-line tools, that is exactly the point.