Skip to content

HormigaDev/miga-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

🐜 MIGA - CLI

Bedrock Addon Utility Package Manager

A fast, zero-dependency CLI that bootstraps, builds, packages and manages Minecraft Bedrock Edition add-ons β€” written in Rust.

License: GPL v3 PayPal

Miga Banner

πŸ“‘ Table of Contents


πŸ”­ Overview

miga replaces a full Node.js toolchain for Bedrock add-on development. It handles:

  • πŸ—οΈ Scaffolding β€” creates a complete BP + RP project with typed TypeScript support.
  • πŸ“˜ TypeScript types β€” downloads .d.ts files directly from the npm registry without requiring npm or node to be installed.
  • πŸ“¦ Registry modules β€” fetches community modules from the miga registry and wires them into your project.
  • ⚑ Compilation β€” transpiles and optionally minifies TypeScript using oxc (native Rust, ~100Γ— faster than tsc).
  • πŸ“‚ Packaging β€” assembles .mcpack and .mcaddon archives ready for distribution.
  • πŸ”„ Hot reload β€” watches your source files and redeploys to Minecraft's dev pack folders on every save.
  • πŸ”€ Version conflict resolution β€” when two modules depend on different versions of the same transitive dependency, miga prompts you to upgrade or keep both.

πŸ“₯ Installation

From source

git clone https://github.com/HormigaDev/miga.git
cd miga
cargo install --path .

Pre-built binaries

Download the latest release from the Releases page and place the binary somewhere on your PATH.


πŸ› οΈ Commands

πŸ†• init

Scaffold a new Bedrock add-on project interactively.

miga init [--namespace <ns>] [--name <name>] [--type <type>] [--yes]

Options

Flag Short Description
--namespace <ns> -N Namespace prefix used inside the add-on (e.g. woc).
--name <name> -n Internal identifier for the add-on (e.g. ecological-spawns).
--type <type> -t Project type to scaffold (see below).
--yes -y Accept all defaults without interactive prompts.

Project types

Type Value Description
Full (default) full Behavior Pack with scripts + Resource Pack.
Behavior behavior Behavior Pack with scripts only (no Resource Pack).
Behavior (scriptless) behavior-scriptless Data-driven Behavior Pack only (no scripts).
Addon (scriptless) addon-scriptless Behavior Pack + Resource Pack, both without scripts.
Resource resource Resource Pack only.

Any missing options are asked interactively. Use -y to skip all prompts and use defaults (namespace=myaddon, name=my-addon, type=full). The command creates a directory named after the add-on containing the appropriate pack skeleton based on the selected project type.

Examples

miga init                                    # fully interactive
miga init --yes                              # accept all defaults
miga init -t resource -N textures -n my-rp   # resource pack only
miga init -y -t behavior                     # behavior + scripts, no prompts

πŸ“˜ add

