gate-dex-wallet-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Gate DEX CLI

Gate DEX CLI

General Rules

通用规则

⚠️ STOP — You MUST read and strictly follow the shared runtime rules before proceeding. Do NOT select or call any tool until all rules are read. These rules have the highest priority. → Read gate-runtime-rules.md
  • Only call MCP tools explicitly listed in this skill. Tools not documented here must NOT be called, even if they exist in the MCP server.
  • Only use the
    gate-dex
    CLI subcommands explicitly listed in this skill and its references.
    Commands not documented here must NOT be run for these workflows, even if other interfaces expose them.
Pure Routing Layer — This SKILL.md is a lightweight router. Sub-module details live in
references/
.
⚠️ 停止 — 你必须先阅读并严格遵守共享运行时规则才能继续。在未读完所有规则前,请勿选择或调用任何工具。这些规则具有最高优先级。 → 阅读gate-runtime-rules.md
  • 仅调用本Skill中明确列出的MCP工具。即使MCP服务器中存在未在此处记录的工具,也不得调用。
  • 仅使用本Skill及其参考文档中明确列出的
    gate-dex
    CLI子命令
    。即使其他接口提供了未在此处记录的命令,也不得在这些工作流中运行。
纯路由层 — 本SKILL.md是一个轻量级路由文件,子模块的详细信息存储在
references/
目录下。

Overview

概述

gate-dex
is a standalone CLI tool that communicates with Gate DEX services via REST APIs. No MCP server is required. All signing operations (transfer, sign-msg, swap) include built-in GV security checkin — the agent does not need to run any external binary.
Auth: login via Gate/Google OAuth, token stored in
~/.gate-dex/auth.json
.
The CLI also supports an interactive REPL — running
gate-dex
with no arguments opens a prompt.
gate-dex
是一款独立的CLI工具,通过REST API与Gate DEX服务通信。无需MCP服务器。所有签名操作(转账、sign-msg、兑换)都内置了GV安全签到功能——Agent无需运行任何外部二进制文件。
认证:通过Gate/Google OAuth登录,令牌存储在
~/.gate-dex/auth.json
中。
该CLI还支持交互式REPL——不带参数运行
gate-dex
会打开一个命令提示符。

Applicable Scenarios

适用场景

Use this skill when the user wants to:
  • Authenticate (login/logout) via Gate OAuth or Google OAuth
  • Query token balances, total portfolio value, or wallet addresses
  • View transaction history
  • Transfer or send tokens to an on-chain address (EVM + Solana)
  • Sign raw messages or raw transactions
  • Use
    gate-dex
    CLI commands directly

当用户需要以下操作时,可使用本Skill:
  • 通过Gate OAuth或Google OAuth进行身份验证(登录/登出)
  • 查询代币余额、总持仓价值或钱包地址
  • 查看交易历史
  • 向链上地址转账或发送代币(支持EVM + Solana链)
  • 签名原始消息或原始交易
  • 直接使用
    gate-dex
    CLI命令

Capability Boundaries

能力边界

SupportedRoute elsewhere
Authentication & session managementToken swap →
gate-dex-trade-cli
skill
Balance, address & token list queriesMarket data / token info / K-line →
gate-dex-market-cli
skill
Transaction historyDApp interactions →
gate-dex-wallet
skill (MCP-based)
Token transfers (EVM + Solana)x402 payments →
gate-dex-wallet
skill (MCP-based)
Sign 32-byte hex messages / raw txMCP tool calls →
gate-dex-wallet
skill (MCP-based)
Prerequisites: A
gate-dex
binary on PATH.
  • GateClaw managed scenario
    skill/setup.sh
    runs automatically on install and drops a pre-built Linux binary into
    /home/node/.openclaw/skills/bin/gate-dex
    . Environment variables (
    RUN_ENV
    ,
    *_URL
    ) are collected via the GateClaw Web form and injected into
    process.env
    at runtime.
  • Personal OpenClaw scenario — the frontmatter
    install
    spec downloads the binary for the host OS automatically (no Node.js required).
  • Local development — build from source:
    bash
    cd cli && pnpm install
    pnpm build:binary                  # production binary (no baked env)
    pnpm build:binary -- --bake-env    # bake root .env into the binary (test env)

