Skip to content

CLI reference

This is the full inventory of mx subcommands plus the hivecast wrapper commands that touch packages, grouped by lifecycle stage. Every entry links to the file where the command is defined.

The mx CLI is built from projects/matrix-3/packages/mx-cli/src/index.ts. Run mx --help for the live help text. Run <verb> --help for a specific command's flags.

Author

CommandSourcePage
mx init [-y]commands/init.tsAuthoring → Scaffold a package
mx actor <name>commands/actor.tsAuthoring → Scaffold a package
mx element <name>commands/element.tsAuthoring → Scaffold a package
mx actor-element <name>commands/actor-element.tsAuthoring → Scaffold a package
mx cqrs <name>commands/cqrs.tsAuthoring → Scaffold a package
mx webapp <name>commands/webapp.tsAuthoring → Scaffold a package
mx validate [target]commands/validate.tsAuthoring → Package manifest

Build / Test

These are package-local, not mx subcommands; documented here for completeness:

CommandWhere
pnpm buildper-package package.json:scripts.build
pnpm testper-package package.json:scripts.test
pnpm build:affected / pnpm test:affectedtop-level package.json (Turbo)

See Local Development → Build and Local Development → Test.

Publish

CommandSourcePage
mx packcommands/pack.tsPublishing → npm-compatible publication
mx publish [--dry-run]commands/publish.tsPublishing
mx config get/set/list/resetcommands/config.tsLocal Development → Config explain
mx logincommands/auth.tsPublishing → npm-compatible publication
mx logoutcommands/auth.ts(auth)
mx whoamicommands/auth.ts(auth)
mx search <query>commands/search.tsPublishing → Package metadata

Install / Manage

CommandSourcePage
mx install <source> [--force]commands/install.tsInstalling
mx uninstall <packageName>commands/uninstall.tsInstalling → Uninstall
mx listcommands/list.tsInstalling → Package store
mx info <packageName>commands/info.tsInstalling → Package store
mx fork <packageName>commands/fork.tsPublishing → Versioning
mx outdatedcommands/outdated.tsPublishing → Versioning
mx update-fork <packageName>commands/update-fork.tsPublishing → Versioning

Run / Operate

mx run and mx up share their body in commands/run.ts:

CommandSourcePage
mx run <target> [--env <name>] [--serve] [--check]commands/run.tsLocal Development → Run in place
mx up <target> [--env] [--serve] [--check]commands/run.ts (alias)Running → hivecast up
mx service <packageDir>commands/service.tsAuthoring → Runtime entrypoints

Identity / HiveCast linking

These don't touch package state directly but commonly appear next to the package commands. Source: commands/auth.ts plus projects/matrix-3/packages/mx-cli/src/utils/hivecast-link-store.ts.

Command
mx login --hivecast [--device] [--cloud <url>]
mx logout --hivecast
mx whoami --hivecast
mx link-status
mx refresh-credentials
mx revoke-device

See projects/matrix-3/packages/docs-hivecast/content/cli/ for the HiveCast-specific narrative.

hivecast wrapper subcommands relevant to packages

The wrapper (projects/matrix-3/packages/hivecast/bin/hivecast.mjs) delegates the package-touching subcommands to the host-service CLI:

CommandWhat it does
hivecast up <package-or-path>Start a runtime that supervises a package. See Running → hivecast up
hivecast down <runtime-id|package|mount>Stop a runtime. See Running → hivecast down
hivecast invoke <mount> <op> [json]Send a request to an actor. See Running → Verify
hivecast runtimesList supervised runtimes. See Running → Health
hivecast statusHost status
hivecast doctor [--repair] [--json]Audit the Host home
hivecast operator refresh-host-packageBuild, install, restart in one step. See Local Development → Refresh without copying

Common flag patterns

FlagCommon acrossDefault
--home <path>hivecast and matrix CLIs~/.matrix
--packages-dir <path>mx install/uninstall/list/info<MATRIX_HOME>/packages
--registry <url>mx install/publish/searchfrom mx config get registry
--registry-dir <path>mx install/publishnone (mutually exclusive with --registry)
--credentials-file <path>mx login/install/publish<MATRIX_HOME>/credentials/registry.json
--jsonmost commandsoff (human output)
--forcemx installoff
--checkmx run/serviceoff

See also

Source: projects/matrix-3/packages/mx-cli/src/index.ts registers every mx subcommand; projects/matrix-3/packages/host-service/src/cli.ts registers the up/down/invoke/status/runtimes commands; projects/matrix-3/packages/hivecast/bin/hivecast.mjs:432-457 is the wrapper's help text.