Add a @minecraft/* type package from the npm registry.

miga add <package[@version]> [<package[@version]> ...]

Examples

miga add @minecraft/server@2.4.0
miga add @minecraft/server @minecraft/common

Types are downloaded to .miga_modules/ and the package is recorded in .miga/miga.json.


πŸ“¦ fetch

Install one or more modules from the miga registry.

miga fetch [<module>] [--version <ver>] [--update]

Options

Flag Description
--version Install a specific version (e.g. --version 1.2.0).
--update Update the module (or all modules if no name given) to the latest.

Examples

miga fetch                        # install all modules listed in miga.json
miga fetch bimap                  # install a specific module
miga fetch bimap --version 1.2.0  # install a specific version
miga fetch bimap --update         # update a module to latest
miga fetch --update               # update all installed modules

Modules are downloaded, extracted and registered in .miga/modules.lock. Transitive dependencies are resolved automatically. If a version conflict is detected (two dependants need different versions of the same module), miga will prompt you to upgrade, keep both, or keep the existing version.


πŸ”„ run

Watch for source changes and hot-reload the add-on into Minecraft.

miga run [--no-watch]
Flag Description
--no-watch Compile and deploy once, then exit (no file watcher)

miga run compiles TypeScript on every change and copies the packs to the paths configured in .env (BEHAVIOR_PACKS_PATH / RESOURCE_PACKS_PATH).


πŸ“¦ build

Compile, minify and package the add-on for release.

miga build

Outputs:

File Description
dist/<name>_behavior_pack-v<ver>.mcpack Behavior Pack only.
dist/<name>_resource_pack-v<ver>.mcpack Resource Pack only.
dist/<name>-v<ver>.mcaddon Combined archive (both packs).

πŸ—‘οΈ remove

Remove installed modules or external type packages.

miga remove <package> [<package> ...]
miga remove --all
Flag Description
--all Remove all installed modules and externals (asks first)

Deletes the module/package files and cleans .miga/modules.lock, .miga/miga.json, tsconfig.json and behavior/manifest.json automatically.


πŸ”€ Versioned module storage

Modules are stored under .miga_modules/<name>/v<version>/, enabling multiple versions of the same module to coexist when different dependants require incompatible versions.

.miga_modules/
β”œβ”€β”€ bimap/
β”‚   └── v1.0.0/
β”‚       β”œβ”€β”€ index.ts
β”‚       └── ...
└── utils/
    β”œβ”€β”€ v1.0.0/
    β”‚   └── ...
    └── v2.0.0/
        └── ...

During compilation, bare imports are rewritten to their versioned paths (e.g. import { ... } from "bimap" β†’ ./libs/bimap/v1.0.0/index.js), so each module always resolves to the exact version it was installed with.


πŸ—‚οΈ Project structure

After running miga init, the project looks like the example below. The actual directories depend on the chosen project type β€” for instance, a resource project has no behavior/ folder, and a behavior-scriptless project has no scripts/ subdirectory.

<addon-name>/
β”œβ”€β”€ behavior/               πŸ“ Behavior Pack
β”‚   β”œβ”€β”€ manifest.json
β”‚   β”œβ”€β”€ pack_icon.png       🎨 Replace with your own icon
β”‚   β”œβ”€β”€ LICENSE
β”‚   └── scripts/
β”‚       β”œβ”€β”€ index.ts        πŸš€ Entry point
β”‚       β”œβ”€β”€ config/
β”‚       β”‚   └── registry.ts πŸ“‹ Central registry / namespace
β”‚       β”œβ”€β”€ events/
β”‚       β”‚   └── index.ts
β”‚       β”œβ”€β”€ components/
β”‚       β”œβ”€β”€ features/
β”‚       └── core/
β”œβ”€β”€ resource/               πŸ“ Resource Pack
β”‚   β”œβ”€β”€ manifest.json
β”‚   β”œβ”€β”€ pack_icon.png
β”‚   β”œβ”€β”€ LICENSE
β”‚   β”œβ”€β”€ texts/              🌍 en_US.lang, es_ES.lang, pt_BR.lang
β”‚   β”œβ”€β”€ textures/
β”‚   β”‚   β”œβ”€β”€ blocks/
β”‚   β”‚   β”œβ”€β”€ items/
β”‚   β”‚   β”œβ”€β”€ entity/
β”‚   β”‚   └── ui/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ sounds/
β”‚   └── ui/
β”œβ”€β”€ .miga/
β”‚   β”œβ”€β”€ miga.json           πŸ“‹ Project manifest (name, version, modules)
β”‚   └── modules.lock        πŸ”’ Installed module lock file
β”œβ”€β”€ .miga_modules/          πŸ“¦ Downloaded modules (versioned)
β”œβ”€β”€ .env                    πŸ”§ Deploy paths (not committed)
β”œβ”€β”€ .env.template           πŸ“„ Template to share with collaborators
β”œβ”€β”€ .gitignore
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ LICENSE
└── README.md

πŸ”§ Environment variables

Configure .env (copy from .env.template):

# Absolute path to Minecraft's development_behavior_packs folder
BEHAVIOR_PACKS_PATH=

# Absolute path to Minecraft's development_resource_packs folder
RESOURCE_PACKS_PATH=

# true = inline source maps (debugging only)
SOURCE_MAPS=false

On Linux the default paths are auto-detected via $HOME. On Windows they point to %LOCALAPPDATA%\Packages\Microsoft.MinecraftUWP_*. If the path is not found, miga will warn and skip the copy step.


Support the Project ❀️

If you enjoy this project and feel that it has helped you in any way, please consider supporting its development.

Your donation helps maintain the project, improve existing features, and create more open-source tools for the community.

Every contribution, no matter the size, makes a real difference.

PayPal


🀝 Contributing

See CONTRIBUTING.md.


πŸ“„ License

miga is free software released under the GNU General Public License v3.0.

About

Bedrock Addon Utility Package Manager

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors

Languages