# 使用 Homebrew 安装 graphql-cli

查看 graphql-cli 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:graphql-cli
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install graphql-cli
```

  证据: local Homebrew formula metadata

## 软件包事实

- **软件包键:** brew:graphql-cli
- **软件包管理器:** Homebrew
- **版本:** 4.1.0
- **来源摘要:** Command-line tool for common GraphQL development workflows
- **主页:** <https://github.com/Urigo/graphql-cli>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- graphql (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 4.1.0
## 项目历史与用法

GraphQL CLI is a Node-based command-line tool for common GraphQL development workflows. It wraps project initialization, GraphQL Config, plugin commands, schema handling, code generation, and related GraphQL ecosystem tools behind the `graphql` command.

### 项目历史

The package originated in the Prisma/Graphcool-era GraphQL tooling ecosystem and later moved into The Guild's maintenance orbit along with graphql-config, graphql-import, and graphql-binding. Prisma's handoff announcement explicitly named graphql-cli among the libraries transferred to The Guild.

The Guild then rebooted GraphQL CLI as an extensible, plugin-oriented tool. The project documentation for version 4 describes a restructured setup based around `.graphqlrc.yml`, a unified GraphQL Config file, and per-command packages.

### 采用历史

GraphQL CLI's adoption was tied to the JavaScript GraphQL ecosystem's need for a single command that could initialize projects, read schemas and documents, run code generation, and host schema-inspection workflows.

Version 4.0 changed the configuration model from older `.graphqlconfig` and endpoint/schemaPath assumptions toward `.graphqlrc.yml` and the newer GraphQL Config shape. Version 4.1 added starter-template improvements and stronger integration with GraphQL Code Generator and GraphQL Inspector.

### 使用方式

The main command is `graphql`. Users initialize a project with `graphql init` or `npx graphql-cli init`, then keep schema and document paths in `.graphqlrc.yml`.

The plugin model lets commands such as code generation live in separate packages and read the same GraphQL Config. The migration guide is important for older users because it documents removed commands and changed configuration names.

### 为什么软件包爱好者会关心

GraphQL CLI is a snapshot of a specific GraphQL tooling moment: Prisma-era tools, The Guild maintenance, GraphQL Config standardization, and an attempt to make a single extensible CLI sit above many competing GraphQL stacks.

For package maintainers, it is notable as a Homebrew formula for a Node CLI whose upstream ecosystem also expects npm or yarn global installation. That split often exposes how JavaScript CLIs move between language package managers and system package managers.

### 时间线

- 2019: Prisma announced transfer of graphql-cli and related libraries to The Guild.
- 2019: The Guild described a rewritten, extensible GraphQL CLI.
- 2020: GraphQL CLI 4.0 was released with a restructured project setup.
- 2020: GraphQL CLI 4.1 added template and ecosystem-tooling integration improvements.

### Related projects

- GraphQL Config supplies the configuration model used by GraphQL CLI.
- GraphQL Code Generator and GraphQL Inspector are explicitly integrated into the GraphQL CLI 4.1 workflow.
- Prisma, GraphQL Import, and GraphQL Binding are part of the same historical handoff described by Prisma and The Guild.

### 来源

- <https://github.com/Urigo/graphql-cli>
- <https://github.com/Urigo/graphql-cli/blob/master/README.md>
- <https://github.com/Urigo/graphql-cli/blob/master/docs/MIGRATION.md>
- <https://github.com/Urigo/graphql-cli/releases>
- <https://the-guild.dev/graphql/hive/blog/graphql-cli-is-back>
- <https://the-guild.dev/graphql/hive/blog/whats-new-in-graphql-cli-4.1.0>
- <https://www.prisma.io/blog/the-guild-takes-over-oss-libraries-vvluy2i4uevs>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: .graphqlrc.yml

## Combined YAML source

View the package source record on GitHub. [combined/graphql-cli.yml](https://github.com/mxcl/pkgdb/blob/main/combined/graphql-cli.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- cross-ecosystem install command graph
