cli
Create a JavaScript or TypeScript project with the packs and tools you need.
Create a project
Use Node.js 26.13.0 or newer. For Yarn or pnpm, install Corepack with
npm install --global corepack and run corepack enable.
- npm
- yarn
- pnpm
npx @bedrock-core/cli my-project
yarn dlx @bedrock-core/cli my-project
pnpm dlx @bedrock-core/cli my-project
The CLI prompts for missing details and your package manager, creates a Git repository without a commit, and installs dependencies. Choose none to create files without installing them.
Choose a starter
| Preset | Packs | Included content |
|---|---|---|
full (default) | Behavior and resource | Runtime registration, config, translations, guides, JSX screens, JSON templates and a GameTest |
script | One behavior pack | Plain Minecraft scripting and a GameTest |
resource | One resource pack | Resource-pack manifest and language files |
- npm
- yarn
- pnpm
npx @bedrock-core/cli my-script --preset script
npx @bedrock-core/cli my-textures --preset resource
yarn dlx @bedrock-core/cli my-script --preset script
yarn dlx @bedrock-core/cli my-textures --preset resource
pnpm dlx @bedrock-core/cli my-script --preset script
pnpm dlx @bedrock-core/cli my-textures --preset resource
These are starting layouts. A project can contain any number of packs, including independent addons.
Build and develop
- npm
- yarn
- pnpm
cd my-project
npm run build
npm run watch
cd my-project
yarn build
yarn watch
cd my-project
pnpm build
pnpm watch
build exports the completed packs to build/. watch rebuilds into Minecraft's development folders after changes. Edit the default profile's export paths for your installation; the generated defaults use Windows Minecraft development folders.
The full starter downloads the shared UI resource pack selected by its behavior manifest. Import that .mcpack into the world for client testing. If the download fails, the CLI prints the selected asset's exact release link and preserves the project.
Lint sources
- npm
- yarn
- pnpm
npm run lint
yarn lint
pnpm lint
The full starter adds the Core hook preset exported by @bedrock-core/ui/eslint to eslint.config.mjs. Lint components and hooks covers its checks and configuration. Script and resource starters use the same file with the shared checks and no UI tooling.
Test and optimize
The full and script starters include one headless GameTest:
- npm
- yarn
- pnpm
npm run test:mc
yarn test:mc
pnpm test:mc
This builds the test profile and runs the example suite on BDS. The test manifest selects gametest.js and enables the beta GameTest module; regular builds select main.js. Add tests under the behavior pack's scripts/tests/ directory and update the command's --expect-registered count when the suite grows.
Every starter includes pack optimization for Windows:
- npm
- yarn
- pnpm
npm run build:optimized
yarn build:optimized
pnpm build:optimized
Optimized output goes to dist/. The build-optimized profile exports production packs to build/production/ for conversion. bds-runner.json pins the server used for both tests and conversion. Run bds:fetch to download it or bds:where to inspect the selection. BDS runner explains results and supported inputs.
Resource-only projects have no GameTest registration; add a behavior pack test harness when testing their resources with GameTests. Client rendering and input need in-game checks.
Project files
| File or directory | Purpose |
|---|---|
config.json | Project metadata, pack paths, profiles and exports |
package.json | Dependencies, project version and commands |
packs/ | Authored packs; each has its own manifest |
packs/BP/ui/ | Full starter's authored screens, components and UI helpers |
packs/BP/i18n/index.ts | Full starter's shared translation instance beside its locale modules |
bds-runner.json | Pinned headless server |
.bedrock-core/ | Generated editor declarations and local build cache |
The full starter demonstrates JSON generation, translations, guides and navigation. Keep the features your project needs. Editor schemas covers schema URLs and local references for project configuration and stage settings.
Command options
| Option | Purpose |
|---|---|
[project-name] | Directory and npm package name |
--preset <preset> | full, script or resource |
-a, --author <name> | Author display name |
-d, --description <text> | Project description |
-p, --package-manager <manager> | npm, yarn, pnpm or none |
--display-name <name> | Human-readable project name |
--creator-id <id> / --pack-id <id> | Stable runtime identifiers, independent of display names |
Show the full command reference:
- npm
- yarn
- pnpm
npx @bedrock-core/cli --help
yarn dlx @bedrock-core/cli --help
pnpm dlx @bedrock-core/cli --help
Next steps
- Projects and packs — understand the project model
- Builder configuration — edit profiles and exports
- Generate JSON — author typed content
- BDS commands — run suites and optimize packs