cli-builder

Build TypeScript CLIs with Bun using structured patterns and examples.

729|67|Updated Dec 8, 2025
One-click install
npx skills add https://github.com/joelhooks/swarm-tools --skill cli-builder-joelhooks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cli-builder
Source: https://github.com/joelhooks/swarm-tools/tree/main/packages/opencode-swarm-plugin/global-skills/cli-builder
Command: npx skills add https://github.com/joelhooks/swarm-tools --skill cli-builder-joelhooks

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Building and maintaining TypeScript CLIs can be tedious and error-prone. This skill provides structured guidance, patterns, and starter templates for Bun-based CLIs to accelerate development and ensure consistency.

Core Features & Use Cases

  • Argument parsing, including flags, options, and positional parameters
  • Subcommand patterns and command registries for scalable tooling
  • Output formatting and user feedback patterns for a polished UX
  • Distribution-ready project layouts and explicit entry points for Bun-based CLIs
  • Use Case: Create a project scaffolding tool with multiple commands and a shared library of utilities

Quick Start

Create a minimal Bun-based CLI by adding a shebang line (#!/usr/bin/env bun) to a TypeScript file, making it executable, and running it directly. Then extend it with a simple command, and progressively add subcommands using a registry pattern.

Frequently Asked Questions about cli-builder

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a TypeScript CLI with Bun?

You build a TypeScript CLI with Bun by adding a `#!/usr/bin/env bun` shebang to a TypeScript file, making it executable, and running it directly. You then extend it with subcommands using a modular command registry pattern for scalable structure.

What is the best way to parse arguments and subcommands in a Bun-based CLI?

The best way to parse arguments and subcommands in a Bun-based CLI is using a structured command registry pattern. This approach enforces explicit CLI entry points and modular definitions to handle flags, options, and positional parameters reliably.

Does this CLI tooling pattern support scalable project structures across teams?

Yes, this CLI tooling pattern supports scalable project structures across teams. It provides a distribution-ready layout with explicit entry points, reusable command definitions, and output formatting patterns to ensure consistency in shared utilities.

How do I format output and user feedback in a TypeScript CLI?

You format output and user feedback in a TypeScript CLI by applying structured patterns for polished UX. This skill provides concrete examples for output formatting alongside argument parsing and subcommand execution within a Bun-based environment.

Can I use this to create a project scaffolding tool with multiple commands?

Yes, you can use this to create a project scaffolding tool with multiple commands. The skill provides a use case specifically for scaffolding tools, utilizing a shared library of utilities and a modular command registry pattern for implementation.