← library
prompt⌨️ CLI toolsv2 · updated 2026-06-12

CLI tool people keep

A fast, scriptable command-line tool with Go + Cobra (or Node + commander).

Run it as a prompt

Paste this into any AI agent, or fetch it: curl -s https://uplift.page/api/v1/prompts/cli-tool/raw

prompt.md
# CLI tool people keep

Build a CLI that starts instantly, composes with pipes, and never surprises a script.

## Recommended stack

- **Go + Cobra** - language & framework. Single static binary, instant startup, trivially cross-compiled - the CLI gold standard.
- **goreleaser** - distribution. Tagged release → binaries, Homebrew tap, and checksums automatically.
- **Node + commander** - alternative. Right choice when your users already live in npm and need your JS ecosystem.

## Build steps

1. Design the grammar first: `tool <noun> <verb>` with global `--json`, `--quiet`, `--help` everywhere.
2. Exit codes are the API: 0 success, 1 expected failure, 2 misuse; print errors to stderr only.
3. Auto-detect TTY: human tables when interactive, plain/JSON when piped.
4. Respect XDG config paths and an env-var override for every flag.
5. Add shell completions and a `--version` that CI can pin.

## Watch out for

- Interactive prompts that hang scripts - every prompt needs a flag equivalent.
- Breaking output formats minor-version to minor-version; scripts parse you.
- Spinners and colors leaking into piped output.

## Definition of done

- `tool --json | jq` works for every read command
- Cold start < 50ms
- Install is one command (brew/npm/curl) with completions included

The full prompt

Build a CLI that starts instantly, composes with pipes, and never surprises a script.

Recommended stack

  • Go + Cobra - language & framework. Single static binary, instant startup, trivially cross-compiled - the CLI gold standard.
  • goreleaser - distribution. Tagged release → binaries, Homebrew tap, and checksums automatically.
  • Node + commander - alternative. Right choice when your users already live in npm and need your JS ecosystem.

Build steps

  1. Design the grammar first: tool <noun> <verb> with global --json, --quiet, --help everywhere.
  2. Exit codes are the API: 0 success, 1 expected failure, 2 misuse; print errors to stderr only.
  3. Auto-detect TTY: human tables when interactive, plain/JSON when piped.
  4. Respect XDG config paths and an env-var override for every flag.
  5. Add shell completions and a --version that CI can pin.

Watch out for

  • Interactive prompts that hang scripts - every prompt needs a flag equivalent.
  • Breaking output formats minor-version to minor-version; scripts parse you.
  • Spinners and colors leaking into piped output.

Definition of done

  • tool --json | jq works for every read command
  • Cold start < 50ms
  • Install is one command (brew/npm/curl) with completions included

Served from the uplift.page library and refreshed within 5 minutes of every update.