Just Use Curl

CLI vs GUI for HTTP/API work

  • Many defend curl + terminal as sufficient and always-available; others prefer Postman-like GUIs for convenience, discoverability, and better organization.
  • GUI advocates cite:
    • Large collections of hundreds of diverse requests.
    • Easy import from OpenAPI/Swagger.
    • Visual editing, syntax highlighting, autoformatting.
    • Chaining requests with stored state (tokens, IDs) and sharing flows with non‑technical stakeholders.
  • CLI advocates emphasize:
    • No install/updates, especially on personal or ephemeral dev machines/VMs.
    • Composability (pipes, scripts), automation, version control, and long‑term stability.
    • Avoiding heavy Electron apps and cloud‑tied tools.

Organizing, Sharing, and Automation

  • Curl workflows often use:
    • Makefiles/Justfiles or shell scripts with reusable curl commands.
    • Plain text, markdown, or git repos to share and version requests.
    • Environment variables and small helper functions for common args.
  • Critics argue that once you start scripting complex flows, you’re re‑implementing an API client in bash, which can become “bash spaghetti” and is harder to maintain than a dedicated tool.

curl’s UX, Discoverability, and Alternatives

  • Curl is praised as robust, ubiquitous, and ideal for one‑off calls and piping to tools like jq.
  • Downsides raised:
    • Dated/complex flag syntax; hard to remember for infrequent users.
    • Manpages are long “walls of text” and poor as quickstart documentation.
    • Windows’ bundled curl is reported to lack crucial features.
  • Suggested helpers:
    • tldr and cht.sh for concise examples.
    • --json and -d instead of manual -X POST + headers.
    • Env vars/files for long bearer tokens; tricks to avoid secrets in history.
  • Alternative tools mentioned: httpie/xh, curlie, hurl, VS Code REST Client, Thunder Client, Emacs restclient, Bruno, SoapUI. Some note httpie’s move toward commercial offerings.

Technical Notes and Gotchas

  • Discussion around -X POST being unnecessary or problematic with redirects; using data flags and redirect‑specific options is safer.
  • Some suggest that if you reach “3‑line Python script” territory for assertions and flows, it may be time to switch from shell + curl to a real language binding or API client.

Reaction to the Article’s Tone

  • The aggressive, profanity‑laced “just use curl” style splits readers:
    • Some find it funny, cathartic, and part of an established meme.
    • Others see it as off‑putting, performatively edgy, and not persuasive, especially for UX‑oriented users.