CLI: bb

Full command reference for the bb binary. Run bb --help for the short form.

bb <command> [options]

Commands

Command Purpose
init <name> Create a fresh add-on project.
build Bundle scripts and copy packs to dist/.
watch Rebuild on save, no deploy.
run Build, then copy into the game packs.
ship Release build plus .mcaddon zip.
clean Remove dist/ and the build cache.
diff Show what changed since the last build.
folders Pick canonical pack folders interactively.
ext List resolved extension path and status.
check Verify config, packs, entry, deploy target.
new <type> [name] Create a feature. See bb new.
manifest Rewrite pack manifest uuids and names.
version <semver> Set the version in config plus manifests.
harness Build then cross-check every dist reference.
publish Ship, harness, optional bump, tag, push.

Global options

Flag Description
-c, --config <path> Config path. Default: ./config.json, then ./bedrock.config.json.
-v, --verbose Verbose logging.
--json One JSON object on stdout, for CI.
-h, --help Show help.
--version Show version.

build

bb build [--release] [--clean] [--typecheck] [--stats] [--json]

Loads the config, bundles the entry with esbuild, and copies both packs into dist/. --release minifies with no sourcemaps. --clean removes dist/ first. --typecheck runs tsc --noEmit first. --stats prints bundle size plus biggest files.

watch

bb watch [--no-types]

Builds once, then rebuilds on save. No deploy. --no-types skips the parallel tsc --watch.

run

bb run [--watch] [--release] [--no-types]

Builds, then copies dist/packs/ into the game dev pack folders. --watch keeps rebuilding on save. --release deploys minified output.

ship

bb ship [--output <path>] [--level 0-9] [--typecheck] [--json]

Runs a release build, validates manifests, and zips into .mcaddon. Default output is dist/<name>-<version>.mcaddon. Default compression is 6. Level 0 stores raw.

publish

bb publish [--bump <v>] [--tag] [--push] [--dry-run] [--typecheck] [--json]

Bumps the version first when --bump is set, then ships, harnesses, tags, and pushes. Bump accepts patch, minor, major, or x.y.z.

clean

bb clean [--json]

Removes dist/ and the build cache. No flags besides --json.

diff

bb diff [--json]

Shows what changed since the last build from the existing cache: added, modified, and deleted files. Reads only, never writes. No flags besides --json.

folders

bb folders

Interactive picker for canonical pack folders. No flags. Skips folders that already exist.

ext

bb ext [--install] [--json]

Lists each configured extension with its resolved path and ok, missing, or broken status. --install installs per-extension node deps into each extension's own folder.

check

bb check [--fix] [--json]

Verifies config, packs, entry, and deploy target. --fix creates missing dirs, manifests, and entry. Exits nonzero when anything fails.

manifest

bb manifest [--name <name>] [--pack-version <v>] [--dir <path>] [--dry-run] [--json]

Detects the layout, rewrites both manifests with consistent names and versions, and cross-links the RP dependency to the BP uuid.

version

bb version <semver> [--dry-run] [--json]

Writes one version to the config plus both manifests. --dry-run previews without writing.

harness

bb harness [--no-build] [--strict] [--json]

Builds, then cross-checks every icon, texture, recipe, and spawn reference in dist/. --no-build checks the current dist/ without rebuilding. --strict also fails on missing pack icons and unused lang keys.

init

bb init <name> [--dir <path>] [--here] [--target-version <v>] [--js] [--git] [--install] [--force] [--json]

Creates a fresh project with config, manifests, entry file, and registries. --here creates into the current directory. --js emits src/main.js instead of TypeScript. --force overwrites a non-empty directory.