# @ramp/cli 中文文档

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

版本：0\.2\.90
npm 元数据更新时间：2026-11-02T04:00:23.506Z
中文译文更新时间：2026-11-02T06:56:59.895Z
软件包许可：MIT

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

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

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

- 包体积（解压后）：71.7 kB，17 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- Node.js 要求：\>=22
- 运行依赖：2 个
- 首次发布：2026-10-15T17:51:01.568Z
- 最新版本发布：2026-11-02T04:00:23.129Z
- 已发布版本数：26（近 12 个月 26 个）

## 中文简介

安装并启动独立的Ramp CLI

## 安装

```sh
npm install @ramp/cli
```

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

## README

# @ramp / cli

CLI用于Ramp的开发者API。通过OAuth认证，管理费用，批准账单，预订旅行等-从您的终端或人工智能代理。

## 安装

```bash
npm install -g @ramp/cli
```

或者直接运行而不进行全局安装：

```bash
npx @ramp/cli --help
```

需要Node.js 22+和npm 10+（不需要Python）。支持的平台：macOS (Apple Silicon & Intel), Linux （glibc x64 & arm64）和Windows （x64）。

关于单命令匝道路由器设置，请参见 [`@ramp/router`](https://www.npmjs.com/package/@ramp/router) （`npx @ramp/router`）。

## 快速入门

```bash
ramp auth login                              # OAuth via browser
ramp users me                                # Current user details
ramp bills search --query "Acme"             # Search bills by vendor name
ramp cards list                              # List your cards (card_state shows ACTIVE)
ramp transactions list --transactions_to_retrieve my_transactions
ramp transactions list --transactions_to_retrieve my_transactions --from_date 2025-01-01
ramp transactions list --transactions_to_retrieve my_transactions --rationale "Monthly review" --agent  # JSON output for scripting
ramp router                                  # Open the Router workspace
ramp update                                  # Update to the latest release
```

## 命令

| 命令 | 描述 |
| --- | --- |
| `auth` | 登录，注销，检查状态 |
| `config` | 获取/设置CLI配置 |
| `env` | 显示或设置默认环境（沙箱/生产） |
| `profile` | 显示、列出或切换凭证配置文件 |
| `router` | 连接编码代理，管理密钥和策略 |
| `applications` | 申请一个Ramp帐户 |
| `skills` | 浏览并安装代理技能说明 |
| `update` | 更新CLI到最新版本 |
| `feedback` | 提交对CLI的反馈 |

## 资源

12种资源，每种资源都有自己的工具：

| 资源 | 工具 |
| --- | --- |
| `accounting` | `categories`， `category-options` |
| `bills` | `search`， `get`， `draft`， `pending`， `approve`， `attachments` |
| `cards` | `list`， `activate`， `lock` (别名也下 `funds`） |
| `funds` | `list`， `activate`， `creds`， `lock` |
| `general` | `comment`， `explain`， `help-center` |
| `purchase-orders` | `search`， `get` |
| `receipts` | `upload`， `attach` |
| `reimbursements` | `list`， `pending`， `submit`， `approve`， `edit` |
| `requests` | `pending`， `approve` |
| `transactions` | `list`， `get`， `approve`， `edit`， `missing`， `flag-missing`， `explain-missing`， `memo-suggestions`， `trips` |
| `travel` | `list`， `create`， `bookings`， `locations` |
| `users` | `list`， `me`， `org-chart` |

用法: `ramp <resource> <tool> [OPTIONS]`

## 全球旗帜

| 国旗 | 描述 |
| --- | --- |
| `--env`， `-e` | `production` (默认)或 `sandbox` |
| `--output`， `-o` | 输出格式: `json` 或者 `table` |
| `--agent` | 机器可读JSON输出（管道时的默认值） |
| `--human` | 人类可读的表输出（终端中的默认值） |
| `--wide` | 在表输出中显示所有列 |
| `--quiet`， `-q` | 抑制进度输出 |
| `--no-input` | 禁用交互式提示（用于CI/脚本） |

## 工具旗帜

| 国旗 | 描述 |
| --- | --- |
| `--json TEXT` | 原始JSON请求体（绕过标志） |
| `--dry_run`， `-n` | 未发送打印请求 |
| `--page_size N` | 每页结果 |
| `--next_page_cursor` | 从以前的响应恢复分页 |

运行 `ramp <resource> <tool> --help` 查看某个工具的所有可用标志。

## 代理模式

`--agent` 输出用于脚本和AI代理使用的JSON。管 `jq` 处理:

```bash
ramp transactions list --transactions_to_retrieve my_transactions --rationale "Monthly review" --agent | jq '.data[0]'
ramp users me --rationale "Look up my user ID" --agent | jq '.data[0].user_id'
```

## 许可证

MIT -见 [https://github.com/ramp-public/ramp-cli](https://github.com/ramp-public/ramp-cli) 获取完整的文档和源代码。

## 常见问题

### @ramp/cli 是什么？

安装并启动独立的Ramp CLI

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

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

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

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/ramp\_\_cli 是否存在。

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

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

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

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

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

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

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

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

