From 0bafb79911e23f1eee03affcc227271b28e9ee8b Mon Sep 17 00:00:00 2001 From: AyushBherwani1998 Date: Mon, 15 Jun 2026 16:29:17 +0400 Subject: [PATCH 1/2] update skills for CLI v2 --- README.md | 2 +- skills/metamask-agent-wallet/SKILL.md | 19 ++-- .../metamask-agent-wallet/references/auth.md | 14 +-- .../references/doctor.md | 44 +++++++++ .../references/errors.md | 8 +- .../references/tx-history.md | 37 ++++++++ .../references/wallet.md | 89 ++++++++++++++++++- .../metamask-agent-wallet/workflows/bridge.md | 2 +- .../workflows/troubleshooting.md | 8 +- skills/metamask-agent-workflows/SKILL.md | 9 +- .../workflows/bridge.md | 2 +- .../workflows/troubleshooting.md | 8 +- 12 files changed, 216 insertions(+), 26 deletions(-) create mode 100644 skills/metamask-agent-wallet/references/doctor.md create mode 100644 skills/metamask-agent-wallet/references/tx-history.md diff --git a/README.md b/README.md index eac2b62..079cc9e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MetaMask Agent CLI Skills -SKILLs for the MetaMask Agent CLI (`@metamask/agentic-cli` v1.0.0). These skills enable AI agents to authenticate, manage wallets, swap tokens, bridge across chains, trade perpetual futures, and more using the MetaMask Agent CLI. +SKILLs for the MetaMask Agent CLI (`@metamask/agentic-cli` v2.0.0). These skills enable AI agents to authenticate, manage wallets, swap tokens, bridge across chains, trade perpetual futures, and more using the MetaMask Agent CLI. ## Skills diff --git a/skills/metamask-agent-wallet/SKILL.md b/skills/metamask-agent-wallet/SKILL.md index 2b39ad4..e764e84 100644 --- a/skills/metamask-agent-wallet/SKILL.md +++ b/skills/metamask-agent-wallet/SKILL.md @@ -4,8 +4,7 @@ description: Use when the user asks anything about blockchain wallets, transacti license: MIT metadata: author: metamask - version: "2.2.0" - cliVersion: "1.0.0" + version: "3.0.0" --- # MetaMask Agentic CLI Skill @@ -35,6 +34,7 @@ Match the user's intent to a command and reference file, then read the reference | Change BYOK mnemonic encryption password | `mm wallet password change` | [auth.md](references/auth.md) | | Remove BYOK mnemonic encryption password | `mm wallet password remove` | [auth.md](references/auth.md) | | Interpret raw CLI error codes | `AuthError`, `ValidationError`, `WALLET_ERROR` | [errors.md](references/errors.md) | +| Inspect CLI, skills, environment, and session health | `mm doctor` | [doctor.md](references/doctor.md) | | Decode EVM calldata into a human-readable intent | `mm decode` | [decode.md](references/decode.md) | | Create a wallet | `mm wallet create` | [wallet.md](references/wallet.md) | | List all wallets | `mm wallet list` | [wallet.md](references/wallet.md) | @@ -42,8 +42,12 @@ Match the user's intent to a command and reference file, then read the reference | Show active wallet details | `mm wallet show` | [wallet.md](references/wallet.md) | | Show active wallet address | `mm wallet address` | [wallet.md](references/wallet.md) | | Check the active wallet balance | `mm wallet balance` | [wallet.md](references/wallet.md) | -| Show current trading mode and policies | `mm wallet trading-mode get` | [wallet.md](references/wallet.md) | +| Show a QR code and address to fund the active wallet | `mm wallet add-fund` | [wallet.md](references/wallet.md) | +| Show current trading mode | `mm wallet trading-mode get` | [wallet.md](references/wallet.md) | | Set trading mode (guard or beast) | `mm wallet trading-mode set` | [wallet.md](references/wallet.md) | +| View wallet policy | `mm wallet policy get` | [wallet.md](references/wallet.md) | +| Set wallet policy | `mm wallet policy set` | [wallet.md](references/wallet.md) | +| Show project policy template | `mm wallet policy template` | [wallet.md](references/wallet.md) | | Sign a plaintext message | `mm wallet sign-message` | [signing.md](references/signing.md) | | Sign EIP-712 typed data | `mm wallet sign-typed-data` | [signing.md](references/signing.md) | | Send a raw EVM transaction | `mm wallet send-transaction` | [transaction.md](references/transaction.md) | @@ -95,6 +99,7 @@ Match the user's intent to a command and reference file, then read the reference | Withdraw pUSD from Predict deposit wallet | `mm predict withdraw` | [predict.md](references/predict.md) | | Fetch prediction order book | `mm predict book` | [predict.md](references/predict.md) | | Watch a Predict job | `mm predict watch` | [predict.md](references/predict.md) | +| List recent transactions for the active wallet | `mm tx history` | [tx-history.md](references/tx-history.md) | | Get a swap or bridge quote | `mm swap quote` | [swap.md](references/swap.md) | | Execute a token swap or bridge | `mm swap execute` | [swap.md](references/swap.md) | | Check swap or bridge status | `mm swap status` | [swap.md](references/swap.md) | @@ -135,7 +140,7 @@ Every `mm` command accepts these flags: | Flag | Short | Description | | --- | --- | --- | -| `--format` | `-f` | Output format: `text`, `json`, `yaml`, `toml`, or `toon` (defaults to `text` in TTY, `json` when piped) | +| `--format` | `-f` | Output format: `text`, `json`, or `toon` (defaults to `text` in TTY, `json` when piped) | | `--json` | | Shorthand for `--format=json` | | `--toon` | | Shorthand for `--format=toon` | | `--verbose` | `-v` | Show debug logs on stderr. Use for troubleshooting | @@ -148,13 +153,13 @@ Run these checks before the first CLI operation in a session, in order. ### 1. Version compatibility -This skill is written for `@metamask/agentic-cli` **v1.0.0** (see `cliVersion` in the frontmatter). Check the installed version: +This skill is written for `@metamask/agentic-cli` **v2.0.0** (see `cliVersion` in the frontmatter). Check the installed version: ```bash mm --version ``` -The installed version is the value after `@metamask/agentic-cli/` (e.g. `@metamask/agentic-cli/1.0.0 darwin-arm64 node-v24.14.1`). 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/agentic-cli/` (e.g. `@metamask/agentic-cli/2.0.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/agentic-cli version @@ -162,7 +167,7 @@ npm view @metamask/agentic-cli version If the installed `major.minor` differs from the pinned `cliVersion`, or the installed version is behind the latest release, warn the user once and continue: -> Version mismatch: installed CLI ``, this skill is pinned to `1.0.0`, latest release is ``. Command syntax in this skill may be inaccurate until they are aligned. Update the CLI with `npm install -g @metamask/agentic-cli@latest`, then re-install the skills with `npx skills add metaMask/agent-skills`. +> Version mismatch: installed CLI ``, this skill is pinned to `2.0.0`, latest release is ``. Command syntax in this skill may be inaccurate until they are aligned. Update the CLI with `npm install -g @metamask/agentic-cli@latest`, then re-install the skills with `npx skills add metaMask/agent-skills`. Run this check once per session. Do not block operations on it. diff --git a/skills/metamask-agent-wallet/references/auth.md b/skills/metamask-agent-wallet/references/auth.md index 1f70aef..de239e6 100644 --- a/skills/metamask-agent-wallet/references/auth.md +++ b/skills/metamask-agent-wallet/references/auth.md @@ -4,7 +4,7 @@ Use these commands to initialize wallet mode, sign in, inspect authentication st ## `init` Command -Initialize the project by selecting wallet mode and trading mode. Requires an authenticated session — run `mm login` first. +Initialize the project by selecting wallet mode and trading mode. Requires an authenticated session. Run `mm login` first. ### Syntax @@ -18,8 +18,8 @@ mm init [--wallet ] [--mode ] [--mnemonic ] [--password | --- | --- | | `env` | `prod`, `dev`, or `uat` | | `verbose` | `true` or `false` | -| `format` | `json`, `text`, `yaml`, `toml`, or `toon` | +| `format` | `json`, `text`, or `toon` | ### Overrides diff --git a/skills/metamask-agent-wallet/references/doctor.md b/skills/metamask-agent-wallet/references/doctor.md new file mode 100644 index 0000000..74975cd --- /dev/null +++ b/skills/metamask-agent-wallet/references/doctor.md @@ -0,0 +1,44 @@ +# Doctor command + +Use `mm doctor` to inspect CLI version, AI skills, environment, and session health. This command does not require authentication or initialization. + +## `doctor` command + +### Syntax + +```bash +mm doctor +``` + +### Supported flags + +This command does not support additional flags beyond output format options. + +### Output + +| Field | Type | Description | +| --- | --- | --- | +| `cli` | string | Installed CLI version | +| `env` | string | Current environment (`prod`, `dev`, or `uat`) | +| `authenticated` | boolean | Whether the CLI session is valid | +| `initialized` | boolean | Whether you have run `mm init` (wallet mode and trading mode are set for server wallets) | +| `recommendedSkills` | object | Installed MetaMask AI skill status for `metamask-agent-wallet` and `metamask-agent-workflows` | +| `compatible` | boolean or null | Whether the installed CLI version is compatible with the installed skills. `null` if no skills are detected | +| `hints` | string[] | Actionable guidance, for example missing skills, auth issues, init needed, or version mismatch | + +### Skill detection + +`mm doctor` detects installed skills from the global skills lock file (`~/.agents/.skill-lock.json` or `$XDG_STATE_HOME/skills/.skill-lock.json`). It parses `SKILL.md` frontmatter for the skill `version` and `cliVersion` metadata, then checks the CLI `major.minor` against the skill `cliVersion` requirement. + +### Example + +```bash +mm doctor +mm doctor --toon +``` + +### Notes + +- Use as the first step in troubleshooting to check if CLI, auth, init, and skills are healthy. +- Run after a CLI upgrade to verify skill compatibility. +- Use in CI or scripting to confirm environment and session state. diff --git a/skills/metamask-agent-wallet/references/errors.md b/skills/metamask-agent-wallet/references/errors.md index 5e6b890..16426a7 100644 --- a/skills/metamask-agent-wallet/references/errors.md +++ b/skills/metamask-agent-wallet/references/errors.md @@ -74,7 +74,7 @@ This reference lists error codes the CLI actually emits. SDK-only or remapped co | Code | Meaning | | --- | --- | | `ABORTED` | Operation aborted by user | -| `NOT_INITIALIZED` | Project not initialized — run `mm init` | +| `NOT_INITIALIZED` | Project not initialized. Run `mm init` | | `NO_MNEMONIC` | Mnemonic not stored | | `NO_TTY` | No TTY available for interactive prompts | | `MISSING_ID` | Missing ID parameter | @@ -150,6 +150,12 @@ This reference lists error codes the CLI actually emits. SDK-only or remapped co | `PREDICT_GEOBLOCKED` | Polymarket is not available in your region; Predict features cannot be used from this location. Emitted by `mm predict setup` (region guard) and surfaced by `mm predict geoblock` | | `UNSUPPORTED_PREDICT_CHAIN` | Predict chain not supported | +## Transaction History Errors + +| Code | Meaning | +| --- | --- | +| `NO_HISTORY_WALLETS` | No EVM wallets found in roster for transaction history | + ## Network & Filesystem Errors | Code | Meaning | diff --git a/skills/metamask-agent-wallet/references/tx-history.md b/skills/metamask-agent-wallet/references/tx-history.md new file mode 100644 index 0000000..a4f5d2d --- /dev/null +++ b/skills/metamask-agent-wallet/references/tx-history.md @@ -0,0 +1,37 @@ +# Transaction history command + +Use `mm tx history` to list recent transactions for the active wallet or specific addresses. + +## `tx history` command + +### Syntax + +```bash +mm tx history [--addresses ] [--chain ] [--type ] [--limit ] +``` + +### Supported flags + +| Name | Required | Description | +| --- | --- | --- | +| `--addresses` | No | Comma-separated EVM wallet addresses to include. Defaults to all EVM wallets for your account | +| `--chain` | No | Comma-separated chain filters (e.g. `1,137` or `eip155:1`). Run `mm chains list` to see options | +| `--type` | No | Filter by direction (`in`, `out`, `self`) or transaction category/type | +| `--limit` | No | Maximum number of transactions to return (1-500, default 50) | + +### Example + +```bash +mm tx history +mm tx history --limit 10 --toon +mm tx history --chain 1,8453 +mm tx history --type out +mm tx history --addresses 0x742d...f2bD18 --chain 137 --limit 100 +``` + +### Notes + +- If you omit `--addresses`, the command queries all EVM wallets for your account. +- Addresses must be 0x-prefixed EVM addresses. +- `--limit` must be between 1 and 500. Values outside this range return an `INVALID_LIMIT` error. +- If your account has no EVM wallets, the command returns a `NO_HISTORY_WALLETS` error. diff --git a/skills/metamask-agent-wallet/references/wallet.md b/skills/metamask-agent-wallet/references/wallet.md index e882c1e..56b39c7 100644 --- a/skills/metamask-agent-wallet/references/wallet.md +++ b/skills/metamask-agent-wallet/references/wallet.md @@ -127,9 +127,32 @@ mm wallet address mm wallet address --chain-namespace evm ``` +## `wallet add-fund` Command + +Show a QR code and address to fund the currently active wallet. In interactive mode (TTY or REPL), renders an ASCII QR code plus the address. In headless mode (`--json`, piped stdout), outputs the address only. + +### Syntax + +```bash +mm wallet add-fund [--chain-namespace ] +``` + +### Supported Flags + +| Name | Required | Description | +| --- | --- | --- | +| `--chain-namespace` | No | Wallet chain namespace: `evm` (EIP-155) (allowed: `evm`) | + +### Example + +```bash +mm wallet add-fund +mm wallet add-fund --toon +``` + ## `wallet trading-mode get` Command -Show the current trading mode, active server-wallet address, and policies for the selected wallet. Server-wallet mode only. +Show the current trading mode and active server-wallet address for the selected wallet. Server-wallet mode only. ### Syntax @@ -166,6 +189,70 @@ mm wallet trading-mode set guard mm wallet trading-mode set beast ``` +## `wallet policy get` Command + +Show the policy for the active server wallet. Server-wallet mode only. + +### Syntax + +```bash +mm wallet policy get +``` + +### Supported Flags + +This command does not support additional flags beyond output format options. + +### Example + +```bash +mm wallet policy get +mm wallet policy get --toon +``` + +## `wallet policy set` Command + +Set the policy for the active server wallet. Server-wallet mode only. + +### Syntax + +```bash +mm wallet policy set --policy +``` + +### Supported Flags + +| Name | Required | Description | +| --- | --- | --- | +| `--policy` | Yes | Policy string to apply | + +### Example + +```bash +mm wallet policy set --policy "maxDailyOutflow: 1000" +``` + +## `wallet policy template` Command + +Show the project policy template. Server-wallet mode only. + +### Syntax + +```bash +mm wallet policy template +``` + +### Supported Flags + +This command does not support additional flags beyond output format options. + +### Example + +```bash +mm wallet policy template +mm wallet policy template --toon +``` + ## `wallet balance` Command Show native and token balances for the active wallet. diff --git a/skills/metamask-agent-wallet/workflows/bridge.md b/skills/metamask-agent-wallet/workflows/bridge.md index a21133c..868d223 100644 --- a/skills/metamask-agent-wallet/workflows/bridge.md +++ b/skills/metamask-agent-wallet/workflows/bridge.md @@ -2,7 +2,7 @@ Use this workflow when the user wants to bridge tokens across chains. -Reference command syntax in `references/swap.md`. The CLI uses the same `swap` commands for bridging — set `--to-chain` to a different chain than `--from-chain`. +Reference command syntax in `references/swap.md`. The CLI uses the same `swap` commands for bridging. Set `--to-chain` to a different chain than `--from-chain`. ## Flow diff --git a/skills/metamask-agent-wallet/workflows/troubleshooting.md b/skills/metamask-agent-wallet/workflows/troubleshooting.md index b0f09b7..ebe5983 100644 --- a/skills/metamask-agent-wallet/workflows/troubleshooting.md +++ b/skills/metamask-agent-wallet/workflows/troubleshooting.md @@ -4,7 +4,13 @@ Use this workflow when a command fails, hangs, prompts unexpectedly, or behaves ## Universal Triage -Run or suggest these in order: +Run `mm doctor` first to inspect CLI version, skills, environment, and session health in one shot: + +```bash +mm doctor +``` + +If you need more detail, run these in order: ```bash mm --version diff --git a/skills/metamask-agent-workflows/SKILL.md b/skills/metamask-agent-workflows/SKILL.md index ab4962f..61766a3 100644 --- a/skills/metamask-agent-workflows/SKILL.md +++ b/skills/metamask-agent-workflows/SKILL.md @@ -4,8 +4,7 @@ description: Use when the user needs to perform multi-step operations with the M license: MIT metadata: author: metamask - version: "2.1.0" - cliVersion: "1.0.0" + version: "3.0.0" --- # MetaMask Agent Workflows @@ -47,13 +46,13 @@ Run these checks before the first CLI operation in a session, in order. ### 1. Version compatibility -This skill is written for `@metamask/agentic-cli` **v1.0.0** (see `cliVersion` in the frontmatter). Check the installed version: +This skill is written for `@metamask/agentic-cli` **v2.0.0** (see `cliVersion` in the frontmatter). Check the installed version: ```bash mm --version ``` -The installed version is the value after `@metamask/agentic-cli/` (e.g. `@metamask/agentic-cli/1.0.0 darwin-arm64 node-v24.14.1`). 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/agentic-cli/` (e.g. `@metamask/agentic-cli/2.0.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/agentic-cli version @@ -61,7 +60,7 @@ npm view @metamask/agentic-cli version If the installed `major.minor` differs from the pinned `cliVersion`, or the installed version is behind the latest release, warn the user once and continue: -> Version mismatch: installed CLI ``, this skill is pinned to `1.0.0`, latest release is ``. Command syntax in this skill may be inaccurate until they are aligned. Update the CLI with `npm install -g @metamask/agentic-cli@latest`, then re-install the skills with `npx skills add metaMask/agent-skills`. +> Version mismatch: installed CLI ``, this skill is pinned to `2.0.0`, latest release is ``. Command syntax in this skill may be inaccurate until they are aligned. Update the CLI with `npm install -g @metamask/agentic-cli@latest`, then re-install the skills with `npx skills add metaMask/agent-skills`. Run this check once per session. Do not block operations on it. diff --git a/skills/metamask-agent-workflows/workflows/bridge.md b/skills/metamask-agent-workflows/workflows/bridge.md index a21133c..868d223 100644 --- a/skills/metamask-agent-workflows/workflows/bridge.md +++ b/skills/metamask-agent-workflows/workflows/bridge.md @@ -2,7 +2,7 @@ Use this workflow when the user wants to bridge tokens across chains. -Reference command syntax in `references/swap.md`. The CLI uses the same `swap` commands for bridging — set `--to-chain` to a different chain than `--from-chain`. +Reference command syntax in `references/swap.md`. The CLI uses the same `swap` commands for bridging. Set `--to-chain` to a different chain than `--from-chain`. ## Flow diff --git a/skills/metamask-agent-workflows/workflows/troubleshooting.md b/skills/metamask-agent-workflows/workflows/troubleshooting.md index b0f09b7..ebe5983 100644 --- a/skills/metamask-agent-workflows/workflows/troubleshooting.md +++ b/skills/metamask-agent-workflows/workflows/troubleshooting.md @@ -4,7 +4,13 @@ Use this workflow when a command fails, hangs, prompts unexpectedly, or behaves ## Universal Triage -Run or suggest these in order: +Run `mm doctor` first to inspect CLI version, skills, environment, and session health in one shot: + +```bash +mm doctor +``` + +If you need more detail, run these in order: ```bash mm --version From b3ff2a976905ff4128adfd42f477990a9d884b79 Mon Sep 17 00:00:00 2001 From: AyushBherwani1998 Date: Mon, 15 Jun 2026 16:37:49 +0400 Subject: [PATCH 2/2] add CLI version --- skills/metamask-agent-wallet/SKILL.md | 1 + skills/metamask-agent-workflows/SKILL.md | 1 + 2 files changed, 2 insertions(+) diff --git a/skills/metamask-agent-wallet/SKILL.md b/skills/metamask-agent-wallet/SKILL.md index e764e84..80c1824 100644 --- a/skills/metamask-agent-wallet/SKILL.md +++ b/skills/metamask-agent-wallet/SKILL.md @@ -5,6 +5,7 @@ license: MIT metadata: author: metamask version: "3.0.0" + cliVersion: "2.0.0" --- # MetaMask Agentic CLI Skill diff --git a/skills/metamask-agent-workflows/SKILL.md b/skills/metamask-agent-workflows/SKILL.md index 61766a3..30ea02c 100644 --- a/skills/metamask-agent-workflows/SKILL.md +++ b/skills/metamask-agent-workflows/SKILL.md @@ -5,6 +5,7 @@ license: MIT metadata: author: metamask version: "3.0.0" + cliVersion: "2.0.0" --- # MetaMask Agent Workflows