Toolkit
ESP-Brookesia Toolkit provides npm tools for initializing, building, packing, verifying, and simulating ESP-Brookesia app packages (.bpk).
Environment Requirements
Node.js 20 or newer.
JavaScript bundling templates require
pnpm installin the app directory.
Install the Toolkit
End users can install the published npm CLI globally:
npm install -g esp-brookesia-toolkit
brookesia --help
The WASM simulator, @brookesia/simulator-wasm, is installed automatically as a CLI dependency.
Quick Start
Create and run a JavaScript GUI app:
brookesia init my-app --template js-gui
cd my-app
pnpm install
brookesia doctor
brookesia build
brookesia simulate --target system
brookesia build creates a debug .bpk. For a release build, initialize signing material first:
brookesia sign init
brookesia release
brookesia verify
App Templates
The brookesia init command supports the following templates:
Template |
Purpose |
Notes |
|---|---|---|
|
JavaScript GUI app |
Default template with GUI resources |
|
Bundled JavaScript app |
Uses an rspack- or webpack-style bundler |
|
Lua GUI app |
Self-contained app |
For example, specify the template and parent directory:
brookesia init test --template js-gui --dir my-app
Command Reference
To view all commands and options:
brookesia --help
brookesia <command> --help
The common commands are:
Command |
Description |
|---|---|
|
Create an app directory from a template; use |
|
Check the app environment, simulator, and bundler; use |
|
Run a development build and create a debug |
|
Run a release build and create a signed release |
|
Generate signing keys in |
|
Pack a directory into a |
|
Verify a release |
|
Start a PC simulator; use |
|
Record the local simulator binary and GUI project directory configuration. |
|
Start the Settings GUI simulator without building an app. |
Simulator Modes
brookesia simulate --target system starts the WASM simulator in a browser and serves it through a local HTTP server:
brookesia simulate --target system
brookesia simulate --target system --smoke --duration-ms 2000
brookesia simulate --target system --gui-debug
brookesia simulate --target system --resolution 1024x600
The main supported targets include:
system: Run the app package in the WASM browser simulator.runtime: Run runtime-side tests with an external runtime simulator.gui: Start a configured GUI simulator project.settings: Start the Settings GUI simulator.both: Start both the GUI and system simulators.
@brookesia/simulator-wasm is resolved from the globally installed CLI, not from the app's node_modules. The app's pnpm install only installs bundler dependencies.