Getting Started
hlz gives you three things:
hlz— A 38-command CLI for Hyperliquid (827KB)hlz-terminal— A full trading terminal (768KB)- hlz — A Zig library for building your own tools
Install the CLI
curl -fsSL https://raw.githubusercontent.com/dzmbs/hlz/main/install.sh | shOr build from source:
git clone https://github.com/dzmbs/hlz
cd hlz
zig build -Doptimize=ReleaseSmall
# Binary at zig-out/bin/hlzConfigure
Set your private key:
# Option 1: Environment variable
export HL_KEY="your_private_key_hex"
# Option 2: Encrypted keystore (recommended)
hlz keys new default
# Enter password when prompted
# Option 3: Config file
echo 'HL_KEY=your_private_key_hex' > .env
# Or system-wide: ~/.hl/config (same key=value format)Your First Commands
No authentication needed for market data:
hlz price BTC # Current price + spread
hlz funding --top 5 # Top funding rates
hlz book ETH --live # Live order bookPlace a trade:
hlz buy BTC 0.1 @50000 # Limit buy 0.1 BTC at $50,000
hlz sell ETH 1.0 # Market sell 1 ETHCheck your account:
hlz portfolio # Positions + balances
hlz orders # Open ordersLaunch the trading terminal:
hlz trade BTC # Full TUI with chart, book, tapeUse as a Zig Library
Add to your build.zig.zon:
.dependencies = .{
.hlz = .{
.url = "git+https://github.com/dzmbs/hlz#main",
},
},Then in your code:
const hlz = @import("hlz");
const client = hlz.hypercore.client.Client.mainnet(allocator);
defer client.deinit();
// Fetch all mid prices (no auth needed)
var result = try client.getAllMids(null);
defer result.deinit();
// result.value is a parsed responseNext Steps
- CLI commands — Full command reference
- SDK guide — Building with the Zig library
- Trading terminal — Terminal keybindings and features
- Agent integration — Using
hlzin automated workflows