2023-03-08 09:17:43 +00:00
|
|
|
# Hive CLI (Command Line Interface)
|
2022-05-18 07:26:57 +00:00
|
|
|
|
2024-11-29 09:47:51 +00:00
|
|
|
[Hive](https://the-guild.dev/graphql/hive) is a fully open-source schema registry, analytics,
|
|
|
|
|
metrics and gateway for [GraphQL federation](https://the-guild.dev/graphql/hive/federation) and
|
|
|
|
|
other GraphQL APIs.
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
A CLI util to manage and control your Hive.
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
[](https://npmjs.org/package/@graphql-hive/cli)
|
|
|
|
|
|
2023-03-08 09:17:43 +00:00
|
|
|
## Installation
|
2022-05-18 07:26:57 +00:00
|
|
|
|
2023-03-08 09:17:43 +00:00
|
|
|
### NodeJS
|
2022-05-18 07:26:57 +00:00
|
|
|
|
2023-03-08 09:17:43 +00:00
|
|
|
If you are running a JavaScript/NodeJS project, you can install Hive CLI from the `npm` registry:
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
```
|
2023-03-08 09:17:43 +00:00
|
|
|
pnpm install -D @graphql-hive/cli
|
|
|
|
|
yarn add -D @graphql-hive/cli
|
|
|
|
|
npm install -D @graphql-hive/cli
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
> We recommend installing Hive CLI as part of your project, under `devDependencies`, instead of
|
|
|
|
|
> using a global installation.
|
|
|
|
|
|
|
|
|
|
### Binary
|
2022-05-18 07:26:57 +00:00
|
|
|
|
2023-03-08 09:17:43 +00:00
|
|
|
If you are running a non-JavaScript project, you can download the prebuilt binary of Hive CLI using
|
|
|
|
|
the following command:
|
2022-05-18 07:26:57 +00:00
|
|
|
|
2023-03-08 09:17:43 +00:00
|
|
|
```bash
|
|
|
|
|
curl -sSL https://graphql-hive.com/install.sh | sh
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Commands
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
<!-- commands -->
|
|
|
|
|
|
2024-08-13 10:15:46 +00:00
|
|
|
- [`hive app:create FILE`](#hive-appcreate-file)
|
|
|
|
|
- [`hive app:publish`](#hive-apppublish)
|
2023-04-20 13:21:06 +00:00
|
|
|
- [`hive artifact:fetch`](#hive-artifactfetch)
|
2022-05-18 07:26:57 +00:00
|
|
|
- [`hive config:delete KEY`](#hive-configdelete-key)
|
|
|
|
|
- [`hive config:get KEY`](#hive-configget-key)
|
|
|
|
|
- [`hive config:reset`](#hive-configreset)
|
|
|
|
|
- [`hive config:set KEY VALUE`](#hive-configset-key-value)
|
2024-04-04 07:18:57 +00:00
|
|
|
- [`hive dev`](#hive-dev)
|
2024-05-23 09:33:53 +00:00
|
|
|
- [`hive help [COMMAND]`](#hive-help-command)
|
2023-08-03 09:24:40 +00:00
|
|
|
- [`hive introspect LOCATION`](#hive-introspect-location)
|
2022-05-18 07:26:57 +00:00
|
|
|
- [`hive operations:check FILE`](#hive-operationscheck-file)
|
|
|
|
|
- [`hive schema:check FILE`](#hive-schemacheck-file)
|
2023-02-07 16:19:07 +00:00
|
|
|
- [`hive schema:delete SERVICE`](#hive-schemadelete-service)
|
2023-08-25 10:09:22 +00:00
|
|
|
- [`hive schema:fetch ACTIONID`](#hive-schemafetch-actionid)
|
2022-05-18 07:26:57 +00:00
|
|
|
- [`hive schema:publish FILE`](#hive-schemapublish-file)
|
|
|
|
|
- [`hive update [CHANNEL]`](#hive-update-channel)
|
|
|
|
|
- [`hive whoami`](#hive-whoami)
|
|
|
|
|
|
2024-08-13 10:15:46 +00:00
|
|
|
## `hive app:create FILE`
|
|
|
|
|
|
|
|
|
|
create an app deployment
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
USAGE
|
|
|
|
|
$ hive app:create FILE --name <value> --version <value> [--registry.endpoint <value>] [--registry.accessToken
|
|
|
|
|
<value>]
|
|
|
|
|
|
|
|
|
|
ARGUMENTS
|
|
|
|
|
FILE Path to the persisted operations mapping.
|
|
|
|
|
|
|
|
|
|
FLAGS
|
|
|
|
|
--name=<value> (required) app name
|
|
|
|
|
--registry.accessToken=<value> registry access token
|
|
|
|
|
--registry.endpoint=<value> registry endpoint
|
|
|
|
|
--version=<value> (required) app version
|
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
|
create an app deployment
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
_See code:
|
2024-10-14 14:36:45 +00:00
|
|
|
[dist/commands/app/create.js](https://github.com/graphql-hive/platform/blob/v0.37.0/dist/commands/app/create.js)_
|
2024-08-13 10:15:46 +00:00
|
|
|
|
|
|
|
|
## `hive app:publish`
|
|
|
|
|
|
|
|
|
|
publish an app deployment
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
USAGE
|
|
|
|
|
$ hive app:publish --name <value> --version <value> [--registry.endpoint <value>] [--registry.accessToken
|
|
|
|
|
<value>]
|
|
|
|
|
|
|
|
|
|
FLAGS
|
|
|
|
|
--name=<value> (required) app name
|
|
|
|
|
--registry.accessToken=<value> registry access token
|
|
|
|
|
--registry.endpoint=<value> registry endpoint
|
|
|
|
|
--version=<value> (required) app version
|
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
|
publish an app deployment
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
_See code:
|
2024-10-14 14:36:45 +00:00
|
|
|
[dist/commands/app/publish.js](https://github.com/graphql-hive/platform/blob/v0.37.0/dist/commands/app/publish.js)_
|
2024-08-13 10:15:46 +00:00
|
|
|
|
2023-04-20 13:21:06 +00:00
|
|
|
## `hive artifact:fetch`
|
|
|
|
|
|
|
|
|
|
fetch artifacts from the CDN
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
USAGE
|
|
|
|
|
$ hive artifact:fetch --artifact sdl|supergraph|metadata|services|sdl.graphql|sdl.graphqls [--cdn.endpoint
|
|
|
|
|
<value>] [--cdn.accessToken <value>] [--outputFile <value>]
|
|
|
|
|
|
|
|
|
|
FLAGS
|
2023-06-27 19:25:49 +00:00
|
|
|
--artifact=<option> (required) artifact to fetch (Note: supergraph is only available for federation projects)
|
|
|
|
|
<options: sdl|supergraph|metadata|services|sdl.graphql|sdl.graphqls>
|
|
|
|
|
--cdn.accessToken=<value> CDN access token
|
|
|
|
|
--cdn.endpoint=<value> CDN endpoint
|
|
|
|
|
--outputFile=<value> whether to write to a file instead of stdout
|
2023-04-20 13:21:06 +00:00
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
|
fetch artifacts from the CDN
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
_See code:
|
2024-10-14 14:36:45 +00:00
|
|
|
[dist/commands/artifact/fetch.js](https://github.com/graphql-hive/platform/blob/v0.37.0/dist/commands/artifact/fetch.js)_
|
2023-04-20 13:21:06 +00:00
|
|
|
|
2022-05-18 07:26:57 +00:00
|
|
|
## `hive config:delete KEY`
|
|
|
|
|
|
|
|
|
|
deletes specific cli configuration
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
USAGE
|
2023-03-08 09:17:43 +00:00
|
|
|
$ hive config:delete KEY
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
ARGUMENTS
|
|
|
|
|
KEY config key
|
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
|
deletes specific cli configuration
|
|
|
|
|
```
|
|
|
|
|
|
2022-11-24 10:00:41 +00:00
|
|
|
_See code:
|
2024-10-14 14:36:45 +00:00
|
|
|
[dist/commands/config/delete.js](https://github.com/graphql-hive/platform/blob/v0.37.0/dist/commands/config/delete.js)_
|
2022-08-16 10:10:55 +00:00
|
|
|
|
2022-05-18 07:26:57 +00:00
|
|
|
## `hive config:get KEY`
|
|
|
|
|
|
|
|
|
|
prints specific cli configuration
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
USAGE
|
2023-03-08 09:17:43 +00:00
|
|
|
$ hive config:get KEY
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
ARGUMENTS
|
2023-06-27 19:25:49 +00:00
|
|
|
KEY (registry|cdn) config key
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
|
prints specific cli configuration
|
|
|
|
|
```
|
|
|
|
|
|
2022-11-24 10:00:41 +00:00
|
|
|
_See code:
|
2024-10-14 14:36:45 +00:00
|
|
|
[dist/commands/config/get.js](https://github.com/graphql-hive/platform/blob/v0.37.0/dist/commands/config/get.js)_
|
2022-08-16 10:10:55 +00:00
|
|
|
|
2022-05-18 07:26:57 +00:00
|
|
|
## `hive config:reset`
|
|
|
|
|
|
|
|
|
|
resets local cli configuration
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
USAGE
|
|
|
|
|
$ hive config:reset
|
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
|
resets local cli configuration
|
|
|
|
|
```
|
|
|
|
|
|
2022-11-24 10:00:41 +00:00
|
|
|
_See code:
|
2024-10-14 14:36:45 +00:00
|
|
|
[dist/commands/config/reset.js](https://github.com/graphql-hive/platform/blob/v0.37.0/dist/commands/config/reset.js)_
|
2022-08-16 10:10:55 +00:00
|
|
|
|
2022-05-18 07:26:57 +00:00
|
|
|
## `hive config:set KEY VALUE`
|
|
|
|
|
|
|
|
|
|
updates specific cli configuration
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
USAGE
|
2023-03-08 09:17:43 +00:00
|
|
|
$ hive config:set KEY VALUE
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
ARGUMENTS
|
2023-06-27 19:25:49 +00:00
|
|
|
KEY (registry|cdn) config key
|
2022-05-18 07:26:57 +00:00
|
|
|
VALUE config value
|
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
|
updates specific cli configuration
|
|
|
|
|
```
|
|
|
|
|
|
2022-11-24 10:00:41 +00:00
|
|
|
_See code:
|
2024-10-14 14:36:45 +00:00
|
|
|
[dist/commands/config/set.js](https://github.com/graphql-hive/platform/blob/v0.37.0/dist/commands/config/set.js)_
|
2024-04-04 07:18:57 +00:00
|
|
|
|
|
|
|
|
## `hive dev`
|
|
|
|
|
|
2024-05-23 09:33:53 +00:00
|
|
|
Develop and compose Supergraph with service substitution
|
2024-04-04 07:18:57 +00:00
|
|
|
|
|
|
|
|
```
|
|
|
|
|
USAGE
|
2024-05-23 09:33:53 +00:00
|
|
|
$ hive dev (--url <value> --service <value>) [--registry.endpoint <value>] [--registry <value>]
|
|
|
|
|
[--registry.accessToken <value>] [--token <value>] [--schema <value> ] [--watch] [--watchInterval <value>] [--write
|
|
|
|
|
<value>]
|
2024-04-04 07:18:57 +00:00
|
|
|
|
|
|
|
|
FLAGS
|
2024-05-23 09:33:53 +00:00
|
|
|
--registry=<value> registry address
|
2024-04-04 07:18:57 +00:00
|
|
|
--registry.accessToken=<value> registry access token
|
|
|
|
|
--registry.endpoint=<value> registry endpoint
|
|
|
|
|
--schema=<filepath>... Service sdl. If not provided, will be introspected from the service
|
|
|
|
|
--service=<string>... (required) Service name
|
2024-05-23 09:33:53 +00:00
|
|
|
--token=<value> api token
|
2024-04-04 07:18:57 +00:00
|
|
|
--url=<address>... (required) Service url
|
|
|
|
|
--watch Watch mode
|
|
|
|
|
--watchInterval=<value> [default: 1000] Watch interval in milliseconds
|
|
|
|
|
--write=<value> [default: supergraph.graphql] Where to save the supergraph schema file
|
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
2024-05-23 09:33:53 +00:00
|
|
|
Develop and compose Supergraph with service substitution
|
|
|
|
|
Only available for Federation projects.
|
|
|
|
|
Work in Progress: Please note that this command is still under development and may undergo changes in future releases
|
2024-04-04 07:18:57 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
_See code:
|
2024-10-14 14:36:45 +00:00
|
|
|
[dist/commands/dev.js](https://github.com/graphql-hive/platform/blob/v0.37.0/dist/commands/dev.js)_
|
2022-08-16 10:10:55 +00:00
|
|
|
|
2024-05-23 09:33:53 +00:00
|
|
|
## `hive help [COMMAND]`
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
Display help for hive.
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
USAGE
|
2024-05-23 09:33:53 +00:00
|
|
|
$ hive help [COMMAND...] [-n]
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
ARGUMENTS
|
2024-05-23 09:33:53 +00:00
|
|
|
COMMAND... Command to show help for.
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
FLAGS
|
|
|
|
|
-n, --nested-commands Include all nested commands in the output.
|
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
|
Display help for hive.
|
|
|
|
|
```
|
|
|
|
|
|
2022-11-24 10:00:41 +00:00
|
|
|
_See code:
|
2024-05-23 09:33:53 +00:00
|
|
|
[@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.0.22/src/commands/help.ts)_
|
2022-05-18 07:26:57 +00:00
|
|
|
|
2023-08-03 09:24:40 +00:00
|
|
|
## `hive introspect LOCATION`
|
2022-05-18 07:26:57 +00:00
|
|
|
|
2023-08-03 09:24:40 +00:00
|
|
|
introspects a GraphQL Schema
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
```
|
|
|
|
|
USAGE
|
2023-08-03 09:24:40 +00:00
|
|
|
$ hive introspect LOCATION [--write <value>] [--header <value>]
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
ARGUMENTS
|
2023-08-03 09:24:40 +00:00
|
|
|
LOCATION GraphQL Schema location (URL or file path/glob)
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
FLAGS
|
2023-08-03 09:24:40 +00:00
|
|
|
--header=<value>... HTTP header to add to the introspection request (in key:value format)
|
|
|
|
|
--write=<value> Write to a file (possible extensions: .graphql, .gql, .gqls, .graphqls, .json)
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
DESCRIPTION
|
2023-08-03 09:24:40 +00:00
|
|
|
introspects a GraphQL Schema
|
2022-05-18 07:26:57 +00:00
|
|
|
```
|
|
|
|
|
|
2022-11-24 10:00:41 +00:00
|
|
|
_See code:
|
2024-10-14 14:36:45 +00:00
|
|
|
[dist/commands/introspect.js](https://github.com/graphql-hive/platform/blob/v0.37.0/dist/commands/introspect.js)_
|
2022-08-16 10:10:55 +00:00
|
|
|
|
2023-08-03 09:24:40 +00:00
|
|
|
## `hive operations:check FILE`
|
2022-05-18 07:26:57 +00:00
|
|
|
|
2023-08-03 09:24:40 +00:00
|
|
|
checks operations against a published schema
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
```
|
|
|
|
|
USAGE
|
2023-08-03 09:24:40 +00:00
|
|
|
$ hive operations:check FILE [--registry.endpoint <value>] [--registry <value>] [--registry.accessToken <value>]
|
2024-01-19 13:35:52 +00:00
|
|
|
[--token <value>] [--require <value>] [--graphqlTag <value>] [--globalGraphqlTag <value>] [--apolloClient]
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
ARGUMENTS
|
|
|
|
|
FILE Glob pattern to find the operations
|
|
|
|
|
|
|
|
|
|
FLAGS
|
2024-01-19 13:35:52 +00:00
|
|
|
--apolloClient
|
|
|
|
|
Supports Apollo Client specific directives
|
|
|
|
|
|
2023-08-25 10:09:22 +00:00
|
|
|
--globalGraphqlTag=<value>...
|
|
|
|
|
Allows to use a global identifier instead of a module import. Similar to --graphqlTag.
|
|
|
|
|
Examples:
|
|
|
|
|
--globalGraphqlTag gql (Supports: export const meQuery = gql`{ me { id } }`)
|
|
|
|
|
--globalGraphqlTag graphql (Supports: export const meQuery = graphql`{ me { id } }`)
|
|
|
|
|
|
|
|
|
|
--graphqlTag=<value>...
|
|
|
|
|
Identify template literals containing GraphQL queries in JavaScript/TypeScript code. Supports multiple values.
|
|
|
|
|
Examples:
|
|
|
|
|
--graphqlTag graphql-tag (Equivalent to: import gqlTagFunction from "graphql-tag")
|
|
|
|
|
--graphqlTag graphql:react-relay (Equivalent to: import { graphql } from "react-relay")
|
|
|
|
|
|
|
|
|
|
--registry=<value>
|
|
|
|
|
registry address
|
|
|
|
|
|
|
|
|
|
--registry.accessToken=<value>
|
|
|
|
|
registry access token
|
|
|
|
|
|
|
|
|
|
--registry.endpoint=<value>
|
|
|
|
|
registry endpoint
|
|
|
|
|
|
|
|
|
|
--require=<value>...
|
|
|
|
|
[default: ] Loads specific require.extensions before running the command
|
|
|
|
|
|
|
|
|
|
--token=<value>
|
|
|
|
|
api token
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
DESCRIPTION
|
2023-08-03 09:24:40 +00:00
|
|
|
checks operations against a published schema
|
2022-05-18 07:26:57 +00:00
|
|
|
```
|
|
|
|
|
|
2022-11-24 10:00:41 +00:00
|
|
|
_See code:
|
2024-10-14 14:36:45 +00:00
|
|
|
[dist/commands/operations/check.js](https://github.com/graphql-hive/platform/blob/v0.37.0/dist/commands/operations/check.js)_
|
2022-08-16 10:10:55 +00:00
|
|
|
|
2022-05-18 07:26:57 +00:00
|
|
|
## `hive schema:check FILE`
|
|
|
|
|
|
|
|
|
|
checks schema
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
USAGE
|
2023-04-20 13:21:06 +00:00
|
|
|
$ hive schema:check FILE [--service <value>] [--registry.endpoint <value>] [--registry <value>]
|
2023-08-03 09:24:40 +00:00
|
|
|
[--registry.accessToken <value>] [--token <value>] [--forceSafe] [--github] [--require <value>] [--author <value>]
|
2024-01-19 13:35:52 +00:00
|
|
|
[--commit <value>] [--contextId <value>]
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
ARGUMENTS
|
|
|
|
|
FILE Path to the schema file(s)
|
|
|
|
|
|
|
|
|
|
FLAGS
|
2023-08-03 09:24:40 +00:00
|
|
|
--author=<value> Author of the change
|
|
|
|
|
--commit=<value> Associated commit sha
|
2024-01-19 13:35:52 +00:00
|
|
|
--contextId=<value> Context ID for grouping the schema check.
|
2023-04-20 13:21:06 +00:00
|
|
|
--forceSafe mark the check as safe, breaking changes are expected
|
|
|
|
|
--github Connect with GitHub Application
|
|
|
|
|
--registry=<value> registry address
|
|
|
|
|
--registry.accessToken=<value> registry access token
|
|
|
|
|
--registry.endpoint=<value> registry endpoint
|
|
|
|
|
--require=<value>... [default: ] Loads specific require.extensions before running the codegen and reading
|
|
|
|
|
the configuration
|
|
|
|
|
--service=<value> service name (only for distributed schemas)
|
|
|
|
|
--token=<value> api token
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
|
checks schema
|
|
|
|
|
```
|
|
|
|
|
|
2022-11-24 10:00:41 +00:00
|
|
|
_See code:
|
2024-10-14 14:36:45 +00:00
|
|
|
[dist/commands/schema/check.js](https://github.com/graphql-hive/platform/blob/v0.37.0/dist/commands/schema/check.js)_
|
2023-02-07 16:19:07 +00:00
|
|
|
|
|
|
|
|
## `hive schema:delete SERVICE`
|
|
|
|
|
|
|
|
|
|
deletes a schema
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
USAGE
|
2023-04-20 13:21:06 +00:00
|
|
|
$ hive schema:delete SERVICE [--registry.endpoint <value>] [--registry <value>] [--registry.accessToken <value>]
|
|
|
|
|
[--token <value>] [--dryRun] [--confirm]
|
2023-02-07 16:19:07 +00:00
|
|
|
|
|
|
|
|
ARGUMENTS
|
|
|
|
|
SERVICE name of the service
|
|
|
|
|
|
|
|
|
|
FLAGS
|
2023-04-20 10:34:57 +00:00
|
|
|
--confirm Confirm deletion of the service
|
|
|
|
|
--dryRun Does not delete the service, only reports what it would have done.
|
2023-04-20 13:21:06 +00:00
|
|
|
--registry=<value> registry address
|
|
|
|
|
--registry.accessToken=<value> registry access token
|
|
|
|
|
--registry.endpoint=<value> registry endpoint
|
|
|
|
|
--token=<value> api token
|
2023-02-07 16:19:07 +00:00
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
|
deletes a schema
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
_See code:
|
2024-10-14 14:36:45 +00:00
|
|
|
[dist/commands/schema/delete.js](https://github.com/graphql-hive/platform/blob/v0.37.0/dist/commands/schema/delete.js)_
|
2023-08-25 10:09:22 +00:00
|
|
|
|
|
|
|
|
## `hive schema:fetch ACTIONID`
|
|
|
|
|
|
2025-01-08 12:16:55 +00:00
|
|
|
fetch a schema, supergraph, or list of subgraphs from the Hive API
|
2023-08-25 10:09:22 +00:00
|
|
|
|
|
|
|
|
```
|
|
|
|
|
USAGE
|
|
|
|
|
$ hive schema:fetch ACTIONID [--registry <value>] [--token <value>] [--registry.endpoint <value>]
|
|
|
|
|
[--registry.accessToken <value>] [--type <value>] [--write <value>] [--outputFile <value>]
|
|
|
|
|
|
|
|
|
|
ARGUMENTS
|
|
|
|
|
ACTIONID action id (e.g. commit sha)
|
|
|
|
|
|
|
|
|
|
FLAGS
|
|
|
|
|
--outputFile=<value> whether to write to a file instead of stdout
|
|
|
|
|
--registry=<value> registry address
|
|
|
|
|
--registry.accessToken=<value> registry access token
|
|
|
|
|
--registry.endpoint=<value> registry endpoint
|
|
|
|
|
--token=<value> api token
|
2025-01-08 12:16:55 +00:00
|
|
|
--type=<value> Type to fetch (possible types: sdl, supergraph, subgraphs)
|
2023-08-25 10:09:22 +00:00
|
|
|
--write=<value> Write to a file (possible extensions: .graphql, .gql, .gqls, .graphqls)
|
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
2025-01-08 12:16:55 +00:00
|
|
|
fetch a schema, supergraph, or list of subgraphs from the Hive API
|
2023-08-25 10:09:22 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
_See code:
|
2024-10-14 14:36:45 +00:00
|
|
|
[dist/commands/schema/fetch.js](https://github.com/graphql-hive/platform/blob/v0.37.0/dist/commands/schema/fetch.js)_
|
2022-08-16 10:10:55 +00:00
|
|
|
|
2022-05-18 07:26:57 +00:00
|
|
|
## `hive schema:publish FILE`
|
|
|
|
|
|
|
|
|
|
publishes schema
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
USAGE
|
2023-04-20 10:34:57 +00:00
|
|
|
$ hive schema:publish FILE [--service <value>] [--url <value>] [--metadata <value>] [--registry.endpoint <value>]
|
2023-04-20 13:21:06 +00:00
|
|
|
[--registry <value>] [--registry.accessToken <value>] [--token <value>] [--author <value>] [--commit <value>]
|
|
|
|
|
[--github] [--force] [--experimental_acceptBreakingChanges] [--require <value>]
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
ARGUMENTS
|
|
|
|
|
FILE Path to the schema file(s)
|
|
|
|
|
|
|
|
|
|
FLAGS
|
2022-11-10 15:07:39 +00:00
|
|
|
--author=<value> author of the change
|
|
|
|
|
--commit=<value> associated commit sha
|
|
|
|
|
--experimental_acceptBreakingChanges (experimental) accept breaking changes and mark schema as valid (only if
|
|
|
|
|
composable)
|
|
|
|
|
--force force publish even on breaking changes
|
|
|
|
|
--github Connect with GitHub Application
|
|
|
|
|
--metadata=<value> additional metadata to attach to the GraphQL schema. This can be a string with a
|
|
|
|
|
valid JSON, or a path to a file containing a valid JSON
|
2023-04-20 13:21:06 +00:00
|
|
|
--registry=<value> registry address
|
|
|
|
|
--registry.accessToken=<value> registry access token
|
|
|
|
|
--registry.endpoint=<value> registry endpoint
|
2022-11-10 15:07:39 +00:00
|
|
|
--require=<value>... [default: ] Loads specific require.extensions before running the codegen and
|
|
|
|
|
reading the configuration
|
|
|
|
|
--service=<value> service name (only for distributed schemas)
|
2023-04-20 13:21:06 +00:00
|
|
|
--token=<value> api token
|
2022-11-10 15:07:39 +00:00
|
|
|
--url=<value> service url (only for distributed schemas)
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
|
publishes schema
|
|
|
|
|
```
|
|
|
|
|
|
2022-11-24 10:00:41 +00:00
|
|
|
_See code:
|
2024-10-14 14:36:45 +00:00
|
|
|
[dist/commands/schema/publish.js](https://github.com/graphql-hive/platform/blob/v0.37.0/dist/commands/schema/publish.js)_
|
2022-08-16 10:10:55 +00:00
|
|
|
|
2022-05-18 07:26:57 +00:00
|
|
|
## `hive update [CHANNEL]`
|
|
|
|
|
|
|
|
|
|
update the hive CLI
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
USAGE
|
2024-05-23 09:33:53 +00:00
|
|
|
$ hive update [CHANNEL] [-a] [--force] [-i | -v <value>]
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
FLAGS
|
2024-05-23 09:33:53 +00:00
|
|
|
-a, --available See available versions.
|
2022-05-18 07:26:57 +00:00
|
|
|
-i, --interactive Interactively select version to install. This is ignored if a channel is provided.
|
|
|
|
|
-v, --version=<value> Install a specific version.
|
2024-05-23 09:33:53 +00:00
|
|
|
--force Force a re-download of the requested version.
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
|
update the hive CLI
|
|
|
|
|
|
|
|
|
|
EXAMPLES
|
|
|
|
|
Update to the stable channel:
|
|
|
|
|
|
|
|
|
|
$ hive update stable
|
|
|
|
|
|
|
|
|
|
Update to a specific version:
|
|
|
|
|
|
|
|
|
|
$ hive update --version 1.0.0
|
|
|
|
|
|
|
|
|
|
Interactively select version:
|
|
|
|
|
|
|
|
|
|
$ hive update --interactive
|
|
|
|
|
|
|
|
|
|
See available versions:
|
|
|
|
|
|
|
|
|
|
$ hive update --available
|
|
|
|
|
```
|
|
|
|
|
|
2022-11-24 10:00:41 +00:00
|
|
|
_See code:
|
2024-05-23 09:33:53 +00:00
|
|
|
[@oclif/plugin-update](https://github.com/oclif/plugin-update/blob/v4.2.13/src/commands/update.ts)_
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
## `hive whoami`
|
|
|
|
|
|
2023-02-07 16:19:07 +00:00
|
|
|
shows information about the current token
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
```
|
|
|
|
|
USAGE
|
2023-04-20 13:21:06 +00:00
|
|
|
$ hive whoami [--registry.endpoint <value>] [--registry <value>] [--registry.accessToken <value>] [--token
|
|
|
|
|
<value>]
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
FLAGS
|
2023-04-20 13:21:06 +00:00
|
|
|
--registry=<value> registry address
|
|
|
|
|
--registry.accessToken=<value> registry access token
|
|
|
|
|
--registry.endpoint=<value> registry endpoint
|
|
|
|
|
--token=<value> api token
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
DESCRIPTION
|
2023-02-07 16:19:07 +00:00
|
|
|
shows information about the current token
|
2022-05-18 07:26:57 +00:00
|
|
|
```
|
|
|
|
|
|
2022-11-24 10:00:41 +00:00
|
|
|
_See code:
|
2024-10-14 14:36:45 +00:00
|
|
|
[dist/commands/whoami.js](https://github.com/graphql-hive/platform/blob/v0.37.0/dist/commands/whoami.js)_
|
2022-08-16 10:10:55 +00:00
|
|
|
|
2022-05-18 07:26:57 +00:00
|
|
|
<!-- commandsstop -->
|
|
|
|
|
|
2023-03-08 09:17:43 +00:00
|
|
|
## Configuration
|
2022-05-18 07:26:57 +00:00
|
|
|
|
2023-03-08 09:17:43 +00:00
|
|
|
### Environment Variables
|
2022-05-18 07:26:57 +00:00
|
|
|
|
2023-03-08 09:17:43 +00:00
|
|
|
You may set the `HIVE_TOKEN` environment variable while running the Hive CLI, in order to set it
|
|
|
|
|
globally.
|
2022-05-18 07:26:57 +00:00
|
|
|
|
2023-03-08 09:17:43 +00:00
|
|
|
### Config file (`hive.json`)
|
2022-05-18 07:26:57 +00:00
|
|
|
|
2023-04-20 10:34:57 +00:00
|
|
|
You can create a `hive.json` file to manage your Hive configuration.
|
|
|
|
|
|
|
|
|
|
Note that the CLI args will override the values in config if both are specified.
|
|
|
|
|
|
|
|
|
|
The configuration input priority is: CLI args > environment variables > hive.json configuration.
|
|
|
|
|
|
|
|
|
|
This is how the structure of the config file should look like:
|
2022-05-18 07:26:57 +00:00
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
2023-04-20 10:34:57 +00:00
|
|
|
"registry": {
|
|
|
|
|
"endpoint": "<yourRegistryURL>",
|
|
|
|
|
"accessToken": "<yourtoken>"
|
|
|
|
|
},
|
|
|
|
|
"cdn": {
|
|
|
|
|
"endpoint": "<yourCdnURL>",
|
|
|
|
|
"accessToken": "<yourtoken>"
|
|
|
|
|
}
|
2022-05-18 07:26:57 +00:00
|
|
|
}
|
|
|
|
|
```
|