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

@cloud-copilot/cli

v0.2.37

Published

A standardized library for CLI building TypeScript CLI applications

Readme

CLI

NPM Version MIT License

GuardDog Known Vulnerabilities

Utilities for standardizing working CLIs in Typescript.

  • Standardizes the way subcommands, arguments, and operands are parsed and validated
  • Includes "prefix matching" of subcommands and arguments, so users can provide partial names if they match only one subcommand or argument
  • Allows users to default arguments with environment variables
  • Automatically generates a help text for the user
  • Provides a type safe response of the parsed arguments
  • Has zero dependencies
  • Built-in argument types for string, number, boolean, enum, array, and map types
  • Easy custom argument types to create your own argument types with validation
  • Async argument validation and version checking
  • Automatic version checking for updates to your CLI

I wrote this because I'm building several CLI applications and want to have a standard parsing of arguments that users can rely on across all of them.

I was inspired by https://github.com/lirantal/nodejs-cli-apps-best-practices and https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html to follow best practices for accepting arguments and environment variables while keeping my scope extremely limited and having no dependencies.

Table of Contents

Documentation

Core Guides

Examples

Example

import {
  parseCliArguments,
  stringArgument,
  stringArrayArgument,
  booleanArgument,
  numberArgument,
  enumArgument
} from '@cloud-copilot/cli'

const cli = await parseCliArguments(
  'my-command',
  // optional subcommands
  {
    init: {
      description: 'Initialize the project',
      // Subcommand Specific Arguments
      arguments: {
        s3: booleanArgument({
          description: 'Use S3 as the storage',
          character: 's'
        }),
        language: enumArgument({
          description: 'The language to use',
          validValues: ['typescript', 'javascript']
        })
      }
    },
    download: {
      description: 'Download a file',
      // Subcommand Specific Arguments
      arguments: {
        url: stringArgument({
          description: 'The URL to download from'
        })
      }
    }
  },
  // Global Arguments that apply to all subcommands
  {
    regions: stringArrayArgument({
      description: 'Regions to deploy to'
    }),
    account: stringArgument({
      description: 'AWS account to deploy to'
    }),
    ssl: booleanArgument({
      description: 'Enable SSL',
      character: 's'
    }),
    port: numberArgument({
      description: 'Port to use'
    })
  },
  {}
)

This will automatically pull in the arguments from the command line and validate them. If any arguments are not valid, it will throw an error with the message of what is wrong. If all arguments and subcommands are valid, it will return an object with a type safe response.

cli.subcommand // 'init' | 'download' | undefined
cli.args.regions // string[] | undefined
cli.args.account // string | undefined
cli.args.ssl // boolean
cli.args.port // number | undefined

cli.anyValues // boolean, whether any values were provided on the CLI

if (cli.subcommand === 'init') {
  // Type Checked command specific arguments only in the return type if the subcommand is selected
  cli.args.s3 // boolean
  cli.args.language // 'typescript' | 'javascript' | undefined
}

if (cli.subcommand === 'download') {
  cli.args.url // string | undefined
}

If the user provides --help a help message will be printed out with the available subcommands and arguments.

Installation

npm install @cloud-copilot/cli