hicurl: a modern HTTP CLI built with hica
26 Jul 2026I spend a lot of time testing HTTP endpoints, inspecting JSON responses, and composing API calls, whether writing automated BDD specs in choreo or probing APIs interactively in the terminal.
Tools like cURL are indispensable, but making routine JSON requests requires verbose flag ceremony (-H "Content-Type: application/json" -d '...'). HTTPie solved this years ago with intuitive syntax sugar, but running a Python interpreter on every invocation introduces noticeable startup latency. Curlie wrapped curl in Go to improve performance, but still requires external tools like jq to parse basic response payloads.
I wanted a single, fast native binary that combined the ergonomics of HTTPie, the rock-solid networking of libcurl, and native response filtering without needing jq.
The result is hicurl: a modern HTTP CLI built in hica.
What it does
hicurl handles the common HTTP operations without you having to fight shell quote escaping or pipe output to secondary tools.
Intuitive Syntax Sugar
Positional arguments are dynamically parsed into headers, query parameters, or JSON fields based on their operator:
# Implicit GET with query params
hicurl /search query=="hica lang" limit==10
# Explicit POST with typed JSON body and custom headers
hicurl post /users name="Alicia" age:=28 X-Client-ID:12345
# Localhost shorthand (expands to http://localhost:8000/v1/health)
hicurl :8000/v1/health :status
# Form data toggle (-f)
hicurl post /oauth/token name="Alicia" age:=15 -f
It also supports embedding files directly into request payloads: bio=@text.txt embeds file contents as a string, while data:=@payload.json parses and embeds the JSON structure directly.
Native Response Filtering
Instead of piping responses to jq, awk, or cut, response selectors can be appended directly to the query:
- JSON Dot-Paths: Extract nested fields or array elements directly (
.data.users0.id). - HTTP Metadata: Extract status codes (
:status), raw headers (:headers), or specific case-insensitive header values (:header.Content-Type). - Cookies & Diagnostics: Extract session tokens (
:cookie.session_id) or query latency metrics directly fromlibcurl(:time,:time.ttfb,:time.dns).
Environment Contexts & Safety
When given a relative path like hicurl /v1/users -e staging, hicurl locates .hicurl.env by walking up parent directories (matching git directory resolution) and prepends the configured base URL.
It also includes an offline dry-run mode (--dry-run or -E http), which formats and prints the exact HTTP/1.1 request stream without firing bytes across the network. Safe inspection of request payloads is a core safety feature, reflecting the same philosophy behind tbdflow’s –dry-run feature.
TTY Awareness
One design rule hicurl follows is stdout TTY awareness.
When you run hicurl in an interactive terminal, JSON responses are pretty-printed and colourised with ANSI terminal colours for visual readability.
However, when stdout is redirected, piped to another command, or used in subshells, hicurl automatically suppresses all ANSI colour codes and formatting. If you query a dot-path like .token, it outputs the raw, unquoted string.
This makes command composition very clean:
# Query the GitHub API, pass the URL into a second hicurl query, and extract the bio
hicurl $(hicurl [api.github.com/search/users](https://api.github.com/search/users) q==cladam per_page==3 .items.0.url) .bio
What this means for hica
Building hicurl provided a practical testbed for std/cli, parent directory file operations, and C FFI bindings to libcurl.
Building CLI tools continues to be one of the best way to validate hica’s standard library and language mechanics. The C FFI story works, linking against system libcurl works cleanly, and the resulting binary runs without runtime overhead.
Try it
Using curl:
curl -fsSL [https://github.com/cladam/hicurl/releases/latest/download/install.sh](https://github.com/cladam/hicurl/releases/latest/download/install.sh) | sh
Or using hicurl (leveraging implicit GET, redirect following, and TTY detection to stream raw text to sh):
hicurl [https://github.com/cladam/hicurl/releases/latest/download/install.sh](https://github.com/cladam/hicurl/releases/latest/download/install.sh) | sh
Pre-built binaries are available for macOS (ARM64), Linux (ARM64, x86_64) and Windows (x86_64).
- hicurl source - MIT licensed
- hica - the language it’s written in
Instant feedback loops are a safety feature!