Developer Experience · Cosmo CLI (wgc)

Manage your entire federated graph from the command line

Install with npm install -g wgc@latest. Create, check, and publish subgraphs. Validate schemas before merge. Deploy from CI/CD with a single command.

Available onFree

The problem

GraphQL deployments need automation

Manual deployments, no pre-merge validation, and ad-hoc environment management produce inconsistent results and let breaking changes reach production.

Manual schema deployments introduce errors

Deploying subgraph schemas through the Studio UI is slow and error-prone. There is no consistent process, no pre-deployment validation, and no audit of who deployed what.

Breaking changes reach production undetected

Without a CLI-integrated check step in CI/CD, schema changes go out without validation. Teams discover breaking changes when consumers report errors.

Multi-environment management lacks consistency

Managing separate dev, staging, and production environments with different scripts and web UI actions produces inconsistent results and makes promotion error-prone.

Our solution

Full lifecycle management from one CLI

wgc handles the full lifecycle of your federated graph. Install once, authenticate with an API key, and use the same commands across every environment.

From install to production

  1. Install wgc with npm install -g wgc@latest or run it without installation via npx -y wgc@latest.

  2. Set the COSMO_API_KEY environment variable to authenticate with the Cosmo control plane.

  3. Run wgc subgraph check to validate schema changes. The check validates composition with all connected federated graphs and analyzes breaking changes against client traffic patterns.

  4. On merge, run wgc subgraph publish to deploy the schema. The federated graph recomposes automatically.

  5. Use the -n flag to target specific namespaces. Manage dev, staging, and production with identical commands.

  6. From v0.63.0, set HTTPS_PROXY or HTTP_PROXY to use the CLI behind a corporate proxy.

One CLI. Every environment. Every stage of the lifecycle.

Cosmo CLI (wgc)

Before & After

Before CosmoWith Cosmo
Manual deployments via the Studio UIwgc subgraph publish automates schema deployment
No pre-deployment schema validationwgc subgraph check catches breaking changes before merge
Separate tools for each environment-n flag targets any namespace consistently
No CI/CD integration for GraphQL managementCOSMO_API_KEY env var enables automated pipeline auth

Configuration

Key environment variables

COSMO_API_KEY
API key for authenticating with the Cosmo control plane.
COSMO_API_URL
URL of the control plane. Defaults to Cosmo Cloud. Set for self-hosted deployments.
HTTPS_PROXY / HTTP_PROXY
Company proxy URL. Supported from wgc v0.63.0.
VCS env vars
Commit, branch, and author context for traceability in check results.

How the Cosmo CLI works

01
npm or npx. Node.js LTS required.

Install

Run npm install -g wgc@latest. Node.js LTS is required. Alternatively, run commands without installation using npx -y wgc@latest.

02
COSMO_API_KEY for auth.

Authenticate

Set COSMO_API_KEY as an environment variable. For self-hosted control planes, also set COSMO_API_URL.

03
Composition + breaking change check.

Check

Run wgc subgraph check <name> --schema schema.graphql before merging. Validates composition and analyzes breaking changes against real client traffic.

04
Automated schema deployment.

Publish

Run wgc subgraph publish <name> --schema schema.graphql to deploy. The federated graph recomposes automatically with the new schema.

Capabilities

What wgc gives you

Full lifecycle management

Create, check, publish, and delete subgraphs, federated graphs, monographs, namespaces, and routers. All from a single CLI.

Pre-deployment schema check

wgc subgraph check validates composition and analyzes breaking changes against client traffic patterns before any schema reaches production.

Namespace management

Use -n to target any namespace. Manage dev, staging, and production with the same set of commands.

CI/CD native

Authenticate via COSMO_API_KEY. Proxy support from v0.63.0. Designed to run in automated pipelines.

Automate your GraphQL deployments

Install wgc, add a check step to CI, and ship schema changes with confidence.

FAQ

Cosmo CLI (wgc)

More in the CLI documentation.