@fiberfx/mx
v0.1.1
Published
Mercury CLI launcher: runs the native mx npm installed for this host and keeps it current from mx.jonnify.com.
Readme
@fiberfx/mx
The Mercury toolchain, mx, from npm: a small Node launcher and the native binary for your platform.

The mx course on mercury.jonnify.com.
Overview
mx is Mercury's native toolchain, written in Rust. It installs and verifies modules, builds apps, hosts and library packages, serves them with hot reload, and runs their tests in a real browser.
This package brings mx to any machine with Node. Its launcher, cli.mjs, is an ES module that runs under Node 20.6
or later; npm installs exactly one optional platform package, the one matching the host's operating system, CPU and C
library, and the launcher starts that binary with your arguments, output and exit code unchanged. The package has no
install script.
To create apps straight away, install @fiberfx/mercury instead: it depends on this release and fills the Mercury
module cache when it installs, so mx new hello works offline from the first run.
Install
npm install --global @fiberfx/mx
mx --versionOr for one project:
npm install --save-dev @fiberfx/mx
npx mx --versionKeep optional dependencies enabled. The binary is an optional dependency, so an install with --omit=optional leaves
the launcher without it.
Staying current
At most once a day the launcher asks https://mx.jonnify.com/releases/latest (GitHub releases if that fails) for the
newest mx. When it is newer than the packaged binary, it downloads that release's archive for this host, checks it
against the release's SHA256SUMS, confirms it reports the expected version, and installs it in ~/.mercury/bin
(%LOCALAPPDATA%\Mercury\bin on Windows), printing one line on stderr. Later runs use the newer binary. A failed or
offline check changes nothing: the packaged binary runs.
Set MX_NO_UPDATE=1 to never check; checks are also skipped when CI is set. The state lives in update.json beside
the installed binary.
Platforms
| Platform | Package | Requires |
| --- | --- | --- |
| Linux x64 (glibc) | @fiberfx/mx-linux-x64 | glibc 2.39 or later |
| Linux arm64 (glibc) | @fiberfx/mx-linux-arm64 | glibc 2.39 or later |
| macOS arm64 | @fiberfx/mx-darwin-arm64 | macOS 11 or later |
| macOS x64 | @fiberfx/mx-darwin-x64 | macOS 11 or later |
| Windows x64 | @fiberfx/mx-win32-x64 | |
The launcher needs Node 18 or later. The Linux and macOS packages also carry hyperscript-lsap, the Hyperscript
language server; the Windows package carries mx.exe alone. Linux with musl (Alpine) has no package yet.
Commands
| Command | What it does |
| --- | --- |
| mx build | Builds what the directory holds: mx.json makes a host build, index.html beside mx.mod an app bundle, and package.json exports naming source entries a library package. --host, --bundle, --lib and --package choose explicitly. |
| mx dev | Serves the module or app with hot reload (--root, --port). |
| mx test | Runs the module's tests in a browser, each file a page. MX_BROWSER names the browser, else the first Chromium found. |
| mx run <script> | Runs a package.json script, or with -r the script of every package in the workspace, with a cache. |
| mx install | Fills the module store from mx.mod, each tree held to mx.sum. |
| mx check | Verifies a host build without writing anything. |
| mx work | Manages a workspace of several modules (mx.work). |
mx <command> --help prints each command's usage. The first page
walks from an empty directory to a running, styled app.
Troubleshooting
When the packaged binary is missing, the launcher explains what is missing rather than downloading anything:
missing optional package @fiberfx/mx-…: npm skipped the platform package. Reinstall@fiberfx/mxwith optional dependencies enabled, on a supported platform.unsupported platform …; this release provides …: no package matches this host; the message lists those that exist.glibc … is too old or unknown: the Linux binaries need glibc 2.39 or later.
Without Node, use the release archives and their SHA-256 sums described in Install mx.
Documentation
- mx course and its chapters: first page, build, dev, modules, workspace, tools
- Install mx and module stability
- API reference; for agents, every page also answers
<page>/llms.txt
Related
- Mercury overview: every module and how they fit
- @fiberfx/hyperscript, @fiberfx/ui, @fiberfx/hypergraph
License
MIT. Each platform package also includes THIRD_PARTY_NOTICES.txt for the Rust crates linked into its binaries and
the Rust standard library's license, RUST-STANDARD-LIBRARY.html.
