@2oolkit/hyperliquid-cli
Advanced tools
+6
-4
@@ -957,7 +957,9 @@ #!/usr/bin/env node | ||
| const disk = loadConfig(); | ||
| const envVal = process.env.HYPERLIQUID_ENV; | ||
| const env = envVal === "testnet" ? "testnet" : disk.env; | ||
| return { | ||
| env: disk.env, | ||
| privateKey: disk.privateKey ?? process.env.HL_PRIVATE_KEY, | ||
| walletAddress: disk.walletAddress ?? process.env.HL_WALLET_ADDRESS, | ||
| subAccountAddress: disk.subAccountAddress ?? process.env.HL_SUB_ACCOUNT_ADDRESS | ||
| env, | ||
| privateKey: disk.privateKey ?? process.env.HYPERLIQUID_WALLET_PRIVATE_KEY, | ||
| walletAddress: disk.walletAddress ?? process.env.HYPERLIQUID_WALLET_ADDRESS, | ||
| subAccountAddress: disk.subAccountAddress ?? process.env.HYPERLIQUID_SUB_ACCOUNT_ADDRESS | ||
| }; | ||
@@ -964,0 +966,0 @@ } |
+1
-1
| { | ||
| "name": "@2oolkit/hyperliquid-cli", | ||
| "version": "0.1.0", | ||
| "version": "0.2.0", | ||
| "description": "CLI & MCP server for Hyperliquid DEX — trade perpetuals & spot, manage orders, and query market data", | ||
@@ -5,0 +5,0 @@ "author": "haeminmoon", |
+24
-7
@@ -75,4 +75,4 @@ # @2oolkit/hyperliquid-cli | ||
| ```bash | ||
| export HL_PRIVATE_KEY=<your-private-key> | ||
| export HL_WALLET_ADDRESS=<your-wallet-address> | ||
| export HYPERLIQUID_WALLET_PRIVATE_KEY=<your-private-key> | ||
| export HYPERLIQUID_WALLET_ADDRESS=<your-wallet-address> | ||
| ``` | ||
@@ -246,5 +246,5 @@ | ||
| ### MCP Prerequisites | ||
| ### MCP Configuration | ||
| Before using MCP tools that require authentication, set up credentials via the CLI: | ||
| **Option 1: CLI setup (recommended)** | ||
@@ -257,2 +257,19 @@ ```bash | ||
| **Option 2: Environment variables in MCP config** | ||
| Pass credentials directly in your MCP config file — no CLI setup needed: | ||
| ```json | ||
| { | ||
| "mcpServers": { | ||
| "hyperliquid": { | ||
| "command": "hyperliquid-mcp", | ||
| "env": { | ||
| "HYPERLIQUID_WALLET_PRIVATE_KEY": "0x..." | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
| --- | ||
@@ -356,5 +373,5 @@ | ||
| |----------|-------------| | ||
| | `HL_PRIVATE_KEY` | Private key (overrides config file) | | ||
| | `HL_WALLET_ADDRESS` | Wallet address (overrides config file) | | ||
| | `HL_SUB_ACCOUNT_ADDRESS` | Sub-account address | | ||
| | `HYPERLIQUID_WALLET_PRIVATE_KEY` | Private key (overrides config file) | | ||
| | `HYPERLIQUID_WALLET_ADDRESS` | Wallet address (overrides config file) | | ||
| | `HYPERLIQUID_ENV` | `mainnet` or `testnet` (default: `mainnet`) | | ||
@@ -361,0 +378,0 @@ ## Resources |
@@ -180,5 +180,5 @@ # Account & Transfers Reference | ||
| |----------|-------------| | ||
| | `HL_PRIVATE_KEY` | Private key (overrides config) | | ||
| | `HL_WALLET_ADDRESS` | Wallet address (overrides config) | | ||
| | `HL_SUB_ACCOUNT_ADDRESS` | Sub-account address | | ||
| | `HYPERLIQUID_WALLET_PRIVATE_KEY` | Private key (overrides config) | | ||
| | `HYPERLIQUID_WALLET_ADDRESS` | Wallet address (overrides config) | | ||
| | `HYPERLIQUID_ENV` | `mainnet` or `testnet` (default: `mainnet`) | | ||
@@ -185,0 +185,0 @@ ## Security Best Practices |
+23
-10
@@ -24,6 +24,6 @@ --- | ||
| homepage: "https://hyperliquid.xyz" | ||
| primaryEnv: "HL_PRIVATE_KEY" | ||
| primaryEnv: "HYPERLIQUID_WALLET_PRIVATE_KEY" | ||
| requires: | ||
| bins: ["hyperliquid-cli", "hyperliquid-mcp"] | ||
| env: ["HL_PRIVATE_KEY"] | ||
| env: ["HYPERLIQUID_WALLET_PRIVATE_KEY"] | ||
| install: | ||
@@ -38,6 +38,6 @@ - id: "hyperliquid-cli-npm" | ||
| homepage: "https://hyperliquid.xyz" | ||
| primaryEnv: "HL_PRIVATE_KEY" | ||
| primaryEnv: "HYPERLIQUID_WALLET_PRIVATE_KEY" | ||
| requires: | ||
| bins: ["hyperliquid-cli", "hyperliquid-mcp"] | ||
| env: ["HL_PRIVATE_KEY"] | ||
| env: ["HYPERLIQUID_WALLET_PRIVATE_KEY"] | ||
| install: | ||
@@ -95,4 +95,4 @@ - id: "hyperliquid-cli-npm" | ||
| ```bash | ||
| export HL_PRIVATE_KEY=<your-private-key> | ||
| export HL_WALLET_ADDRESS=<your-wallet-address> | ||
| export HYPERLIQUID_WALLET_PRIVATE_KEY=<your-private-key> | ||
| export HYPERLIQUID_WALLET_ADDRESS=<your-wallet-address> | ||
| ``` | ||
@@ -359,5 +359,5 @@ | ||
| |----------|-------------| | ||
| | `HL_PRIVATE_KEY` | Private key (overrides config) | | ||
| | `HL_WALLET_ADDRESS` | Wallet address (overrides config) | | ||
| | `HL_SUB_ACCOUNT_ADDRESS` | Sub-account address | | ||
| | `HYPERLIQUID_WALLET_PRIVATE_KEY` | Private key (overrides config) | | ||
| | `HYPERLIQUID_WALLET_ADDRESS` | Wallet address (overrides config) | | ||
| | `HYPERLIQUID_ENV` | `mainnet` or `testnet` (overrides config, default: `mainnet`) | | ||
@@ -398,4 +398,17 @@ ## Tips | ||
| Credentials are shared with the CLI — set up once with `hyperliquid-cli config init`. | ||
| Credentials are shared with the CLI — set up once with `hyperliquid-cli config init`, or pass via environment variables in your MCP config: | ||
| ```json | ||
| { | ||
| "mcpServers": { | ||
| "hyperliquid": { | ||
| "command": "hyperliquid-mcp", | ||
| "env": { | ||
| "HYPERLIQUID_WALLET_PRIVATE_KEY": "0x..." | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
| ## Resources | ||
@@ -402,0 +415,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances
365712
0.39%3287
0.12%384
4.63%11
22.22%