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 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
.
Overview
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
.
The CLI also supports an
interactive REPL — running
with no arguments opens a prompt.
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 CLI commands directly
Capability Boundaries
| Supported | Route elsewhere |
|---|
| Authentication & session management | Token swap → skill |
| Balance, address & token list queries | Market data / token info / K-line → skill |
| Transaction history | DApp interactions → skill (MCP-based) |
| Token transfers (EVM + Solana) | x402 payments → skill (MCP-based) |
| Sign 32-byte hex messages / raw tx | MCP tool calls → skill (MCP-based) |
Prerequisites: A
binary on PATH.
- GateClaw managed scenario — runs automatically on install and drops a pre-built Linux binary into
/home/node/.openclaw/skills/bin/gate-dex
. Environment variables (, ) are collected via the GateClaw Web form and injected into at runtime.
- Personal OpenClaw scenario — the frontmatter 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)
Installation
The published binary is a single self-contained executable (no Node.js runtime required).
bash
# GateClaw / OpenClaw: auto-installed via setup.sh or 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
# Login
gate-dex login # Gate OAuth (default)
gate-dex login --google # Google OAuth
Storage:
Environment variables (all optional; defaults target production):
| Variable | Purpose |
|---|
| / / — selects GV API environment and CDN candidates |
| endpoint (used by ) |
| endpoint |
| gateio_service_web3_trade_token
endpoint (market/token/swap) |
| endpoint (token info, security audit, ranking) |
| OAuth session management endpoint |
Global Options
| Option | Description |
|---|
| Custom auth storage directory (overrides ; also via env) |
| Custom auth.json file path (overrides ; also via env) |
| Print version |
Sub-Modules
| Sub-module | File | Scope |
|---|
| Auth | | OAuth login/logout, session status, web3-domain |
| Asset Query | references/asset-query.md
| balance, address, tokens, tx-history, tx-detail |
| Transfer & Sign | | transfer (preview), send (one-shot), sign-msg, sign-tx, sol-tx, gas |
Routing Rules
| User Intent | Target |
|---|
| Login, logout, re-login, session expired, OAuth, "not logged in", switch account, web3-domain | |
| 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 | |
| Swap, exchange tokens, "swap ETH for USDT", "buy SOL", quote, "convert tokens" | → skill |
| K-line, token price, market cap, liquidity, trading stats, token security, token rankings, new tokens | → skill |
Execution
- Detect intent using the Routing Rules table; resolve to exactly one sub-module file or a peer-skill route.
- Read the matched sub-module (,
references/asset-query.md
, or ) and follow its workflow as the authoritative execution contract.
- Apply the safety rules in this SKILL.md (Security Rules section) before any write command (, , ).
- For write paths (): require explicit user confirmation in chat before invoking the CLI; preview via first.
- For peer-skill routes (, ): hand off without invoking those skills' commands from here.
Full Command Reference
Auth & Session
| Command | Description |
|---|
| Gate OAuth Device Flow login |
| Google OAuth Device Flow login |
| Print auth URL instead of opening browser |
| Logout and clear |
| Show current session info |
| View / refresh dynamic web3_domain list |
| Force re-fetch domain list |
Wallet Queries
| Command | Description |
|---|
| Total portfolio value (USD) across all chains |
| Show EVM + Solana wallet addresses |
| Token list with balances (gateway) |
| Filter by chain |
| Pagination |
Transfer & Signing
| Command | Description |
|---|
| Preview-only unsigned tx (no broadcast) |
| One-shot: preview → GV checkin → sign → broadcast |
| Build → GV checkin → sign → broadcast (or broadcast pre-signed with ) |
| Build Solana unsigned tx locally (latest blockhash) |
| Query gas price + gas limit |
| Sign 32-byte hex message (GV checkin built-in) |
| Sign raw hex transaction (GV checkin built-in) |
Swap (out of scope — route to skill)
The
,
,
,
,
, and
commands are documented in the
skill. Do not invoke them from this skill.
Transaction History
| Command | Description |
|---|
| Transfer transaction history |
| Transaction detail by hash |
Market & Token Data (out of scope — route to skill)
The
,
,
,
,
,
, and
commands are documented in the
skill. Do not invoke them from this skill.
Chain / RPC
| Command | Description |
|---|
| Chain config (networkKey, endpoint, chainID) |
| Raw JSON-RPC call |
Maintenance
Key Design Differences from MCP-based Skills
| Aspect | This skill (gate-dex-wallet-cli) | MCP-based skill (gate-dex-wallet) |
|---|
| Transport | Pure REST (no MCP) | MCP tool calls |
| GV security checkin | Built into CLI /// | External binary required |
| Auth storage | | MCP session |
| Swap method | one-shot | multi-step tools |
| Transfer method | one-shot | dex_wallet_sign_transaction
+ broadcast |
| Agent binary dependency | None | |
CRITICAL: When using this CLI skill, the agent
MUST NOT run
binary separately. The CLI handles GV checkin internally. Just run the CLI command after user confirmation.
Agent Usage Notes
- Agent runs in a non-interactive shell (no stdin). Commands that ask for confirmation will hang. For and , always confirm with the user in chat before running the command.
- The and 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).
On-Chain Operation Flow
Transfer operations follow: preview → user confirm in chat → execute one-shot command.
- Pre-check: → for sufficient funds
- Preview: (preview-only, no signing)
- User confirmation in chat: Display details, wait for explicit approval
- Execute: (GV checkin, sign, broadcast handled internally)
- Verify:
gate-dex tx-detail <hash>
NEVER run without explicit user confirmation.
Follow-up Routing
After completing an operation, proactively suggest 2-4 relevant next actions:
| User Intent After Operation | Target |
|---|
| Check balance / tokens | references/asset-query.md
|
| Transfer tokens | |
| Swap tokens | skill |
| Token prices, K-line, token security | skill |
| Login / session issues | |
NOT This Skill (Common Misroutes)
| User Intent | Correct Skill |
|---|
| DApp connect / sign / approve / contract call | skill (MCP-based) |
| x402 payment | skill (MCP-based) |
| On-chain withdraw to Gate Exchange (UID binding) | skill (MCP-based) |
| MCP tool calls directly | skill (MCP-based) |
Supported Chains
EVM:
,
,
,
(arb),
(op),
,
Non-EVM:
Chain names are case-insensitive.
Security Rules
- Confirm before fund operations: 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 may be executed — only read-only queries (, , , , , preview) are allowed.
- Preview before execute: Use (preview-only) before .
- No external checkin binary: Do not run binary — it is not needed; CLI handles it internally.
- Token confidentiality: stores credentials. Never display the raw token to users. Never commit this file to Git.
- Transaction irreversibility: On-chain transfers are generally irreversible. Re-verify recipient address, chain, and token contract with the user before executing .
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.