Skip to content

Commit 9097efc

Browse files
committed
update for v1.0.0
1 parent 52db8eb commit 9097efc

11 files changed

Lines changed: 185 additions & 27 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MetaMask Agent CLI Skills
22

3-
SKILLs for the MetaMask Agent CLI. These skills enable AI agents to authenticate, manage wallets, swap tokens, bridge across chains, trade perpetual futures, and more using the MetaMask Agent CLI.
3+
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.
44

55
## Skills
66

skills/metamask-agent-wallet/SKILL.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ description: Use when the user asks anything about blockchain wallets, transacti
44
license: MIT
55
metadata:
66
author: metamask
7-
version: "2.1.0"
7+
version: "2.2.0"
8+
cliVersion: "1.0.0"
89
---
910

1011
# MetaMask Agentic CLI Skill
@@ -28,6 +29,8 @@ Match the user's intent to a command and reference file, then read the reference
2829
| Sign in via email OTP | `mm login email` | [auth.md](references/auth.md) |
2930
| Sign out | `mm logout` | [auth.md](references/auth.md) |
3031
| Reset CLI session | `mm reset` | [auth.md](references/auth.md) |
32+
| Show CLI configuration | `mm config get` | [auth.md](references/auth.md) |
33+
| Set CLI configuration | `mm config set` | [auth.md](references/auth.md) |
3134
| Set BYOK mnemonic encryption password | `mm wallet password set` | [auth.md](references/auth.md) |
3235
| Change BYOK mnemonic encryption password | `mm wallet password change` | [auth.md](references/auth.md) |
3336
| Remove BYOK mnemonic encryption password | `mm wallet password remove` | [auth.md](references/auth.md) |
@@ -127,7 +130,29 @@ Always use `--toon` for command output unless the user explicitly requests a dif
127130

128131
## Preflight
129132

130-
Always run preflight before any CLI operation.
133+
Run these checks before the first CLI operation in a session, in order.
134+
135+
### 1. Version compatibility
136+
137+
This skill is written for `@metamask/agentic-cli` **v1.0.0** (see `cliVersion` in the frontmatter). Check the installed version:
138+
139+
```bash
140+
mm --version
141+
```
142+
143+
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):
144+
145+
```bash
146+
npm view @metamask/agentic-cli version
147+
```
148+
149+
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:
150+
151+
> Version mismatch: installed CLI `<installed>`, this skill is pinned to `1.0.0`, latest release is `<latest>`. 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`.
152+
153+
Run this check once per session. Do not block operations on it.
154+
155+
### 2. Authentication
131156

132157
```bash
133158
mm auth status

skills/metamask-agent-wallet/references/auth.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ export MM_PASSWORD="mypassword"
3434
mm init --wallet byok
3535
```
3636

37+
### Note
38+
39+
- In server-wallet mode, if the account already has a remote EVM wallet, `mm init` syncs it and loads the existing trading mode and policies instead of prompting for a new trading mode or creating a wallet.
40+
3741
## `init show` Command
3842

3943
Display the current initialization settings (wallet mode, trading mode, policies).
@@ -130,9 +134,69 @@ This command does not support flags.
130134
mm logout
131135
```
132136

137+
## `config get` Command
138+
139+
Show persisted CLI configuration. Does not require authentication.
140+
141+
### Syntax
142+
143+
```bash
144+
mm config get [env|verbose|format]
145+
```
146+
147+
### Supported Keys
148+
149+
| Key | Description |
150+
| --- | --- |
151+
| `env` | Target API environment: `prod`, `dev`, or `uat` (defaults to `prod` when unset) |
152+
| `verbose` | Whether verbose logging is persisted (`true` or `false`) |
153+
| `format` | Default output format: `json`, `text`, `yaml`, `toml`, or `toon` |
154+
155+
Omit the key to return all values.
156+
157+
### Example
158+
159+
```bash
160+
mm config get
161+
mm config get env
162+
```
163+
164+
## `config set` Command
165+
166+
Persist a CLI configuration value in `~/.metamask/config.json`. Does not require authentication.
167+
168+
### Syntax
169+
170+
```bash
171+
mm config set <env|verbose|format> <value>
172+
```
173+
174+
### Supported Keys
175+
176+
| Key | Values |
177+
| --- | --- |
178+
| `env` | `prod`, `dev`, or `uat` |
179+
| `verbose` | `true` or `false` |
180+
| `format` | `json`, `text`, `yaml`, `toml`, or `toon` |
181+
182+
### Example
183+
184+
```bash
185+
mm config set env prod
186+
mm config set env dev
187+
mm config set env uat
188+
mm config set format toon
189+
```
190+
191+
### Note
192+
193+
- Set the target environment **before** signing in. To switch environments after login, run `mm logout` or `mm reset` first, then `mm config set env`.
194+
- `MM_ENV=prod|dev|uat` overrides the persisted environment for a single invocation (useful in CI).
195+
- Non-prod sessions are stored in env-scoped files under `~/.metamask/` (e.g. `session.dev.json`, `session.uat.json`); prod uses `session.json`.
196+
133197
## `reset` Command
134198

