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

@bitkai/cli

v0.0.3

Published

A modern cli framework for building cli applications

Readme

@bitkai/cli

A modern, type-safe CLI framework for building command-line applications in TypeScript with interactive prompts and beautiful output.

Features

  • 🎯 Type-safe: Full TypeScript support with proper type inference
  • 💬 Interactive: Built-in support for interactive prompts and rich input types
  • 🎨 Beautiful Output: Colored and formatted terminal output
  • 🔒 Validation: Built-in argument validation
  • 🚀 Modern: Built for ESM and modern Node.js
  • 📝 Great DX: Intuitive and fluent API
  • 🤖 Smart Prompts: Automatic fallback to interactive prompts for missing arguments

Installation

npm install @bitkai/cli

Quick Start

import { CLI } from '@bitkai/cli';

const cli = new CLI({
  name: 'mycli',
  version: '1.0.0',
  description: 'My awesome CLI tool'
});

cli.command('greet')
  .description('Greet someone by name')
  .argument('name', 'Name of the person to greet', { 
    type: 'text',
    required: true 
  })
  .option('loud', 'Print the greeting in uppercase', { 
    type: 'confirm',
    default: false 
  })
  .handler(async ({ args, options }) => {
    let message = `Hello, ${args.name}!`;
    if (options.loud) {
      message = message.toUpperCase();
    }
    console.log(message);
  });

cli.run();

Interactive Prompts

@bitkai/cli provides a rich set of interactive prompts that automatically engage when required arguments are missing. This creates a user-friendly experience where users can be guided through the command inputs.

Available Prompt Types

  • text: Free-form text input
  • number: Numeric input with optional validation
  • confirm: Yes/No confirmation
  • list: Multi-select from a list of choices
  • select: Single selection from a list of choices

Prompt Behavior

  • Prompts automatically trigger for missing required arguments
  • Each prompt type provides appropriate validation
  • Users can use arrow keys for navigation in list/select prompts
  • Support for default values and initial inputs
  • Tab completion for better UX

Example of how prompts work:

$ mycli init
? Project name: (required) my-project
? Select template: (Use arrow keys)
❯ typescript
  javascript
  react

API Reference

Creating a CLI

const cli = new CLI({
  name: string;      // Name of your CLI application
  version: string;   // Version number
  description: string; // Brief description
});

Defining Commands

cli.command(name: string)
  .description(description: string)
  .argument(name: string, description: string, options?: ArgumentOptions)
  .option(name: string, description: string, options?: OptionOptions)
  .handler(handler: (context: CommandContext) => Promise<void>)

Argument Options

type ArgumentOptions = {
  type: 'text' | 'number' | 'confirm' | 'list' | 'select';
  required?: boolean;
  initial?: any;
  choices?: string[];  // For 'list' and 'select' types
}

Option Options

type OptionOptions = {
  type: 'text' | 'number' | 'confirm' | 'list' | 'select';
  default?: any;
  initial?: any;
  choices?: string[];  // For 'list' and 'select' types
}

Command Context

The action handler receives a context object with:

type CommandContext = {
  args: Record<string, any>;    // Parsed command arguments
  options: Record<string, any>; // Parsed command options
  raw: string[];               // Raw command-line arguments
}

Examples

Basic Command with Prompts

cli.command('create')
  .description('Create a new resource')
  .argument('name', 'Resource name', { 
    type: 'text',
    required: true,
    initial: 'my-resource'
  })
  .argument('type', 'Resource type', {
    type: 'select',
    required: true,
    choices: ['component', 'service', 'model']
  })
  .option('path', 'Output path', { 
    type: 'text',
    default: './src' 
  })
  .handler(async ({ args, options }) => {
    const { name, type } = args;
    const { path } = options;
    console.log(`Creating ${type} "${name}" in ${path}`);
  });

Interactive Configuration

cli.command('config')
  .description('Configure application settings')
  .argument('settings', 'Settings to configure', {
    type: 'list',
    choices: ['database', 'api', 'logging', 'security'],
    required: true
  })
  .option('environment', 'Target environment', {
    type: 'select',
    choices: ['development', 'staging', 'production'],
    default: 'development'
  })
  .handler(async ({ args, options }) => {
    const { settings } = args;
    const { environment } = options;
    console.log(`Configuring ${settings.join(', ')} for ${environment}`);
  });

Multi-step Workflow

cli.command('deploy')
  .description('Deploy the application')
  .argument('stage', 'Deployment stage', {
    type: 'select',
    required: true,
    choices: ['staging', 'production']
  })
  .argument('services', 'Services to deploy', {
    type: 'list',
    required: true,
    choices: ['frontend', 'backend', 'database']
  })
  .option('force', 'Skip confirmation', {
    type: 'confirm',
    default: false
  })
  .handler(async ({ args, options }) => {
    const { stage, services } = args;
    const { force } = options;
    console.log(`Deploying ${services.join(', ')} to ${stage}`);
  });

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

ISC