支持功能路由至其他Skill
身份认证与会话管理代币兑换 →
gate-dex-trade-cli
Skill
余额、地址及代币列表查询市场数据/代币信息/K线 →
gate-dex-market-cli
Skill
交易历史DApp交互 →
gate-dex-wallet
Skill(基于MCP)
代币转账(EVM + Solana)x402支付 →
gate-dex-wallet
Skill(基于MCP)
签名32字节十六进制消息/原始交易MCP工具调用 →
gate-dex-wallet
Skill(基于MCP)
前置条件:PATH环境变量中需存在
gate-dex
二进制文件。
  • GateClaw托管场景 — 安装时会自动运行
    skill/setup.sh
    ,并将预构建的Linux二进制文件放入
    /home/node/.openclaw/skills/bin/gate-dex
    。环境变量(
    RUN_ENV
    *_URL
    )通过GateClaw网页表单收集,并在运行时注入到
    process.env
    中。
  • 个人OpenClaw场景 — 前端的
    install
    规范会自动为宿主操作系统下载二进制文件(无需Node.js)。
  • 本地开发 — 从源码构建:
    bash
    cd cli && pnpm install
    pnpm build:binary                  # 生产环境二进制文件(不包含环境变量)
    pnpm build:binary -- --bake-env    # 将根目录的.env文件嵌入二进制文件(测试环境)

Installation

安装

The published binary is a single self-contained executable (no Node.js runtime required).
bash
undefined
发布的二进制文件是一个独立的可执行文件(无需Node.js运行时)。
bash
undefined

GateClaw / OpenClaw: auto-installed via setup.sh or frontmatter.install

GateClaw / OpenClaw:通过setup.sh或frontmatter.install自动安装

Manual download (example):

手动下载(示例):

curl -fsSL https://gate-dex-cli.gateweb3.cc/latest/gate-dex-linux-x64
-o /usr/local/bin/gate-dex chmod +x /usr/local/bin/gate-dex
curl -fsSL https://gate-dex-cli.gateweb3.cc/latest/gate-dex-linux-x64
-o /usr/local/bin/gate-dex chmod +x /usr/local/bin/gate-dex

Login

登录

gate-dex login # Gate OAuth (default) gate-dex login --google # Google OAuth

**Storage**:
- Auth token → `~/.gate-dex/auth.json`

**Environment variables** (all optional; defaults target production):

| Variable | Purpose |
|----------|---------|
| `RUN_ENV` | `dev` / `pre` / `prod` — selects GV API environment and CDN candidates |
| `WALLET_SERVICE_URL` | `web3-wallet-service` endpoint (used by `balance`) |
| `BW_SERVICE_URL` | `web3-business-wallet` endpoint |
| `MARKET_TOKEN_URL` | `gateio_service_web3_trade_token` endpoint (market/token/swap) |
| `DATA_API_URL` | `web3-data-api` endpoint (token info, security audit, ranking) |
| `BIZ_WALLET_URL` | OAuth session management endpoint |

---
gate-dex login # 默认使用Gate OAuth登录 gate-dex login --google # 使用Google OAuth登录

**存储**:
- 认证令牌 → `~/.gate-dex/auth.json`

**环境变量**(均为可选;默认指向生产环境):

| 变量名 | 用途 |
|----------|---------|
| `RUN_ENV` | `dev` / `pre` / `prod` — 选择GV API环境和CDN候选地址 |
| `WALLET_SERVICE_URL` | `web3-wallet-service`端点(用于`balance`命令) |
| `BW_SERVICE_URL` | `web3-business-wallet`端点 |
| `MARKET_TOKEN_URL` | `gateio_service_web3_trade_token`端点(市场/代币/兑换) |
| `DATA_API_URL` | `web3-data-api`端点(代币信息、安全审计、排名) |
| `BIZ_WALLET_URL` | OAuth会话管理端点 |

