Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@ catch up if you are on an older skill version — apply the entries above yours
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and the skills follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [7.10.0] — targets CLI v7.3.0

### Added

- `mm perps vault list`, `mm perps vault info`, `mm perps vault deposit`, and `mm perps vault withdraw` in `references/perps.md` for Hyperliquid vaults. The docs cover the 1 USDC minimum, the deposit lock period and `lockedUntilTimestamp`, and that `--dry-run` only validates flags.
- `mm perps account mode get` and `mm perps account mode set` in `references/perps.md` for switching between standard and unified Hyperliquid accounts. `set` has no `--dry-run` and changes the whole Hyperliquid account.
- `--vault <address>` on `mm perps open`, `close`, `modify`, `cancel`, `positions`, `orders`, and `balance` to trade or read on behalf of a vault. Deposits, withdrawals, and spot to perp transfers are not available with `--vault`.
- `--tif` with `gtc`, `ioc`, or `alo` on `mm perps open` and `mm perps quote`. `gtc` and `alo` need a limit order.
- `--reduce-only` on `mm perps open`, with matching guidance in `workflows/perps-open-position.md`.
- `INVALID_TIF`, `REDUCE_ONLY_REJECTED`, and `ALREADY_SET_ACCOUNT_MODE` in `references/errors.md`, and troubleshooting rows for those plus vault lock and vault deposit balance failures.
- SKILL.md routing rows for the vault and account mode commands, input validation rules for `--vault`, `--tif`, and `--mode`, and confirmation rules for vault deposits and withdrawals and account mode changes. The `description` now also triggers on Hyperliquid vaults.

### Changed

- The SKILL.md perps trading confirmation rule now also covers `--tif`, `--reduce-only`, and `--vault`.
- `UNSUPPORTED_ROUTE` in `references/errors.md` also covers locked vault equity and `--vault` combined with deposits, withdrawals, or transfers.
- Bumped `cliVersion` to `7.3.0`.

## [7.9.0] — targets CLI v7.2.0

### Added
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MetaMask Agent CLI Skills

SKILLs for the MetaMask Agent CLI (`@metamask/agent-wallet` v7.2.0). These skills enable AI agents to authenticate, manage wallets, swap tokens, bridge across chains, trade perpetual futures, earn yield on DeFi vaults, and more using the MetaMask Agent Wallet CLI (`mm`).
SKILLs for the MetaMask Agent CLI (`@metamask/agent-wallet` v7.3.0). These skills enable AI agents to authenticate, manage wallets, swap tokens, bridge across chains, trade perpetual futures, earn yield on DeFi vaults, and more using the MetaMask Agent Wallet CLI (`mm`).

This repository is also packaged as a **plugin** for Claude Code, Cursor, Codex, Antigravity CLI (`agy`), and Grok Build. The plugin ships the same skills plus a session-start hook that checks CLI readiness via `mm doctor` and records local install attribution.

Expand Down Expand Up @@ -117,7 +117,7 @@ The plugin does not bundle `mm`. After the agent asks and the user consents:
```bash
npm install -g @metamask/agent-wallet@latest
# or pin to the skill's cliVersion, e.g.:
npm install -g @metamask/agent-wallet@7.2.0
npm install -g @metamask/agent-wallet@7.3.0
```

Requires a supported Node.js version. Then complete onboarding with `mm login` and `mm init` (see the skill workflows).
Expand Down
24 changes: 17 additions & 7 deletions skills/metamask-agent-wallet/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: metamask-agent-wallet
description: Use when the user asks anything about blockchain wallets, transactions, signing, token transfers, supported chains, wallet balances, perpetual futures trading and funding rates, prediction markets, token swaps, cross-chain bridges, market data, token discovery, tokenized real-world assets, RWAs, AI-generated market and asset summaries via pulse, decoding EVM calldata, DeFi earn/yield vaults, installing or removing third-party `mm` CLI plugins, or authentication via the MetaMask Agentic CLI; also when an HTTP request returns 402 Payment Required / x402, when an MCP tool call returns an x402 payment-required result, or the agent needs to pay for a paywalled API, endpoint, file, tool, or resource. Single entry point for all mm CLI operations. Financial operations are protected by server-enforced access controls including MFA approval, configurable wallet policies, and trading-mode guards (guard/beast) that restrict operation scope independently of the agent.
description: Use when the user asks anything about blockchain wallets, transactions, signing, token transfers, supported chains, wallet balances, perpetual futures trading, funding rates, and Hyperliquid vaults, prediction markets, token swaps, cross-chain bridges, market data, token discovery, tokenized real-world assets, RWAs, AI-generated market and asset summaries via pulse, decoding EVM calldata, DeFi earn/yield vaults, installing or removing third-party `mm` CLI plugins, or authentication via the MetaMask Agentic CLI; also when an HTTP request returns 402 Payment Required / x402, when an MCP tool call returns an x402 payment-required result, or the agent needs to pay for a paywalled API, endpoint, file, tool, or resource. Single entry point for all mm CLI operations. Financial operations are protected by server-enforced access controls including MFA approval, configurable wallet policies, and trading-mode guards (guard/beast) that restrict operation scope independently of the agent.
license: MIT
metadata:
author: metamask
version: "7.9.0"
cliVersion: "7.2.0"
version: "7.10.0"
cliVersion: "7.3.0"
---

