Reference › Commands

Reference

archec commands

archec <command> … — archec with no command lists the everyday ones; archec help --all lists every command by what it is for (the sections below), archec help <command> (or archec <command> --help) gives one command's usage and an example; archec --version gives the version. A command that checks something exits 1 when it finds a problem, so each one can be a CI step; archec ci is all of them at once.

There is one page per group of commands.

Group What it is for Commands
Start The commands that start a project and give help. new, help, config
Write and check The commands you use while you write a model: check it, fix it and format it. check, fix, explain, suggest, vet, fmt, edit, review, live-fix, mcp, convert-handlers, stubs, patterns, ast
Build and test The commands that build the Arche project, run its tests and simulate it. build, pull, test, sim, physics, fit, difftest, where, ci, validate, diff
Analyse The commands that analyse a model and the running system: timing, model checking, safety, security and logs. analyze, timing, verify, why, why-not, replay, live, study, safety, tara, parts, merge, observe, cad, synth
Present The commands that show a model: animations, the product's screens, the Arche app and stories. animation, ui, app, story
Requirements The commands for requirements: baselines, sign-off, issues, standards, specifications and diagrams. baseline, approve, approvals, issues, cert, qualify, polarion, reqif, doc, diagram
Generate The commands that write code, and files for other tools, from the model. gen, generator, plugin, fmi, kicad, sysml, export, api, capella
Import The command that reads other tools' files into arche-lang. import
Refactor The rewrites that change how a model is written but not what it means. refactor
Code and model The commands that compare existing code with the model. recover, conform, arch-diff, impact, brief, agent-context
Libraries The command that manages the versioned libraries a project uses. lib
Boards The commands for boards, devices and their pins. board, device, pins
Store The commands that find, add and publish packages of the Arche Store. store, add, audit, publish, search, shelf
Provenance The commands that tell who wrote each piece of code, and who understands it. provenance, guard, debt

Examples#

npm install && npm run build
node dist/cli.js build examples/autonomous-car/main.arche -o out   # → an Arche project
../arche/dist/arche-darwin-arm64 --project out                     # open it
node dist/cli.js check examples/autonomous-car/main.arche          # lint (exit 1 on errors, --strict on warnings, --json)
node dist/cli.js fmt --write examples/**/*.arche                   # format
node dist/cli.js fmt --simplify --write old.arche                  # rewrite in the short forms (same meaning)
node dist/cli.js fmt --extract-code --write main.arche             # move ```python blocks into .py files (same meaning)
node dist/cli.js stubs main.arche                                  # .arche/typings: Arche's helpers + the model's names, for Python and TypeScript tooling
node dist/cli.js pull main.arche --write                           # code edited in the Arche app → back into the .py / .arche sources
node dist/cli.js test main.arche                                   # build + arche-cli test, errors shown at their source line
node dist/cli.js analyze examples/autonomous-car/main.arche        # core load, response times, bus load, latency chains
node dist/cli.js difftest examples/live/main.arche                # the simulator and the generated C on the same random inputs
node dist/cli.js physics examples/dc-motor/main.arche Drive --integrator implicit --tol 1e-6  # a physical network, a stiff one too
node dist/cli.js physics examples/dc-motor/main.arche Drive --linearize --inputs supply.v --lqr 1,0.1  # A, B, C, D, its modes, an LQR gain
node dist/cli.js physics examples/dc-motor/main.arche Drive --batch 100 --vary motor.r=0.8..1.2 --csv runs.csv  # 100 runs over worker threads
node dist/cli.js sim examples/live/main.arche --html sim.html     # one page that runs the model live: pause, step, speed, send, plots
node dist/cli.js doc examples/autonomous-car/main.arche -o spec.tex # LaTeX specification (lualatex spec.tex)
node dist/cli.js doc examples/autonomous-car/main.arche --template examples/templates/autonomous-car-spec.docx -o spec.docx # your Word template, filled ({{ … }}: docs/templates.md)
node dist/cli.js diagram main.arche Car --md >> README.md          # a diagram as Mermaid, which GitHub draws (or --format d2|svg)
node dist/cli.js validate ../arche/sample-aesa                     # schema-check any Arche project
node dist/cli.js patterns                                          # the pattern reference
node dist/cli.js import model.sysml -o model.arche                 # a SysML v2 model in arche-lang
node dist/cli.js import bus.dbc -o bus.arche                       # a CAN DBC: frames, signals, nodes, routes
node dist/cli.js capella main.arche -o project.zip                 # a Capella 6.1 project (and back: capella model.capella -o dir)
node dist/cli.js ci main.arche --junit report.xml                   # every check a pipeline runs, one exit code
node dist/cli.js check main.arche --sarif archec.sarif             # the diagnostics as SARIF, for code scanning
node dist/cli.js lib main.arche lock                               # the versioned libraries used, locked in arche.lock
node dist/cli.js recover src -o recovered.arche                    # the architecture of code, as arche-lang
node dist/cli.js conform recovered.arche                           # the code's imports against the model's links
node dist/cli.js arch-diff src main..HEAD --md                     # what a branch changed in the architecture
node dist/cli.js impact main..HEAD --md                            # why each hunk exists: part, functions, requirements, tests