xh
$ xh Community Med Riskxh mirrors HTTPie's ergonomic key=value and key:=json syntax in a static Rust binary. Agents get instant startup, --offline previews, --curl command translation, and clean non-TTY stdout formatting.
brew install xh xh combines HTTPie ergonomics with curl-class startup speed, making it ideal for tight agent API test loops without MCP overhead.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Combines --offline, --curl, --check-status, --pretty=none, and automatic non-TTY plain JSON output with sub-10ms Rust startup.
- Supports
--offline,--curl,--check-status, and--pretty=none
Built-in --offline and --curl dry-run modes let agents verify payloads safely before sending writes.
--offlineand--curlpreview requests without network side effects
Single static Rust binary available via brew, cargo, and GitHub releases across macOS, Linux, and Windows.
- Zero-dependency static binary across all major OSes
Eliminates both curl quoting friction and HTTPie Python startup overhead.
- HTTPie-compatible JSON request DSL at native compiled speed
Well-maintained OSS project (ducaale/xh) under MIT license.
- Active
ducaale/xhGitHub repository
Clean --help, README flag tables, and HTTPie parity.
- Clear README and
--helpoutput
Security, Auth & Guardrails
Supports optional --session JSON files and --netrc; otherwise holds credentials only in process memory.
Free, MIT open-source single Rust binary.
# xh Agent Rules - Always pass `--check-status` and `--timeout=15` on automated API calls. - Use `--offline` or `--curl` first when constructing non-trivial `POST`/`PATCH`/`DELETE` requests.
Agent-Ready Command Recipes
Safe Read-Only Queries
xh --check-status --pretty=none GET https://api.github.com/zen
Disables colors/formatting for piping and exits non-zero on 4xx/5xx responses.
xh --curl POST https://httpbin.org/post name=agent count:=2
Prints a portable curl command offline without executing the network request.
Controlled Writes & Previews
xh --check-status --timeout=15 POST https://httpbin.org/post ok:=true env=staging
Sends a typed JSON payload with a 15-second timeout and strict HTTP status checking.
Strengths for Agents
- + Millisecond Rust startup with HTTPie's ergonomic JSON request syntax.
- + Includes both
--offlineand--curlmodes for safe verification and shell portability. - + Cleanly suppresses ANSI formatting when piped to
jqor captured by agents.
Caveats & Pitfalls
- ! HTTP 4xx/5xx responses still exit
0unless--check-statusis supplied.