---

Global Options

全局选项

OptionDescription
--auth-dir <path>
Custom auth storage directory (overrides
~/.gate-dex
; also via
GATE_DEX_HOME
env)
--auth-file <path>
Custom auth.json file path (overrides
--auth-dir
; also via
GATE_DEX_AUTH_FILE
env)
-v, --version
Print version

选项描述
--auth-dir <path>
自定义认证存储目录(覆盖
~/.gate-dex
;也可通过
GATE_DEX_HOME
环境变量设置)
--auth-file <path>
自定义auth.json文件路径(覆盖
--auth-dir
;也可通过
GATE_DEX_AUTH_FILE
环境变量设置)
-v, --version
打印版本信息

Sub-Modules

子模块

Sub-moduleFileScope
Auth
references/auth.md
OAuth login/logout, session status, web3-domain
Asset Query
references/asset-query.md
balance, address, tokens, tx-history, tx-detail
Transfer & Sign
references/transfer.md
transfer (preview), send (one-shot), sign-msg, sign-tx, sol-tx, gas
子模块文件范围
认证
references/auth.md
OAuth登录/登出、会话状态、web3-domain
资产查询
references/asset-query.md
余额、地址、代币、交易历史、交易详情
转账与签名
references/transfer.md
transfer(预览)、send(一键执行)、sign-msg、sign-tx、sol-tx、gas

Routing Rules

路由规则

User IntentTarget
Login, logout, re-login, session expired, OAuth, "not logged in", switch account, web3-domain
references/auth.md
Check balance, total assets, wallet address, account address, token list, tx history, "how much do I have", "show my tokens"
references/asset-query.md
Transfer, send tokens, "send ETH to 0x...", "transfer USDT", "pay someone", "move tokens", sign-msg, sign-tx, sol-tx
references/transfer.md
Swap, exchange tokens, "swap ETH for USDT", "buy SOL", quote, "convert tokens"
gate-dex-trade-cli
skill
K-line, token price, market cap, liquidity, trading stats, token security, token rankings, new tokens
gate-dex-market-cli
skill
用户意图目标
登录、登出、重新登录、会话过期、OAuth、"未登录"、切换账户、web3-domain
references/auth.md
查询余额、总资产、钱包地址、账户地址、代币列表、交易历史、"我有多少资产"、"显示我的代币"
references/asset-query.md
转账、发送代币、"发送ETH到0x..."、"转账USDT"、"付款给他人"、"转移代币"、sign-msg、sign-tx、sol-tx
references/transfer.md
兑换、交换代币、"把ETH换成USDT"、"购买SOL"、报价、"转换代币"
gate-dex-trade-cli
Skill
K线、代币价格、市值、流动性、交易统计、代币安全、代币排名、新代币
gate-dex-market-cli
Skill

Execution

执行流程

  1. Detect intent using the Routing Rules table; resolve to exactly one sub-module file or a peer-skill route.
  2. Read the matched sub-module (
    references/auth.md
    ,
    references/asset-query.md
    , or
    references/transfer.md
    ) and follow its workflow as the authoritative execution contract.
  3. Apply the safety rules in this SKILL.md (Security Rules section) before any write command (
    send
    ,
    sign-msg
    ,
    sign-tx
    ).
  4. For write paths (
    send
    ): require explicit user confirmation in chat before invoking the CLI; preview via
    transfer
    first.
  5. For peer-skill routes (
    gate-dex-trade-cli
    ,
    gate-dex-market-cli
    ): hand off without invoking those skills' commands from here.

  1. 检测意图:使用路由规则表,确定对应的子模块文件或其他Skill路由。
  2. 读取匹配的子模块
    references/auth.md
    references/asset-query.md
    references/transfer.md
    ),并遵循其工作流作为权威执行约定。
  3. 应用本SKILL.md中的安全规则(安全规则章节),再执行任何写入命令(
    send
    sign-msg
    sign-tx
    )。
  4. 对于写入路径
    send
    ):在调用CLI前需在聊天中获取用户的明确确认;先通过
    transfer
    进行预览。
  5. 对于其他Skill路由
    gate-dex-trade-cli
    gate-dex-market-cli
    ):直接转交,无需在此处调用这些Skill的命令。

