CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-bunli

CLI development framework specifically designed for Bun runtime with complete toolchain for building, testing, and distributing command-line applications.

Overview
Eval results
Files

cli-commands.mddocs/

CLI Commands

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.

Capabilities

Development Command

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 help

Usage 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 value

Build Command

Build 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 help

Target Platforms:

  • native - Current platform
  • all - All supported platforms
  • darwin-arm64 - macOS Apple Silicon
  • darwin-x64 - macOS Intel
  • linux-arm64 - Linux ARM64
  • linux-x64 - Linux x86_64
  • windows-x64 - Windows x86_64

Usage 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 --bytecode

Test Command

Run 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 help

Usage 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 30000

Release Command

Create 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 help

Version 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 number

Usage 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 --all

Initialization Command

Initialize 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 help

Available Templates:

  • basic - Simple CLI project with minimal setup
  • advanced - Advanced CLI with multiple commands and utilities
  • monorepo - Multi-package workspace setup

Package Managers:

  • bun (default) - Use Bun package manager
  • pnpm - Use PNPM
  • yarn - Use Yarn
  • npm - Use npm

Usage 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-cli

Global Options

All commands support these global options:

--help, -h                   # Show help information
--version, -V                # Show version information

Command Aliases

All main commands have short aliases for convenience:

  • bunli dbunli dev
  • bunli bbunli build
  • bunli tbunli test
  • bunli rbunli release
  • bunli ibunli init

Interactive Features

Commands provide rich interactive experiences:

  • Colored output with status indicators
  • Progress spinners for long-running operations
  • Interactive prompts for missing required information
  • Confirmation dialogs for destructive operations
  • Error handling with helpful error messages and suggestions

Install with Tessl CLI

npx tessl i tessl/npm-bunli

docs

cli-commands.md

configuration.md

index.md

project-utilities.md

tile.json