# @apollo/rover 中文文档

规范地址：https://npmcn.com/package/%40apollo/rover/

版本：1\.0\.1
npm 元数据更新时间：2026-10-21T22:33:14.196Z
中文译文更新时间：2026-11-06T10:56:42.404Z
软件包许可：MIT

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

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

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

- 包体积（解压后）：21.8 kB，4 个文件
- TypeScript 类型：未声明
- Node.js 要求：\>=22\.14\.0
- 运行依赖：0 个
- 首次发布：2021-02-01T18:37:42.971Z
- 最新版本发布：2026-10-21T22:33:13.898Z
- 近 30 天下载量：1377481（2026-10-07 至 2026-11-05，npm 官方下载统计）
- 已发布版本数：170（近 12 个月 14 个）

## 中文简介

罗弗是同阿波罗GraphQL注册公司合作的工具.

## 安装

```sh
npm install @apollo/rover
```

也可以使用：`pnpm add @apollo/rover`、`yarn add @apollo/rover`、`bun add @apollo/rover`

## README

# 漫游者

[![GitHub Release Downloads](https://shields.io/github/downloads/apollographql/rover/total.svg)](https://github.com/apollographql/rover/releases/latest) [![Unit/Integration Tests](https://github.com/apollographql/rover/actions/workflows/checks.yml/badge.svg)](https://github.com/apollographql/rover/actions/workflows/checks.yml) [![E2E Tests](https://github.com/apollographql/rover/actions/workflows/run-smokes-on-pr.yml/badge.svg)](https://github.com/apollographql/rover/actions/workflows/run-smokes-on-pr.yml) [![Command E2E Tests](https://github.com/apollographql/rover/actions/workflows/run-commands-e2e.yml/badge.svg)](https://github.com/apollographql/rover/actions/workflows/run-commands-e2e.yml)

这里是罗弗的故乡,是阿波罗系列GraphQL开发者生产力工具的新CLI.

### 说明

这个 `README` 里面只有足够信息 让你开始与罗弗。 我们 [文档](https://go.apollo.dev/r/docs) 包含更详细的信息,应该成为你对万事万事的主要参考.

## 使用量

与您的图表交互的几个有用的 Rover 命令 :

1.  从联邦远程端点取出图表.

```bash
rover graph fetch test@cats
```

2.  验证您最近对本地图所作的更改 `rover graph check`。 。 。 .

```bash
rover graph check --schema=./path-to-valid-sdl test@cats
```

3.  将本地图表发布给阿波罗工作室.

```bash
rover graph publish --schema ./path-to-valid-schema test@cats
```

## 命令行选项

```console
Rover - Your Graph Companion

Usage: rover [OPTIONS] <COMMAND>

Commands:
  init
          Initialize a federated graph in your current directory
  api-key
          API Key Related Commands
  auth
          Authentication commands
  connector
          Work with Apollo Connectors
  completion
          Generate shell completion scripts
  config
          Configuration profile commands
  contract
          Contract configuration commands
  schema
          Schema inspection commands
  dev
          Run a supergraph locally to develop and test subgraph changes
  supergraph
          Supergraph schema commands
  graph
          Graph API schema commands
  template
          Commands for working with templates
  readme
          Readme commands
  subgraph
          Subgraph schema commands
  docs
          Interact with Rover's documentation
  update
          Commands related to updating rover
  persisted-queries
          Commands for persisted queries [alias: pq]
  install
          Installs Rover
  plugin
          Plugin management commands
  explain
          Explain error codes
  license
          Commands for fetching offline licenses
  client
          Client workflow commands
  graph-artifact
          Graph artifact commands
  help
          Print this message or the help of the given subcommand(s)

Options:
  -l, --log <LOG_LEVEL>
          Specify Rover's log level

          [env: APOLLO_LOG_LEVEL=]

      --profile <PROFILE_NAME>
          Name of configuration profile to use

      --format <FORMAT_KIND>
          Specify Rover's format type

          [env: APOLLO_FORMAT=]
          [default: plain]
          [possible values: plain, json]

  -o, --output <OUTPUT_FILE>
          Specify a file to write Rover's console output to instead of stdout

      --no-color
          Disable colored output.

          `NO_COLOR`/`APOLLO_NO_COLOR` already disable it too, on any value other than an empty string, `0`, or `false` (case-insensitive) - this flag doesn't change that convention, it's just an additional way to opt out.

      --insecure-accept-invalid-certs
          Accept invalid certificates when performing HTTPS requests.

          You should think very carefully before using this flag.

          If invalid certificates are trusted, any certificate for any site will be trusted for use. This includes expired certificates. This introduces significant vulnerabilities, and should only be used as a last resort.

      --insecure-accept-invalid-hostnames
          Accept invalid hostnames when performing HTTPS requests.

          You should think very carefully before using this flag.

          If hostname verification is not used, any valid certificate for any site will be trusted for use from any other. This introduces a significant vulnerability to man-in-the-middle attacks.

      --client-timeout <CLIENT_TIMEOUT>
          Configure the timeout length (in seconds) when performing HTTP(S) requests.

          Defaults to 30s for standard operations and 300s for plugin downloads.

          [env: APOLLO_CLIENT_TIMEOUT=]

      --registry-url <REGISTRY_URL>
          Override the GraphOS registry endpoint

          [env: APOLLO_REGISTRY_URL=]

      --telemetry-url <TELEMETRY_URL>
          Override the endpoint anonymous usage telemetry is reported to

          [env: APOLLO_TELEMETRY_URL=]

      --telemetry-disabled
          Opt out of anonymous usage telemetry.

          The `APOLLO_TELEMETRY_DISABLED` environment variable disables telemetry on any value it's set to, including `false` - this flag doesn't change that, it's just an additional way to opt out.

      --checks-timeout <CHECKS_TIMEOUT>
          Override how long check/launch polling waits (in whole seconds) before giving up

          [env: APOLLO_CHECKS_TIMEOUT_SECONDS=]

      --download-host <DOWNLOAD_HOST>
          Override the host plugin binaries (`router`, `supergraph`, and `apollo-mcp-server`) are downloaded from

          [env: APOLLO_ROVER_DOWNLOAD_HOST=]

      --vcs-remote-url <VCS_REMOTE_URL>
          Override the Git remote URL reported to GraphOS on check/publish.

          Defaults to the remote URL inferred from the current directory's Git repository.

          [env: APOLLO_VCS_REMOTE_URL=]

      --vcs-branch <VCS_BRANCH>
          Override the Git branch reported to GraphOS on check/publish.

          Defaults to the branch inferred from the current directory's Git repository.

          [env: APOLLO_VCS_BRANCH=]

      --vcs-commit <VCS_COMMIT>
          Override the Git commit reported to GraphOS on check/publish.

          Defaults to the commit inferred from the current directory's Git repository.

          [env: APOLLO_VCS_COMMIT=]

      --vcs-author <VCS_AUTHOR>
          Override the Git commit author reported to GraphOS on check/publish.

          Defaults to the author inferred from the current directory's Git repository.

          [env: APOLLO_VCS_AUTHOR=]

      --config-home <CONFIG_HOME>
          Override the location of Rover's config directory, where profiles live

          [env: APOLLO_CONFIG_HOME=]

      --rover-home <ROVER_HOME>
          Override the location Rover installs its binary and plugins to

          [env: APOLLO_HOME=]

      --skip-update-check
          Skip checking for newer versions of rover.

          Set the `APOLLO_ROVER_SKIP_UPDATE` environment variable (to `1` or `true`) to disable all of Rover's auto-updating at once — both this self-update check and the plugin auto-updates (`--skip-update`).

      --no-config-notices
          Suppress the notices Rover prints when a profile or the project file overrides a network destination, or when an environment variable overrides a value an explicitly selected profile or the project file also set.

          Set the `APOLLO_ROVER_NO_CONFIG_NOTICES` environment variable (to `1` or `true`) to suppress them the same way. Neither a profile nor a project file can suppress these notices - only this flag or its environment variable can.

      --oauth-authorization-url <AUTHORIZATION_URL>
          Override the OAuth authorization endpoint `rover auth login` uses

          [env: APOLLO_OAUTH_AUTHORIZATION_URL=]

      --oauth-token-url <TOKEN_URL>
          Override the OAuth token endpoint `rover auth login` and the client-credentials exchange (`APOLLO_CLIENT_ID`/`APOLLO_CLIENT_SECRET`) use

          [env: APOLLO_OAUTH_TOKEN_URL=]

      --oauth-whoami-url <WHOAMI_URL>
          Override the OAuth whoami/userinfo endpoint `rover auth whoami` uses

          [env: APOLLO_OAUTH_WHOAMI_URL=]

      --oauth-client-id <CLIENT_ID>
          Override the OAuth client ID `rover auth login` uses

          [env: APOLLO_OAUTH_CLIENT_ID=]

      --oauth-revocation-url <REVOCATION_URL>
          Override the OAuth revocation endpoint `rover auth logout` uses

          [env: APOLLO_OAUTH_REVOCATION_URL=]

      --oauth-device-authorization-url <DEVICE_AUTHORIZATION_URL>
          Override the OAuth device authorization endpoint `rover auth login --no-browser` uses

          [env: APOLLO_OAUTH_DEVICE_AUTHORIZATION_URL=]

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version



** Getting Started with Rover **

Run the following command to authenticate with GraphOS:

    $ rover config auth

Once you're authenticated, create a new graph:

    $ rover init

To learn more about Rover, view the full documentation:

    $ rover docs open
```

这回波是作为 [`cargo` 工作空间](https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html),包含若干相关项目:

-   `rover`: 阿波罗的GraphQL开发者生产力工具套件
-   [`houston`](https://github.com/apollographql/rover/tree/main/crates/houston): 配置漫游车的公用事业
-   [`robot-panic`](https://github.com/apollographql/rover/tree/main/crates/robot-panic): 叉线 [`rust-cli/human-panic`](https://github.com/rust-cli/human-panic) 按路虎调整
-   [`rover-client`](https://github.com/apollographql/rover/tree/main/crates/rover-client): 一个 HTTP 客户端,用于为 Rover 生成 GraphQL 请求
-   [`rover-graphql`](https://github.com/apollographql/rover/tree/main/crates/rover-graphql)页:1 [`tower`](https://docs.rs/tower/latest/tower/) 允许 GraphQL 请求的图层 \[`tower`HTTP 客户端
-   [`rover-http`](https://github.com/apollographql/rover/tree/main/crates/rover-http)页:1 [`tower`](https://docs.rs/tower/latest/tower/) 实施HTTP客户端和额外的HTTP请求公用事业
-   [`rover-std`](https://github.com/apollographql/rover/tree/main/crates/rover-std): 提供常见的公用事业,为Rover的CLI风格提供信息
-   [`rover-studio`](https://github.com/apollographql/rover/tree/main/crates/rover-studio)页:1 [`tower`](https://docs.rs/tower/latest/tower/) 为与阿波罗工作室通信提供必要的信头和设置的层
-   [`sputnik`](https://github.com/apollographql/rover/tree/main/crates/sputnik): 协助收集Rust CLI匿名数据的箱子
-   [`timber`](https://github.com/apollographql/rover/tree/main/crates/timber): 漫游者记录物

## 安装方法

截至Rover v0.39.1,下面列出的所有平台都执行不可变的放出标记. 这意味着您可以直接使用 SemVer 的 GitHub 发布、 Docker 图像或国家防范机制发布版本 保证文物不会改变。 注意 `curl | sh` 方法,虽然最终引用不可移动的 GitHub 发布二进制,但仍首先从网络服务下载 shell 脚本 并没有提供同样的不可改变性保障。 安全意识安装者应验证已下载的 shell 脚本匹配 [被钉住的文物 用于各自的"漫游"版本](https://github.com/apollographql-gh-actions/install-rover) 或使用下述不可改变的安装方法之一.

#### Linux 和 MacOS 数据 `curl | sh` 安装器

要安装 Rover 的最新版本 :

```bash
curl -sSL https://rover.apollo.dev/nix/latest | sh
```

要安装一个特定的Rover版本(注意 `v` 前缀版本编号 :

> 注:如果在CI环境中安装了Rover,阿波罗高度建议使用 [不可改变的多克图像](https://npmcn.com/package/%40apollo/rover/#readme-docker-images)) (中文(简体) ). 作为 GitHub 动作用户的替代品, 阿波罗 vends a [GitHub 动作](https://github.com/marketplace/actions/install-apollo-rover-cli) 它会给下载脚本的永久实例针入并安装本地二进制.

```bash
curl -sSL https://rover.apollo.dev/nix/v0.10.0 | sh
```

你会需要 `curl` 安装在您的系统中以运行上述安装命令。 您可以从 [卷曲下载页面](https://curl.se/download.html)。 。 。 .

> 说明: `rover supergraph compose` 目前无法为Alpine Linux 服务。 您可以追踪在阿尔卑斯山支持此命令的进展情况 [这个问题](https://github.com/apollographql/rover/issues/537)。 。 。 .

#### Windows PowerShell 安装器

```bash
iwr 'https://rover.apollo.dev/win/latest' | iex
```

要安装一个特定的Rover版本(注意 `v` 前缀版本编号 :

> 注意: 如果您在 Windows CI 环境中安装了 Rover, 您需要将 Docker 放到 Linux 模式中才能使用 [建议的不可移动多克图像](https://npmcn.com/package/%40apollo/rover/#readme-docker-images)) (中文(简体) ). 作为 GitHub 动作用户的替代品, 阿波罗 vends a [GitHub 动作](https://github.com/marketplace/actions/install-apollo-rover-cli) 以显示下载脚本的永久实例并安装本地二进制.

```bash
iwr 'https://rover.apollo.dev/win/v0.10.0' | iex
```

#### 嵌入图像

从0.39.1版本开始,漫游者Vends immunable Linux Docker 图像预建漫游者作为 CI 环境中消费的切入点 或者在Rover并非本地建造的平台上运行Rover. 在平台级别上,每个释放的活性标记都作为不可改变的 这样你就可以在不需要处理SHA接力的间接作用的情况下 找到你想要的Rover版本.

从 Dockerhub 直接安装 :

```bash
docker pull apollograph/rover:0.39.1
docker run apollograph/rover:0.39.1 <<args>>
```

或通过ghcr.io:

```bash
docker pull ghcr.io/apollographql/rover:0.39.1
docker run ghcr.io/apollographql/rover:0.39.1 <<args>>
```

所有支持从这些图像存储库引用图像的CI平台也可以直接这样做.

#### GitHub 动作

漫游者与一些GitHub行动, 以方便地引用您的CI管道中常见的漫游者命令。 它们可以在 [GitHub 的行动市场](https://github.com/marketplace?query=apollographql-gh-actions+Rover&type=actions)。 。 。 .

从Rover v0.39.1起,每次Rover的发布都对应一个不可改变的动作标记: `<action>@rover-<version>`。这允许您指定 准确的Rover版本 用于你的CI行动 不需要依赖SHA的定位来保证行动不可改变 这些行动 利用Rover在引擎盖下所显示的 Docker 形象 和沙盒的Rover 引用,只暴露在 `APOLLO_*` 环境变量 表面.

用于需要引用更古老版本的Rover或不能使用多克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克克, 遗产 `<action>@v1` 标记被保留下来,可以接受Rover版本作为输入.

他们的源代码被控制在这个寄存器中 `actions` 目录.

#### npm 安装器

Rover在npm上分发,以方便与您的JavaScript项目集成. Rover的节点依赖性将在可能时跟随LTS版本,除非出于安全考虑有理由提前升级. 虽然在已经处于节点生态系统的项目中提供这种安装方法是为了方便,但阿波罗不建议将其作为一种安装方法,否则它暴露了您 国家防范机制表面可能存在供应链攻击的装置。 阿波罗试图将罗弗的NPL安装脚本的依赖面降到最低,但它仍然代表了非零风险.

##### 依赖性安装

如果你想安装 `rover` 作为 `devDependency` 在您的 JavaScript 项目中,您可以运行 `npm i --save-dev @apollo/rover`。然后可以打电话 `rover` 直接在您的 `package.json` [脚本](https://docs.npmjs.com/cli/v6/using-npm/scripts),或者你可以运行 `npx rover` 在工程目录中执行命令.

注意直接通过 `npx install` 绕过锁文件(包括Rover的自有文件),因此就潜在的供应链风险而言,是风险最高的安装方法.

#### 土生土长

虽然阿波罗建议采用上述其他安装方法之一,但我们确实有家畜配方 `brew install rover`。这个食谱的代码在 [家庭骨干重播](https://github.com/Homebrew/homebrew-core/blob/master/Formula/r/rover.rb)。 。 。 .

#### 手动二进制下载

你也可以这样 [下载操作系统的二进制](https://github.com/apollographql/rover/releases) 并手动将其位置添加到您的 `PATH`。 。 。 .

##### 不支持的架构

如果你不看到你的CPU架构作为我们发布管道的一部分得到支持,并且不能使用多克图像,你可以从源代码构建 [`cargo`](https://github.com/rust-lang/cargo)。 。 。 . 砍下这回波,然后跑 `cargo xtask dist`。这将为您编译一个已发行的 Rover 版本,并将二进制放在您的 `target` 目录.

如果您想要特定的Rover版本,请在构建前检查各自的Git标签.

```
git clone https://github.com/apollographql/rover
cargo xtask dist
```

从这里可以把二进制放进你的 `PATH` 手动或运行 `./target/release/{optional_target}/rover install`。 。 。 .

## 捐款

见 [此页面](https://go.apollo.dev/r/contributing) 给罗弗提供情报.

## 许可证发放

该寄存器的源代码由(一) MIT相容许可证或(二) Elastic License 2.0所覆盖,在每种情况下,由子目录或文件标题内的许可证文件所指定. 整个寄存器的默认是MIT兼容许可证,除非子目录中的文件头或许可证文件指定了另一个许可证.

## 常见问题

### @apollo/rover 是什么？

罗弗是同阿波罗GraphQL注册公司合作的工具\.

### 如何安装 @apollo/rover？

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

### @apollo/rover 支持 TypeScript 吗？

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

### @apollo/rover 需要什么版本的 Node\.js？

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

### @apollo/rover 可以商用吗？

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

### @apollo/rover 的下载量有多少？

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

### @apollo/rover 还在维护吗？

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

