Skip to content

mbler documentation

Command usage

This page lists common commands, formats, aliases, and brief descriptions of mbler. Most commands need to be set up or go to the working directory first (see 'checkout / -c'). If you run commands frequently in your dev repository, it is recommended to use 'npm link' to link your local mbler to global commands (see tips below).

Important

  • If you are still using node index.js<cmd>, it is recommended to run npm link in the root directory of the repository, and then you can use mbler <cmd>.
  • Features marked as {BETA} are experimental/imperfect, please use them with caution and feedback questions.

Command overview

CommandUsageAliasDescription
checkout`mbler checkout <PATHnull>`-c
buildmbler build---Package the current working directory (build behavior package/resource).
initmbler init-iInitialize the project skeleton in the current working directory (interactive).
versionmbler versionDisplays the version of the current working directory item (version in the package or MBLER configuration).
vmbler v-vDisplays the version of the MBLER tool itself
cleanmbler cleanclnClean up temporary files and output traces generated by the build
web_editmbler web_edit{BETA} Launches the local web code editor (experimental feature).
install`mbler install <git-urllocal path >`
addmbler add<package-name>Add a declaration of installed dependencies in the configuration of the current working directory (add the dependencies to the project reference).
removembler remove<package-name>Remove dependency claims from the current working directory configuration (do not delete installed packages).
uninstallmbler uninstall<package-name>Delete the installed dependency package (removed from the dependency repository).
devmbler devEnable development mode: listen to source code changes and compile/build in real time (for local debugging).
recachembler recacheReset cache
helpmbler help<命令名>See help for the command
langmbler lang' <语言名>switch language
create`mbler create <git repodirnpm package>`
Common examples
  • Toggle/view the working directory
bash
# Switch to the MyProject directory and make it your current working directory
mbler checkout ./myproject
# checkout is too long, -c is recommended
mbler -c ./myproject

# Check the current working directory
mbler -c
  • Initialize the project (perform interactive initialization in the current working directory)
bash
cd ./myproject && mbler -c ./
mbler init
  • Switch languages
bash
# Switch to Chinese Simplified, others en English 
mbler lang zh
mbler help lang
  • Build
bash
# Build the current working directory
mbler build
  • Install and manage dependencies
bash
# Install dependencies from a remote git repository (pull packages into local dependencies repositories)
mbler install https://github.com/owner/dep-repo.git
# Local path installation (commonly used in development)
mbler install .. /local-dep
# Declare installed dependencies in the project (add them to the project configuration)
mbler add gameLib
# Remove dependency declarations from the project configuration
mbler remove gameLib
# Uninstall installed dependency packages (removed from local dependency repositories)
mbler uninstall gameLib
  • Development with thermal heavy loads
bash
# Enter development mode to automatically listen and build
mbler dev

Other Notes and FAQs

  • npm link related: After executing npm link, make sure that the global npm bin is in the system PATH. Linux/macOS can be confirmed with which mbler and Windows can be confirmed with 'where mbler'.
  • Command context: Most commands (such as build, add, remove, version) rely on the current working directory (checkout point), make sure to bind the working directory to mbler -c ./ before using it.
  • web_edit is an experimental feature

Next Step

Create Project