CLI Reference
Complete reference for all BunCover CLI commands and options. A cross-platform CLI tool for collecting, analyzing, and reporting test coverage data for Bun projects.
Commands
buncover login
Login using browser authentication or access key. Supports both interactive browser-based authentication and access key authentication for CI/CD environments.
Options
--access-key <key>Use an access key for authentication (recommended for CI/CD). Environment variable BUNCOVER_ACCESS_KEY takes precedence for security.buncover logout
Logout and remove stored authentication token
buncover status
Display current configuration status including authentication state and project information
buncover create-project
Create a new project
Options
-n, --name <NAME>Project name--log-level <LOG_LEVEL>Log level (error, warn, info, debug, trace)buncover run
Run tests with coverage reporting. Automatically includes --coverage --coverage-reporter=text flags. All arguments after buncover run options are passed directly to bun test.
Options
--project-id <id>Specify project ID for coverage upload--Pass additional arguments to Bun test (e.g., -- --timeout 5000, -- --bail, -- src/**/*.test.ts)Available Bun Test Arguments
All arguments after buncover run options are passed directly to bun test:
- • --bail - Stop after first test failure
- • --timeout <ms> - Set test timeout (default: 5000)
- • --preload <file> - Preload a script before running tests
- • --test-name-pattern <pattern> - Only run tests matching the pattern
- • --rerun-each <n> - Run each test n times
- • File/directory paths - Specify which test files to run
buncover serve
Serve source files for a project to enable real-time coverage visualization in the web interface
Options
--dir <path>Specify custom directory to serve (default: current directory)--project-id <id>Use specific project ID for serving filesbuncover help
Print help message or the help of the given subcommand(s)
Usage Examples
Authentication
Browser Authentication (Interactive)
Access Key Authentication (CI/CD)
Note: Environment variables take precedence over command parameters for security.
Running Tests with Coverage
Basic Usage
Run tests and collect coverage. If no project ID is provided, it will use the one executed the last time. If there is no run history, then you will be asked to select to create a new project:
Passing Arguments to Bun Test
All arguments after buncover run options are passed directly to bun test:
Coverage Server
CI/CD Integration
GitHub Actions
Docker
Other CI Systems
For other CI systems, simply:
- Install BunCover CLI
- Set BUNCOVER_ACCESS_KEY environment variable
- Run buncover login
- Run buncover run
Configuration
Environment Variables
Configuration File
BunCover automatically creates and manages a configuration file at .buncover/config.json:
Configuration Options
- •
project_id(string): Your project identifier (set automatically after first run)
Requirements
- • Node.js ≥ 18.0.0
- • Bun runtime installed
- • Supported platforms: Linux, macOS, Windows
- • BunCover must be run from a JavaScript/TypeScript project root (directory containing
package.json)