# Tool Xh

> tool-xh

- Skill: `niksavis/tool-xh-2` (Agent Skill)
- Install (CLI): `npx skillmds@latest add niksavis/tool-xh-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/niksavis/tool-xh-2/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: niksavis (https://skillmd.com/u/niksavis)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/niksavis/tool-xh-2

---

# tool-xh

## When To Use

- Probe HTTP endpoints quickly with clean CLI syntax.
- Send JSON requests and inspect response headers/status.
- Validate API behavior with straightforward failure handling.

## Trusted Commands

```bash
xh get httpbin.org/json
xh post httpbin.org/post name=Alice age:=30
xh get api.example.com Authorization:"Bearer $TOKEN"
xh --json get api.example.com
xh --follow get example.com
xh --print=hHbB get httpbin.org/get
xh --check-status get api.example.com
xh -b get api.example.com
xh -h get api.example.com
xh --download get example.com/file.zip
```

## Safe Defaults

- Use `--check-status` in scripts so 4xx/5xx produce non-zero exits.
- Use explicit method forms (`get`, `post`) for readability.
- Use `key:=value` for raw JSON numbers/booleans, not quoted strings.

## Common Pitfalls

- `key=value` sends strings; `key:=value` sends typed JSON.
- Headers and bodies can leak secrets in shell history if not handled carefully.
- xh option behavior is not one-to-one with curl flags.

## Output Interpretation

- Pretty response body is written to stdout by default.
- `-b` prints body only; `-h` prints headers only.
- `--print=hHbB` controls request/response header/body visibility.

## Why It Matters For Agents

- Reduces curl quoting complexity for API tests.
- Combines readable defaults with strict exit handling when needed.

## Repo Conventions

- Prefer xh for interactive API probing.
- Use curl when low-level transfer or compatibility control is required.

## Trigger Examples

- Should trigger: "Quickly test this webhook endpoint with JSON body."
- Should trigger: "Show response headers for this API URL."
- Should not trigger: "Rename a function symbol across source files."

