返回顶部
g

gator-cli鳄鱼CLI

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.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.1
安全检测
已通过
650
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

gator-cli

快速参考

使用此技能可从仓库运行 gator CLI,并为委托工作流选择正确的命令/标志。

安装

sh
npm install -g @metamask/gator-cli

CLI 概述

  • - 二进制名称:gator
  • 默认配置文件:default
  • 配置路径:~/.gator-cli/permissions.json(或 ~/.gator-cli/profiles/.json)
  • 委托本地缓存:未配置存储时位于 ~/.gator-cli/delegations/.json

配置要求

运行 gator init 后编辑配置文件:

json
{
delegationStorage: {
apiKey: your-api-key,
apiKeyId: your-api-key-id
},
rpcUrl: https://your-rpc-url.com
}

  • - delegationStorage 为可选配置;缺失时委托将存储在本地。
  • rpcUrl 为链上操作所必需。

命令

init

生成私钥并保存配置。如果配置文件已存在则会报错。

  • - gator init [--chain ] [--profile ]
  • --chain 可选值:base(默认)、baseSepolia、sepolia
  • --profile 默认值:default
  • 输出:地址、链和配置文件路径。

create

将 EOA 升级为 EIP-7702 智能账户。使用配置文件中的链。

  • - gator create [--profile ]
  • 要求账户先存入原生代币。
  • 输出:地址、链和升级交易哈希。

show

显示配置文件的 EOA 地址。

  • - gator show [--profile ]

status

检查配置和链上账户状态。

  • - gator status [--profile ]
  • 输出:地址、链、配置升级状态、链上代码存在性、存储和 RPC URL 配置。

balance

显示原生代币余额和可选的 ERC-20 余额。

  • - gator balance [--tokenAddress
    ] [--profile ]
  • 如果提供了 --tokenAddress,则输出 ERC-20 余额及基于小数位的单位。

grant

创建、签名并存储具有预定义范围的委托。

  • - gator grant --to --scope [scope flags] [--profile ]

范围标志:

  • - 代币范围:--tokenAddress 、--maxAmount 、--tokenId
  • 定期范围:--periodAmount 、--periodDuration 、--startDate
  • 流式范围:--amountPerSecond 、--initialAmount 、--startTime
  • 函数调用范围:--targets 、--selectors 、--valueLte
  • 所有权转移:--contractAddress

支持的范围:

  • - erc20TransferAmount
  • erc20PeriodTransfer
  • erc20Streaming
  • erc721Transfer
  • nativeTokenTransferAmount
  • nativeTokenPeriodTransfer
  • nativeTokenStreaming
  • functionCall
  • ownershipTransfer

各范围的授权标志:

范围必需标志可选标志
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 和 --startTime 默认为当前时间(Unix 秒)。
  • --valueLte 为 functionCall 范围设置每次调用的最大原生代币值。

redeem

使用特定操作类型赎回存储的委托。

  • - gator redeem --from --action [action flags] [--profile ]

支持的操作类型:erc20Transfer、erc721Transfer、nativeTransfer、functionCall、ownershipTransfer、raw

操作特定标志:

  • - erc20Transfer:--tokenAddress、--to、--amount
  • erc721Transfer:--tokenAddress、--to、--tokenId
  • nativeTransfer:--to、--amount
  • functionCall:--target、--function、--args、--value
  • ownershipTransfer:--contractAddress、--to
  • raw:--target、--callData、--value

revoke

在链上撤销委托。撤销第一个匹配的委托。

  • - gator revoke --to [--profile ]

inspect

检查账户的委托。

  • - gator inspect [--from ] [--to ] [--profile ]
  • 无过滤器时,同时显示已授予和已接收的委托。
  • 输出字段:发送方、接收方、授权方、限制条件数量、已签名标志。

各操作的赎回标志

操作必需标志
erc20Transfer--tokenAddress、--to、--amount
erc721Transfer
--tokenAddress、--to、--tokenId | | nativeTransfer | --to、--amount | | functionCall | --target、--function、--args | | ownershipTransfer | --contractAddress、--to | | raw | --target、--callData |

示例流程

初始化和升级:

bash
gator init --profile
gator create --profile

授予 ERC-20 转账委托:

bash
gator grant --profile --to --scope erc20TransferAmount \
--tokenAddress --maxAmount 50

赎回 ERC-20 转账:

bash
gator redeem --profile --from --action erc20Transfer \
--tokenAddress --to --amount 10

赎回原生代币转账:

bash
gator redeem --profile --from --action nativeTransfer \
--to --amount 0.5

以原始模式赎回:

bash
gator redeem --profile --from --action raw \
--target --callData 0xa9059cbb...

检查委托:

bash
gator inspect --profile
gator inspect --profile --from
gator inspect --profile --to

撤销委托:

bash
gator revoke --profile --to

操作说明

  • - 私钥安全:此为 alpha 版本。私钥以明文 JSON 存储。切勿使用存有大额资金的账户。
  • --from 指委托方地址;--to 指被委托方/接收方。
  • --targets 和 --selectors 为逗号分隔列表。
  • --function 接受人类可读的 Solidity 函数签名,如 approve(address,uint256)。不要传递 4 字节选择器(例如 0x095ea7b3

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 gator-cli-1776420045 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 gator-cli-1776420045 技能

通过命令行安装

skillhub install gator-cli-1776420045

下载

⬇ 下载 gator-cli v1.0.1(免费)

文件大小: 3.12 KB | 发布时间: 2026-4-17 20:20

v1.0.1 最新 2026-4-17 20:20
- Added quick global installation instructions using `npm install -g @metamask/gator-cli`.
- Documented support for the `baseSepolia` chain in the `init` command.
- Clarified scopes, required and optional flags, and added detail on default values for `--startDate` and `--startTime`.
- For `functionCall` grants, explicitly documented the optional `--valueLte` flag.
- Added a warning regarding private key storage in plaintext JSON and alpha state of the tool.
- Made minor corrections and clarifications for improved usability and accuracy.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部