@crossberryweb/mozhi
v3.7.1
Published
Mozhi programming language interpreter — native web, JSON, fs, math, SQLite, templates — with the built-in package manager (`mz install`). Install once, get both commands: `mozhi` and the short alias `mz` (identical behavior).
Maintainers
Readme
@crossberryweb/mozhi — official npm distribution
The Mozhi programming language, delivered as pre-built native binaries through npm.
Installing this package gives you two equivalent commands:
mozhi run app.mz # canonical command
mz run app.mz # short alias — same binary, identical behaviorBoth are installed by npm from the same launcher, so mz and mozhi are
always in sync: same version, same flags, same exit codes.
Requirements
- Node.js ≥ 22 — any currently supported release line: 22.x (Maintenance
LTS), 24.x (LTS) or 26.x (Current). Node.js 14, 16, 18 and 20 have reached
end of life and are no longer supported; on those lines the launcher still
works (it only uses
child_process,fsandpath) but prints a one-time end-of-life notice. The interpreter itself is a fully static native binary — Node.js only runs the tiny launcher shim.
Package manager (v3.3.0)
The launcher now includes a package manager — no interpreter required:
mz install strings # from the Mozhi registry (version-controlled JSON)
mz install [email protected] # a specific release tag
mz install @user/repo # from any Git repo's tagged releases
mz install @user/[email protected] # ... pinned to a tag
mz install ./tool.mz.pkg.zip # manual/offline install from a package zip
mz install ./mytool # from a local package directory
mz list # installed packages + origins
mz search web # search the registry
mz uninstall stringsPackages are verified before every install (package.toml manifest + entry
module, traversal-safe extraction) and resolve automatically at import:
import strings
echo(strings.reverse("Mozhi"))Create your own package — complete with a GitHub Actions workflow that
attaches <name>.mz.pkg.zip to the release whenever you push a v* tag:
mz pkg new mytoolFull guide: https://crossberry-in.github.io/mozhi-doc/packages.html
What you get (v3.3.0)
- Precise error diagnostics: every error carries a stable code
(
LEX001,PARSE002,NAME001, ...), a caret span under the exact token, a suggested fix, and a link to its documentation page. - Free AI Diagnosis (opt-in for scripts, automatic in interactive
terminals): an anonymous, keyless service explains the error — no API
key, no account, no payment. Disable with
--no-aiorMOZHI_NO_AI=1. Failure of the service never affects the local diagnosis or exit code. - Machine-readable output:
mozhi --json run app.mzemitsmozhi.diagnostics.v1JSON to stderr (codes, spans, docs URLs). - Native modules:
web(HTTP server),json,fs(sandboxed),db(SQLite),math,template,httpclient.
Usage
mozhi run app.mz # run a script (plain: mozhi app.mz)
mz run app.mz # identical
mozhi new myapp # scaffold a project (web | minimal)
mozhi dev # auto-reload dev server
mozhi test tests/ # run *.test.mz suites
mozhi lint src/ # parse checks with error codesPlatform support
Bundled binaries (fully static musl builds, SQLite vendored — work on glibc distros, Alpine, Termux/Noxs):
linux-x86_64linux-arm64
macOS / Windows: use the installer
curl -fsSL https://github.com/crossberry-in/mozhi-doc/raw/main/install.sh | bash
(it installs mozhi and the mz alias too).
Diagnostics & AI Diagnosis
error[LEX001]: illegal character in source
--> app.mz:1:14
1 | echo(string(5 ^ 3))
| ^
reason: the character '^' is not part of the Mozhi language
help: exponentiation is written with '**' in Mozhi, e.g. 5 ** 3
docs: https://crossberry-in.github.io/mozhi-doc/errors/LEX001Every docs: URL is a real page in the official error reference.
See mozhi help for all output flags (--json, --no-color,
--verbose, --no-ai, --ai).
Links
- Documentation: https://crossberry-in.github.io/mozhi-doc/
- Error code reference: https://crossberry-in.github.io/mozhi-doc/errors/
- Source/issues: https://github.com/crossberry-in/mozhi
