# @aave/cli 中文文档

规范地址：https://npmcn.com/package/%40aave/cli/

版本：4\.4\.1
npm 元数据更新时间：2026-10-20T21:18:29.257Z
中文译文更新时间：2026-11-06T22:32:18.795Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40aave/cli
原文对照：https://npmcn.com/package/%40aave/cli/?lang=original
项目主页：https://github.com/aave/aave-v4-sdk#readme
源码仓库：https://github.com/aave/aave-v4-sdk

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：124 kB，48 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=22\.17\.0
- 运行依赖：6 个
- 首次发布：2025-12-10T12:05:02.995Z
- 最新版本发布：2026-10-20T21:18:28.907Z
- 近 30 天下载量：2248（2026-10-05 至 2026-11-03，npm 官方下载统计）
- 已发布版本数：129（近 12 个月 129 个）

## 中文简介

与 AaveKit API 互动的 CLI

## 安装

```sh
npm install @aave/cli
```

也可以使用：`pnpm add @aave/cli`、`yarn add @aave/cli`、`bun add @aave/cli`

## README

# 翻译:

与 AaveKit API 互动的 CLI

[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io/) [![Version](https://img.shields.io/npm/v/@aave/cli.svg)](https://npmjs.org/package/@aave/cli) [![Downloads/week](https://img.shields.io/npm/dw/@aave/cli.svg)](https://npmjs.org/package/@aave/cli)

-   [使用量](https://npmcn.com/package/%40aave/cli/#readme-usage)
-   [图标](https://npmcn.com/package/%40aave/cli/#readme-commands)

# 使用量

```sh-session
$ npm install -g @aave/cli
$ aave COMMAND
running command...
$ aave (--version)
@aave/cli/4.2.0 linux-x64 node-v22.22.2
$ aave --help [COMMAND]
USAGE
  $ aave COMMAND
...
```

# 图标

-   [`aave action borrow`](https://npmcn.com/package/%40aave/cli/#readme-aave-action-borrow)
-   [`aave action claim-rewards`](https://npmcn.com/package/%40aave/cli/#readme-aave-action-claim-rewards)
-   [`aave action repay`](https://npmcn.com/package/%40aave/cli/#readme-aave-action-repay)
-   [`aave action supply`](https://npmcn.com/package/%40aave/cli/#readme-aave-action-supply)
-   [`aave action swap token`](https://npmcn.com/package/%40aave/cli/#readme-aave-action-swap-token)
-   [`aave action withdraw`](https://npmcn.com/package/%40aave/cli/#readme-aave-action-withdraw)
-   [`aave hubs list`](https://npmcn.com/package/%40aave/cli/#readme-aave-hubs-list)
-   [`aave reserve`](https://npmcn.com/package/%40aave/cli/#readme-aave-reserve)
-   [`aave reserves holders`](https://npmcn.com/package/%40aave/cli/#readme-aave-reserves-holders)
-   [`aave reserves list`](https://npmcn.com/package/%40aave/cli/#readme-aave-reserves-list)
-   [`aave spokes list`](https://npmcn.com/package/%40aave/cli/#readme-aave-spokes-list)
-   [`aave user balance`](https://npmcn.com/package/%40aave/cli/#readme-aave-user-balance)
-   [`aave user borrows`](https://npmcn.com/package/%40aave/cli/#readme-aave-user-borrows)
-   [`aave user positions`](https://npmcn.com/package/%40aave/cli/#readme-aave-user-positions)
-   [`aave user rewards`](https://npmcn.com/package/%40aave/cli/#readme-aave-user-rewards)
-   [`aave user summary`](https://npmcn.com/package/%40aave/cli/#readme-aave-user-summary)
-   [`aave user supplies`](https://npmcn.com/package/%40aave/cli/#readme-aave-user-supplies)

## `aave action borrow`

从准备金借入ERC20令牌

```
USAGE
  $ aave action borrow --reserve-id <value> --amount <value> [--json] [-k <private-key>]

FLAGS
  -k, --private-key=<private-key>  Private key to sign transactions (overrides PRIVATE_KEY env var)
      --amount=<value>             (required) Amount of the token to borrow
      --reserve-id=<value>         (required) Reserve ID of the reserve to borrow from

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Borrow ERC20 tokens from a reserve
```

_参见代码 : [src/命令/动作/借阅. ts](https://github.com/aave/aave-v4-sdk/blob/v4.2.0/src/commands/action/borrow.ts)_

## `aave action claim-rewards`

当前钱包的索赔奖励

```
USAGE
  $ aave action claim-rewards -c <chain-id> [--json] [--ids <value>] [-k <private-key>]

FLAGS
  -c, --chain_id=<chain-id>        (required) Chain ID to claim rewards on
  -k, --private-key=<private-key>  Private key to sign transactions (overrides PRIVATE_KEY env var)
      --ids=<value>                Comma-separated reward IDs to claim (defaults to all claimable rewards for the wallet
                                   on this chain)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Claim rewards for the current wallet
```

_参见代码 : [src/commands/action/claim-rewards.ts (中文(简体) )](https://github.com/aave/aave-v4-sdk/blob/v4.2.0/src/commands/action/claim-rewards.ts)_

## `aave action repay`

将ERC20债务还给准备金

```
USAGE
  $ aave action repay --reserve-id <value> --amount <value> [--json] [-k <private-key>]

FLAGS
  -k, --private-key=<private-key>  Private key to sign transactions (overrides PRIVATE_KEY env var)
      --amount=<value>             (required) Amount of the token to repay
      --reserve-id=<value>         (required) Reserve ID of the reserve to repay

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Repay ERC20 debt to a reserve
```

_参见代码 : [src/命令/动作/还款](https://github.com/aave/aave-v4-sdk/blob/v4.2.0/src/commands/action/repay.ts)_

## `aave action supply`

向储备供应ERC20令牌

```
USAGE
  $ aave action supply --reserve-id <value> --amount <value> [--json] [-k <private-key>] [--enable-collateral]

FLAGS
  -k, --private-key=<private-key>  Private key to sign transactions (overrides PRIVATE_KEY env var)
      --amount=<value>             (required) Amount of the token to supply
      --enable-collateral          If provided, the supplied position is enabled as collateral
      --reserve-id=<value>         (required) Reserve ID of the reserve to supply

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Supply ERC20 tokens to a reserve
```

_参见代码 : [src/命令/动作/供应.ts](https://github.com/aave/aave-v4-sdk/blob/v4.2.0/src/commands/action/supply.ts)_

## `aave action swap token`

使用市场模式将一个令牌换成另一个令牌

```
USAGE
  $ aave action swap token -c <chain-id> --sell-token <value> --buy-token <value> --amount <value> [--json] [--kind
    sell|buy] [--quote-only] [--address <evm-address>] [-k <private-key>]

FLAGS
  -c, --chain=<chain-id>           (required) Chain ID where the token swap will be executed
  -k, --private-key=<private-key>  Private key to sign transactions (overrides PRIVATE_KEY env var)
      --address=<evm-address>      User address for quote generation
      --amount=<value>             (required) Amount to swap
      --buy-token=<value>          (required) Token address to buy
      --kind=<option>              [default: sell] Swap amount interpretation
                                   <options: sell|buy>
      --quote-only                 Only fetch and display quote
      --sell-token=<value>         (required) Token address to sell

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Swap one token for another token using market mode
```

_参见代码 : [src/commands/ action/swap/token.ts 命令/动作/移动/移动](https://github.com/aave/aave-v4-sdk/blob/v4.2.0/src/commands/action/swap/token.ts)_

## `aave action withdraw`

从保留区撤回 ERC20 令牌

```
USAGE
  $ aave action withdraw --reserve-id <value> --amount <value> [--json] [-k <private-key>]

FLAGS
  -k, --private-key=<private-key>  Private key to sign transactions (overrides PRIVATE_KEY env var)
      --amount=<value>             (required) Amount of the token to withdraw
      --reserve-id=<value>         (required) Reserve ID of the reserve to withdraw from

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Withdraw ERC20 tokens from a reserve
```

_参见代码 : [src/命令/动作/撤回.ts](https://github.com/aave/aave-v4-sdk/blob/v4.2.0/src/commands/action/withdraw.ts)_

## `aave hubs list`

列表 Aave v4 流动性中心

```
USAGE
  $ aave hubs list [--json] [-c <chain-id>]

FLAGS
  -c, --chain=<chain-id>  The chain ID (e.g. 1, 137, 42161)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List Aave v4 liquidity hubs
```

_参见代码 : [src/commands/hubs/list.ts (中文(简体) )](https://github.com/aave/aave-v4-sdk/blob/v4.2.0/src/commands/hubs/list.ts)_

## `aave reserve`

通过保留 ID 显示 Aave v4 保留细节

```
USAGE
  $ aave reserve -i <value> [--json]

FLAGS
  -i, --id=<value>  (required) Reserve ID (e.g. SGVsbG8h…)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Show Aave v4 reserve details by reserve ID
```

_参见代码 : [src/命令/保留](https://github.com/aave/aave-v4-sdk/blob/v4.2.0/src/commands/reserve.ts)_

## `aave reserves holders`

列出保留的顶端持有者

```
USAGE
  $ aave reserves holders -i <value> [--json] [-f SUPPLIED|BORROWED]

FLAGS
  -f, --filter=<option>  [default: SUPPLIED] Filter by SUPPLIED or BORROWED holders
                         <options: SUPPLIED|BORROWED>
  -i, --id=<value>       (required) Reserve ID (e.g. SGVsbG8h…)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List top holders for a reserve
```

_参见代码 : [斜弧/命令/保留地/持有者.ts](https://github.com/aave/aave-v4-sdk/blob/v4.2.0/src/commands/reserves/holders.ts)_

## `aave reserves list`

列表 Aave v4 储备

```
USAGE
  $ aave reserves list [--json] [-s <spoke-id>] [-h <hub-id>] [--hub_address <evm-address> -c <chain-id>]

FLAGS
  -c, --chain_id=<chain-id>        The chain ID (e.g. 1, 137, 42161)
  -h, --hub_id=<hub-id>            The hub ID (e.g. SGVsbG8h…)
  -s, --spoke_id=<spoke-id>        The spoke ID (e.g. SGVsbG8h…)
      --hub_address=<evm-address>  The hub address (e.g. 0x123…)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List Aave v4 reserves
```

_参见代码 : [src/命令/保留地/列表.ts](https://github.com/aave/aave-v4-sdk/blob/v4.2.0/src/commands/reserves/list.ts)_

## `aave spokes list`

列表 Aave v4 语句

```
USAGE
  $ aave spokes list [--json] [-h <hub-id>] [--hub_address <evm-address> -c <chain-id>]

FLAGS
  -c, --chain_id=<chain-id>        The chain ID (e.g. 1, 137, 42161)
  -h, --hub_id=<hub-id>            The hub ID (e.g. SGVsbG8h…)
      --hub_address=<evm-address>  The hub address (e.g. 0x123…)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List Aave v4 spokes
```

_参见代码 : [src/commands/ speaks/list.ts 互联网档案馆的存檔,存档日期2013-12-02](https://github.com/aave/aave-v4-sdk/blob/v4.2.0/src/commands/spokes/list.ts)_

## `aave user balance`

列出 Aave v4 可使用的用户符号余额

```
USAGE
  $ aave user balance -c <chain-id> [--json] [--address <evm-address>]

FLAGS
  -c, --chain_id=<chain-id>    (required) Chain ID to query balances from
      --address=<evm-address>  User address (defaults to PRIVATE_KEY wallet address)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List user token balances that can be used in Aave v4
```

_参见代码 : [src/命令/用户/平衡.ts](https://github.com/aave/aave-v4-sdk/blob/v4.2.0/src/commands/user/balance.ts)_

## `aave user borrows`

列出特定链的用户借入

```
USAGE
  $ aave user borrows -c <chain-id> [--json] [--address <evm-address>]

FLAGS
  -c, --chain_id=<chain-id>    (required) Chain ID to query borrows from
      --address=<evm-address>  User address (defaults to PRIVATE_KEY wallet address)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List user borrows for a specific chain
```

_参见代码 : [src/命令/用户/借阅](https://github.com/aave/aave-v4-sdk/blob/v4.2.0/src/commands/user/borrows.ts)_

## `aave user positions`

列出跨链的用户位置

```
USAGE
  $ aave user positions -c <chain-id> [--json] [--address <evm-address>]

FLAGS
  -c, --chain_id=<chain-id>    (required) Filter by chain ID
      --address=<evm-address>  User address (defaults to PRIVATE_KEY wallet address)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List user positions across chains
```

_参见代码 : [src/命令/用户/位置.ts](https://github.com/aave/aave-v4-sdk/blob/v4.2.0/src/commands/user/positions.ts)_

## `aave user rewards`

为特定链条上的用户列出可要求的奖励

```
USAGE
  $ aave user rewards -c <chain-id> [--json] [--address <evm-address>]

FLAGS
  -c, --chain_id=<chain-id>    (required) Chain ID to query rewards from
      --address=<evm-address>  User address (defaults to PRIVATE_KEY wallet address)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List claimable rewards for a user on a specific chain
```

_参见代码 : [src/命令/用户/奖励](https://github.com/aave/aave-v4-sdk/blob/v4.2.0/src/commands/user/rewards.ts)_

## `aave user summary`

显示特定链的用户摘要

```
USAGE
  $ aave user summary -c <chain-id> [--json] [--address <evm-address>]

FLAGS
  -c, --chain_id=<chain-id>    (required) Chain ID to query summary from
      --address=<evm-address>  User address (defaults to PRIVATE_KEY wallet address)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Show a user summary for a specific chain
```

_参见代码 : [src/命令/用户/摘要.ts](https://github.com/aave/aave-v4-sdk/blob/v4.2.0/src/commands/user/summary.ts)_

## `aave user supplies`

列出特定链条的用户用品

```
USAGE
  $ aave user supplies -c <chain-id> [--json] [--address <evm-address>]

FLAGS
  -c, --chain_id=<chain-id>    (required) Chain ID to query supplies from
      --address=<evm-address>  User address (defaults to PRIVATE_KEY wallet address)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List user supplies for a specific chain
```

_参见代码 : [src/命令/用户/用户](https://github.com/aave/aave-v4-sdk/blob/v4.2.0/src/commands/user/supplies.ts)_

## 常见问题

### @aave/cli 是什么？

与 AaveKit API 互动的 CLI

### 如何安装 @aave/cli？

在项目目录运行 npm install @aave/cli，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 aave，可以用 npx aave 直接运行。

### @aave/cli 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @aave/cli 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @aave/cli 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=22\.17\.0。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @aave/cli 可以商用吗？

@aave/cli 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @aave/cli 的下载量有多少？

根据 npm 官方下载统计，@aave/cli 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,248 次，日均约 75 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @aave/cli 还在维护吗？

最新版本 4\.4\.1 发布于 2026/10/21（17 天前）；至今共发布 129 个版本，其中过去 12 个月发布了 129 个；首次发布于 2025/12/10。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