135-
Clear the local CLI session entirely.
199+
Clear the local CLI session entirely, including auth credentials, wallet state, mnemonic, swap quotes, and persisted config.
136200

137201
### Syntax
138202

skills/metamask-agent-wallet/references/errors.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ This reference lists error codes the CLI actually emits. SDK-only or remapped co
7878
| `MISSING_ID` | Missing ID parameter |
7979
| `MISSING_QUOTE_ID` | Missing quote ID |
8080
| `MISSING_SWAP_PARAMS` | Missing swap parameters |
81-
| `COMING_SOON` | Feature not yet available (e.g. `mm login qr`) |
81+
| `COMING_SOON` | Feature not yet available (e.g. `mm login qr` on production) |
82+
| `INVALID_CONFIG_KEY` | Unknown config key passed to `mm config get` or `mm config set` |
83+
| `INVALID_CONFIG_VALUE` | Invalid value for a config key (e.g. env not in `prod|dev|uat`) |
8284

8385
## Swap & Bridge Errors
8486

skills/metamask-agent-wallet/workflows/login.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ Reference command syntax in `references/auth.md`.
66

77
## Flow
88

9-
1. Ask the user which login method they want: MetaMask Mobile QR, Google, or Email.
10-
2. Execute login.
11-
3. Verify with token.
9+
1. Confirm the target environment with `mm config get env` (set with `mm config set env` before login if not `prod`).
10+
2. Ask the user which login method they want: MetaMask Mobile QR, Google, or Email.
11+
3. Execute login.
12+
4. Verify with token.
1213

1314
## Login
1415

skills/metamask-agent-wallet/workflows/onboarding.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,34 @@ Reference command syntax in `references/auth.md` and `references/wallet.md`.
77
## Flow
88

99
1. Check CLI installation.
10-
2. Login.
11-
3. Initialize wallet mode.
12-
4. Verify auth status.
13-
5. Show wallet address.
10+
2. Configure environment (if not using production).
11+
3. Login.
12+
4. Initialize wallet mode.
13+
5. Verify auth status.
14+
6. Show wallet address.
1415

1516
## Check CLI Installation
1617

1718
```bash
1819
mm --version
1920
```
2021

21-
If this fails, the CLI is not installed. Guide the user to install it before proceeding.
22+
If this fails, the CLI is not installed. Guide the user to install it with `npm install -g @metamask/agentic-cli@latest` before proceeding.
23+
24+
Then run the version compatibility check from the skill `Preflight` section: compare the installed `major.minor` against the pinned `cliVersion` and the latest published release, and warn the user if they are out of sync.
25+
26+
## Configure Environment
27+
28+
Production (`prod`) is the default. Set the target environment **before** login if the user needs dev or uat:
29+
30+
```bash
31+
mm config get env
32+
mm config set env dev
33+
```
34+
35+
For a one-off override without persisting, use `MM_ENV=dev mm login` (or `uat`).
36+
37+
To switch environments after a prior login, run `mm logout` or `mm reset` first, then `mm config set env`.
2238

2339
## Login Flow
2440

