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