Bunli
Examples

Examples

Real-world examples of CLIs built with Bunli

Examples

Learn by example with these real-world CLI implementations, organized from simple to advanced.

Learning Path

Follow this progression to master Bunli:

  1. Hello World - Absolute basics (5 min)
  2. Task Runner - Validation and interactivity (15 min)
  3. Git Tool - Command structure and organization (15 min)
  4. Dev Server - Plugins and advanced patterns (20 min)

Example Projects

Check out these complete example projects in the Bunli repository:

hello-world

The simplest possible Bunli CLI with a single command. Perfect starting point to understand the basics.

  • Basic command definition
  • Simple flag handling
  • Minimal configuration
  • Type generation for enhanced DX

task-runner

A practical task automation CLI showcasing validation and interactivity patterns.

  • Schema validation with Zod
  • Interactive prompts and confirmations
  • Progress indicators and spinners
  • Build, test, deploy, and setup workflows

git-tool

A Git workflow helper demonstrating command organization and external tool integration.

  • Nested command structure
  • Command aliases
  • Integration with external tools (git)
  • Shell command execution

dev-server

A development server CLI showcasing advanced plugin system and configuration management.

  • Plugin system with lifecycle hooks
  • Type-safe plugin context
  • Configuration management
  • Long-running processes

Getting Started

Each example demonstrates the recommended Bunli development workflow:

# Navigate to an example
cd examples/hello-world

# Install dependencies
bun install

# Start development with hot reload
bun run dev

# Build for production
bun run build

# Run the built executable
bun run start

Key Features Demonstrated

  • Type Generation: Automatic TypeScript definitions for commands
  • Schema Validation: Type-safe options with runtime validation
  • Interactive Prompts: User-friendly CLI experiences
  • Plugin System: Extensible architecture with type safety
  • Command Organization: Scalable multi-command structure
  • External Integration: Working with git, build tools, and more