@@ -49,7 +65,11 @@ First check if the project is already initialized:
4965
mm init show
5066
```
5167

52-
If already initialized, skip this step. Otherwise, ask the user which wallet mode they want:
68+
If already initialized, skip this step.
69+
70+
For server-wallet mode, if the account already has a remote wallet, `mm init` syncs it and reuses the existing trading mode — no trading-mode prompt.
71+
72+
Otherwise, ask the user which wallet mode they want:
5373
- `server-wallet` (recommended) — keys are hosted by MetaMask infrastructure. No need to manage private keys or mnemonics.
5474
- `byok` — bring your own mnemonic. The user manages their own keys locally.
5575

skills/metamask-agent-wallet/workflows/troubleshooting.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Run or suggest these in order:
88

99
```bash
1010
mm --version
11+
mm config get env
1112
mm auth status
1213
mm <failing-command> --help
1314
```
@@ -20,7 +21,7 @@ If `auth status` reports anything other than authenticated, fix authentication b
2021
| --- | --- | --- |
2122
| `mm: command not found` | Binary not installed or not on `PATH` | Check install and PATH |
2223
| Async command returns a polling id and appears stuck | Request was dispatched without `--wait` | Use `mm wallet requests list` or `mm wallet requests watch --polling-id <id>` |
23-
| Auth errors after previously working | Expired token or wrong environment | Check `mm auth status` and environment/session file |
24+
| Auth errors after previously working | Expired token or wrong environment | Check `mm config get env`, `mm auth status`, and the env-scoped session file under `~/.metamask/` |
2425
| `CHAIN_ID_MISMATCH` on typed data | Payload `domain.chainId` differs from `--chain-id` | Align the two chain IDs |
2526
| `MNEMONIC_LOCKED` or `WRONG_PASSWORD` | BYOK mnemonic is encrypted and password was wrong or missing | Set the correct `MM_PASSWORD` environment variable and re-run |
2627
| `ALREADY_ENCRYPTED` on `wallet password set` | Mnemonic already has a password | Use `mm wallet password change` instead |

skills/metamask-agent-workflows/SKILL.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ description: Use when the user needs to perform multi-step operations with the M
44
license: MIT
55
metadata:
66
author: metamask
7-
version: "2.0.0"
7+
version: "2.1.0"
8+
cliVersion: "1.0.0"
89
---
910

1011
# MetaMask Agent Workflows
@@ -30,7 +31,29 @@ Always use `--toon` for command output unless the user explicitly requests a dif
3031

3132
## Preflight
3233

33-
Always run preflight before any CLI operation.
34+
Run these checks before the first CLI operation in a session, in order.
35+
36+
### 1. Version compatibility
37+
38+
This skill is written for `@metamask/agentic-cli` **v1.0.0** (see `cliVersion` in the frontmatter). Check the installed version:
39+
40+
```bash
41+
mm --version
42+
```
43+
44+
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):
45+
46+
```bash
47+
npm view @metamask/agentic-cli version
48+
```
49+
50+
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:
51+
52+
> Version mismatch: installed CLI `<installed>`, this skill is pinned to `1.0.0`, latest release is `<latest>`. 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`.
53+
54+
Run this check once per session. Do not block operations on it.
55+
56+
### 2. Authentication
3457

3558
```bash
3659
mm auth status

skills/metamask-agent-workflows/workflows/login.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ Reference command syntax in `references/auth.md`.
66

77
## Flow
88

9-
1. Ask the user which login method they want: MetaMask Mobile QR, Google, or Email.
10-
2. Execute login.
11-
3. Verify with token.
9+
1. Confirm the target environment with `mm config get env` (set with `mm config set env` before login if not `prod`).
10+
2. Ask the user which login method they want: MetaMask Mobile QR, Google, or Email.
11+
3. Execute login.
12+
4. Verify with token.
1213

1314
## Login
1415

skills/metamask-agent-workflows/workflows/onboarding.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,34 @@ Reference command syntax in `references/auth.md` and `references/wallet.md`.
77
## Flow
88

99
1. Check CLI installation.
10-
2. Login.
11-
3. Initialize wallet mode.
12-
4. Verify auth status.
13-
5. Show wallet address.
10+
2. Configure environment (if not using production).
11+
3. Login.
12+
4. Initialize wallet mode.
13+
5. Verify auth status.
14+
6. Show wallet address.
1415

1516
## Check CLI Installation
1617

1718
```bash
1819
mm --version
1920
```
2021

21-
If this fails, the CLI is not installed. Guide the user to install it before proceeding.
22+
If this fails, the CLI is not installed. Guide the user to install it with `npm install -g @metamask/agentic-cli@latest` before proceeding.
23+
24+
Then run the version compatibility check from the skill `Preflight` section: compare the installed `major.minor` against the pinned `cliVersion` and the latest published release, and warn the user if they are out of sync.
25+
26+
## Configure Environment
27+
28+
Production (`prod`) is the default. Set the target environment **before** login if the user needs dev or uat:
29+
30+
```bash
31+
mm config get env
32+
mm config set env dev
33+
```
34+
35+
For a one-off override without persisting, use `MM_ENV=dev mm login` (or `uat`).
36+
37+
To switch environments after a prior login, run `mm logout` or `mm reset` first, then `mm config set env`.
2238

2339
## Login Flow
2440

@@ -49,7 +65,11 @@ First check if the project is already initialized:
4965
mm init show
5066
```
5167

52-
If already initialized, skip this step. Otherwise, ask the user which wallet mode they want:
68+
If already initialized, skip this step.
69+
70+
For server-wallet mode, if the account already has a remote wallet, `mm init` syncs it and reuses the existing trading mode — no trading-mode prompt.
71+
72+
Otherwise, ask the user which wallet mode they want:
5373
- `server-wallet` (recommended) — keys are hosted by MetaMask infrastructure. No need to manage private keys or mnemonics.
5474
- `byok` — bring your own mnemonic. The user manages their own keys locally.
5575

0 commit comments

Comments
 (0)