hypecli 0.1.5

CLI tool for interacting with Hyperliquid via hypersdk
hypecli-0.1.5 is not a library.

hypecli

A command-line interface for interacting with the Hyperliquid protocol.

Crates.io License: MPL 2.0

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

curl -fsSL https://raw.githubusercontent.com/infinitefield/hypersdk/main/hypecli/install.sh | sh

From crates.io

cargo install hypecli

From source

git clone https://github.com/infinitefield/hypersdk.git
cd hypersdk/hypecli
cargo install --path .

Usage

hypecli --help

Account Management

Create and manage Foundry-compatible keystores for signing transactions.

# Create a new keystore with a random private key
hypecli account create --name my-wallet
# You'll be prompted to enter and confirm a password

# List all available keystores
hypecli account list

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.

hypecli dexes

List Perpetual Markets

List perpetual markets from Hyperliquid or a specific HIP-3 DEX.

# List all Hyperliquid perpetual markets
hypecli perps

# List perpetual markets from a specific HIP-3 DEX
hypecli perps --dex xyz

Query Balances

Query all balances (spot, perp, and DEX) for a user address.

# Pretty format (default)
hypecli balance 0x1234567890abcdef1234567890abcdef12345678

# Table format for terminal viewing
hypecli balance 0x1234... --format table

# JSON format for programmatic consumption
hypecli balance 0x1234... --format json

# Skip querying HIP-3 DEX balances (only show spot and perp)
hypecli balance 0x1234... --skip-hip3

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:

hypecli multisig send-asset \
  --multi-sig-addr 0xYourMultiSigWallet... \
  --chain Mainnet \
  --to 0xRecipient... \
  --token USDC \
  --amount 100 \
  --keystore my-wallet

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:

hypecli multisig sign \
  --multi-sig-addr 0xYourMultiSigWallet... \
  --chain Mainnet \
  --connect endpoint... \
  --keystore another-wallet

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
hypecli multisig sign --keystore my-wallet --connect endpoint...

# With password flag (less secure, visible in history)
hypecli multisig sign --keystore my-wallet --password mypass --connect endpoint...

How P2P Multi-Sig Works:

  1. Decentralized: Uses Iroh's gossip protocol for peer-to-peer communication
  2. No Server: No centralized coordinator required
  3. NAT Traversal: Supports mDNS and DNS discovery with relay fallback
  4. Secure: Each signer reviews and cryptographically signs the exact transaction
  5. Threshold: Collects signatures until the on-chain threshold is met
  6. 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


Note: This CLI is not officially affiliated with Hyperliquid. It is a community-maintained project built on hypersdk.