cli-builder

Build TypeScript CLIs with Bun, including subcommands and JSON output.

38|3|Updated Mar 22, 2024
One-click install
npx skills add https://github.com/anthonyshew/dotfiles --skill cli-builder-anthonyshew
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cli-builder
Source: https://github.com/anthonyshew/dotfiles/tree/main/opencode/.config/opencode/skill/cli-builder
Command: npx skills add https://github.com/anthonyshew/dotfiles --skill cli-builder-anthonyshew

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill guides developers in quickly building TypeScript CLIs using Bun, reducing boilerplate and enabling consistent CLI tooling across projects.

Core Features & Use Cases

  • Minimal CLI scaffolding to expose a command interface and handle basic args.
  • Subcommand patterns and command registries to manage multiple actions.
  • Output formatting options including human-readable and JSON modes for scriptability.
  • Distribution guidance covering packaging, shebang usage, and executable permissions for seamless local deployment.
  • Real-world scenarios include building project tools, automation scripts, and developer utilities that integrate with pipelines.

Quick Start

Install Bun and create a new CLI file under scripts, add a shebang, make it executable, and run it directly or via bun. For example: create scripts/cli.ts with a basic command that prints a greeting, then run bun scripts/cli.ts hello. Then extend with subcommands and observe help output.

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?

To build a TypeScript CLI with Bun, create a script file, add a shebang, make it executable, and run it directly via Bun to handle command-line tooling with minimal boilerplate.

How do I structure subcommands in a Bun CLI?

Structure subcommands in a Bun CLI using command registries and subcommand patterns to manage multiple actions, allowing your developer tooling to scale across different project workflows.

Can I output JSON from a custom command-line tool?

Yes, you can output JSON from a custom command-line tool by applying JSON output modes alongside human-readable formatting, ensuring your CLI scripts remain scriptable and pipeline-friendly.

What is the best way to distribute a local CLI built with Bun?

The best way to distribute a local CLI built with Bun involves applying executable permissions, configuring shebang usage, and following packaging guidance for seamless local deployment across projects.

Does Bun support argument parsing for command-line scripts?

Yes, Bun supports argument parsing for command-line scripts, enabling you to expose a command interface and handle basic args effectively when creating new CLIs or augmenting existing developer utilities.

When should I use Bun for CLI tooling instead of other runtimes?

Use Bun for CLI tooling when you need to quickly build TypeScript CLIs with minimal boilerplate, streamline command-line development, and enable consistent tooling across multiple projects.