Mbler Command Line Usage
Module Import Note
Starting from version 0.2.4-rc.6, Mbler supports modular imports:
// Main entry - contains CLI and core types
import * as mbler from "mbler";
// Build module - contains Build, build, watch and other build-related APIs
import * as Build from "mbler/build";init Command
Initialize a project, usage:
mbler initlang Command
Switch/Query the tool language, usage:
mbler lang
# Should output: zh or en
mbler lang en
# Should output: enversion Command
Query the tool version, usage:
mbler version
# Output: commit: xxxx version: xxx
mbler version -show commit
# Output: commit: xxxbuild Command
Build the project as an mc addon. If BUILD_MODULE in the env is build, it will additionally generate a package that can be imported into the game.
watch Command
Monitor changes and build in real time. No parameters, depends on the working directory context.
set-work-dir Command
Set work dir manger mode.
Example
- Use current cwd
mbler set-work-dir off- Use work dir manger
mbler set-work-dir on
# set work dir
mbler work ./projectwork Command
Set work dir, more see set-work-dir
install Command
Beta — subject to change.
Usage:
mbler install @scope/name@versionIf no version is specified, the latest version is used.
Downloads an addon from pmnx.qzz.io and copies it to the Minecraft game directory (behavior/resource packs).
uninstall Command
Beta — subject to change.
Usage:
mbler uninstall @scope/name@versionRemoves an installed addon from the Minecraft game directory.
login Command
Beta — subject to change.
Usage:
mbler login [token]Authenticates with the MNX marketplace. If no token is provided, prompts for input interactively.
profile Command
Beta — subject to change.
Usage:
mbler profileShows the currently logged-in user profile information.
publish Command
Beta — subject to change.
Usage:
mbler publish -tag :tag_namePublishes your addon to the MNX marketplace.
Options:
-tag— Version tag (e.g.latest,beta)-build—skiporenable(default:enable), whether to run the build before publishing
unpublish Command
Beta — subject to change.
Usage:
mbler unpublish @scope/name@versionRemoves a published version from the MNX marketplace.
view Command
Beta — subject to change.
Usage:
mbler view @scope/nameLists all published versions of a package on the MNX marketplace.
config Command
Manages global CLI configuration stored at ~/.config/.mbler.config.global.cli.json.
Usage:
mbler config get <key>
mbler config set <key> <value>
mbler config point
mbler config point <new config file path>Common keys:
token— stores the MNX authentication token
log Command
Manages the CLI log file (~/.cache/mbler/latest.log).
Usage:
mbler log point # Show log file path
mbler log clean # Clear the log file