Skip to content

Repository files navigation

English | Korean | Japanese

mxpak

Mendix package manager and workspace deduplicator with global caching and hard links.

Download each widget once, cache it globally, and share it across all your projects at zero extra disc cost. Then deduplicate the rest of the shared assets (libraries, theme resources) in one pass.

How it works

mxpak has two complementary mechanisms, both backed by the same content-addressable store at ~/.mxpak/store/{sha256}/:

  1. mxp install — widget dependency manager. Downloads .mpk files from the Mendix Marketplace, stores them in the CAS by SHA-256 hash, and hard-links them into <project>/widgets/. Locked via mxpak.lock for reproducibility.
  2. mxp scan — workspace deduplicator. Scans every project under a workspace, hashes shared files that install doesn't manage (Java libraries in userlib//vendorlib/, Mendix standard theme assets in themesource/), and replaces duplicates with hard links to a single CAS-stored copy.

If the cache and project are on different drives (where hard links don't work), mxpak falls back to a regular file copy automatically.

Install

Prerequisite — Erlang/OTP 26+ must be on PATH (escript command available).

  • macOS: brew install erlang
  • Windows: winget install Erlang.ErlangOTP
  • Linux: sudo apt-get install erlang (or your distro's equivalent)

Release binary

Download mxp from the latest GitHub release, make it executable, and place it on PATH.

install -d "$HOME/.local/bin"
curl -fsSL \
  https://github.com/glendix-labs/mxpak/releases/latest/download/mxp \
  -o "$HOME/.local/bin/mxp"
chmod +x "$HOME/.local/bin/mxp"

The mxp asset is an Erlang escript and can also be run explicitly with escript /path/to/mxp.

Arch Linux users can install the mxpak-bin AUR package after its initial AUR publication. Maintainer setup and release automation are documented in AUR_PUBLISHING.md.

Troubleshooting

  • escript: ... command not found — Erlang/OTP is missing. Install it via the prerequisite step above.
  • mxp: command not found — ensure the install directory, such as $HOME/.local/bin, is on PATH.
  • undefined function mxpak:main/0 — download the current mxp release asset again.

From source

git clone https://github.com/glendix-labs/mxpak.git
cd mxpak
gleam run -m gleescript    # produces ./mxpak — rename to mxp and place on PATH

Usage

mxp <command> [options]
Command Description
install [project_root] Resolve and install all widgets from config (lock file preferred)
add <name> --version <v> Add a widget to config and install
remove <name> Remove a widget from config
update [name] Update widget(s) (clears lock, re-resolves)
marketplace [project_root] Interactive TUI browser for the Mendix Marketplace
outdated [project_root] List widgets with available updates
list [project_root] List installed widgets
info <name> Show widget details
audit [project_root] Verify SHA-256 integrity of all installed .mpk files
cache clean Clean the global cache
scan [path] Deduplicate *.mpk, *.jar, and themesource/** across all projects under the workspace
status [path] Show per-project deduplication stats and disc savings

Configuration

Add a [tools.mxpak] section to your project's TOML config:

[tools.mxpak]
mode = "mpk"
widgets_dir = "widgets"

[tools.mxpak.widgets.Badge]
version = "3.2.2"
id = 50325

[tools.mxpak.widgets."com.mendix.widget.web.Datagrid"]
version = "2.22.3"
id = 116540

Running mxp install generates a lock file (mxpak.lock) that pins exact versions and SHA-256 hashes for reproducible builds.

Workspace deduplication

mxp scan auto-detects what to scan based on where you run it:

# Case 1 — inside a single Mendix project (a `*.mpr` is in the directory):
cd ~/Mendix/TSVE4HMC-main
mxp scan         # scans this project only
                 # its assets are absorbed into the global CAS at ~/.mxpak/store/
                 # future scans of any other project automatically dedup against them

# Case 2 — a directory whose immediate children are Mendix projects:
cd ~/Mendix      # contains TSVE4HMC-main/, ChartTest/, Blank/, ...
mxp scan         # scans every Mendix project (every immediate subdir with `*.mpr`)

mxp status       # works the same way (single project or workspace)

If neither case matches (no *.mpr here, none in immediate children), scan exits with a clear hint.

Default rules (zero-config)

scan works with sensible defaults out of the box — no setup file required:

Rule Default value
include ["*.mpk", "*.jar"] — widgets and Java libraries (widgets/, userlib/, vendorlib/)
include_dirs ["themesource"] — Mendix standard theme modules (atlas_core, datawidgets, etc.); all extensions scanned under these directories
exclude_dirs ["deployment", "javascriptsource", "javasource", "modules", ".mendix-cache", ...] — build artefacts and project-unique code

scan and install share the same CAS at ~/.mxpak/store/. Widgets installed via mxp install are already hard-linked into the cache, so scan over them is effectively a no-op. Widgets that Mendix Studio Pro placed directly are absorbed into the CAS on the first scan and deduplicated thereafter.

Customising

Drop a .mxpak-workspace.toml in your workspace root to override any of the above:

[scan]
include      = ["*.mpk", "*.jar", "*.zip"]
include_dirs = ["themesource", "shared"]
exclude_dirs = [".git", "deployment"]

Missing keys fall back to defaults.

Measured savings (16 real Mendix projects, ~23 GB total)

mxp scan covers everything below in one pass:

Target Total After dedup Saved Ratio
widgets/*.mpk 804 MB 533 MB 270 MB 33.6%
*.jar in userlib/vendorlib 534 MB 222 MB 311 MB 58.3%
themesource/** 57 MB 15 MB 42 MB 74.0%
Combined 1,395 MB 770 MB 623 MB 44.7%

Licence

MIT License

About

CLI package manager for Mendix Marketplace widgets with version resolution, content-addressable caching, and an interactive TUI browser.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages