返回顶部
b

byreal-perps-cliByreal永续合约CLI

Byreal Hyperliquid perpetual futures trading CLI: account setup, market/limit orders with TP/SL, position close-market/close-limit/close-all, leverage control, trade history, market signal scanner & technical analysis. Use when user mentions Hyperliquid, perps, perpetual futures, leverage trading, or market signals/technical analysis.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 0.2.2
安全检测
已通过
97
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

byreal-perps-cli

Hyperliquid 永续合约交易

安装

bash

检查是否已安装


which byreal-perps-cli && byreal-perps-cli --version

安装

npm install -g @byreal-io/byreal-perps-cli

凭证与权限

  • - 所有交易命令在执行任何交易操作前,都需要通过 byreal-perps-cli account init 进行账户初始化
  • 只读命令(账户信息、持仓列表、订单列表、账户历史):需要已初始化的永续合约账户
  • 写入命令(市价单、限价单、撤单、平仓-市价/限价/全部平仓、持仓杠杆):需要已初始化且带有有效代理钱包的永续合约账户
  • 信号命令(信号扫描、信号详情):无需账户——仅使用公开市场数据
  • 永续合约代理密钥存储在本地 byreal 数据目录中,具有严格的文件权限(模式 0600)
  • CLI 永远不会通过网络传输私钥——密钥仅用于本地交易签名
  • AI 代理绝不应要求用户在聊天中粘贴私钥;始终引导他们交互式运行 byreal-perps-cli account init

WebSocket / API 回退

某些命令(account info、position list、position close-market、position close-limit、position close-all)使用 WebSocket 订阅获取实时数据。如果 WebSocket 连接失败或超时,CLI 会自动回退到 HTTP API 调用。无需用户操作。

如果命令返回连接错误:

  1. 1. CLI 会自动通过 HTTP API 重试;如果仍然失败,问题可能是网络连接或 Hyperliquid API 停机。
  2. 检查网络连接:curl -s https://api.hyperliquid.xyz/info -X POST -H Content-Type: application/json -d {type:meta}
  3. 对于测试网,检查:curl -s https://api.hyperliquid-testnet.xyz/info -X POST -H Content-Type: application/json -d {type:meta}
  4. 如果 HTTP API 也失败,Hyperliquid 服务可能暂时不可用——稍等片刻后重试。

硬性约束

  1. 1. -o json 仅用于解析——向用户展示结果时,省略该参数,让 CLI 内置表格直接渲染。切勿自行获取 JSON 后再重新绘制表格。
  2. 绝不显示私钥——仅使用密钥对路径
  3. 绝不直接调用 SDK——不要编写 node -e / tsx -e 脚本来 import 或 require 诸如 @nktkas/hyperliquid 或 viem 之类的包。始终使用 byreal-perps-cli 命令与 Hyperliquid 交互。SDK 已集成在 CLI 内部;外部调用会导致 CJS/ESM 兼容性错误。

命令参考

账户管理

bash

初始化永续合约账户(交互式向导)


byreal-perps-cli account init

显示账户信息与余额

byreal-perps-cli account info

显示近期交易历史

byreal-perps-cli account history

订单

bash

市价单(方向:buy/sell/long/short,数量以币为单位)


byreal-perps-cli order market <方向> <数量> <币种>
byreal-perps-cli order market buy 0.01 BTC --tp 110000 --sl 90000

限价单

byreal-perps-cli order limit <方向> <数量> <币种> <价格> byreal-perps-cli order limit sell 1 ETH 4000

列出未成交订单

byreal-perps-cli order list

撤销订单

byreal-perps-cli order cancel <币种> <订单ID>

撤销所有订单

byreal-perps-cli order cancel-all -y

持仓

bash

列出未平仓持仓


byreal-perps-cli position list

设置杠杆(1-50倍)

byreal-perps-cli position leverage <币种> <杠杆倍数>

以市价平仓(全仓或部分)

byreal-perps-cli position close-market <币种>

以限价单平仓

byreal-perps-cli position close-limit <币种> <价格>

平掉所有持仓

byreal-perps-cli position close-all -y

市场信号

bash

扫描市场寻找交易信号


byreal-perps-cli signal scan

详细技术分析

byreal-perps-cli signal detail <币种>

更新

bash

检查是否有可用的 CLI 更新


byreal-perps-cli update check

安装最新版 CLI

byreal-perps-cli update install

测试网

所有命令均支持 --testnet:

bash
byreal-perps-cli --testnet account info

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 byreal-perps-cli-1776062821 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 byreal-perps-cli-1776062821 技能

通过命令行安装

skillhub install byreal-perps-cli-1776062821

下载

⬇ 下载 byreal-perps-cli v0.2.2(免费)

文件大小: 2.48 KB | 发布时间: 2026-4-14 13:24

v0.2.2 最新 2026-4-14 13:24
- Improved documentation and command reference in SKILL.md, detailing installation, credential management, command usage, and API/WebSocket fallback.
- Added clear guidance on permissions, data privacy, and security practices for running trading and signal commands.
- Explicitly listed hard constraints: only use the CLI interface, do not expose private keys, and avoid raw SDK calls.
- Provided updated examples for key commands: account management, order/position handling, market signals, updates, and testnet usage.
- Enhanced troubleshooting information for API connectivity issues.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部