CLI Reference
Complete command reference for ecmacraft and create-ecmacraft
EcmaCraft ships two CLIs:
ecmacraftfor building/running plugin projects,create-ecmacraftfor scaffolding new projects.
ecmacraft Commands
ecmacraft dev
Starts the development environment.
ecmacraft dev [--cwd <dir>]Behavior:
- loads
ecmacraft.config.*if present, - bundles your entry file in non-minified mode,
- creates/updates
.ecmacraft/development/server.propertiesfromdevelopment.serverProperties, - starts a Paper server process,
- watches
src/for changes (.ts,.tsx,.js,.jsx), - sends reload commands based on
development.reloadType.
Interactive Paper Console (stdin passthrough)
When ecmacraft dev is running, your terminal is also the Paper console.
Anything you type is forwarded to PaperMC stdin directly, so you can run server commands without opening a second terminal.
Common examples:
say hello from ecmacraft dev
list
help
time set day
gamerule keepInventory true
ecmacraft-reloadImportant notes:
- command output appears prefixed with
[paper], - your own EcmaCraft process logs appear with
[ecmacraft], - stdin forwarding stays active for the whole dev session,
- pressing
Ctrl+Cgracefully stops watcher + server.
Auto reload behavior after rebuild
After each successful source rebuild, EcmaCraft optionally runs a server command:
reloadType: 'soft'→ runsecmacraft-reload(recommended),reloadType: 'hard'→ runsreload confirm,reloadType: 'none'→ does not run any reload command.
This means you can choose between automatic reloads or fully manual console control.
Session lifecycle
During startup, ecmacraft dev:
- writes/update local dev server files under
.ecmacraft/development, - does an initial bundle,
- launches Paper,
- starts file watching,
- begins stdin forwarding.
If Paper exits unexpectedly, EcmaCraft attempts automatic restarts (up to 2 times, except for detected fatal JVM crash situations).
Useful examples:
# run from another directory
ecmacraft dev --cwd ./examples/my-plugin
# standard project run
pnpm dev
# send commands manually while running
# (type directly in the same terminal)
# list
# say dev server is liveecmacraft build
Builds a production artifact.
ecmacraft build [--cwd <dir>]Behavior:
- bundles your entry file in minified mode,
- downloads the EcmaCraft host jar,
- writes
dist/main.js, - creates
dist/ecmacraft.jarwith embedded plugin JavaScript.
Useful examples:
# build current project
ecmacraft build
# build from another path
ecmacraft build --cwd ./examples/my-plugincreate-ecmacraft Commands
Basic Usage
create-ecmacraft [project-name] [options]Options
-n, --name <name>: project/package name-d, --dir <dir>: target directory--description <text>: package description--pm, --package-manager <pm>:pnpm | npm | yarn | bun--install: install dependencies--no-install: skip dependency installation--overwrite: allow writing into a non-empty directory-y, --yes: skip prompts and accept defaults-h, --help: show help text
Example
pnpm create ecmacraft my-plugin --pm pnpm --installTypical non-interactive setup
create-ecmacraft my-plugin --pm pnpm --yes --install