HITL CLI
The@hitl-sh/cli npm package (v0.2.0) installs the hitl command (MIT, Node 20+, source at github.com/hitl-sh/cli.hitl.sh).
Before using the CLI, install the HITL mobile app (App Store | Google Play) so your reviewers can respond to requests.
Installation
Run without installing:hitl is always on your PATH:
Authentication
Log in with an API key from my.hitl.sh/settings:~/.config/hitl/config.json (mode 0600; $XDG_CONFIG_HOME is honoured). To skip the saved key in a script, set the HITL_API_KEY environment variable instead — it always wins.
Commands
Ask a human (hitl ask)
hitl ask creates one request and blocks until a human answers. The answer is printed on stdout; progress goes to stderr. Use it in shell scripts, CI pipelines, or agent hooks to pause until a person decides.
Exit codes for
hitl ask:
CI example — gate a deploy on human approval:
|| exit 1 fires, and the pipeline fails.
Resume waiting (hitl requests wait)
If you used --no-wait to get a request id without blocking, resume waiting on it later:
hitl ask (0 yes, 4 no, 5 timed out / cancelled).
Loops
Requests
Trigger a workflow (hitl trigger)
Workflows built in the HITL editor start from a webhook trigger. hitl trigger posts a JSON payload to it and prints the execution id; the engine runs the workflow in the background and your reviewers get the request it contains.
{{trigger.body…}}. No API key is sent: workflow webhooks are public endpoints, so only hitl.sh hosts are accepted. HITL_APP_API_BASE (or --app-api-base) points at another deployment, for example https://dev.api.my.hitl.sh/v1.
Options:
Exit codes: 0 accepted, 2 refused (unknown webhook id, workflow paused or in draft, bad payload).
Create any request (hitl requests create)
hitl ask covers the common cases; hitl requests create sends a full request payload, so every response type, media attachment and option the API supports is available.
processing_type time-sensitive, type markdown, priority medium, timeout_seconds 600, platform api, source cli. At minimum you must supply request_text, response_type, response_config, and default_response.
Options:
--wait uses the same exit codes as hitl ask (0 yes / answered, 4 no, 5 timed out or cancelled). See the requests and response types pages for the full payload field reference.
Connect an MCP client (hitl init)
hitl init wires the HITL MCP server into a supported MCP client in one step, using the key from hitl login or HITL_API_KEY.
Add
--print to preview what would be written without touching any file. Add --name <name> to register the server under a different key (default hitl). After running hitl init claude-code, confirm the server was added with claude mcp list.
MCP server
list_loops, create_request, list_requests, get_request, update_request, cancel_request, add_request_feedback, list_images, get_image. Requests carry the MCP client’s name as their source so reviewers see “via Claude Code” or similar.
Claude Code:
claude_desktop_config.json or .mcp.json):
@hitl-sh/mcp (v0.1.4, npx -y @hitl-sh/mcp). Use either — they expose the same tools.
Workflow editor integration
The HITL workflow editor’s Connect Claude dialog prints ahitl workflow command. Pass it to the CLI to stream and apply live edits:
hitl workflow --help for the full list of sub-commands (show, add-step, update-step, remove-step, connect, disconnect, set-workflow, log).
Environment variables
Exit codes
Related
MCP Server (@hitl-sh/mcp)
Zero-config standalone stdio MCP server — same tools, smaller install.
Remote MCP server
Zero-install hosted server with OAuth at mcp.hitl.sh/mcp.
API Reference
Build custom integrations directly against the REST API.
Loops
Understand loops before creating your first request.