Skip to main content
Language v0.2.0 · Preview

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@next

To pin this release:

npm install --global @nm-lang/cli@0.2.1

Create a program and run the local simulator

nm --version
nm init main.nm
nm run main.nm --json

Examples 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.

success: 0failure: 1
nm run main.nm --sweep sweep.json --experimental-parameter-groups --json

Execute explicit zip/cartesian axes with shared work budgets and replayable source evidence.

output: human-or-jsondeterminism: runtime-timingfilesystem: neverJSON
01
nm check main.nm --json

Parse and validate a program with optional explicitly negotiated experimental language support.

output: human-or-jsondeterminism: byte-stablefilesystem: neverJSON
02
nm run main.nm --shots 1024 --json

Execute with explicit shot, output, and optional independently negotiated experimental language capabilities.

output: human-or-jsondeterminism: runtime-timingfilesystem: neverJSON
03
nm debug main.nm --breakpoint 6 --json

Record a bounded source-mapped debug session with verified breakpoints.

output: human-or-jsondeterminism: byte-stablefilesystem: neverJSON
04
nm fmt main.nm --check

Format or verify source-preserving output.

output: human-or-sourcedeterminism: byte-stablefilesystem: optional
05
nm lint main.nm --strict

Report diagnostics and enforce strict warning policy.

output: humandeterminism: byte-stablefilesystem: never
06
nm test main.nm --experimental-property-assertions --json

Run named tests, properties, snapshots, and explicitly negotiated branch verification with a versioned report.

output: human-or-jsondeterminism: byte-stablefilesystem: neverJSON
07
nm explain main.nm --json

Explain diagnostics and improvement opportunities.

output: human-or-jsondeterminism: byte-stablefilesystem: neverJSON
08
nm transpile main.nm --target superconducting --calibration calibration.json --json

Lower to a target-native gate basis with optional calibrated placement.

output: source-or-jsondeterminism: byte-stablefilesystem: neverJSON
09
nm estimate main.nm --ftqc --budget nm-budget.json

Print logical and fault-tolerant resource estimates and optionally fail closed against a versioned budget artifact.

output: jsondeterminism: byte-stablefilesystem: neverJSON
10
nm export main.nm --to qasm3 --strict --json

Export 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.

output: source-or-jsondeterminism: byte-stablefilesystem: neverJSON
11
nm benchmark main.nm --optimizers gd,adam --steps 8 --csv

Benchmark bounded objective or supervised workloads and emit versioned JSON or CSV evidence.

output: source-or-jsondeterminism: runtime-timingfilesystem: neverJSON
12
nm checkpoint create main.nm --steps 8

Create a deterministic, integrity-protected exact-GD training checkpoint.

output: jsondeterminism: byte-stablefilesystem: neverJSON
13
nm checkpoint resume training.checkpoint.json --additional-steps 8

Validate and continue an exact-GD checkpoint without mutating the input artifact.

output: jsondeterminism: byte-stablefilesystem: neverJSON
14
nm checkpoint model training.checkpoint.json --name resumed-model

Convert validated checkpoint state into the existing model-package contract; createdAt reflects invocation time.

output: jsondeterminism: runtime-timingfilesystem: neverJSON
15
nm init main.nm

Create a guarded runnable starter.

output: humandeterminism: filesystem-dependentfilesystem: always
16
nm package build main.nm

Build a portable learning-package artifact.

output: jsondeterminism: byte-stablefilesystem: neverJSON
17
nm package validate package.json

Validate a learning-package contract.

output: humandeterminism: byte-stablefilesystem: never
18
nm package list --json

List exact registry packages and trust metadata.

output: human-or-jsondeterminism: byte-stablefilesystem: neverJSON
19
nm package inspect std.bell@0.1 --json

Inspect source, integrity, license, and trust metadata.

output: human-or-jsondeterminism: byte-stablefilesystem: neverJSON
20
nm package install std.bell@0.1 --output std_bell.nm --json

Install an integrity-checked exact package.

output: human-or-jsondeterminism: filesystem-dependentfilesystem: alwaysJSON
21
nm package sign release.json --output release.signed.json --json

Create an Ed25519 release attestation.

output: human-or-jsondeterminism: filesystem-dependentfilesystem: alwaysJSON
22
nm package verify release.signed.json --json

Verify a signed package release against trusted keys.

output: human-or-jsondeterminism: byte-stablefilesystem: neverJSON
23
nm workspace snapshot main.nm

Create a deterministic read-only workspace snapshot.

output: jsondeterminism: byte-stablefilesystem: neverJSON
24
nm workspace share main.nm

Print a bounded fragment-first snapshot URL.

output: urldeterminism: byte-stablefilesystem: never
25
nm workspace validate workspace.snapshot.json --json

Validate snapshot integrity with stable diagnostic codes.

output: human-or-jsondeterminism: byte-stablefilesystem: neverJSON
26
nm lock main.nm

Create a canonical exact dependency lock from experimental package imports.

output: jsondeterminism: byte-stablefilesystem: neverJSON
27
nm lock main.nm --lock nm-lock.json --json

Validate missing, stale, changed, and non-exact source dependencies against a lock.

output: human-or-jsondeterminism: byte-stablefilesystem: neverJSON
28
Open Playground