npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

wgc

v0.112.7

Published

The official CLI tool to manage the GraphQL Federation Platform Cosmo

Downloads

403,427

Readme

WunderGraph Cosmo CLI (wgc)

The all-in-one CLI for managing federated GraphQL APIs with WunderGraph Cosmo.

npm License Downloads


🚀 What is wgc?

wgc is the official CLI for WunderGraph Cosmo, an open-source, full-lifecycle GraphQL API management platform.

With wgc, you can:

  • Create and manage federated GraphQL APIs and subgraphs
  • Perform schema checks and composition validations
  • Generate and deploy router configurations
  • Integrate with CI/CD pipelines for automated workflows
  • Manage namespaces, API keys, and more

Whether you're building monolithic or federated GraphQL architectures, wgc provides the tools to manage your development and deployment processes.


🧰 Cosmo Features

  • Federation Support: Compatible with GraphQL Federation v1 and v2
  • Schema Registry: Centralized management of your GraphQL schemas with versioning and change tracking
  • Composition Checks: Automated validation to ensure subgraphs compose correctly without breaking changes
  • Router Configuration: Generate and manage router configurations for efficient query planning and execution
  • Observability: Integrated with OpenTelemetry and Prometheus for metrics, tracing, and monitoring
  • Access Control: Fine-grained access controls with support for OIDC, RBAC, and SCIM

📦 Installation

Prerequisites

Install via npm

npm install -g wgc@latest

Or use npx:

npx -y wgc@latest

🛠️ Getting Started

1. Clone the Example Project

Start with the Cosmo Demo, which includes two subgraphs (posts and users) and a router configuration.

git clone https://github.com/wundergraph/cosmo-demo.git
cd cosmo-demo

2. Install wgc

Ensure you have wgc installed globally:

npm install -g wgc@latest

3. Start Subgraphs

Make the startup script executable and run it:

chmod +x start-subgraphs.sh
./start-subgraphs.sh

Verify the subgraphs are running:

4. Generate Router Configuration

Navigate to the router directory and compose the router configuration:

cd router
wgc router compose --input graph.localhost.yaml --out config.json

5. Run the Router

Start the router using Docker:

docker run \
  --name cosmo-router \
  --rm \
  -p 3002:3002 \
  --add-host=host.docker.internal:host-gateway \
  --platform=linux/amd64 \
  -e pull=always \
  -e DEV_MODE=true \
  -e LISTEN_ADDR=0.0.0.0:3002 \
  -e EXECUTION_CONFIG_FILE_PATH="/config/config.json" \
  -v "$(pwd)/config.json:/config/config.json" \
  ghcr.io/wundergraph/cosmo/router:latest

6. Query the Federated Graph

Access the federated GraphQL API at http://localhost:3002.

Example query:

query {
  posts {
    id
    content
    author {
      id
      name
    }
  }
}

📚 Documentation


🌐 About WunderGraph Cosmo

WunderGraph Cosmo is a comprehensive, open-source platform for managing GraphQL APIs at scale. It offers:

  • Schema Registry: Centralized schema management with versioning and validation
  • Cosmo Studio: A web interface for exploring schemas, monitoring performance, and managing access
  • Cosmo Router: A high-performance, Go-based router supporting federation, subscriptions, and more
  • Observability: Built-in support for OpenTelemetry and Prometheus
  • Security: Fine-grained access controls with OIDC, RBAC, and SCIM support

Cosmo can be deployed on-premises, in the cloud, or used as a managed service.


🧪 Example Commands

  • Create Namespace:
npx wgc namespace create production
  • Create Federated Graph:
npx wgc federated-graph create main -r http://router.example.com/graphql -n production
  • Create Subgraph:
npx wgc subgraph create products --routing-url http://localhost:4001/graphql
  • Check Subgraph Schema Changes:
npx wgc subgraph check products -n production --schema ./schemas/products.graphql
  • Generate Router Configuration locally:

Composition Configuration (graph.yaml):

version: 1
subgraphs:
  - name: products
    routing_url: http://localhost:4001/graphql
    schema:
      file: ./schemas/products.graphql

Generate CMD:

npx wgc router compose -i graph.yaml -o config.json
  • Run Router:
docker run \
  --name cosmo-router \
  --rm \
  -p 3002:3002 \
  --add-host=host.docker.internal:host-gateway \
  --platform=linux/amd64 \
  -e pull=always \
  -e DEV_MODE=true \
  -e LISTEN_ADDR=0.0.0.0:3002 \
  -e EXECUTION_CONFIG_FILE_PATH="/config/config.json" \
  -v "$(pwd)/config.json:/config/config.json" \
  ghcr.io/wundergraph/cosmo/router:latest

🔗 Related Projects


🔗 From the WunderGraph Blog

Here's a selection of blog posts that focus on the technical aspects of Cosmo:


Telemetry

The CLI tool collects usage data to help us improve the tool and understand how users interact with it. You can disable telemetry in one of the following ways:

export COSMO_TELEMETRY_DISABLED=true

or

export DO_NOT_TRACK=1

📄 License

This project is licensed under the Apache 2.0 License.


📬 Support & Community


Empower your GraphQL Federation development with wgc and WunderGraph Cosmo!