# MetaMask Agentic CLI Skill
Expand Down Expand Up @@ -85,6 +85,12 @@ Match the user's intent to a command and reference file, then read the reference
| Transfer USDC between spot and perp accounts | `mm perps transfer` | [perps.md](references/perps.md) |
| List perpetual futures venues | `mm perps list-venues` | [perps.md](references/perps.md) |
| List available DEXs for a venue | `mm perps dexs` | [perps.md](references/perps.md) |
| List vault equities for the wallet | `mm perps vault list` | [perps.md](references/perps.md) |
| Show Hyperliquid vault details | `mm perps vault info` | [perps.md](references/perps.md) |
| Deposit USDC into a Hyperliquid vault | `mm perps vault deposit` | [perps.md](references/perps.md) |
| Withdraw USDC from a Hyperliquid vault | `mm perps vault withdraw` | [perps.md](references/perps.md) |
| Show Hyperliquid account mode | `mm perps account mode get` | [perps.md](references/perps.md) |
| Switch Hyperliquid account mode | `mm perps account mode set` | [perps.md](references/perps.md) |
| Set Predict trading mode | `mm predict mode` | [predict.md](references/predict.md) |
| One-time Predict setup | `mm predict setup` | [predict.md](references/predict.md) |
| Create or refresh Predict credentials | `mm predict auth` | [predict.md](references/predict.md) |
Expand Down Expand Up @@ -177,13 +183,13 @@ Run these checks before the first CLI operation in a session, in order.
### 1. Version compatibility


This skill is written for `@metamask/agent-wallet` v7.2.0, as specified by `cliVersion` in the frontmatter. The CLI requires Node.js 22.18 or later; on an older runtime every command exits 1 with `UNSUPPORTED_NODE` before the CLI loads. Check the installed version:
This skill is written for `@metamask/agent-wallet` v7.3.0, as specified by `cliVersion` in the frontmatter. The CLI requires Node.js 22.18 or later; on an older runtime every command exits 1 with `UNSUPPORTED_NODE` before the CLI loads. Check the installed version:

```bash
mm --version
```

The installed version is the value after `@metamask/agent-wallet/`, such as `@metamask/agent-wallet/7.2.0 darwin-arm64 node-v22.18.0`. Compare its `major.minor` against the pinned `cliVersion`. Optionally check the latest published version (best-effort, skip silently on network failure):
The installed version is the value after `@metamask/agent-wallet/`, such as `@metamask/agent-wallet/7.3.0 darwin-arm64 node-v22.18.0`. Compare its `major.minor` against the pinned `cliVersion`. Optionally check the latest published version (best-effort, skip silently on network failure):

