CLI development framework specifically designed for Bun runtime with complete toolchain for building, testing, and distributing command-line applications.
Bunli provides a comprehensive command-line interface for developing, building, testing, and releasing CLI applications. All commands support help flags and colorized output with progress indicators.
Run CLI applications in development mode with hot reload and debugging support.
bunli dev [options]
# Aliases: bunli d
# Options:
--entry, -e <file> # Entry file (defaults to auto-detect)
--watch, -w # Watch for changes (default: true)
--inspect, -i # Enable debugger (default: false)
--port, -p <number> # Debugger port (default: 9229)
--help # Show command helpUsage Examples:
# Basic development with auto-detected entry
bunli dev
# Specify entry file and enable debugging
bunli dev --entry src/my-cli.ts --inspect
# Run with custom debugger port
bunli dev --inspect --port 9230
# Disable file watching
bunli dev --no-watch
# Pass arguments to the CLI being developed
bunli dev -- --my-cli-arg valueBuild CLI applications for production with optional compilation to standalone executables.
bunli build [options]
# Aliases: bunli b
# Options:
--entry, -e <file> # Entry file (defaults to auto-detect)
--outdir, -o <directory> # Output directory (default: ./dist)
--outfile <filename> # Output filename for single executable
--minify, -m # Minify output (default: true)
--sourcemap, -s # Generate sourcemaps (default: false)
--bytecode # Enable bytecode compilation (experimental)
--runtime, -r <bun|node> # Runtime target for non-compiled builds
--targets, -t <platforms> # Target platforms (comma-separated)
--watch, -w # Watch for changes (default: false)
--help # Show command helpTarget Platforms:
native - Current platformall - All supported platformsdarwin-arm64 - macOS Apple Silicondarwin-x64 - macOS Intellinux-arm64 - Linux ARM64linux-x64 - Linux x86_64windows-x64 - Windows x86_64Usage Examples:
# Basic build
bunli build
# Build for specific platforms
bunli build --targets darwin-arm64,linux-x64,windows-x64
# Build for all platforms with compression
bunli build --targets all
# Traditional build (no compilation)
bunli build --runtime node --outdir lib
# Build with source maps and watch
bunli build --sourcemap --watch
# Experimental bytecode compilation
bunli build --targets native --bytecodeRun tests for CLI applications with coverage and watch mode support.
bunli test [options]
# Aliases: bunli t
# Options:
--pattern, -p <patterns> # Test file patterns (default: **/*.test.ts)
--watch, -w # Watch for changes (default: false)
--coverage, -c # Generate coverage report (default: false)
--bail, -b # Stop on first failure (default: false)
--timeout <ms> # Test timeout in milliseconds
--all # Run tests in all packages (workspace mode)
--help # Show command helpUsage Examples:
# Run all tests
bunli test
# Run specific test patterns
bunli test --pattern "**/*.unit.test.ts,**/*.integration.test.ts"
# Run tests with coverage
bunli test --coverage
# Watch mode with bail on first failure
bunli test --watch --bail
# Run tests in all workspace packages
bunli test --all
# Set custom timeout
bunli test --timeout 30000Create releases with version management, npm publishing, and GitHub releases.
bunli release [options]
# Aliases: bunli r
# Options:
--version, -v <version> # Version to release (patch/minor/major/x.y.z)
--tag, -t <format> # Git tag format (default: v${version})
--npm # Publish to npm (default: true)
--github # Create GitHub release (default: true)
--dry, -d # Dry run - show what would be done
--all # Release all packages (workspace mode)
--help # Show command helpVersion Strategies:
patch - Increment patch version (1.0.0 → 1.0.1)minor - Increment minor version (1.0.0 → 1.1.0)major - Increment major version (1.0.0 → 2.0.0)x.y.z - Explicit version numberUsage Examples:
# Interactive release with version selection
bunli release
# Patch release
bunli release --version patch
# Specific version
bunli release --version 2.1.0
# Dry run to preview changes
bunli release --dry
# Release without GitHub release
bunli release --no-github
# Custom tag format
bunli release --tag "release-${version}"
# Workspace release (all packages)
bunli release --allInitialize new Bunli CLI projects with templates and package manager selection.
bunli init [options] [name]
# Aliases: bunli i
# Options:
--name, -n <name> # Project name
--template, -t <template> # Project template (default: basic)
--dir, -d <directory> # Directory to create project in
--git, -g # Initialize git repository (default: true)
--install # Install dependencies (default: true)
--package-manager, -p <pm> # Package manager (default: bun)
--help # Show command helpAvailable Templates:
basic - Simple CLI project with minimal setupadvanced - Advanced CLI with multiple commands and utilitiesmonorepo - Multi-package workspace setupPackage Managers:
bun (default) - Use Bun package managerpnpm - Use PNPMyarn - Use Yarnnpm - Use npmUsage Examples:
# Interactive initialization
bunli init
# Create named project
bunli init my-awesome-cli
# Advanced template with pnpm
bunli init --template advanced --package-manager pnpm my-cli
# Create in specific directory
bunli init --dir ./projects/cli-tools my-new-cli
# Skip git and dependencies
bunli init --no-git --no-install basic-cliAll commands support these global options:
--help, -h # Show help information
--version, -V # Show version informationAll main commands have short aliases for convenience:
bunli d → bunli devbunli b → bunli buildbunli t → bunli testbunli r → bunli releasebunli i → bunli initCommands provide rich interactive experiences:
Install with Tessl CLI
npx tessl i tessl/npm-bunli