Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

CLI Overview

hlz is a 38-command CLI for Hyperliquid. 827KB static binary, zero config required for market data.

Design Principles

  • Pipe-aware — Tables on TTY, JSON when piped. No surprises.
  • Agent-native — Structured output, semantic exit codes, no interactive prompts.
  • One binary — Everything in 827KB. No runtime dependencies.
  • Smart defaults — Works out of the box. Power users customize.

Command Categories

CategoryCommandsAuth Required
Market Dataprice, mids, funding, book, perps, spot, dexesNo
Tradingbuy, sell, cancel, modify, leverage, twap, batchYes
Accountportfolio, positions, orders, fills, balance, status, referralAddress only
TransferssendYes
StreamingstreamNo (public) / Yes (user events)
Keyskeys ls/new/import/export/default/rmNo
TUItrade, marketsYes (trading) / No (viewing)

Global Flags

--output json|pretty|csv    Output format (auto-json when piped)
--json                      Shorthand for --output json
--quiet, -q                 Minimal output (just result value)
--chain mainnet|testnet     Target chain
--key <HEX>                 Private key (prefer keystore)
--key-name <NAME>           Use named keystore key
--address <ADDR>            User address for queries
--dry-run, -n               Preview trade without sending

Exit Codes

CodeMeaningExample
0SuccessCommand completed
1ErrorAPI error, invalid response
2Usage errorBad arguments, unknown command
3Auth errorMissing key or address
4Network errorConnection refused, timeout

Asset Name Syntax

hlz uses a unified asset syntax across all commands:

FormatExampleDescription
SYMBOLBTC, ETHPerpetual on Hyperliquid DEX
BASE/QUOTEPURR/USDCSpot market
dex:SYMBOLxyz:BTCHIP-3 DEX perpetual