Full Command Reference

完整命令参考

Auth & Session

认证与会话

CommandDescription
login
Gate OAuth Device Flow login
login --google
Google OAuth Device Flow login
login --no-open
Print auth URL instead of opening browser
logout
Logout and clear
~/.gate-dex/auth.json
status
Show current session info
web3-domain
View / refresh dynamic web3_domain list
web3-domain --refresh
Force re-fetch domain list
命令描述
login
Gate OAuth设备流登录
login --google
Google OAuth设备流登录
login --no-open
打印认证URL而非打开浏览器
logout
登出并清除
~/.gate-dex/auth.json
status
显示当前会话信息
web3-domain
查看/刷新动态web3_domain列表
web3-domain --refresh
强制重新获取域名列表

Wallet Queries

钱包查询

CommandDescription
balance
Total portfolio value (USD) across all chains
address
Show EVM + Solana wallet addresses
tokens
Token list with balances (gateway)
tokens --chain ETH,SOL
Filter by chain
tokens --page N --size N
Pagination
命令描述
balance
所有链上的总持仓价值(USD)
address
显示EVM + Solana钱包地址
tokens
带余额的代币列表(网关)
tokens --chain ETH,SOL
按链过滤
tokens --page N --size N
分页

Transfer & Signing

转账与签名

CommandDescription
transfer
Preview-only unsigned tx (no broadcast)
send
One-shot: preview → GV checkin → sign → broadcast
send-tx
Build → GV checkin → sign → broadcast (or broadcast pre-signed with
--hex
)
sol-tx
Build Solana unsigned tx locally (latest blockhash)
gas [chain]
Query gas price + gas limit
sign-msg <hex>
Sign 32-byte hex message (GV checkin built-in)
sign-tx <raw_tx>
Sign raw hex transaction (GV checkin built-in)
命令描述
transfer
仅预览未签名交易(不广播)
send
一键执行:预览 → GV签到 → 签名 → 广播
send-tx
构建 → GV签到 → 签名 → 广播(或使用
--hex
广播预签名交易)
sol-tx
本地构建Solana未签名交易(使用最新区块哈希)
gas [chain]
查询燃气价格 + 燃气限额
sign-msg <hex>
签名32字节十六进制消息(内置GV签到)
sign-tx <raw_tx>
签名原始十六进制交易(内置GV签到)

Swap (out of scope — route to
gate-dex-trade-cli
skill)

兑换(超出范围 — 路由至
gate-dex-trade-cli
Skill)

The
quote
,
swap
,
swap-tokens
,
bridge-tokens
,
swap-history
, and
swap-detail
commands are documented in the
gate-dex-trade-cli
skill. Do not invoke them from this skill.
quote
swap
swap-tokens
bridge-tokens
swap-history
swap-detail
命令在
gate-dex-trade-cli
Skill中有文档说明。请勿在此Skill中调用它们。

Transaction History

交易历史

CommandDescription
tx-history
Transfer transaction history
tx-detail <hash>
Transaction detail by hash
命令描述
tx-history
转账交易历史
tx-detail <hash>
通过哈希查询交易详情

Market & Token Data (out of scope — route to
gate-dex-market-cli
skill)

市场与代币数据(超出范围 — 路由至
gate-dex-market-cli
Skill)

The
tx-stats
,
kline
,
liquidity
,
token-info
,
token-risk
,
token-rank
, and
new-tokens
commands are documented in the
gate-dex-market-cli
skill. Do not invoke them from this skill.
tx-stats
kline
liquidity
token-info
token-risk
token-rank
new-tokens
命令在
gate-dex-market-cli
Skill中有文档说明。请勿在此Skill中调用它们。

Chain / RPC

链/RPC

CommandDescription
chain-config [chain]
Chain config (networkKey, endpoint, chainID)
rpc
Raw JSON-RPC call
命令描述
chain-config [chain]
链配置(networkKey、端点、chainID)
rpc
原始JSON-RPC调用

