hypecli
A command-line interface for interacting with the Hyperliquid protocol.
Overview
hypecli is a lightweight CLI tool built on top of hypersdk for quick queries and operations on Hyperliquid. It provides fast access to market data, user balances, and DeFi protocol information without writing custom code.
Installation
Quick Install
|
From crates.io
From source
Usage
Account Management
Create and manage Foundry-compatible keystores for signing transactions.
# Create a new keystore with a random private key
# You'll be prompted to enter and confirm a password
# List all available keystores
Keystores are stored in ~/.foundry/keystores/ and are compatible with Foundry's cast tool. Use the keystore name with --keystore in other commands.
List HIP-3 DEXes
List all available HIP-3 perpetual DEXes.
List Perpetual Markets
List perpetual markets from Hyperliquid or a specific HIP-3 DEX.
# List all Hyperliquid perpetual markets
# List perpetual markets from a specific HIP-3 DEX
Query Balances
Query all balances (spot, perp, and DEX) for a user address.
# Pretty format (default)
# Table format for terminal viewing
# JSON format for programmatic consumption
# Skip querying HIP-3 DEX balances (only show spot and perp)
Shows spot balances, perp account details (account value, margin used, withdrawable, positions), and all HIP-3 DEX balances. Use --skip-hip3 to skip DEX queries.
Features
Multi-Signature Transactions (P2P)
Coordinate multi-signature transactions using decentralized peer-to-peer gossip, without relying on a centralized server.
Initiating an Asset Transfer
The initiator creates a transaction proposal and waits for authorized signers to connect and sign:
If no wallet is detected, hypecli defaults to a connected Ledger, if any.
Output:
Using signer 0xSigner1...
Authorized users: [0xSigner1..., 0xSigner2..., 0xSigner3...]
hypecli multisig sign --multi-sig-addr 0xYourMultiSigWallet... --chain Mainnet --connect endpoint...
Authorized 1/2
The command displays a connection ticket that other signers can use to connect. It waits until the signature threshold is met, then submits the transaction.
Signing a Transaction
Other authorized signers connect to the initiator using the endpoint ticket:
Output:
Signer found using 0xSigner2...
Neighbor up: abc123...
SendAsset {
destination: 0xRecipient...,
token: "USDC",
amount: 100,
...
}
Accept (y/n)?
The signer reviews the transaction details and types y to approve or n to reject.
Signer Options:
You can provide signing credentials via:
--private-key 0x...- Direct private key (hex format)--keystore filename- Foundry keystore file (prompts for password)- No flag - Automatically searches connected Ledger devices
For keystores:
# With password prompt
# With password flag (less secure, visible in history)
How P2P Multi-Sig Works:
- Decentralized: Uses Iroh's gossip protocol for peer-to-peer communication
- No Server: No centralized coordinator required
- NAT Traversal: Supports mDNS and DNS discovery with relay fallback
- Secure: Each signer reviews and cryptographically signs the exact transaction
- Threshold: Collects signatures until the on-chain threshold is met
- Privacy: Ephemeral keys used for P2P connections
Network Discovery:
The CLI uses multiple discovery mechanisms:
- mDNS: Discovers peers on the local network
- DNS: Uses the n0 relay network for discovery
- Direct Connect: Uses endpoint tickets for direct peer connections
This allows signers to coordinate from anywhere, even behind NATs or firewalls.
Documentation
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Ideas for contributions:
- New commands for trading operations
- JSON output format support
- Configuration file support
- Interactive mode
- Performance optimizations
License
This project is licensed under the Mozilla Public License 2.0 - see the LICENSE file for details.
Support
- GitHub Issues: Report bugs or request features
- Documentation: docs.rs/hypersdk
Note: This CLI is not officially affiliated with Hyperliquid. It is a community-maintained project built on hypersdk.