漫游者
这里是罗弗的故乡,是阿波罗系列GraphQL开发者生产力工具的新CLI.
说明
这个 README 里面只有足够信息 让你开始与罗弗。 我们 文档 包含更详细的信息,应该成为你对万事万事的主要参考.
使用量
与您的图表交互的几个有用的 Rover 命令 :
- 从联邦远程端点取出图表.
rover graph fetch test@cats
- 验证您最近对本地图所作的更改
rover graph check。 。 。 .
rover graph check --schema=./path-to-valid-sdl test@cats
- 将本地图表发布给阿波罗工作室.
rover graph publish --schema ./path-to-valid-schema test@cats
命令行选项
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 工作空间,包含若干相关项目:
rover: 阿波罗的GraphQL开发者生产力工具套件houston: 配置漫游车的公用事业robot-panic: 叉线rust-cli/human-panic按路虎调整rover-client: 一个 HTTP 客户端,用于为 Rover 生成 GraphQL 请求rover-graphql页:1tower允许 GraphQL 请求的图层 [towerHTTP 客户端rover-http页:1tower实施HTTP客户端和额外的HTTP请求公用事业rover-std: 提供常见的公用事业,为Rover的CLI风格提供信息rover-studio页:1tower为与阿波罗工作室通信提供必要的信头和设置的层sputnik: 协助收集Rust CLI匿名数据的箱子timber: 漫游者记录物
安装方法
截至Rover v0.39.1,下面列出的所有平台都执行不可变的放出标记. 这意味着您可以直接使用 SemVer 的 GitHub 发布、 Docker 图像或国家防范机制发布版本
保证文物不会改变。 注意 curl | sh 方法,虽然最终引用不可移动的 GitHub 发布二进制,但仍首先从网络服务下载 shell 脚本
并没有提供同样的不可改变性保障。 安全意识安装者应验证已下载的 shell 脚本匹配
被钉住的文物 用于各自的"漫游"版本 或使用下述不可改变的安装方法之一.
Linux 和 MacOS 数据 curl | sh 安装器
要安装 Rover 的最新版本 :
curl -sSL https://rover.apollo.dev/nix/latest | sh
要安装一个特定的Rover版本(注意 v 前缀版本编号 :
注:如果在CI环境中安装了Rover,阿波罗高度建议使用 不可改变的多克图像) (中文(简体) ). 作为 GitHub 动作用户的替代品, 阿波罗 vends a GitHub 动作 它会给下载脚本的永久实例针入并安装本地二进制.
curl -sSL https://rover.apollo.dev/nix/v0.10.0 | sh
你会需要 curl 安装在您的系统中以运行上述安装命令。 您可以从 卷曲下载页面。 。 。 .
说明:
rover supergraph compose目前无法为Alpine Linux 服务。 您可以追踪在阿尔卑斯山支持此命令的进展情况 这个问题。 。 。 .
Windows PowerShell 安装器
iwr 'https://rover.apollo.dev/win/latest' | iex
要安装一个特定的Rover版本(注意 v 前缀版本编号 :
注意: 如果您在 Windows CI 环境中安装了 Rover, 您需要将 Docker 放到 Linux 模式中才能使用 建议的不可移动多克图像) (中文(简体) ). 作为 GitHub 动作用户的替代品, 阿波罗 vends a GitHub 动作 以显示下载脚本的永久实例并安装本地二进制.
iwr 'https://rover.apollo.dev/win/v0.10.0' | iex
嵌入图像
从0.39.1版本开始,漫游者Vends immunable Linux Docker 图像预建漫游者作为 CI 环境中消费的切入点 或者在Rover并非本地建造的平台上运行Rover. 在平台级别上,每个释放的活性标记都作为不可改变的 这样你就可以在不需要处理SHA接力的间接作用的情况下 找到你想要的Rover版本.
从 Dockerhub 直接安装 :
docker pull apollograph/rover:0.39.1
docker run apollograph/rover:0.39.1 <<args>>
或通过ghcr.io:
docker pull ghcr.io/apollographql/rover:0.39.1
docker run ghcr.io/apollographql/rover:0.39.1 <<args>>
所有支持从这些图像存储库引用图像的CI平台也可以直接这样做.
GitHub 动作
漫游者与一些GitHub行动, 以方便地引用您的CI管道中常见的漫游者命令。 它们可以在 GitHub 的行动市场。 。 。 .
从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 脚本,或者你可以运行 npx rover 在工程目录中执行命令.
注意直接通过 npx install 绕过锁文件(包括Rover的自有文件),因此就潜在的供应链风险而言,是风险最高的安装方法.
土生土长
虽然阿波罗建议采用上述其他安装方法之一,但我们确实有家畜配方 brew install rover。这个食谱的代码在 家庭骨干重播。 。 。 .
手动二进制下载
你也可以这样 下载操作系统的二进制 并手动将其位置添加到您的 PATH。 。 。 .
不支持的架构
如果你不看到你的CPU架构作为我们发布管道的一部分得到支持,并且不能使用多克图像,你可以从源代码构建 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。 。 。 .
捐款
见 此页面 给罗弗提供情报.
许可证发放
该寄存器的源代码由(一) MIT相容许可证或(二) Elastic License 2.0所覆盖,在每种情况下,由子目录或文件标题内的许可证文件所指定. 整个寄存器的默认是MIT兼容许可证,除非子目录中的文件头或许可证文件指定了另一个许可证.