Maintenance

维护

CommandDescription
cleanup
Delete
~/.gate-dex

命令描述
cleanup
删除
~/.gate-dex
目录

Key Design Differences from MCP-based Skills

与基于MCP的Skill的核心设计差异

AspectThis skill (gate-dex-wallet-cli)MCP-based skill (gate-dex-wallet)
TransportPure REST (no MCP)MCP tool calls
GV security checkinBuilt into CLI
send
/
swap
/
sign-msg
/
sign-tx
External
tx-checkin
binary required
Auth storage
~/.gate-dex/auth.json
MCP session
mcp_token
Swap method
gate-dex swap
one-shot
dex_tx_swap_*
multi-step tools
Transfer method
gate-dex send
one-shot
dex_wallet_sign_transaction
+ broadcast
Agent binary dependencyNone
tools/tx-checkin/bin/
CRITICAL: When using this CLI skill, the agent MUST NOT run
tx-checkin
binary separately. The CLI handles GV checkin internally. Just run the CLI command after user confirmation.

方面本Skill(gate-dex-wallet-cli)基于MCP的Skill(gate-dex-wallet)
传输方式纯REST(无MCP)MCP工具调用
GV安全签到内置到CLI的
send
/
swap
/
sign-msg
/
sign-tx
命令中
需要外部
tx-checkin
二进制文件
认证存储
~/.gate-dex/auth.json
MCP会话
mcp_token
兑换方式
gate-dex swap
一键执行
dex_tx_swap_*
多步骤工具
转账方式
gate-dex send
一键执行
dex_wallet_sign_transaction
+ 广播
Agent二进制依赖
tools/tx-checkin/bin/
重要提示:使用本CLI Skill时,Agent绝对不能单独运行
tx-checkin
二进制文件。CLI会在内部处理GV签到。只需在用户确认后运行CLI命令即可。

Agent Usage Notes

Agent使用注意事项

  • Agent runs in a non-interactive shell (no stdin). Commands that ask for confirmation will hang. For
    send
    and
    swap
    , always confirm with the user in chat before running the command.
  • The
    send
    and
    swap
    commands are one-shot: they preview, checkin, sign, and broadcast in a single run.
  • All amounts use human-readable values, not smallest chain units (wei/lamports).

  • Agent运行在非交互式shell中(无标准输入)。需要确认的命令会挂起。对于
    send
    swap
    命令,必须在聊天中获得用户的明确确认之后再运行命令。
  • send
    swap
    命令是一键式的:它们会在单次运行中完成预览、签到、签名和广播。
  • 所有金额使用人类可读的值,而非链的最小单位(wei/lamports)。

On-Chain Operation Flow

链上操作流程

Transfer operations follow: preview → user confirm in chat → execute one-shot command.
  1. Pre-check:
    gate-dex address
    gate-dex tokens
    for sufficient funds
  2. Preview:
    gate-dex transfer
    (preview-only, no signing)
  3. User confirmation in chat: Display details, wait for explicit approval
  4. Execute:
    gate-dex send ...
    (GV checkin, sign, broadcast handled internally)
  5. Verify:
    gate-dex tx-detail <hash>
NEVER run
send
without explicit user confirmation.

转账操作遵循:预览 → 聊天中用户确认 → 执行一键命令
  1. 预检查
    gate-dex address
    gate-dex tokens
    确认资金充足
  2. 预览
    gate-dex transfer
    (仅预览,不签名)
  3. 聊天中用户确认:显示详情,等待明确批准
  4. 执行
    gate-dex send ...
    (GV签到、签名、广播由内部处理)
  5. 验证
    gate-dex tx-detail <hash>
绝对不要在未获得用户明确确认的情况下运行
send
命令

Follow-up Routing

后续路由

After completing an operation, proactively suggest 2-4 relevant next actions:
User Intent After OperationTarget
Check balance / tokens
references/asset-query.md
Transfer tokens
references/transfer.md
Swap tokens
gate-dex-trade-cli
skill
Token prices, K-line, token security
gate-dex-market-cli
skill
Login / session issues
references/auth.md

