Toolkit
ESP-Brookesia Toolkit is the npm CLI for initializing, building, packing, verifying, simulating, and deploying ESP-Brookesia app packages (.bpk).
The published package is esp-brookesia-toolkit.
Agent IDE integration (MCP) is documented separately: App Dev Plugin.
Environment Requirements
Node.js 20 or newer (
>=20), withnpm/npxonPATH. Matches the published Toolkit and pluginengines.noderequirement.After
brookesia init --template js-bundle, runnpm installin the app directory (the template pulls in@rspack/cli).js-gui,lua-gui, andwasm-guihave no extra npm dependencies.
Install the Toolkit
End users install the published CLI globally:
npm install -g esp-brookesia-toolkit
brookesia --help
The WASM simulator package @brookesia/simulator-wasm is installed as a CLI dependency and resolved from the global CLI, not from the app's node_modules. brookesia simulate needs the staged simulator artifacts inside that package. If they are missing, brookesia doctor reports it and simulate fails.
To bump the CLI later:
npm install -g esp-brookesia-toolkit@latest
After a global install, reopen the terminal if brookesia is missing from PATH.
Quick Start
Create and run a JavaScript GUI app:
brookesia init my-app --template js-gui
cd my-app
brookesia doctor
brookesia build
brookesia simulate
brookesia build creates a debug .bpk. For a signed release:
brookesia sign init
brookesia release
brookesia verify
Install the newest .bpk in dist/ onto hardware (requires Serial Command-Line Tool):
brookesia deploy
brookesia deploy --port /dev/ttyACM0
App Templates
brookesia init supports the following templates:
Template |
Purpose |
Notes |
|---|---|---|
|
JavaScript GUI app |
Default template with GUI resources |
|
Bundled JavaScript app |
rspack-style bundler; run |
|
Lua GUI app |
No extra npm dependencies |
|
WebAssembly GUI app |
Ship a prebuilt |
Example:
brookesia init test --template js-gui --dir my-app
Command Reference
brookesia --help
brookesia <command> --help
Command |
Description |
|---|---|
|
Create an app directory from a template; |
|
Check the app environment, WASM simulator artifacts, bundler, USB CLI, and connected device. |
|
Development build; writes a debug |
|
Release build; writes a signed release |
|
Generate signing keys under |
|
Pack a directory into a |
|
Verify a release |
|
Start the WASM browser simulator (local HTTP server). There is no |
|
Install a |
WASM Simulator
brookesia simulate launches only the WASM browser simulator:
brookesia simulate
brookesia simulate --package dist/my-app.debug.bpk
brookesia simulate --smoke --duration-ms 2000
brookesia simulate --gui-debug
brookesia simulate --resolution 1024x600
brookesia simulate --no-open --port 8787 --pid-file /tmp/brookesia-sim.pid
brookesia simulate --stop --pid-file /tmp/brookesia-sim.pid
Option |
Description |
|---|---|
|
Load this |
|
Headless smoke: start non-running apps, then exit. |
|
Per-app duration for |
|
JSON UI debug outlines. |
|
Window size, for example |
|
Do not open a browser. |
|
HTTP port (default |
|
Write the server PID; required with |
|
Stop the server recorded by |