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

@common-grants/cli

v0.2.4

Published

The CommonGrants protocol CLI tool

Downloads

71

Readme

CommonGrants CLI

The CommonGrants CLI (cg) is a tool for working with the CommonGrants protocol. It simplifies the process of defining, implementing, and validating CommonGrants APIs.

Note: This package is currently in alpha. The commands described below are mocked implementations that will be replaced with full functionality in future releases.

Installation

# Install globally
npm install -g @common-grants/cli

# Or use with npx
npx @common-grants/cli <command>

Usage

View available commands and options:

cg --help

Output:

CommonGrants CLI tools

Options:
  -V, --version           output the version number
  -h, --help              display help for command

Commands:
  init [options]          Initialize a new CommonGrants project
  preview <specPath>      Preview an OpenAPI specification
  check                   Validate APIs and specifications
  compile <typespecPath>  Compile a TypeSpec file to OpenAPI
  help [command]          display help for command

Initialize a Project

Create a new CommonGrants project from a template:

# Initialize interactively
cg init

# List available templates
cg init --list

# Use a specific template
cg init --template custom-api

Compile TypeSpec to OpenAPI

Compile a TypeSpec file to an OpenAPI specification:

cg compile spec.tsp

This is a thin wrapper around the tsp compile command and uses your project's tspconfig.yaml file to determine the output format.

Preview OpenAPI Specification

Preview an API specification using Swagger UI:

# Preview a YAML file
cg preview openapi.yaml

# Preview a JSON file
cg preview openapi.json

Validate an API Specification

Validate an API specification against the CommonGrants base protocol. You can optionally specify a specific protocol version to check against, or provide a path to your own base spec. By default, check spec uses the latest version of the base protocol bundled with the CLI.

# Using the base protocol spec bundled with @common-grants/cli, uses the latest version by default
cg check spec openapi.yaml

# Using a specific protocol version
cg check spec openapi.yaml --protocol-version 0.1.0

# Using the path to a locally compiled base spec
cg check spec openapi.yaml --base <path-to-base-spec>

Development status

This CLI is under active development and only supports the following commands:

  • cg init with a limited set of templates
  • cg compile
  • cg preview
  • cg check spec

Anticipated features

The following examples describe the anticipated features of the CLI, but these are not yet implemented and are subject to change.

Validate API Implementation

Check if an API implementation matches its specification:

# Basic validation
cg check api https://api.example.com spec.yaml

# Generate validation report
cg check api https://api.example.com spec.yaml --report json

# Validate with authentication
cg check api https://api.example.com spec.yaml --auth bearer:token