// the cli framework for bun

The comprehensive
CLI framework for Bun.

Composable plugins, interactive terminal UI, and a complete toolchain from dev to release. Everything you need to ship production CLIs with Bun.

~/my-clibash
version0.8.2licenseMITruntimebun ≥1.0typesincluded
~/bunlibunli --help
$ bunli --help
bunli v0.8.2
The CLI framework for Bun
Commands
bunli <command> [options]
dev
Hot-reload development server
build
Compile your CLI to a standalone binary
test
Run tests with coverage and watch mode
generate
Generate TypeScript types from command definitions
release
Publish to npm with versioning and changelog
init
Scaffold a new bunli project
> Run bunli <command> --help for more information
> quick start

from zero to cli in seconds

~bash
$bun create bunli my-cli
Creating project in ./my-cli...
Installing dependencies...
Project created successfully
$cd my-cli
$bunli dev
Watching for changes...
Ready! Try running: ./my-cli --help
hover to copy commands
> examples

see it in action

~/examples/greet.ts
import { defineCommand, option } from '@bunli/core'import { z } from 'zod'export default defineCommand({  name: 'greet',  description: 'Greet someone',  version: '1.0.0',  arguments: [    {      name: 'name',      description: 'Name to greet',      required: true,      schema: z.string().min(1),    },  ],  options: [    option(z.boolean(), {      name: 'excited',      short: 'e',      description: 'Add excitement',    }),  ],  handler({ args, flags }) {    const suffix = flags.excited ? '!' : '.'    console.log(`Hello, ${args.name}${suffix}`)  },})
press [1-4] to switch examples
> interactive playground

try it live

Test Bunli commands directly in your browser. Edit the code, run commands, and see results instantly.

press enter to get started