Best Tech Stack for Building a CLI Tool as a Solo Developer
The ideal tech stack for solo developers building a CLI tool in 2026.
CLI tools are the most underrated product category for solo developers. No frontend to design. No CSS to debug. No mobile responsiveness to worry about. Just your logic, the terminal, and users who appreciate well-crafted command-line tools. I've built several CLI tools over the years, and the best part is that they're usually feature-complete in a few weeks.
The stack decision for a CLI tool comes down to one fundamental question. Do you need your tool to be distributed as a single binary, or is requiring a runtime (Node.js, Python) acceptable? That question determines everything else. Here's what I'd choose, with the current versions and adoption numbers I checked while writing this (all figures verified on 2026-05-30, sources listed at the end).
The Recommended Stack
| Layer | Tool | Why |
|---|---|---|
| Language | Go or TypeScript (Node.js) | Go for binaries, TS for npm distribution |
| CLI Framework | Cobra (Go) or Commander.js (TS) | Mature, well-documented, handles args/flags |
| Output Formatting | Lipgloss (Go) or Chalk + Ora (TS) | Beautiful terminal output |
| Config | Viper (Go) or Cosmiconfig (TS) | User config files, env vars, flags |
| Testing | Go's built-in testing or Vitest | Fast, reliable |
| Distribution | goreleaser (Go) or npm publish (TS) | Automated release builds |
| CI/CD | GitHub Actions | Build, test, release on tag |
Here is how the core libraries stack up by current adoption, so you can pick with real numbers instead of vibes.
| Library | Language | Latest version | GitHub stars | npm weekly downloads |
|---|---|---|---|---|
| Cobra | Go | v1.10.2 | 44,019 | n/a (Go module) |
| Viper | Go | v1.21.0 | 30,268 | n/a (Go module) |
| Lipgloss | Go | v2.0.3 | 11,343 | n/a (Go module) |
| Bubble Tea | Go | v2.0.6 | 42,772 | n/a (Go module) |
| goreleaser | Go | v2.16.0 | 15,823 | n/a (Go module) |
| Commander.js | TypeScript | v15.0.0 | 28,231 | 390.9M |
| Chalk | TypeScript | v5.6.2 | 23,227 | 409.2M |
| Ora | TypeScript | v9.4.0 | 9,708 | 66.4M |
| Inquirer | TypeScript | v14.0.1 | 21,569 | 42.9M |
| tsup | TypeScript | v8.5.1 | 11,249 | 5.68M |
| Vitest | TypeScript | v4.1.7 | 16,602 | 59.3M |
Why This Stack Works for Solo Developers
CLI tools have a unique advantage: the "UI" is text. You don't need a design system, responsive breakpoints, or browser compatibility testing. This means you can focus entirely on the logic and user experience of the commands themselves.
For solo developers, the choice between Go and TypeScript usually comes down to your audience. If your users are developers who install tools via Homebrew or download binaries, Go is the better choice. Single binary, no runtime dependency, cross-compiles to every major platform from a single machine. The current stable release is go1.26.3, and both Go and its toolchain are free and open source. If your users are JavaScript/Node.js developers who install via npm, TypeScript is the obvious pick. Target the active LTS line, which is Node.js v24 (codename Krypton, latest v24.16.0), rather than the Current v26 line, so your users are on the version most production machines actually run.
I built my first CLI tool in Python, and distribution was a nightmare. Telling users to install Python 3.9+, create a virtual environment, and pip install my package was a non-starter for most people. When I rewrote it in Go, adoption tripled because the install was just "download this one file." The lesson: distribution friction kills CLI tools faster than missing features.
Go Path: For Binary Distribution
Go is the language most CLI tools are written in today, and for good reason. The standard library handles file I/O, HTTP requests, JSON parsing, and concurrency without any external dependencies. Your tool compiles to a single binary that runs on macOS, Linux, and Windows.
Cobra is the CLI framework. Kubectl, Hugo, GitHub CLI, and Docker CLI all use it. The pattern is simple. Define commands, add flags, write the logic. Cobra handles help text generation, flag parsing, autocompletion scripts, and subcommand nesting. It's mature enough that you won't hit edge cases that aren't already solved, and the numbers back that up. Cobra sits at 44,019 GitHub stars on Apache License 2.0, with the latest stable release being v1.10.2.
Viper (made by the same author as Cobra) handles configuration. It reads from config files, environment variables, and command flags with a clear precedence order. Users can set defaults in a ~/.myconfig.yaml file, override with environment variables, and further override with command flags. This flexibility is expected in modern CLI tools. Viper has 30,268 stars and ships at v1.21.0, and it pairs with Cobra cleanly because they share an author.
Lipgloss and Bubble Tea from Charm are the visual layer. Lipgloss gives you styled text output (colors, borders, padding) and Bubble Tea lets you build interactive terminal UIs (spinners, progress bars, selection menus). The Charm ecosystem has made Go CLI tools look genuinely beautiful. When I first saw the output from tools using these libraries, I was surprised it was a terminal application. Both crossed major v2 milestones recently. Lipgloss is at v2.0.3 with 11,343 stars, and Bubble Tea is at v2.0.6 with 42,772 stars, which makes it the most-starred of the two and one of the most popular TUI frameworks in any language.
For distribution, goreleaser automates everything. Push a git tag, and goreleaser builds binaries for all platforms, creates a GitHub release with checksums, updates your Homebrew tap, and publishes to Snapcraft. The initial configuration takes 30 minutes, and after that, releasing is just tagging and pushing. goreleaser has 15,823 stars and the latest release is v2.16.0. The open-source core is free, with a paid Pro tier for extras like split-and-merge builds (check current pricing on the goreleaser site).
TypeScript Path: For npm Distribution
If your audience is the JavaScript ecosystem, build your CLI in TypeScript and distribute via npm. Users run npx your-tool or npm install -g your-tool and they're ready to go.
Commander.js is the npm equivalent of Cobra. It handles argument parsing, subcommands, help generation, and option handling. The API is clean and TypeScript-friendly. It is also enormous as far as adoption goes, pulling roughly 390.9 million npm downloads a week and sitting at 28,231 GitHub stars. The current major is v15.0.0.
Chalk for colored output, Ora for spinners, and Inquirer for interactive prompts give you a polished terminal experience. Chalk is one of the most-downloaded packages on npm, period, at about 409.2 million weekly downloads (23,227 stars, latest v5.6.2). Ora handles spinners at v9.4.0 with roughly 66.4 million weekly downloads, and Inquirer covers interactive prompts at v14.0.1 with about 42.9 million weekly downloads. Inquirer's prompts (checkboxes, selections, confirmations) are especially useful for CLI tools that need user input during setup or configuration. All three are free and MIT-licensed.
For bundling, use tsup (built on esbuild, which itself has 39,896 stars). It compiles your TypeScript to a single JavaScript file that starts fast. By default, Node.js CLI tools that import dozens of modules have a noticeable startup delay. Bundling into a single file eliminates that. tsup is at v8.5.1 with 11,249 stars and around 5.68 million weekly downloads, so it is well past the "will this be abandoned next month" stage.
One thing I learned the hard way. Add a shebang line (#!/usr/bin/env node) to your entry file and set "bin" in your package.json. Without these, npx won't know how to run your tool. It's a two-minute thing that's easy to forget and confusing to debug.
Testing CLI Tools
CLI testing is different from web testing because you're testing input/output at the process level. For Go, the built-in testing package works well. Run the command as a subprocess, capture stdout and stderr, assert on the output.
For TypeScript, use Vitest and test your command handler functions directly. Vitest is at v4.1.7 with 16,602 stars and roughly 59.3 million weekly downloads, so it has clearly become the default test runner in the modern TypeScript world. For integration tests, spawn your CLI as a real command using Node's child process utilities. Both approaches catch different types of bugs, and I'd recommend having both. If you also need user config-file support on the TypeScript side, cosmiconfig (the Viper equivalent) is the standard pick, at v9.0.1 with about 105.5 million weekly downloads.
The most important thing to test in a CLI tool is error handling. What happens when the user passes an invalid flag? What happens when a required file doesn't exist? What happens when the network is down? CLI users expect helpful error messages, not stack traces. Test every error path you can think of.
What I'd Skip
Rust for your first CLI tool. Rust produces great binaries, but the learning curve is steep. If you already know Rust, use it. If you don't, Go gives you 90% of the benefits with a much shorter time to productivity. You can always rewrite in Rust later if performance is a bottleneck.
Electron-based CLI wrappers. I've seen people package Node.js CLI tools with pkg or similar tools that bundle the Node runtime. The resulting binary is 50-80MB for a tool that does text processing. If you need binaries, use Go. If npm distribution is fine, stay in Node.js.
Interactive TUIs for v1. A full terminal UI (like a dashboard that takes over the whole terminal) is cool but complex. Start with simple command-output interactions. Add interactive features in v2 when you know what users actually need.
Monorepo structure. A CLI tool is usually one package. Don't set up a monorepo with workspaces for a single program. One src/ directory, one package.json, one build command. Keep it flat until you have a reason not to.
Getting Started
Here's what I'd do this weekend.
Pick your path. Binary distribution? Go. npm distribution? TypeScript. Don't agonize over this. Both work great.
Scaffold the project. For Go:
go mod init github.com/you/tooland install Cobra. For TypeScript:npm init -y, installcommander,chalk, andtsup.Build one command. The main command that does the core thing your tool does. Get it working end to end. Don't add subcommands or flags yet.
Add error handling. Make every failure produce a clear, helpful error message. This is what separates amateur CLI tools from professional ones.
Publish. For Go: set up goreleaser and push a v0.1.0 tag. For TypeScript: run
npm publish. Get it in people's hands and iterate from there.
CLI tools are the fastest path from idea to shipped product I know of. No UI framework debates, no design reviews, no responsive testing. Just clean code that does useful things. And developers love good CLI tools. Build one that saves someone 10 minutes a day and they'll tell every developer they know.
Sources
All version, star, and download figures were checked on 2026-05-30. GitHub star counts came from api.github.com, npm weekly-download counts from api.npmjs.org, and latest npm versions from registry.npmjs.org.
- Cobra (stars, license, v1.10.2): https://github.com/spf13/cobra and https://api.github.com/repos/spf13/cobra
- Viper (stars, v1.21.0): https://github.com/spf13/viper and https://api.github.com/repos/spf13/viper
- Lipgloss (stars, v2.0.3): https://github.com/charmbracelet/lipgloss and https://api.github.com/repos/charmbracelet/lipgloss
- Bubble Tea (stars, v2.0.6): https://github.com/charmbracelet/bubbletea and https://api.github.com/repos/charmbracelet/bubbletea
- goreleaser (stars, v2.16.0, Pro pricing): https://github.com/goreleaser/goreleaser and https://goreleaser.com/
- Commander.js (stars, v15.0.0, downloads): https://github.com/tj/commander.js, https://registry.npmjs.org/commander, https://api.npmjs.org/downloads/point/last-week/commander
- Chalk (stars, v5.6.2, downloads): https://github.com/chalk/chalk, https://registry.npmjs.org/chalk, https://api.npmjs.org/downloads/point/last-week/chalk
- Ora (stars, v9.4.0, downloads): https://github.com/sindresorhus/ora, https://registry.npmjs.org/ora, https://api.npmjs.org/downloads/point/last-week/ora
- Inquirer (stars, v14.0.1, downloads): https://github.com/SBoudrias/Inquirer.js, https://registry.npmjs.org/inquirer, https://api.npmjs.org/downloads/point/last-week/inquirer
- tsup (stars, v8.5.1, downloads): https://github.com/egoist/tsup, https://registry.npmjs.org/tsup, https://api.npmjs.org/downloads/point/last-week/tsup
- esbuild (stars): https://github.com/evanw/esbuild
- Vitest (stars, v4.1.7, downloads): https://github.com/vitest-dev/vitest, https://registry.npmjs.org/vitest, https://api.npmjs.org/downloads/point/last-week/vitest
- cosmiconfig (v9.0.1, downloads): https://registry.npmjs.org/cosmiconfig, https://api.npmjs.org/downloads/point/last-week/cosmiconfig
- Go latest stable (go1.26.3): https://go.dev/dl/
- Node.js LTS v24.16.0 (Krypton) and Current v26.2.0: https://nodejs.org/en/download and https://nodejs.org/dist/index.json
Like this? You'll like what I'm building too.
Two ways to support and get more of this work.
HEARTH
A privacy-first Life OS for your desktop. Journal, tasks, and notes that stay on your machine. Coming soon, direct download from this site.
Read moreMY TOOLKITS
Receipts-first toolkits for shipping after hours, building Claude agents, publishing on Amazon, and more. The exact methods I used, not theory.
Browse on WhopRelated Articles
AI Wrapper Stack Guide for Solo Developers
Complete guide to the AI wrapper stack - when to use it, setup, pros/cons, and alternatives.
Best Tech Stack for Building an AI Wrapper as a Solo Developer
The ideal tech stack for solo developers building an AI wrapper in 2026.
Best Tech Stack for an Analytics Dashboard as a Solo Developer
The best tech stack for building an analytics dashboard as a solo developer - frameworks, databases, hosting, and tools.