Quick Reference
Use this skill to run the gator CLI from the repo and to choose the correct command/flags for delegation workflows.
Installation
npm install -g @metamask/gator-cli
CLI Overview
- Binary name:
gator
- Default profile:
default
- Config path:
~/.gator-cli/permissions.json (or ~/.gator-cli/profiles/<profile-name>.json)
- Delegations local cache:
~/.gator-cli/delegations/<profile-name>.json when storage not configured
Configuration Requirements
Edit the profile config after gator init:
{
"delegationStorage": {
"apiKey": "your-api-key",
"apiKeyId": "your-api-key-id"
},
"rpcUrl": "https://your-rpc-url.com"
}
delegationStorage is optional; when missing, delegations are stored locally.
rpcUrl is required for on-chain actions.
Commands
init
Generate a private key and save config. Errors if the profile already exists.
gator init [--chain <chain>] [--profile <profile-name>]
--chain values: base (default), baseSepolia, sepolia
--profile default: default
- Prints: address, chain, and config file path.
create
Upgrade an EOA to an EIP-7702 smart account. Uses the chain in your profile config.
gator create [--profile <profile-name>]
- Requires the account to be funded with native token first.
- Prints: address, chain, and the upgrade transaction hash.
show
Display the EOA address for a profile.
gator show [--profile <profile-name>]
status
Check config and on-chain account status.
gator status [--profile <profile-name>]
- Prints: address, chain, config upgrade status, on-chain code presence, storage and RPC URL config.
balance
Show native balance and optional ERC-20 balance.
gator balance [--tokenAddress <address>] [--profile <profile-name>]
- If
--tokenAddress is provided, prints ERC-20 balance and decimals-derived units.
grant
Create, sign, and store a delegation with a predefined scope.
gator grant --to <to-address> --scope <type> [scope flags] [--profile <profile-name>]
Scope flags:
- Token scopes:
--tokenAddress <token-address>, --maxAmount <amount>, --tokenId <id>
- Periodic scopes:
--periodAmount <amount>, --periodDuration <seconds>, --startDate <timestamp>
- Streaming scopes:
--amountPerSecond <amount>, --initialAmount <amount>, --startTime <timestamp>
- Function call scope:
--targets <addresses>, --selectors <sigs>, --valueLte <ether>
- Ownership transfer:
--contractAddress <contract-address>
Supported scopes:
erc20TransferAmount
erc20PeriodTransfer
erc20Streaming
erc721Transfer
nativeTokenTransferAmount
nativeTokenPeriodTransfer
nativeTokenStreaming
functionCall
ownershipTransfer
Grant flags per scope:
| Scope |
Required Flags |
Optional Flags |
erc20TransferAmount |
--tokenAddress, --maxAmount |
|
erc20PeriodTransfer |
--tokenAddress, --periodAmount, --periodDuration |
--startDate |
erc20Streaming |
--tokenAddress, --amountPerSecond, --initialAmount, --maxAmount |
--startTime |
erc721Transfer |
--tokenAddress, --tokenId |
|
nativeTokenTransferAmount |
--maxAmount |
|
nativeTokenPeriodTransfer |
--periodAmount, --periodDuration |
--startDate |
nativeTokenStreaming |
--amountPerSecond, --initialAmount, --maxAmount |
--startTime |
functionCall |
--targets, --selectors |
--valueLte |
ownershipTransfer |
--contractAddress |
|
--startDate and --startTime default to the current time (unix seconds) when omitted.
--valueLte sets the max native token value per call for functionCall scopes.
redeem
Redeem a stored delegation using a specific action type.
gator redeem --from <from-address> --action <type> [action flags] [--profile <profile-name>]
Supported action types: erc20Transfer, erc721Transfer, nativeTransfer, functionCall, ownershipTransfer, raw
Action-specific flags:
erc20Transfer: --tokenAddress, --to, --amount
erc721Transfer: --tokenAddress, --to, --tokenId
nativeTransfer: --to, --amount
functionCall: --target, --function, --args, --value
ownershipTransfer: --contractAddress, --to
raw: --target, --callData, --value
revoke
Revoke a delegation on-chain. Revokes the first matching delegation.
gator revoke --to <to-address> [--profile <profile-name>]
inspect
Inspect delegations for your account.
gator inspect [--from <from-address>] [--to <to-address>] [--profile <profile-name>]
- With no filters, prints both Given and Received.
- Printed fields: From, To, Authority, Caveats count, Signed flag.
Redeem Flags per Action
| Action |
Required Flags |
erc20Transfer |
--tokenAddress, --to, --amount |
erc721Transfer |
--tokenAddress, --to, --tokenId |
nativeTransfer |
--to, --amount |
functionCall |
--target, --function, --args |
ownershipTransfer |
--contractAddress, --to |
raw |
--target, --callData |
Example Flows
Initialize and upgrade:
gator init --profile <profile-name>
gator create --profile <profile-name>
Grant an ERC-20 transfer delegation:
gator grant --profile <profile-name> --to <to-address> --scope erc20TransferAmount \
--tokenAddress <token-address> --maxAmount 50
Redeem an ERC-20 transfer:
gator redeem --profile <profile-name> --from <from-address> --action erc20Transfer \
--tokenAddress <token-address> --to <to-address> --amount 10
Redeem a native transfer:
gator redeem --profile <profile-name> --from <from-address> --action nativeTransfer \
--to <to-address> --amount 0.5
Redeem in raw mode:
gator redeem --profile <profile-name> --from <from-address> --action raw \
--target <contract-address> --callData 0xa9059cbb...
Inspect delegations:
gator inspect --profile <profile-name>
gator inspect --profile <profile-name> --from <from-address>
gator inspect --profile <profile-name> --to <to-address>
Revoke a delegation:
gator revoke --profile <profile-name> --to <to-address>
Operational Notes
- Private key security: This is alpha version. Private keys are stored in plaintext JSON. Never use accounts with significant funds.
--from refers to the delegator address; --to refers to the delegate/recipient.
--targets and --selectors are comma-separated lists.
--function accepts a human-readable Solidity function signature like "approve(address,uint256)". Do not pass a 4-byte selector (e.g. 0x095ea7b3) — the CLI derives the selector from the signature automatically.
--startDate and --startTime accept unix timestamps in seconds. When omitted, they default to the current time.
--action is required for redeem and must be one of: erc20Transfer, erc721Transfer, nativeTransfer, functionCall, ownershipTransfer, raw.
- Supported chains for
--chain in gator init: base (default), baseSepolia, sepolia.
1---
2name: gator-cli
3description: Use when you need to operate the @metamask/gator-cli to initialize profiles, upgrade EOA to EIP-7702, grant, redeem, and revoke ERC-7710 delegations, or inspect balances and delegations. Covers commands, required flags, grant scopes, redeem action types, configuration locations, and common usage flows.
4metadata:
5 source: https://skillmd.com/skills/modbender/gator-cli
6 openclaw:
7 emoji: "🐊"
8 homepage: "https://docs.metamask.io/smart-accounts-kit"
9 requires:
10 bins: ["gator"]
11 install:
12 - id: "node"
13 kind: "node"
14 package: "@metamask/gator-cli"
15 bins: ["gator"]
16 label: "Install gator CLI"
17---
18
19## Quick Reference
20
21Use this skill to run the gator CLI from the repo and to choose the correct command/flags for delegation workflows.
22
23## Installation
24
25```sh
26npm install -g @metamask/gator-cli
27```
28
29## CLI Overview
30
31- Binary name: `gator`
32- Default profile: `default`
33- Config path: `~/.gator-cli/permissions.json` (or `~/.gator-cli/profiles/<profile-name>.json`)
34- Delegations local cache: `~/.gator-cli/delegations/<profile-name>.json` when storage not configured
35
36## Configuration Requirements
37
38Edit the profile config after `gator init`:
39
40```json
41{
42 "delegationStorage": {
43 "apiKey": "your-api-key",
44 "apiKeyId": "your-api-key-id"
45 },
46 "rpcUrl": "https://your-rpc-url.com"
47}
48```
49
50- `delegationStorage` is optional; when missing, delegations are stored locally.
51- `rpcUrl` is required for on-chain actions.
52
53## Commands
54
55### init
56
57Generate a private key and save config. Errors if the profile already exists.
58
59- `gator init [--chain <chain>] [--profile <profile-name>]`
60- `--chain` values: `base` (default), `baseSepolia`, `sepolia`
61- `--profile` default: `default`
62- Prints: address, chain, and config file path.
63
64### create
65
66Upgrade an EOA to an EIP-7702 smart account. Uses the chain in your profile config.
67
68- `gator create [--profile <profile-name>]`
69- Requires the account to be funded with native token first.
70- Prints: address, chain, and the upgrade transaction hash.
71
72### show
73
74Display the EOA address for a profile.
75
76- `gator show [--profile <profile-name>]`
77
78### status
79
80Check config and on-chain account status.
81
82- `gator status [--profile <profile-name>]`
83- Prints: address, chain, config upgrade status, on-chain code presence, storage and RPC URL config.
84
85### balance
86
87Show native balance and optional ERC-20 balance.
88
89- `gator balance [--tokenAddress <address>] [--profile <profile-name>]`
90- If `--tokenAddress` is provided, prints ERC-20 balance and decimals-derived units.
91
92### grant
93
94Create, sign, and store a delegation with a predefined scope.
95
96- `gator grant --to <to-address> --scope <type> [scope flags] [--profile <profile-name>]`
97
98Scope flags:
99
100- Token scopes: `--tokenAddress <token-address>`, `--maxAmount <amount>`, `--tokenId <id>`
101- Periodic scopes: `--periodAmount <amount>`, `--periodDuration <seconds>`, `--startDate <timestamp>`
102- Streaming scopes: `--amountPerSecond <amount>`, `--initialAmount <amount>`, `--startTime <timestamp>`
103- Function call scope: `--targets <addresses>`, `--selectors <sigs>`, `--valueLte <ether>`
104- Ownership transfer: `--contractAddress <contract-address>`
105
106Supported scopes:
107
108- `erc20TransferAmount`
109- `erc20PeriodTransfer`
110- `erc20Streaming`
111- `erc721Transfer`
112- `nativeTokenTransferAmount`
113- `nativeTokenPeriodTransfer`
114- `nativeTokenStreaming`
115- `functionCall`
116- `ownershipTransfer`
117
118Grant flags per scope:
119
120| Scope | Required Flags | Optional Flags |
121| --------------------------- | ----------------------------------------------------------------------- | ---------------- |
122| `erc20TransferAmount` | `--tokenAddress`, `--maxAmount` | |
123| `erc20PeriodTransfer` | `--tokenAddress`, `--periodAmount`, `--periodDuration` | `--startDate` |
124| `erc20Streaming` | `--tokenAddress`, `--amountPerSecond`, `--initialAmount`, `--maxAmount` | `--startTime` |
125| `erc721Transfer` | `--tokenAddress`, `--tokenId` | |
126| `nativeTokenTransferAmount` | `--maxAmount` | |
127| `nativeTokenPeriodTransfer` | `--periodAmount`, `--periodDuration` | `--startDate` |
128| `nativeTokenStreaming` | `--amountPerSecond`, `--initialAmount`, `--maxAmount` | `--startTime` |
129| `functionCall` | `--targets`, `--selectors` | `--valueLte` |
130| `ownershipTransfer` | `--contractAddress` | |
131
132- `--startDate` and `--startTime` default to the current time (unix seconds) when omitted.
133- `--valueLte` sets the max native token value per call for `functionCall` scopes.
134
135### redeem
136
137Redeem a stored delegation using a specific action type.
138
139- `gator redeem --from <from-address> --action <type> [action flags] [--profile <profile-name>]`
140
141Supported action types: `erc20Transfer`, `erc721Transfer`, `nativeTransfer`, `functionCall`, `ownershipTransfer`, `raw`
142
143Action-specific flags:
144
145- `erc20Transfer`: `--tokenAddress`, `--to`, `--amount`
146- `erc721Transfer`: `--tokenAddress`, `--to`, `--tokenId`
147- `nativeTransfer`: `--to`, `--amount`
148- `functionCall`: `--target`, `--function`, `--args`, `--value`
149- `ownershipTransfer`: `--contractAddress`, `--to`
150- `raw`: `--target`, `--callData`, `--value`
151
152### revoke
153
154Revoke a delegation on-chain. Revokes the first matching delegation.
155
156- `gator revoke --to <to-address> [--profile <profile-name>]`
157
158### inspect
159
160Inspect delegations for your account.
161
162- `gator inspect [--from <from-address>] [--to <to-address>] [--profile <profile-name>]`
163- With no filters, prints both Given and Received.
164- Printed fields: From, To, Authority, Caveats count, Signed flag.
165
166## Redeem Flags per Action
167
168| Action | Required Flags |
169| ------------------- | ------------------------------------- |
170| `erc20Transfer` | `--tokenAddress`, `--to`, `--amount` |
171| `erc721Transfer` | `--tokenAddress`, `--to`, `--tokenId` |
172| `nativeTransfer` | `--to`, `--amount` |
173| `functionCall` | `--target`, `--function`, `--args` |
174| `ownershipTransfer` | `--contractAddress`, `--to` |
175| `raw` | `--target`, `--callData` |
176
177## Example Flows
178
179Initialize and upgrade:
180
181```bash
182gator init --profile <profile-name>
183gator create --profile <profile-name>
184```
185
186Grant an ERC-20 transfer delegation:
187
188```bash
189gator grant --profile <profile-name> --to <to-address> --scope erc20TransferAmount \
190 --tokenAddress <token-address> --maxAmount 50
191```
192
193Redeem an ERC-20 transfer:
194
195```bash
196gator redeem --profile <profile-name> --from <from-address> --action erc20Transfer \
197 --tokenAddress <token-address> --to <to-address> --amount 10
198```
199
200Redeem a native transfer:
201
202```bash
203gator redeem --profile <profile-name> --from <from-address> --action nativeTransfer \
204 --to <to-address> --amount 0.5
205```
206
207Redeem in raw mode:
208
209```bash
210gator redeem --profile <profile-name> --from <from-address> --action raw \
211 --target <contract-address> --callData 0xa9059cbb...
212```
213
214Inspect delegations:
215
216```bash
217gator inspect --profile <profile-name>
218gator inspect --profile <profile-name> --from <from-address>
219gator inspect --profile <profile-name> --to <to-address>
220```
221
222Revoke a delegation:
223
224```bash
225gator revoke --profile <profile-name> --to <to-address>
226```
227
228## Operational Notes
229
230- **Private key security**: This is alpha version. Private keys are stored in plaintext JSON. Never use accounts with significant funds.
231- `--from` refers to the delegator address; `--to` refers to the delegate/recipient.
232- `--targets` and `--selectors` are comma-separated lists.
233- `--function` accepts a human-readable Solidity function signature like `"approve(address,uint256)"`. Do **not** pass a 4-byte selector (e.g. `0x095ea7b3`) — the CLI derives the selector from the signature automatically.
234- `--startDate` and `--startTime` accept unix timestamps in seconds. When omitted, they default to the current time.
235- `--action` is required for `redeem` and must be one of: `erc20Transfer`, `erc721Transfer`, `nativeTransfer`, `functionCall`, `ownershipTransfer`, `raw`.
236- Supported chains for `--chain` in `gator init`: `base` (default), `baseSepolia`, `sepolia`.