N/M command-line reference
Operational commands for creating, checking, testing, running, packaging, exporting, transpiling, and sharing reproducible N/M workspaces.
Public npm installation
Install the N/M command line
Create and run a local N/M program without a repository checkout or a TypeScript build.
Requires Node.js 20 or newer. Release checks use Node.js 22.23.1.
npm package 0.2.1 targets N/M language 0.2.0. next selects the preview channel and can change; use @0.2.1 to reproduce this release. An untagged install selects latest. The VS Code extension has a separate distribution version.
npm install --global @nm-lang/cli@nextTo pin this release:
npm install --global @nm-lang/cli@0.2.1Create a program and run the local simulator
nm --version
nm init main.nm
nm run main.nm --jsonExamples run on a local simulator. Installation does not establish physical QPU access or make every capability stable.
Personal, educational and commercial use is free. QuantumSoftware retains rights to its package code; modification and redistribution require separate permission. Your N/M programs and results remain yours. Read LICENSE.txt in the installed package.
CLI 0.1 command contract
Help output, documentation, the spec API, packaged CLI exports, output kinds, filesystem mutation, determinism, and exit codes are generated from one registry. Successful commands return 0; invocation, validation, provider, or execution failures return 1.
nm run main.nm --sweep sweep.json --experimental-parameter-groups --jsonExecute explicit zip/cartesian axes with shared work budgets and replayable source evidence.
nm check main.nm --jsonParse and validate a program with optional explicitly negotiated experimental language support.
nm run main.nm --shots 1024 --jsonExecute with explicit shot, output, and optional independently negotiated experimental language capabilities.
nm debug main.nm --breakpoint 6 --jsonRecord a bounded source-mapped debug session with verified breakpoints.
nm fmt main.nm --checkFormat or verify source-preserving output.
nm lint main.nm --strictReport diagnostics and enforce strict warning policy.
nm test main.nm --experimental-property-assertions --jsonRun named tests, properties, snapshots, and explicitly negotiated branch verification with a versioned report.
nm explain main.nm --jsonExplain diagnostics and improvement opportunities.
nm transpile main.nm --target superconducting --calibration calibration.json --jsonLower to a target-native gate basis with optional calibrated placement.
nm estimate main.nm --ftqc --budget nm-budget.jsonPrint logical and fault-tolerant resource estimates and optionally fail closed against a versioned budget artifact.
nm export main.nm --to qasm3 --strict --jsonExport QASM, Quantikz, raw AST JSON (json), versioned JSON IR (ir), or executable PennyLane Python; QASM JSON retains source sidecars; QASM3 also includes conformance evidence; PennyLane JSON retains required source sidecars.
nm benchmark main.nm --optimizers gd,adam --steps 8 --csvBenchmark bounded objective or supervised workloads and emit versioned JSON or CSV evidence.
nm checkpoint create main.nm --steps 8Create a deterministic, integrity-protected exact-GD training checkpoint.
nm checkpoint resume training.checkpoint.json --additional-steps 8Validate and continue an exact-GD checkpoint without mutating the input artifact.
nm checkpoint model training.checkpoint.json --name resumed-modelConvert validated checkpoint state into the existing model-package contract; createdAt reflects invocation time.
nm init main.nmCreate a guarded runnable starter.
nm package build main.nmBuild a portable learning-package artifact.
nm package validate package.jsonValidate a learning-package contract.
nm package list --jsonList exact registry packages and trust metadata.
nm package inspect std.bell@0.1 --jsonInspect source, integrity, license, and trust metadata.
nm package install std.bell@0.1 --output std_bell.nm --jsonInstall an integrity-checked exact package.
nm package sign release.json --output release.signed.json --jsonCreate an Ed25519 release attestation.
nm package verify release.signed.json --jsonVerify a signed package release against trusted keys.
nm workspace snapshot main.nmCreate a deterministic read-only workspace snapshot.
nm workspace share main.nmPrint a bounded fragment-first snapshot URL.
nm workspace validate workspace.snapshot.json --jsonValidate snapshot integrity with stable diagnostic codes.
nm lock main.nmCreate a canonical exact dependency lock from experimental package imports.
nm lock main.nm --lock nm-lock.json --jsonValidate missing, stale, changed, and non-exact source dependencies against a lock.