```bash
npm view @metamask/agent-wallet version
Expand Down Expand Up @@ -222,7 +228,7 @@ Before constructing any command, validate all user-provided values:

| Flag | Validation rule |
| --- | --- |
| `--to`, `--address` | Must match `^0x[0-9a-fA-F]{40}$` |
| `--to`, `--address`, `--vault` | Must match `^0x[0-9a-fA-F]{40}$` |
| `--amount` | Human-readable decimal such as 0.5 or 100. Must match `^\d+\.?\d*$`. Reject spaces, semicolons, pipes, backticks, or shell metacharacters |
| `--chain-id` | Must be a positive integer (`^\d+$`) |
| `--payload` for send-transaction | Must be valid JSON. No unescaped shell metacharacters outside the JSON structure |
Expand All @@ -232,6 +238,8 @@ Before constructing any command, validate all user-provided values:
| `--size` | Human-readable positive decimal such as 0.01 or 1. Scientific notation and host-locale grouping/decimals are accepted and canonicalized by the CLI. Reject shell metacharacters. Malformed values return `INVALID_AMOUNT` |
| `--venue` | Must be `hyperliquid` |
| `--side` for perps | Must be `long` or `short` |
| `--tif` | Must be `gtc`, `ioc`, or `alo` |
| `--mode` for perps account | Must be `standard` or `unified` |
| `--order-id` | Must be a positive integer (`^\d+$`) |
| `--token-id` | Must be a non-empty outcome token ID string |
| `--price`, `--limit-price` | Must be a positive number in range `(0, 1]` |
Expand Down Expand Up @@ -264,8 +272,10 @@ Do not pass unvalidated user input into any command.
| Typed-data signing | Always show domain, primary type, chain, verifying contract, and message summary before signing |
| Swaps / bridges | Always confirm from/to tokens, amount, source/destination chain, slippage, quoted output, recipient address if `--to-address` is set, and the destination gas top-up if `--refuel` is set before executing |
| x402 payments | Always confirm asset, decimals-correct amount, network, `payTo`, and resource URL or MCP tool before signing the authorization — over HTTP with `pay --confirm`, over MCP with `mcp-sign --confirm`. One payment attempt per resource, never auto-retry a payment. Autonomous auto-pay is not supported. |
| Perps trading | Always confirm symbol, side, size, leverage, venue, order type, and limit price if present before executing |
| Perps trading | Always confirm symbol, side, size, leverage, venue, order type, and limit price if present before executing. Also confirm time in force if `--tif` is set, that the order is reduce-only if `--reduce-only` is set, and the vault address if `--vault` is set |
| Perps deposit/withdraw | Always confirm amount, asset, venue, network, and destination where applicable before executing |
| Perps vault deposit/withdraw | Always confirm vault address and name from `mm perps vault info`, amount, venue, and network before executing. For deposits, say that the equity is locked for a period before it can be withdrawn |
| Perps account mode set | Always show the current mode from `mm perps account mode get` and the target mode, and say that the change applies to the whole Hyperliquid account, before executing |
| Predict trading | Always confirm token ID, side, size, price, order type, market, and outcome before executing |
| Predict deposit | Always confirm amount before executing |
| Predict withdraw | Always confirm amount and recipient before executing. `--to` defaults to owner EOA |
Expand Down
5 changes: 4 additions & 1 deletion skills/metamask-agent-wallet/references/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ This reference lists error codes the CLI actually emits. SDK-only or remapped co
| `INVALID_MNEMONIC` | BYOK mnemonic is invalid |
| `INVALID_VENUE` | Invalid perpetual venue value |
| `INVALID_NETWORK` | Invalid network value. Must be `mainnet` or `testnet` |
| `INVALID_TIF` | Invalid `--tif` on `mm perps open` or `mm perps quote`. Must be `gtc`, `ioc`, or `alo`, and `gtc` or `alo` need `--type limit` with `--limit-px` |
| `INVALID_WINDOW` | Invalid `--window` on `mm perps funding-rates`. Must be `1h`, `8h`, or `1d` |
| `INVALID_ASSET` | Invalid asset value |
| `INVALID_SIDE` | Invalid side value. Must be `long`/`short` or `buy`/`sell` |
Expand Down Expand Up @@ -176,7 +177,7 @@ This reference lists error codes the CLI actually emits. SDK-only or remapped co
| --- | --- |
| `UNSUPPORTED_VENUE` | Unsupported perpetual venue |
| `UNSUPPORTED_NETWORK` | Unsupported network for perps |
| `UNSUPPORTED_ROUTE` | Unsupported deposit or withdraw route |
| `UNSUPPORTED_ROUTE` | Unsupported deposit or withdraw route. Also returned when vault equity is still locked on `mm perps vault withdraw`, and when `--vault` is combined with a deposit, withdrawal, or spot to perp transfer |
| `UNSUPPORTED_ASSET` | Unsupported asset |
| `UNSUPPORTED_SOURCE_CHAIN` | Unsupported source chain for perps deposit |
| `INVALID_SYMBOL` | Unknown perpetual market symbol |
Expand All @@ -190,6 +191,8 @@ This reference lists error codes the CLI actually emits. SDK-only or remapped co
| `POSITION_NOT_FOUND` | Position not found |
| `QUOTE_FAILED` | Quote generation failed |
| `ORDER_REJECTED` | Order rejected |
| `REDUCE_ONLY_REJECTED` | A `--reduce-only` order on `mm perps open` would increase or flip the position. Check `mm perps positions`, or drop `--reduce-only` if the user wants to add to the position |
| `ALREADY_SET_ACCOUNT_MODE` | `mm perps account mode set` target matches the current mode. Nothing changed |
| `CANCEL_FAILED` | Order cancellation failed |
| `SIGNING_FAILED` | Signing operation failed |
| `WITHDRAW_FAILED` | Withdrawal failed |
Expand Down
Loading
Loading