Skip to content

CointMU CLI Reference ​

cmu is an all-in-one CLI toolkit for building, compiling, deploying, and auditing Web3 applications on the CointMU private network ecosystem. It abstracts the complexity of blockchain execution into instant terminal commands.

Command Overview ​

CommandPurpose
cmu createScaffold a new CointMU project from a selectable template.
cmu compileCompile Solidity contracts and generate contract artifacts.
cmu deployExecute deployment scripts sequentially from the deploy/ directory.
cmu consoleOpen an interactive REPL against the configured network.
cmu explorerQuery block and contract information over RPC.
cmu testRun the contract test suite against an ephemeral local DevNet.
cmu auditRun dependency checks and Solidity static analysis.
cmu walletSave and switch encrypted wallets, check balances and send coins.
cmu networkSave, list, switch, and ping the RPC networks available to the CLI.
cmu nodeTest RPC connectivity or start a local development network.
cmu mineStart, stop and watch block mining on the active network's node.
cmu versionPrint CLI, runtime, and dependency versions.
cmu updateUpgrade the CLI to the latest release from the npm registry.

TIP

Run cmu <command> -h to see the detailed options for any individual command.

Global Options ​

FlagDescription
-v, --verbosePrint full stack traces on failure.
-V, --versionPrint the full version report and exit.
-h, --helpDisplay help for a command.

-v, --verbose is declared once on cmu itself rather than on each command, so it is accepted anywhere on the line:

bash
cmu -v network list
cmu network -v list
cmu network list -v

Error Output ​

Every command reports a failure the same way: the command that failed, the message, and — where the CLI can suggest something useful — a hint.

bash
error: network save failed
--name is required.
hint: e.g. `cmu network save http://127.0.0.1:8585 --name local`.

Failures exit with code 1. Pass -v to print the full error object with stack frames instead of the message alone.

INFO

Paths printed in errors have your home directory replaced with ~, both in plain messages and in -v stack traces. Since 1.7.2, URLs in errors also have their credentials and query values masked; see Credentials in RPC URLs.

Color Output ​

Labels such as error:, warning: and hint: are colored only when color is wanted. Since 1.7.2 the first matching rule decides, separately for stdout and stderr:

ConditionColor
FORCE_COLOR=0 or FORCE_COLOR=falseOff
FORCE_COLOR set to anything elseOn
NO_COLOR set and not emptyOff
The stream is a terminalOn
Otherwise (pipe or file)Off

Only color codes are removed; prompts and the cmu mine start --watch status line still redraw. In 1.7.1 and older, color codes were written to pipes and files as well.

Runtime Requirements ​

ScopeMinimum Node.js
The CLI itself20.12.0
cmu test and cmu node start22

The DevNet commands need a newer runtime than the rest of the CLI because they run on EDR, whose native binary npm skips without warning on older Node. See Installation.

Executing Project Code ​

cmu compile, cmu deploy, cmu test, cmu console, and cmu explorer execute files from your project directory — cmu.config.ts/js is require()d, and every script in deploy/ runs with your decrypted PRIVATE_KEY in its environment. The CLI lists those files and asks for confirmation before any of them run.

Pass -y, --yes to skip the prompt in a pipeline you trust. See the trust model on the cmu deploy page.

Typical Workflow ​

Most CointMU projects follow this sequence:

bash
cmu create <project> [options]
cd <project>
cmu compile
cmu deploy

After deployment, use the remaining commands to validate and operate the project environment:

CommandWhen to use
cmu testRun contract tests against a throwaway local chain.
cmu auditSecurity review for dependencies and smart contracts.
cmu explorerInspect a block, or confirm a deployment landed on-chain.
cmu consoleCall a deployed contract interactively, without writing a script.
cmu node connectVerify RPC endpoint connectivity.
cmu network listReview which networks are saved and which is active.
cmu wallet createGenerate wallets for local development.

Command Reference ​

Use the linked pages for full command-specific behavior, options, and validation rules.