What is Bunli?
Bunli is a CLI framework that provides everything you need to build professional command-line applications:- Type-safe command definitions with automatic type inference using Zod schemas
- Plugin architecture for extending functionality with typed stores
- Terminal UI components powered by OpenTUI and React
- Development toolchain with hot-reload, testing, and building
- Shell completions for bash, zsh, and fish
- Standalone binaries that compile your CLI to a single executable
Bunli requires Bun >= 1.0.0. If you don’t have Bun installed, visit bun.sh to get started.
Who is Bunli for?
Bunli is perfect for developers who want to:- Build CLIs with full TypeScript type safety from commands to runtime
- Create interactive terminal applications with React components
- Package CLIs as standalone binaries for easy distribution
- Leverage Bun’s performance and built-in tools (shell, test runner, bundler)
- Extend functionality through a powerful plugin system
Key benefits
Type safety
Full end-to-end type inference from command definitions to handler arguments. Zod schemas provide runtime validation with compile-time types.
Fast development
Hot-reload development mode, instant startup with Bun, and integrated testing with coverage reports.
Rich UIs
Build interactive terminal UIs with React components, progress bars, spinners, and prompts powered by OpenTUI.
Plugin ecosystem
Extensible plugin system with typed stores for AI detection, config management, shell completions, and more.
Quick example
Here’s a simple CLI with type-safe options and a React-based TUI:cli.ts
What’s included
Bunli is organized as a monorepo with focused packages: Core packages:@bunli/core- Framework with command definitions and plugin system@bunli/tui- Terminal UI components and hooks@bunli/utils- Colors, validation, and utilities@bunli/runtime- Prompt and renderer runtime@bunli/test- Testing utilities for CLI applications
bunli- Development CLI with build, dev, test commandscreate-bunli- Scaffolding tool for new projects@bunli/generator- TypeScript type generation from commands
@bunli/plugin-ai-detect- Detect AI coding assistants@bunli/plugin-completions- Generate shell completions@bunli/plugin-config- Configuration file loading@bunli/plugin-mcp- MCP integration for agentic workflows
Next steps
Quickstart
Build your first CLI in 5 minutes
Why Bunli?
Learn what makes Bunli different
Architecture
Understand how Bunli works
Commands
Define type-safe commands