完成操作后,主动建议2-4个相关的下一步操作
操作后的用户意图目标
查询余额/代币
references/asset-query.md
转账代币
references/transfer.md
兑换代币
gate-dex-trade-cli
Skill
代币价格、K线、代币安全
gate-dex-market-cli
Skill
登录/会话问题
references/auth.md

NOT This Skill (Common Misroutes)

不属于本Skill的场景(常见错误路由)

User IntentCorrect Skill
DApp connect / sign / approve / contract call
gate-dex-wallet
skill (MCP-based)
x402 payment
gate-dex-wallet
skill (MCP-based)
On-chain withdraw to Gate Exchange (UID binding)
gate-dex-wallet
skill (MCP-based)
MCP tool calls directly
gate-dex-wallet
skill (MCP-based)

用户意图正确Skill
DApp连接/签名/授权/合约调用
gate-dex-wallet
Skill(基于MCP)
x402支付
gate-dex-wallet
Skill(基于MCP)
链上提取至Gate交易所(UID绑定)
gate-dex-wallet
Skill(基于MCP)
直接调用MCP工具
gate-dex-wallet
Skill(基于MCP)

Supported Chains

支持的链

EVM:
eth
,
bsc
,
polygon
,
arbitrum
(arb),
optimism
(op),
avax
,
base
Non-EVM:
sol
Chain names are case-insensitive.

EVM链:
eth
bsc
polygon
arbitrum
(arb)、
optimism
(op)、
avax
base
非EVM链:
sol
链名称不区分大小写。

Security Rules

安全规则

  1. Confirm before fund operations:
    send
    involves real funds. Always confirm target address, amount, token, and chain with the user in chat before running the command. Without explicit user confirmation in chat, no
    send
    may be executed — only read-only queries (
    balance
    ,
    address
    ,
    tokens
    ,
    tx-history
    ,
    tx-detail
    ,
    transfer
    preview) are allowed.
  2. Preview before execute: Use
    transfer
    (preview-only) before
    send
    .
  3. No external checkin binary: Do not run
    tx-checkin
    binary — it is not needed; CLI handles it internally.
  4. Token confidentiality:
    ~/.gate-dex/auth.json
    stores credentials. Never display the raw token to users. Never commit this file to Git.
  5. Transaction irreversibility: On-chain transfers are generally irreversible. Re-verify recipient address, chain, and token contract with the user before executing
    send
    .

  1. 资金操作前确认
    send
    涉及真实资金。运行命令前,务必在聊天中与用户确认目标地址、金额、代币和链。未获得聊天中用户的明确确认,不得执行任何
    send
    命令——仅允许只读查询(
    balance
    address
    tokens
    tx-history
    tx-detail
    transfer
    预览)。
  2. 执行前预览:在
    send
    前使用
    transfer
    (仅预览)。
  3. 无外部签到二进制文件:不要运行
    tx-checkin
    二进制文件——不需要;CLI会在内部处理。
  4. 令牌保密性
    ~/.gate-dex/auth.json
    存储凭证。切勿向用户显示原始令牌。切勿将此文件提交到Git。
  5. 交易不可逆性:链上转账通常不可逆。执行
    send
    前,需与用户重新验证接收地址、链和代币合约。

Risk Disclosure

风险提示

Digital asset transactions are generally irreversible. Please verify the recipient address before confirming. Outputs from this skill are for informational purposes only and do not constitute investment, financial, tax, or legal advice. AI-assisted outputs are for general information only and do not constitute any representation, warranty, or guarantee by Gate. This skill is intended for users aged 18 or above with full civil capacity; availability may vary by jurisdiction.
数字资产交易通常不可逆。请在确认前验证接收地址。本Skill的输出仅供参考,不构成投资、财务、税务或法律建议。AI辅助输出仅用于一般信息,不构成Gate的任何陈述、保证或担保。本Skill面向年满18周岁且具有完全民事行为能力的用户;可用性可能因司法管辖区而异。