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

@xrpckit/cli

v0.0.3

Published

CLI for xRPC - generate type-safe API code from Zod schemas

Downloads

11

Readme

xRPC CLI

Command-line interface for xRPC code generation with a beautiful TUI (Terminal User Interface).

Installation

bun install

Usage

Interactive Mode

Run without arguments to see the interactive menu:

xrpc

Or run a command interactively - the CLI will prompt for missing arguments:

xrpc generate

Command Mode

Provide all arguments directly:

# Generate code for Go
xrpc generate -i src/api.ts -o generated -t go

# Generate code for multiple targets
xrpc generate --input src/api.ts --output generated --targets go,typescript-express

# Show help
xrpc --help
xrpc help
xrpc help generate

Features

🎨 Beautiful TUI

  • Interactive Prompts: Missing arguments are prompted interactively
  • Progress Indicators: Spinners show real-time progress during code generation
  • Colorful Output: Success, error, and info messages are color-coded
  • Rich Formatting: File paths, targets, and commands are highlighted

📋 Commands

generate

Generate type-safe clients and servers from API contracts.

Options:

  • -i, --input <path>: Path to API contract file (e.g., src/api.ts)
  • -o, --output <directory>: Output directory for generated code (default: generated)
  • -t, --targets <targets>: Comma-separated list of targets (e.g., go,typescript-express)

Examples:

# Interactive mode
xrpc generate

# With all arguments
xrpc generate -i src/api.ts -o generated -t go

# Multiple targets
xrpc generate -i api.ts -o out -t go,typescript-express

help

Show comprehensive help and documentation.

Usage:

xrpc help              # Show general help
xrpc help generate     # Show help for generate command
xrpc --help           # Alias for help

CLI Framework: Bunli

This CLI uses Bunli utilities for TUI features, providing:

  • Zero dependencies (Bun-native)
  • Built-in prompts for interactive input
  • Progress spinners for visual feedback
  • Color utilities for rich terminal output
  • Type-safe with TypeScript

Architecture

The CLI uses a hybrid approach:

  • Bunli utilities (@bunli/utils) for TUI features (prompts, spinners, colors)
  • Custom argument parser for command routing
  • Modular command structure for easy extension

TUI Components

  • Interactive Prompts: File path selection, target multi-select
  • Progress Spinners: Real-time feedback during parsing and generation
  • Color Formatting:
    • ✅ Green for success messages
    • ❌ Red for errors
    • ⚠️ Yellow for warnings
    • ℹ️ Blue for info
    • Cyan for file paths
    • Magenta for target names

Development

# Run CLI locally
bun run packages/cli/src/index.ts generate -i examples/x-rpc-todo-app/packages/api/src/contract.ts -o generated -t go

# Test interactive mode
bun run packages/cli/src/index.ts generate

# Show menu
bun run packages/cli/src/index.ts

Project Structure

packages/cli/
├── src/
│   ├── index.ts              # Main entry point
│   ├── commands/
│   │   ├── generate.ts      # Generate command with TUI
│   │   ├── help.ts          # Help command
│   │   └── menu.ts          # Interactive menu
│   └── utils/
│       └── tui.ts            # TUI utility functions
└── package.json

Examples

Interactive Generation

$ xrpc generate
API contract file path: (src/api.ts) examples/x-rpc-todo-app/packages/api/src/contract.ts
Output directory: (generated) 
Select targets to generate: [Use arrow keys, space to select]
  ◯ go
  ◯ typescript-express

Non-Interactive (CI-friendly)

$ xrpc generate -i src/api.ts -o generated -t go
✅ Found 1 endpoint
✅ Wrote 2 files
  ✓ Generated generated/go/server/types.go
  ✓ Generated generated/go/server/router.go
✅ Generated go code
✓ Generation complete!
ℹ Output directory: generated