bunli

Build type-safe Bun CLIs with commands, options, and Zod validation.

66|8|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/mikkelkrogsholm/skills --skill bunli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bunli
Source: https://github.com/mikkelkrogsholm/skills/tree/main/.agents/skills/bunli
Command: npx skills add https://github.com/mikkelkrogsholm/skills --skill bunli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill removes friction from creating and maintaining robust, type-safe command-line interfaces with Bun by consolidating command definition patterns, validation, plugin workflows, and interactive UI guidance.

Core Features & Use Cases

  • Command and option definitions: Patterns for defineCommand, option, nested groups, aliases, and handler contexts for predictable CLI behavior.
  • Type safety and validation: Best practices for Zod-based schemas and generated types to ensure compile-time safety for flags and positional arguments.
  • Plugin architecture and lifecycle: Guidance on creating, composing, and using plugins with setup, beforeCommand, and afterCommand hooks and shared stores.
  • Interactive workflows and TUI components: Prompt and spinner runtime APIs, form-driven TUI components, and OpenTUI integration for richer render flows.
  • Project scaffolding and release tooling: Instructions for initializing projects, development hot-reload, building, testing, generating types, and releasing packages.
  • Use Case: Scaffold a new CLI, register typed commands with prompts and TUI forms, validate inputs with Zod, and publish a production-ready executable.

Quick Start

Run the bunli init workflow to scaffold a new type-safe Bun CLI project and start defining commands, options, prompts, and TUI components.

Frequently Asked Questions about bunli

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

FAQPage Schema
How do I build a type-safe CLI with Bun and Zod?

To build a type-safe Bun CLI with Zod, define commands, options, and positional arguments using Zod schemas for compile-time validation. This approach ensures predictable CLI behavior by generating types for flags and interactive prompts.

What is the best way to scaffold a new Bun CLI project with plugins?

Scaffolding a new Bun CLI project involves running an initialization workflow to set up command structures, plugin architecture, and lifecycle hooks. This generates a production-ready foundation with shared stores, setup, and command hooks.

Can I create interactive TUI forms and spinners in a Bun CLI?

Yes, you can create interactive TUI forms and spinners in a Bun CLI using prompt and spinner runtime APIs. This enables form-driven TUI components and OpenTUI integration for richer render flows and interactive user workflows.

Does bunli support bundling and releasing production-ready CLI executables?

Yes, bunli supports bundling and releasing production-ready CLI executables through dedicated CLI commands. It handles the complete release workflow, including development hot-reload, building, testing, and generating types for your package.

How do plugin lifecycle hooks work in a Bun CLI architecture?

Plugin lifecycle hooks in a Bun CLI architecture work through setup, beforeCommand, and afterCommand phases. This allows plugins to compose, share stores, and execute logic predictably before and after command handlers run.