modus
Menu
On this page

Commands of modustool

All the automation of the project is one program of the host, modustool. Run a command with nix develop -c modustool <command>. 59 commands.

The commands of the tool. The name is the first argument; the help after it is what modustool help prints, one line for each command. The comment above each command is its documentation on the site.

modustool is the one program of the automation of the project: the build, the machine tests, the pictures, the measures, the changelog, the news and the site. The project has no script: each step of the work, by hand or in a workflow, is a command here, so each call of a third-party program (the compiler, the linker, QEMU) is written in one place.

Run a command from the root of the repository, in the development shell of the flake, which gives the tool its compilers, QEMU and the firmware:

nix develop -c modustool <command> <arguments>

The tool writes into build/, which is not committed, and into the files of the repository that a command names (the pictures, the measure record, the changelog). A command ends with the status 0 when it succeeds, 1 when a step fails, and 2 when its arguments are wrong.

The comment above COMMANDS in tools/modustool/main.odin.

The table names each command; under it, each command has its documentation, the help that modustool help prints, and a link to its line.

Read from tools/modustool/main.odin.

CommandWhat it does
build

Builds the whole system: each module, the boot image, and the boot program that holds the kernel and the boot image.

  • whole (optional): a whole build: the tool ignores every build record and builds each module and each boot volume.
  • processes (optional): the count of module builds at once; the count of the processors when it is absent.

The build is incremental: a module whose inputs are the same as at its last build is kept, and so is each boot volume.

module

Builds one module of the table of modules in this process, with the options of one build.

  • name: a module of the table (module_builds).
  • with_checks or without_checks: the checks of the kernel (the order of the locks, the frames).
  • with_debug_information or without_debug_information: the debug object beside the module.
  • compile or convert: one step alone.
sdk-pack

Builds one module from a folder outside the repository: the module file and its debug object, with the two steps of a module of the system.

  • folder of the module: a folder with one Odin package and the module build file module.txt: the name of the module, its imports, its settings of the compiler, and whether it is a library module.
  • --system <folder>: the folder of the system.
sdk-verify

Verifies an unpacked SDK directory against its SDK_MANIFEST.txt: checks every file's BLAKE3 hash, rejects missing or stray unlisted files, rejects symbolic links and any internal or modulus path, and verifies the Ed25519 signature when present or required by --public-key.

  • sdk-dir: directory of the unpacked SDK.
  • --public-key <path> (optional): 32-byte Ed25519 public key (64 hex digits or unpadded base64url); requires a valid signature by this key.
sdk-convert

Converts a freestanding x86-64 relocatable ELF object (.o, from C, Rust, Zig, Odin, or assembly) paired with a language-neutral module.manifest into a verified modus module file with no repository checkout.

  • object.o: freestanding System V AMD64 ET_REL relocatable object.
  • module.manifest: plain-text language-neutral module description.
  • output.modus: destination path for the validated modus module file.
  • --sdk <sdk-dir> (optional): verified SDK directory whose modules folder resolves declared imports.
  • --import-dir <dir> (optional, repeatable): extra directory searched for imported .module or .modus files.
c-headers

Generates five self-contained C11 contract headers (modus_types.h, modus_operation.h, modus_errors.h, modus_ring.h, modus_module.h) with fixed-width types, explicit enum values, struct layouts, and _Static_assert size and offset checks derived from Odin's size_of and offset_of.

  • output-dir: target directory where the C11 header files are written.
module-diskmodule-disk <disk file to write> <module file> [<module file> ...]: write a data disk whose store module_files holds each module file under the name of its file, with the debug object <name>.debug beside it under the hash of the module, and print the line of the console that starts each one
module-buildmodule-build <folder of the module> [--system <folder of the system>] [--out <folder of the outputs>]: build one module from a folder outside the repository, with its module build file module.txt: write <name>.module and <name>.debug, and print the hash of the module and the names of its exports
volume

Builds one boot volume in this process: its boot image with the system description, its boot program, and the volume file.

  • name: main, or the end of the name of the volume file: shortage for build/boot_volume_shortage.img.

The build runs this command once for each boot volume that it must build, several at once.

test

Runs the machine tests: it builds, starts each test machine under QEMU, plays its scenario, and checks its log.

A scenario is a list of steps: press keys, move the pointer, wait for a line of the log, save a picture of the screen.

test_inputsCopies the test inputs of the build folder (the files of a whole build that the machine test reads) into <folder>/test_inputs, and writes the names of the test parts into <folder>/test_parts.json: the derivation of the whole build of the flake runs it . See: The full check: The derivations of the check in the repository
test_joinJoins the output of the host checks and of each part derivation into the output of the check boot-test of the flake: the logs, the pictures, and the count of the checks of all.
part_cacheProves that a change of a document, or of a host test of the tool, leaves the derivation of each test part the same: three copies of the tracked files in build/part_cache, two of them changed, and the derivations of the parts of each.
fact_waitsBuilds the modules, then holds each text of the log that a step of a scenario waits for against the fact templates of the module files: a fact wait that no template renders fails here, before any machine . See: The loop of a fault of a scenario in the repository
failed_partsAfter a build of the check of the flake with --keep-going: the host checks and each part whose output is not in the store, with its first failed step and its whole build log in build/failed_parts/. screenshots runs it after a failed build.
run

Builds, then starts the machine under QEMU in a window, with the log of the kernel on this terminal: the way to use the system by hand.

  • without_checks (optional): the build of the measures, with no check in the kernel.

The data disk build/data_disk.img stays from run to run, so the stores of the storage service keep their objects.

screenshots

Takes the results of the check of the flake, which ran the whole machine test and the second build, then publishes them into the repository.

It builds the check boot-test of the flake: Nix takes it from the store when nix flake check passed on the same tree.

See: The full check in the repository
measure

Runs a machine that measures, with no other load: the numbers that it prints are measures, never conditions of the test.

Each machine is a measure run: its boot image holds the resource measure_run, and a process then measures its rates over a duration. The modules are those of the test.

  • no argument: the process locks on a machine where only the desktop runs: the kernel entries in one second with 1, 2 and 4 lockers, in build/test_output_measure.txt.
  • scheduler N: N machines that run the process scheduler alone, in build/test_output_scheduler_<n>.txt.
  • time_page, crowd, disk, flow, limits: the process alone, in build/test_output_measure_<process>.txt; the command prints its lines.
  • windows: each window of the interface package, alone, and a table of the time of its pictures.
  • address_space, shortage: the machine of one measure.
  • without_checks ...: the same, on the build with no check in the kernel.

The tool checks no speed: a process checks its counts, and the numbers are printed for a reader.

See: Developer tools: The bounds of the tests
filmBuilds, starts a machine that runs the scenario of a film, and films it: the pictures of the screen, taken while the scenario types, become a film with ffmpeg, which must be on the path.
fontConverts the BDF files of Spleen (8x16, 12x24, 16x32 and 32x64, from the folder FONT_SOURCE) to Odin data in src/library/modus/graphics/font.odin and src/library/modus/bootscreen/spleen_sizes.odin.
pointers

Converts the pointer manifests of resources/pointers to the pointer theme files of the boot image, in build/pointers.

  • folder (optional): the Xcursor theme to read; else the folder of POINTER_THEME_SOURCE.

It prints a table of each theme: each pointer, its size and its hot spot.

See: Pointer pictures
vector_fontsTakes the subset of each vector font candidate of VECTOR_FONT_SOURCES that the system draws, writes it to resources/fonts, and draws one picture that compares the candidates.
logo

Draws the files of the mark of the system from its geometry in src/library/modus/mark: the icons in resources/logo, the font of the name of the mark, the picture of the project, and one picture of every frame of the animations of the mark.

  • check: draws them again and compares them with the files of the repository; modustool check runs it, so a mark that changed in the code and not in the files fails.
mark

Draws one picture of the mark: the one entry to the generator of the pictures of the mark, which logo and site also ask.

  • still: the still mark, a PNG file.
  • frame: one frame of an animation (--animation, --frame).
  • tile_map: the tile map of every animation, or of one (--animation): a tile for each distinct frame and, with --forms yes, a tile for each drawn form of the moves.
  • table: the table of that tile map, as JSON: the place and the size of each tile, the times, the moves in cells.
  • uses: prints the table of the uses: each file of the mark of the repository and of the site, with its variant.
  • developer: the picture of every frame and form, with its texts.

The options say how: --variant smooth|cells, --cell <pixels>, --scheme dark|light, --background none|scheme, --size <pixels> or --size <width>x<height>, --name-cell <pixels>, --gap <pixels>, --width <pixels> (the widest tile map), --out <file>.

portraitsConverts each picture of Credits and licences to the pixels of a portrait of the process hall_of_fame, in src/modules/demonstrations/hall_of_fame/portraits.
call

Calls an export of a service of the machine that modustool run started, from the host, and prints the typed result.

  • key: the public key of the process remote, as its window shows it. The QUIC client of the tool pins it: a machine with another key is refused.
  • call: one call in the language of the console, in quotes.

The call goes to the peer of run through a socket that only this user reaches, then over QUIC to remote, which calls the service for the principal.

repeat

Builds one module again and again, with no machine, and counts the distinct results: one distinct module, LLVM IR file and object each is a build that gives the same bytes every time.

  • module, count: the module and the count of builds.
  • all count [host_processes]: every module and the boot program, one row each.
self-host

Proves two-stage self-hosting fixed-point determinism of modustool: builds tools/modustool into stage1/modustool, invokes that binary to build stage2/modustool with identical deterministic flags, compares their BLAKE3 hashes, and reports the first diverging byte offset if they differ.

  • --staging-dir <folder> (optional): isolated staging directory root; defaults to build/self_host.
  • --emit-binary <path> (optional): compile tools/modustool once with deterministic self-host flags into <path> (invoked by stage1).
  • --verify-chains (optional): also verify the C compiler self-host, live-bootstrap seed, and SQLite/Lua/zstd C-world recipe chains.
See: Developer tools: The self-hosting check
c-self-hostProves that the C compiler builds itself: chibicc built by clang compiles the sources of chibicc, the assembler of modus makes stage 1 of the texts, stage 1 compiles the same sources on the host, and the module of stage 2 has the hash of stage 1. See: Developer tools: The self-hosting of the C compiler
cryptography-take

Copies a file of core:crypto of the Odin compiler into the repository with the package name of the copy and the listed changes of its imports, and prints its line of the manifest of the origin.

  • origin: the file, under the root of Odin.
  • file: its path in the repository.
cryptography-system-hashesPrints the line of the list of the system files for each .odin file of src/library/modus/cryptography that the manifest of the origin does not name: the files that the project wrote, which a reviewer checks before the lines go into the list.
cryptography-originChecks that each file that the manifest of the origin names is its file in Odin with the listed changes only.
rule-checksChecks that each import of each source file of src/ follows the rule of its file: a source that is not a test imports no package of the core library, the kernel and a contract package import no support package, and a host test that imports a package of the core library names its build line.
library-importscheck that each import of each source file of src/ follows the rule of its file, that the kernel and a contract package import no support package, and that each host test that imports a package of core: starts with the build line of the host
similarityMeasures how similar the code pieces of the Odin sources are, and proposes where to factor them.
changelog

Works on the changelog: the fragments of changelog.d/, and the releases of CHANGELOG.md.

  • new <type> <subject> "<text>": writes one fragment; the type is Added, Changed, Deprecated, Removed, Fixed or Security.
shipMakes a release in one command: changelog release, a commit, a signed release tag, and one atomic push of both to master.
queueMerges a batch of branches into master after one full check, in the order of its arguments, each with its own merge commit.
rename-libraryMoves the folders of the source library into the two source libraries and rewrites the import lines, the comments and the documents.
measure-historyGives each release tag whose tree holds a measure record its copy in the measure history, for the releases from before the release command copied the record.
measure-compareCompares two measure records, as the record of a build before a change and the record after it. See: Developer tools: The comparison of two measure records
news

Works on the news entries of news/, the dated reports of what a reader can now see or use.

  • new <subject>: writes an entry with the date of today and no title and no text: the check fails until they are written.
  • check: checks the head, the date, the picture, the release, the guide and the length of each entry.
roadmap

Checks the roadmap, ROADMAP.md: the planned work of the system, in the sections Now, Next and Later.

  • check: checks the title, the three sections in their order, the form of each entry (a bold summary, then one or two sentences), the design link of an entry, and that the file gives no date.
byte-layouts

Works on the fences byte-layout of the guides, whose body is the text form of the byte layout of a record of a format.

  • write: writes the body of each fence again from the code: the offsets and the sizes from the compiler, the types from the source.
  • check: checks that each body is that text.
site

Writes the site in build/site/: the home, the guides, the reference tables read from the code, the status, the news, the releases, the roadmap, the index of the search and its script.

  • --address https://<host>/<path> (optional): the address of the published site, for the canonical addresses, the sitemap and the feeds.

Before it writes a page, it checks every page: one title, each link to a page or a file that it writes, each picture with its text.

browser-machineBuilds the kernel of a browser machine: src/modulus for freestanding_wasm64p32, in build/browser_machine/modulus_kernel.wasm. It checks the border of the file: each import is one of the six functions of the module modus_page that the page gives, and the exports are memory, entry and modus_processor_loop_run.
release_numberPrints the number of the newest release of CHANGELOG.md, as 0.91.0: the number that a workflow gives to a release.
release

Makes the files of a release: the disk image of the system that a principal writes to a USB key, its checksum list and the release signature of the list.

  • image: a whole build with the keys of the publisher of the system, the release volume (the main boot image with its boot program signed for Secure Boot), then a GPT disk around it, compressed with zstd, SHA256SUMS.txt and SHA256SUMS.txt.sig in dist/, and the notes of the release in build/release_notes.md. It refuses the test keys, a release signing key whose public key is not resources/keys/release_signing_key.public, and every volume of a test.
  • tag-check <tag>: checks that a tag is v and the release number.

The workflow of a release runs it on each tag v*.

See: Install
verifyVerifies the files of a release: the release signature of the checksum list with the public key of the repository, then the SHA-256 of the image against its line.
module-hashesRecords the hash of the file of each module of the build, or compares the build with such a record.
check

Runs every check of the work tree, and writes no file of the repository: the count of its checks goes to build/checks_passed.txt. The full check of a batch is nix flake check, which runs this command, with screenshots.

In order: odin check -vet of the tool, each package of the contract alone, the host tests of each folder (several at once, each with its log in build/host_tests/), the origin of the cryptography, the mark, the pictures of the README, the fixed addresses, the bounds of the tests, the rule on comments, the form of the glossary, the file index of the intent, the source paths in the documents, the changelog, the news and the roadmap.

fuzz

Fuzzes the readers of the system on the host: the module file, the debug object, the storage format, QUIC and TLS, TCP and HTTP .

  • list: the fuzz targets, with the inputs of their corpus.
  • <target> [executions [host_processes [seed]]], all [executions]: builds the instrumented child, then runs the target until it is stopped, or for a count of executions; a fuzz finding is minimized into build/fuzzing/<target>/findings.
  • show <target> <file>: runs one input, and prints its outcome and its bytes as an Odin array, for a host test.
  • minimize <target> <file>: the smallest input with the same fuzz finding.
  • regression <target> <file>: after a fix, adds the input to the regression inputs of the corpus.
  • corpus <target>: writes the reach inputs of the corpus from the inputs that the long runs kept.
See: Developer tools: The fuzzing
fuzz-childThe child process of fuzz and of check: it runs the engine on one target.
key

Makes or shows the key that signs the system description.

  • new <folder>: writes a new private key, readable by its owner only, and its public key, in a folder outside the repository, with the firmware signing key of Secure Boot and the release signing key beside them.
  • write <folder>: writes the same key folder from the variables SYSTEM_SIGNING_KEY_TEXT, FIRMWARE_SIGNING_KEY_TEXT, FIRMWARE_CERTIFICATE_TEXT and RELEASE_SIGNING_KEY_TEXT: the secrets of the workflow of a release (secrets/README.md).
  • show: prints the public key that the build uses: the key of SYSTEM_SIGNING_KEY, or the test signing key of the repository.

A system signed with the test key is for a test machine only: its private key is published.

cache-serve

Serves a content-addressed object cache on the host over framed streams: objects by BLAKE3 or tree hash, and signed realisations.

  • --dir <path>: the folder of the store (objects/ and realisations/).
  • --listen <host:port> (optional): the address to listen on; defaults to 127.0.0.1:7200.
  • --signer-key <path> (optional, repeatable): a 64-hex-digit Ed25519 private key file whose derived public key may upload objects and signed realisations.
  • --authorized-key <path> (optional, repeatable): a 64-hex-digit Ed25519 public key file allowed to upload objects and signed realisations.
cache-put

The client of an object cache.

  • blob <file>...: puts each file as a blob and prints its hash.
  • release <boot image>: puts each file of the image that the cache does not hold, then the cache test recipe, its output and its realisation signed with the key.
See: The publication of a release to an object cache in the repository
cache-getGets from an object cache and checks: a blob against its hash, a realisation against a trusted signer, each file of a boot image and the cache test recipe.
assistant

Serves the typed host agent bridge over line-delimited JSON-RPC 2.0 on standard input and output, enforcing client-key permissions, remote key uses, active wide-grant window scopes, append-only BLAKE3 act recording, and explicit principal approval for grant-adding plans.

  • --remote-key <64-hex>: public key of remote pinned by the transport.
  • --client-key <64-hex>: client public key authorized by the principal.
  • --socket <path> (optional): path to the call socket of the peer.
  • --principal <id> (optional): principal identifier; defaults to 0.
  • --permissions <csv> (optional): comma-separated subset of eval_lex,read_screen,send_input,read_log_facts.
  • --wide-grant-serial <u64>, --wide-grant-windows <id,...>, --wide-grant-duration-ms <u64> (optional): active wide-grant window scope required for synthetic input.
agent-bridgeagent-bridge --remote-key <64-hex> --client-key <64-hex> [--socket <path>] [--principal <id>] [--permissions <csv>] [--snapshot-dir <folder>] [--wide-grant-serial <u64> --wide-grant-windows <id,...> [--wide-grant-duration-ms <u64>]]: serve the typed host agent bridge over stdio JSON-RPC 2.0

Each command

build

nix develop -c modustool build

Builds the whole system: each module, the boot image, and the boot program that holds the kernel and the boot image.

  • whole (optional): a whole build: the tool ignores every build record and builds each module and each boot volume.
  • processes (optional): the count of module builds at once; the count of the processors when it is absent.

The build is incremental: a module whose inputs are the same as at its last build is kept, and so is each boot volume. The command prints the count of the modules and of the boot volumes that it kept, and the measure of its time.

Each module is built in its own process (the command module). The command then builds the main boot volume, and the volumes that the tests need: a start that must fail, a shortage of frames, the volumes that the trusted boot must refuse (a changed module, a wrong signature, no system description), the volumes of Secure Boot, and one volume for each test of the kernel on itself. The volumes that must be built are built at the same time, each in its own process (the command volume). run, test and measure build first, with only the boot volumes that they boot: run build alone to check that the whole system compiles.

nix develop -c modustool build 8

See: Developer tools: The incremental build

What modustool help prints
the modules, the boot image and the boot program, as build/boot/main/BOOTX64.EFI; one host process for each module, as many at once as the processors, or `build <host_processes>`; a module or a boot volume whose inputs are the same is kept; `build whole`: ignore the build records and build all
Source
tools/modustool/main.odin:122

module

nix develop -c modustool module

Builds one module of the table of modules in this process, with the options of one build.

  • name: a module of the table (module_builds).
  • with_checks or without_checks: the checks of the kernel (the order of the locks, the frames).
  • with_debug_information or without_debug_information: the debug object beside the module.
  • compile or convert: one step alone. compile writes the linked file; convert writes the module and its debug object from it.

The parallel build of build runs this command once for each step of a module. Run it by hand to see the errors of one module alone.

What modustool help prints
module <name> with_checks|without_checks with_debug_information|without_debug_information [compile|convert]: build one module of the table, and its debug object with the debug information, or run one of its two steps alone (the parallel build runs this command for each step)
Source
tools/modustool/main.odin:136

sdk-pack

nix develop -c modustool sdk-pack

Builds one module from a folder outside the repository: the module file and its debug object, with the two steps of a module of the system.

  • folder of the module: a folder with one Odin package and the module build file module.txt: the name of the module, its imports, its settings of the compiler, and whether it is a library module.
  • --system <folder>: the folder of the system. With none, the environment variable MODUS_SYSTEM, then the folder where the command runs.
  • --out <folder>: the folder of the outputs. With none, the folder build in the folder of the module.

It prints the hash of the module file, the hash of each import and the names of the exports. A module with an import needs the built modules of the system: run build in the folder of the system first . Writes a data disk whose store of the module files holds module files: a machine with that disk starts each one from its console, by its hash. Packs a self-contained, deterministic SDK directory containing the public modus: library, runtime assembly, public module catalog and verified .module files, minimal freestanding Odin and C examples, and a canonical SDK_MANIFEST.txt with BLAKE3 root digest and optional Ed25519 signature.

  • output-dir: target directory to write the unpacked SDK.
  • --sign-key <path> (optional): 32-byte Ed25519 private key seed (64 hex digits or unpadded base64url) used to sign the manifest root digest.
  • --modules-dir <path> (optional): directory containing built .module files; defaults to build/modules when present.

See: Developer tools: A module from a source outside the repository

What modustool help prints
sdk-pack <output-dir> [--sign-key <path>] [--modules-dir <path>]: assemble a deterministic, self-contained SDK directory with public library, runtime, module catalog, examples, and signed or unsigned SDK_MANIFEST.txt
Source
tools/modustool/main.odin:166

sdk-verify

nix develop -c modustool sdk-verify

Verifies an unpacked SDK directory against its SDK_MANIFEST.txt: checks every file's BLAKE3 hash, rejects missing or stray unlisted files, rejects symbolic links and any internal or modulus path, and verifies the Ed25519 signature when present or required by --public-key.

  • sdk-dir: directory of the unpacked SDK.
  • --public-key <path> (optional): 32-byte Ed25519 public key (64 hex digits or unpadded base64url); requires a valid signature by this key.
What modustool help prints
sdk-verify <sdk-dir> [--public-key <path>]: verify every file hash, absence of stray or internal/modulus paths, and Ed25519 signature of an unpacked SDK directory
Source
tools/modustool/main.odin:175

sdk-convert

nix develop -c modustool sdk-convert

Converts a freestanding x86-64 relocatable ELF object (.o, from C, Rust, Zig, Odin, or assembly) paired with a language-neutral module.manifest into a verified modus module file with no repository checkout.

  • object.o: freestanding System V AMD64 ET_REL relocatable object.
  • module.manifest: plain-text language-neutral module description.
  • output.modus: destination path for the validated modus module file.
  • --sdk <sdk-dir> (optional): verified SDK directory whose modules folder resolves declared imports.
  • --import-dir <dir> (optional, repeatable): extra directory searched for imported .module or .modus files.
What modustool help prints
sdk-convert <object.o> <module.manifest> <output.modus> [--sdk <sdk-dir>] [--import-dir <dir>]: convert a freestanding ET_REL object and language-neutral module.manifest into a validated modus module file
Source
tools/modustool/main.odin:187

c-headers

nix develop -c modustool c-headers

Generates five self-contained C11 contract headers (modus_types.h, modus_operation.h, modus_errors.h, modus_ring.h, modus_module.h) with fixed-width types, explicit enum values, struct layouts, and _Static_assert size and offset checks derived from Odin's size_of and offset_of.

  • output-dir: target directory where the C11 header files are written.
What modustool help prints
c-headers <output-dir>: generate self-contained C11 contract headers (modus_types.h, modus_operation.h, modus_errors.h, modus_ring.h, modus_module.h) with _Static_assert sizeof and offsetof checks
Source
tools/modustool/main.odin:194

module-disk

nix develop -c modustool module-disk

module-disk <disk file to write> <module file> [<module file> ...]: write a data disk whose store module_files holds each module file under the name of its file, with the debug object <name>.debug beside it under the hash of the module, and print the line of the console that starts each one

What modustool help prints
module-disk <disk file to write> <module file> [<module file> ...]: write a data disk whose store `module_files` holds each module file under the name of its file, with the debug object `<name>.debug` beside it under the hash of the module, and print the line of the console that starts each one
Source
tools/modustool/main.odin:195

module-build

nix develop -c modustool module-build

module-build <folder of the module> [--system <folder of the system>] [--out <folder of the outputs>]: build one module from a folder outside the repository, with its module build file module.txt: write <name>.module and <name>.debug, and print the hash of the module and the names of its exports

What modustool help prints
module-build <folder of the module> [--system <folder of the system>] [--out <folder of the outputs>]: build one module from a folder outside the repository, with its module build file `module.txt`: write <name>.module and <name>.debug, and print the hash of the module and the names of its exports
Source
tools/modustool/main.odin:196

volume

nix develop -c modustool volume

Builds one boot volume in this process: its boot image with the system description, its boot program, and the volume file.

  • name: main, or the end of the name of the volume file: shortage for build/boot_volume_shortage.img.

The build runs this command once for each boot volume that it must build, several at once. Run it by hand, after a build, to see the errors of one volume alone.

What modustool help prints
volume <name>: build one boot volume, after a build wrote the modules and the boot images (the build runs this command for each volume that it must build)
Source
tools/modustool/main.odin:206

test

nix develop -c modustool test

Runs the machine tests: it builds, starts each test machine under QEMU, plays its scenario, and checks its log.

A scenario is a list of steps: press keys, move the pointer, wait for a line of the log, save a picture of the screen. A step that waits ends at the hang bound, never at a fixed delay: the test checks an order of events, not a speed. Each machine writes its log in a file build/test_output*.txt and its pictures in build/screenshots. The whole run runs every part of the table of the parts, several at once, each on a new data disk of its own, and prints the time of each part . It ends with "modustool: all tests passed".

The build of the whole run builds every boot volume. The build of one part builds only the boot volumes that the part boots .

  • part (optional): one part only, for the work on it; a word that names no part is refused with the list of the parts.
  • from <folder> (optional, after a part): the part on the test inputs of a folder, with no build: the command of a part derivation of the flake. It writes the count of its checks in build/checks_passed.txt.
  • steps <first> to <last> (optional, after a part): the boot steps, the setup steps of each with <first> to <last>, and the steps of the range, of the first machine of the part or of the machine that of <log name> names; then the part ends.
nix develop -c modustool test network

See: Developer tools: The parts of the machine test, Developer tools: The incremental build

What modustool help prints
build, then run the parts of the machine test, several at once: start each machine under QEMU, press its keys and move its pointer, check the log, save pictures of the screen; `test <part>`: one part only; `test <part> from <folder>`: one part on the test inputs of a folder, with no build; `test <part> steps <first> to <last> [of <machine>] [with <first> to <last>]...`: the boot steps, the setup steps and the steps of a range of one machine
Source
tools/modustool/main.odin:238

test_inputs

nix develop -c modustool test_inputs

Copies the test inputs of the build folder (the files of a whole build that the machine test reads) into <folder>/test_inputs, and writes the names of the test parts into <folder>/test_parts.json: the derivation of the whole build of the flake runs it .

See: The full check: The derivations of the check in the repository

What modustool help prints
copy the test inputs of the build folder into <folder>/test_inputs, and the names of the test parts into <folder>/test_parts.json, for the derivations of the check of the flake
Source
tools/modustool/main.odin:244

test_join

nix develop -c modustool test_join

Joins the output of the host checks and of each part derivation into the output of the check boot-test of the flake: the logs, the pictures, and the count of the checks of all. It refuses a join that lacks a part, has a part twice, or where two outputs write one file.

What modustool help prints
<target> <host checks> <part>=<folder> ...: join the outputs of the derivations of the check of the flake into its output
Source
tools/modustool/main.odin:249

part_cache

nix develop -c modustool part_cache

Proves that a change of a document, or of a host test of the tool, leaves the derivation of each test part the same: three copies of the tracked files in build/part_cache, two of them changed, and the derivations of the parts of each. Each evaluation builds the test inputs of its tree, so it costs two whole builds.

What modustool help prints
check that a change of a document or of a host test of the tool leaves the derivation of each test part the same, so Nix runs no part again
Source
tools/modustool/main.odin:255

fact_waits

nix develop -c modustool fact_waits

Builds the modules, then holds each text of the log that a step of a scenario waits for against the fact templates of the module files: a fact wait that no template renders fails here, before any machine . check and test run the same check after their build.

See: The loop of a fault of a scenario in the repository

What modustool help prints
build the modules, then check that each fact wait of the scenarios is the start of a sentence that a fact template of the build renders, with no machine
Source
tools/modustool/main.odin:261

failed_parts

nix develop -c modustool failed_parts

After a build of the check of the flake with --keep-going: the host checks and each part whose output is not in the store, with its first failed step and its whole build log in build/failed_parts/. screenshots runs it after a failed build.

What modustool help prints
list the host checks and each test part of the check of the flake that failed or did not run, with the first failed step and the path of the whole log of each
Source
tools/modustool/main.odin:266

run

nix develop -c modustool run

Builds, then starts the machine under QEMU in a window, with the log of the kernel on this terminal: the way to use the system by hand.

  • without_checks (optional): the build of the measures, with no check in the kernel.

The data disk build/data_disk.img stays from run to run, so the stores of the storage service keep their objects. The command also starts the peer of the host that takes the calls of modustool call, on a socket that only this user reaches. Close the window, or run shutdown() in the console, to end it.

What modustool help prints
build, then start the machine under QEMU, with the log of the kernel on this terminal; `run without_checks`: the measure build; `run --remote-display <viewer key>`: a machine with no window for a viewer on the host, through the UDP relay of the peer to remote_display
Source
tools/modustool/main.odin:278

screenshots

nix develop -c modustool screenshots

Takes the results of the check of the flake, which ran the whole machine test and the second build, then publishes them into the repository.

It builds the check boot-test of the flake: Nix takes it from the store when nix flake check passed on the same tree. It copies each picture of the test to docs/screenshots and to a new dated folder of the development log beside the repository, runs the measure runs on the host, and writes the measure record (docs/measures/measures.txt): the numbers of the logs of this run, with the commit, the host and the count of checks. It is, with nix flake check, the full check before a release.

  • compress: no machine; it compresses each PNG file of docs/screenshots and resources whose data is stored with no compression, and prints the bytes before and after.

See: The full check in the repository

What modustool help prints
take the pictures and the logs of the check of the flake (its one run of the machine test), run the measure runs on the host, then write the measure record docs/measures/measures.txt and copy the pictures to docs/screenshots and to a new folder of the development log kernel-devlog beside the main working tree; `screenshots compress`: compress the PNG files of docs/screenshots and resources whose data is stored, with no machine
Source
tools/modustool/main.odin:295

measure

nix develop -c modustool measure

Runs a machine that measures, with no other load: the numbers that it prints are measures, never conditions of the test.

Each machine is a measure run: its boot image holds the resource measure_run, and a process then measures its rates over a duration. The modules are those of the test.

  • no argument: the process locks on a machine where only the desktop runs: the kernel entries in one second with 1, 2 and 4 lockers, in build/test_output_measure.txt.
  • scheduler N: N machines that run the process scheduler alone, in build/test_output_scheduler_<n>.txt.
  • time_page, crowd, disk, flow, limits: the process alone, in build/test_output_measure_<process>.txt; the command prints its lines.
  • windows: each window of the interface package, alone, and a table of the time of its pictures.
  • address_space, shortage: the machine of one measure.
  • without_checks ...: the same, on the build with no check in the kernel.

The tool checks no speed: a process checks its counts, and the numbers are printed for a reader.

See: Developer tools: The bounds of the tests

What modustool help prints
build, start the machine, run the measures of the locks of the kernel with no other process, then the frame at 1920x1080 of processor_frame, and stop: the numbers are in build/test_output_measure.txt; `measure scheduler N`: the process scheduler N times; `measure time_page|crowd|disk|flow|limits`: the process alone, and its lines; `measure windows`: each window that the interface package draws, alone, and a table of the time of its pictures; `measure without_checks ...`: the measure build, with no check in the kernel (no lock order check, no check of the frames)
Source
tools/modustool/main.odin:319

film

nix develop -c modustool film

Builds, starts a machine that runs the scenario of a film, and films it: the pictures of the screen, taken while the scenario types, become a film with ffmpeg, which must be on the path. The film is for the development log and for a news entry that names it, not a test.

  • no argument, or terminal: the film of the terminal.
  • palette: the film of the palette.
  • heron: the film of the process heron.
What modustool help prints
build, start the machine, film a scenario (terminal | palette | heron | boot | desktop | console | program | monitor; no argument: terminal), and write build/films/<name>.mp4, build/films/<name>.webm, the film cues build/films/<name>.cues, a copy of the MP4 file in a new folder of the development log kernel-devlog beside the main working tree, and docs/films/<name>.webm when a news entry names the film (needs ffmpeg)
Source
tools/modustool/main.odin:328

font

nix develop -c modustool font

Converts the BDF files of Spleen (8x16, 12x24, 16x32 and 32x64, from the folder FONT_SOURCE) to Odin data in src/library/modus/graphics/font.odin and src/library/modus/bootscreen/spleen_sizes.odin. The results are in the repository, so a build does not need the BDF files: run it only to change the font.

What modustool help prints
convert the BDF files of the font to src/library/modus/graphics/font.odin and src/library/modus/bootscreen/spleen_sizes.odin
Source
tools/modustool/main.odin:334

pointers

nix develop -c modustool pointers

Converts the pointer manifests of resources/pointers to the pointer theme files of the boot image, in build/pointers.

  • folder (optional): the Xcursor theme to read; else the folder of POINTER_THEME_SOURCE.

It prints a table of each theme: each pointer, its size and its hot spot.

See: Pointer pictures

What modustool help prints
convert the pointer manifests of resources/pointers to pointer theme files in build/pointers, with the Xcursor folder of POINTER_THEME_SOURCE or of the path after the command; print a table of each theme
Source
tools/modustool/main.odin:343

vector_fonts

nix develop -c modustool vector_fonts

Takes the subset of each vector font candidate of VECTOR_FONT_SOURCES that the system draws, writes it to resources/fonts, and draws one picture that compares the candidates. Run it to change a font; a build reads the files of the repository.

See: The text of the system: a vector font with subpixel bands

What modustool help prints
subset the vector font candidates of VECTOR_FONT_SOURCES to resources/fonts and draw build/fonts/candidates.png
Source
tools/modustool/main.odin:348
nix develop -c modustool logo

Draws the files of the mark of the system from its geometry in src/library/modus/mark: the icons in resources/logo, the font of the name of the mark, the picture of the project, and one picture of every frame of the animations of the mark.

  • check: draws them again and compares them with the files of the repository; modustool check runs it, so a mark that changed in the code and not in the files fails.
What modustool help prints
draw the files of the mark of the system from src/library/modus/mark: resources/logo and .project/image.png; `check` verifies them; and build/mark_animations.png, every frame of the animations of the mark
Source
tools/modustool/main.odin:357

mark

nix develop -c modustool mark

Draws one picture of the mark: the one entry to the generator of the pictures of the mark, which logo and site also ask.

  • still: the still mark, a PNG file.
  • frame: one frame of an animation (--animation, --frame).
  • tile_map: the tile map of every animation, or of one (--animation): a tile for each distinct frame and, with --forms yes, a tile for each drawn form of the moves.
  • table: the table of that tile map, as JSON: the place and the size of each tile, the times, the moves in cells.
  • uses: prints the table of the uses: each file of the mark of the repository and of the site, with its variant.
  • developer: the picture of every frame and form, with its texts.

The options say how: --variant smooth|cells, --cell <pixels>, --scheme dark|light, --background none|scheme, --size <pixels> or --size <width>x<height>, --name-cell <pixels>, --gap <pixels>, --width <pixels> (the widest tile map), --out <file>. A request with no sense is refused with a sentence: the smooth variant at one pixel for a cell, a part of a pixel, a picture smaller than its drawing.

See: Developer tools: The pictures of the mark

What modustool help prints
draw one file of the mark: still | frame | animation | tile_map | table | uses | developer, with --variant smooth|cells, --cell <pixels>, --scheme dark|light, --background none|scheme, --animation <name>, --frame <number>, --forms yes|no, --width <pixels>, --format png|ico|svg|apng|json, --entry <variant>:<cell>:<pixels>, --dark-rule yes|no, --out <file>
Source
tools/modustool/main.odin:379

portraits

nix develop -c modustool portraits

Converts each picture of Credits and licences to the pixels of a portrait of the process hall_of_fame, in src/modules/demonstrations/hall_of_fame/portraits. The result is in the repository, so a build decodes no PNG file.

What modustool help prints
convert the pictures of resources/hall_of_fame/CREDITS.md to the portraits of src/modules/demonstrations/hall_of_fame/portraits
Source
tools/modustool/main.odin:384

call

nix develop -c modustool call

Calls an export of a service of the machine that modustool run started, from the host, and prints the typed result.

  • key: the public key of the process remote, as its window shows it. The QUIC client of the tool pins it: a machine with another key is refused.
  • call: one call in the language of the console, in quotes.

The call goes to the peer of run through a socket that only this user reaches, then over QUIC to remote, which calls the service for the principal. A table prints as rows, with its count.

nix develop -c modustool call <key> "monitor.counts_named([(\"processes\"), (\"processors\")])"
What modustool help prints
call <key> "service.export(arguments)": call an export of a service of the machine that `run` started, through the process remote over QUIC (key: the public key of remote, from its window), and print the typed result; the peer of `run` takes the call on a socket that only this user reaches
Source
tools/modustool/main.odin:400

repeat

nix develop -c modustool repeat

Builds one module again and again, with no machine, and counts the distinct results: one distinct module, LLVM IR file and object each is a build that gives the same bytes every time.

  • module, count: the module and the count of builds.
  • all count [host_processes]: every module and the boot program, one row each.
What modustool help prints
repeat <module> <count>: build one module again and again, with no machine, and count the distinct modules, LLVM IR files and objects; `repeat all <count> [host_processes]`: every module and the boot program, one row each
Source
tools/modustool/main.odin:408

self-host

nix develop -c modustool self-host

Proves two-stage self-hosting fixed-point determinism of modustool: builds tools/modustool into stage1/modustool, invokes that binary to build stage2/modustool with identical deterministic flags, compares their BLAKE3 hashes, and reports the first diverging byte offset if they differ.

  • --staging-dir <folder> (optional): isolated staging directory root; defaults to build/self_host.
  • --emit-binary <path> (optional): compile tools/modustool once with deterministic self-host flags into <path> (invoked by stage1).
  • --verify-chains (optional): also verify the C compiler self-host, live-bootstrap seed, and SQLite/Lua/zstd C-world recipe chains.

See: Developer tools: The self-hosting check

What modustool help prints
self-host [--staging-dir <folder>] [--emit-binary <path>] [--verify-chains]: build stage1/modustool, invoke stage1 to build stage2/modustool with deterministic flags, and prove blake3(stage1) == blake3(stage2)
Source
tools/modustool/main.odin:421

c-self-host

nix develop -c modustool c-self-host

Proves that the C compiler builds itself: chibicc built by clang compiles the sources of chibicc, the assembler of modus makes stage 1 of the texts, stage 1 compiles the same sources on the host, and the module of stage 2 has the hash of stage 1. It needs the variable CHIBICC_SOURCE of the shell of the flake, and writes into build/c_self_host.

See: Developer tools: The self-hosting of the C compiler

What modustool help prints
c-self-host: build chibicc with clang, then with itself twice through the assembler of modus, and prove blake3(stage 1) == blake3(stage 2)
Source
tools/modustool/main.odin:428

cryptography-take

nix develop -c modustool cryptography-take

Copies a file of core:crypto of the Odin compiler into the repository with the package name of the copy and the listed changes of its imports, and prints its line of the manifest of the origin.

  • origin: the file, under the root of Odin.
  • file: its path in the repository.
What modustool help prints
cryptography-take <file under the root of Odin> <file of the repository>: copy a file of core:crypto with the listed import changes, and print its line of the manifest
Source
tools/modustool/main.odin:435

cryptography-system-hashes

nix develop -c modustool cryptography-system-hashes

Prints the line of the list of the system files for each .odin file of src/library/modus/cryptography that the manifest of the origin does not name: the files that the project wrote, which a reviewer checks before the lines go into the list.

What modustool help prints
print the line of src/library/modus/cryptography/system_files.manifest for each .odin file of src/library/modus/cryptography that is not taken from Odin
Source
tools/modustool/main.odin:440

cryptography-origin

nix develop -c modustool cryptography-origin

Checks that each file that the manifest of the origin names is its file in Odin with the listed changes only. modustool check runs it.

What modustool help prints
check that each file of src/library/modus/cryptography/origin.manifest is its origin in Odin with the listed changes only
Source
tools/modustool/main.odin:443

rule-checks

nix develop -c modustool rule-checks

Checks that each import of each source file of src/ follows the rule of its file: a source that is not a test imports no package of the core library, the kernel and a contract package import no support package, and a host test that imports a package of the core library names its build line. Each build runs it before its first compiler starts, and modustool check runs it. Checks three rules of the system that a reader had to trust: the count of the kernel operations against the properties, no call of an allocator in a source of the system, and an error record from each export that fails.

What modustool help prints
check that src/library/modus/contract/operation/operation.odin declares the count of kernel operations that docs/PROPERTIES.md states, that no source file of the system that is not a test calls or names an allocator, that no export of a module gives a negative number with no error record, that no family of integer constants is used as a closed set of choices, that no cast of a word to an enum skips its border, and that only the loader and the root service name the field image_checks of a load source
Source
tools/modustool/main.odin:454

library-imports

nix develop -c modustool library-imports

check that each import of each source file of src/ follows the rule of its file, that the kernel and a contract package import no support package, and that each host test that imports a package of core: starts with the build line of the host

What modustool help prints
check that each import of each source file of src/ follows the rule of its file, that the kernel and a contract package import no support package, and that each host test that imports a package of core: starts with the build line of the host
Source
tools/modustool/main.odin:455

similarity

nix develop -c modustool similarity

Measures how similar the code pieces of the Odin sources are, and proposes where to factor them. It reads src/ and tools/, gives a similarity score from 0 to 1 to each pair that it compares, groups the similar pieces in families with their factoring template, and ranks the families by the nodes that a factoring saves .

  • no argument: the report on the terminal, and the whole report with two tables in build/similarity/.
  • near <file>:<line>: the procedures most similar to the one that holds the line.
  • pair <file>:<line> <file>:<line>: the score of two procedures and their template.

It never edits a source and never fails on a similarity: a human or an agent decides what to factor. A family that is kept on purpose is a line of tools/modustool/similarity/similarity_kept.txt.

See: Developer tools: The similarity finder

What modustool help prints
the similarity of the code pieces of src/ and tools/: families with their factoring template, ranked by the nodes that a factoring saves, in build/similarity; `similarity near <file>:<line>`: the procedures most similar to one; `similarity pair <file>:<line> <file>:<line>`: the score of two procedures
Source
tools/modustool/main.odin:473

changelog

nix develop -c modustool changelog

Works on the changelog: the fragments of changelog.d/, and the releases of CHANGELOG.md.

  • new <type> <subject> "<text>": writes one fragment; the type is Added, Changed, Deprecated, Removed, Fixed or Security. With - as the text, the text comes from the standard input.
  • check: checks the form of each fragment and of the changelog.
  • assemble: prints the next release from the fragments, with no change.
  • release <release number>: moves the fragments into a new release of the changelog, with its release time in UTC and its release link, and deletes them. It copies the measure record to the measure history, unless the release before holds the same run.
  • notes <release number>: prints the changes of one release.
  • times: gives each old heading with its day alone the time of the commit of its release, and adds each missing release link.

No one edits CHANGELOG.md by hand: this command writes it.

What modustool help prints
new <type> <subject> "<text>" (or - and the text on the standard input) | check | assemble | release <release number> | notes <release number> | times: the fragments of `changelog.d` and the releases of `CHANGELOG.md`
Source
tools/modustool/main.odin:492

ship

nix develop -c modustool ship

Makes a release in one command: changelog release, a commit, a signed release tag, and one atomic push of both to master. It refuses a branch other than master, a tree with changes, and a master that does not hold origin/master; when origin moved, it undoes, merges and tries again with the next number.

See: Developer tools: The release

What modustool help prints
step | correction | <release number> [--dry-run]: the release in one command: the changelog, a commit, a signed release tag v<number>, one atomic push to master
Source
tools/modustool/main.odin:498

queue

nix develop -c modustool queue

Merges a batch of branches into master after one full check, in the order of its arguments, each with its own merge commit. When the check fails, it checks the two halves of the batch, to name the branch at fault, and merges the halves that pass; it stops after two branches at fault, and never passes its budget of full checks. Then it pushes master and removes each merged branch and its worktree. It refuses a wrong list, a branch that git does not allow and an identity that is not the configured git user, with nothing changed .

See: Developer tools: The merge queue

What modustool help prints
<branch>...: merge a batch of branches into master after one full check in a worktree beside the main tree, split the batch in halves to name a branch at fault, push master, and remove the merged branches and their worktrees
Source
tools/modustool/main.odin:508

rename-library

nix develop -c modustool rename-library

Moves the folders of the source library into the two source libraries and rewrites the import lines, the comments and the documents. A second run changes nothing, so a branch runs it after its merge of master. It prints each move, each file changed and each string of a source that still holds an old form, for a hand change .

See: Developer tools: The rename of the library

What modustool help prints
move the folders of the source library into its two source libraries with git mv, and rewrite the import lines, the comments and the documents; idempotent, for each branch after its merge of master
Source
tools/modustool/main.odin:515

measure-history

nix develop -c modustool measure-history

Gives each release tag whose tree holds a measure record its copy in the measure history, for the releases from before the release command copied the record. It changes no file that exists .

See: Developer tools: The release

What modustool help prints
the copy of the measure record of each release tag that holds one, in `docs/measures/releases`, for the charts of each measure over the releases
Source
tools/modustool/main.odin:520

measure-compare

nix develop -c modustool measure-compare

Compares two measure records, as the record of a build before a change and the record after it. It asserts nothing.

See: Developer tools: The comparison of two measure records

What modustool help prints
<record before> <record after>: the line of each measure in two measure records, and the number of each series with its ratio
Source
tools/modustool/main.odin:524

news

nix develop -c modustool news

Works on the news entries of news/, the dated reports of what a reader can now see or use.

  • new <subject>: writes an entry with the date of today and no title and no text: the check fails until they are written.
  • check: checks the head, the date, the picture, the release, the guide and the length of each entry. modustool check runs it.
What modustool help prints
new <subject> | check: the news entries of news, dated reports in prose of what a reader can now see or use, for the page of the news of the site
Source
tools/modustool/main.odin:532

roadmap

nix develop -c modustool roadmap

Checks the roadmap, ROADMAP.md: the planned work of the system, in the sections Now, Next and Later.

  • check: checks the title, the three sections in their order, the form of each entry (a bold summary, then one or two sentences), the design link of an entry, and that the file gives no date. It refuses an entry whose summary is the summary of an entry of the changelog: that work is done. modustool check runs it.

The file is written by hand: an entry is added when a work is planned, and removed in the commit that ends the work .

See: Developer tools: The roadmap

What modustool help prints
check: the planned work of `ROADMAP.md`, in the sections Now, Next, Later and Maybe, for the page of the roadmap of the site
Source
tools/modustool/main.odin:545

byte-layouts

nix develop -c modustool byte-layouts

Works on the fences byte-layout of the guides, whose body is the text form of the byte layout of a record of a format.

  • write: writes the body of each fence again from the code: the offsets and the sizes from the compiler, the types from the source.
  • check: checks that each body is that text. modustool check runs it, and modustool site stops on such a fault too.

The design:.

See: The site: The byte layouts in the repository

What modustool help prints
write | check: the text of each fence `byte-layout` of the guides, the byte layout of a record of a format from the code
Source
tools/modustool/main.odin:555

site

nix develop -c modustool site

Writes the site in build/site/: the home, the guides, the reference tables read from the code, the status, the news, the releases, the roadmap, the index of the search and its script.

  • --address https://<host>/<path> (optional): the address of the published site, for the canonical addresses, the sitemap and the feeds.

Before it writes a page, it checks every page: one title, each link to a page or a file that it writes, each picture with its text. A failure stops the command with the page and the reason, and writes nothing. The design:.

See: The site: The command in the repository

What modustool help prints
write the site of the system in build/site: the pages from the documents, the code, the news, the pictures and the logs of the last machine tests, an index and one small script for the search, and the feed of the news; no request to another server
Source
tools/modustool/main.odin:568

browser-machine

nix develop -c modustool browser-machine

Builds the kernel of a browser machine: src/modulus for freestanding_wasm64p32, in build/browser_machine/modulus_kernel.wasm. It checks the border of the file: each import is one of the six functions of the module modus_page that the page gives, and the exports are memory, entry and modus_processor_loop_run. It writes the page, its worker and the host of the kernel beside it, and the boot image of the build when there is one: the folder is a site that a static server serves.

  • boot (optional): then start the kernel in Node with the host of the page, print each line of its serial port, and check the mark of the kernel and, with a boot image, the start of the root service. The run ends when the machine stops, or at the hang bound. Node 24 or later must be on the path.
  • <boot image> (optional, after boot): the boot image to start, in place of the one of the build.
  • console: then write the console page, browser_machine_console.html, and its boot image, console.image, from the boot image of the build: the console with dom_terminal on the second serial port, and no compositor, drawing module or font.
nix develop -c modustool browser-machine boot
nix develop -c modustool browser-machine console

The design: modus in a web page: the browser machine: The page and its host in the repository.

What modustool help prints
build the kernel for WebAssembly in build/browser_machine, check its imports and its exports, and write the page of the browser machine beside it; `browser-machine boot [<boot image>]`: then start it in Node and print its serial port; `browser-machine console`: then write the console page and its console image, with dom_terminal on the second serial port and no desktop
Source
tools/modustool/main.odin:596

release_number

nix develop -c modustool release_number

Prints the number of the newest release of CHANGELOG.md, as 0.91.0: the number that a workflow gives to a release.

What modustool help prints
print the release number of the system: the newest release of `CHANGELOG.md`
Source
tools/modustool/main.odin:599

release

nix develop -c modustool release

Makes the files of a release: the disk image of the system that a principal writes to a USB key, its checksum list and the release signature of the list.

  • image: a whole build with the keys of the publisher of the system, the release volume (the main boot image with its boot program signed for Secure Boot), then a GPT disk around it, compressed with zstd, SHA256SUMS.txt and SHA256SUMS.txt.sig in dist/, and the notes of the release in build/release_notes.md. It refuses the test keys, a release signing key whose public key is not resources/keys/release_signing_key.public, and every volume of a test.
  • tag-check <tag>: checks that a tag is v and the release number.

The workflow of a release runs it on each tag v*.

See: Install

What modustool help prints
image: build the release volume with the keys of the publisher (SYSTEM_SIGNING_KEY), and write the compressed GPT disk image, SHA256SUMS.txt and its release signature in dist/; `release tag-check <tag>`: check that the tag is v and the release number
Source
tools/modustool/main.odin:615

verify

nix develop -c modustool verify

Verifies the files of a release: the release signature of the checksum list with the public key of the repository, then the SHA-256 of the image against its line. The signature file is beside the checksum list, with the suffix .sig.

nix develop -c modustool verify modus-0.93.0-x86_64.img.zst SHA256SUMS.txt
What modustool help prints
verify <image> <SHA256SUMS.txt>: check the release signature of the checksum list with resources/keys/release_signing_key.public, then the SHA-256 of the image
Source
tools/modustool/main.odin:624

module-hashes

nix develop -c modustool module-hashes

Records the hash of the file of each module of the build, or compares the build with such a record. It builds nothing: run build first.

  • write <file>: writes the record: one line for each module of build/modules, its BLAKE3 hash and its name.
  • compare <file>: prints each module whose hash is not the hash of the record, each module that only one of the two has, and the count of the modules with the same hash. It fails when one differs.

It is the proof of a change that must not change the system, such as a move of the sources .

See: Developer tools: The hashes of the modules of two builds

What modustool help prints
write <file> | compare <file>: record the hash of each module of build/modules, or compare the build with such a record: print each module whose hash differs, and fail if one does
Source
tools/modustool/main.odin:637

check

nix develop -c modustool check

Runs every check of the work tree, and writes no file of the repository: the count of its checks goes to build/checks_passed.txt. The full check of a batch is nix flake check, which runs this command, with screenshots.

In order: odin check -vet of the tool, each package of the contract alone, the host tests of each folder (several at once, each with its log in build/host_tests/), the origin of the cryptography, the mark, the pictures of the README, the fixed addresses, the bounds of the tests, the rule on comments, the form of the glossary, the file index of the intent, the source paths in the documents, the changelog, the news and the roadmap. Then the whole machine test (test), the test of the debug objects against the linked files of the build, and a second build that must give the same bytes.

  • without_machines (optional): no machine test; a whole build of the main volume before the second build. The check of the flake runs this form, and each test part in a derivation of its own.
What modustool help prints
odin check -vet and odin test of the host code, the fuzz targets (their corpus and a fixed count of new executions), the checks of the sources (among them the rule on comments and the form of the glossary), changelog check, news check, roadmap check, then test; `check without_machines`: no machine test
Source
tools/modustool/main.odin:656

fuzz

nix develop -c modustool fuzz

Fuzzes the readers of the system on the host: the module file, the debug object, the storage format, QUIC and TLS, TCP and HTTP .

  • list: the fuzz targets, with the inputs of their corpus.
  • <target> [executions [host_processes [seed]]], all [executions]: builds the instrumented child, then runs the target until it is stopped, or for a count of executions; a fuzz finding is minimized into build/fuzzing/<target>/findings.
  • show <target> <file>: runs one input, and prints its outcome and its bytes as an Odin array, for a host test.
  • minimize <target> <file>: the smallest input with the same fuzz finding.
  • regression <target> <file>: after a fix, adds the input to the regression inputs of the corpus.
  • corpus <target>: writes the reach inputs of the corpus from the inputs that the long runs kept.

See: Developer tools: The fuzzing

What modustool help prints
list | <target> [executions [host_processes [seed]]] | all [executions] | show <target> <file> | minimize <target> <file> | regression <target> <file> | corpus <target>: fuzz the readers of the system on the host, guided by edge counters
Source
tools/modustool/main.odin:674

fuzz-child

nix develop -c modustool fuzz-child

The child process of fuzz and of check: it runs the engine on one target. The parent starts it; it is not a command to run by hand.

What modustool help prints
the child process of `fuzz` and of `check`, which the parent starts
Source
tools/modustool/main.odin:677

key

nix develop -c modustool key

Makes or shows the key that signs the system description.

  • new <folder>: writes a new private key, readable by its owner only, and its public key, in a folder outside the repository, with the firmware signing key of Secure Boot and the release signing key beside them.
  • write <folder>: writes the same key folder from the variables SYSTEM_SIGNING_KEY_TEXT, FIRMWARE_SIGNING_KEY_TEXT, FIRMWARE_CERTIFICATE_TEXT and RELEASE_SIGNING_KEY_TEXT: the secrets of the workflow of a release (secrets/README.md).
  • show: prints the public key that the build uses: the key of SYSTEM_SIGNING_KEY, or the test signing key of the repository.

A system signed with the test key is for a test machine only: its private key is published.

What modustool help prints
key new <folder outside the repository>: write a new signing key of the system description (the private key, readable by its owner only, and the public key), with the firmware signing key and the release signing key; `key write <folder>`: the same folder from the variables of the secrets of a workflow; `key show`: print the public key that the build uses (SYSTEM_SIGNING_KEY, or the test signing key)
Source
tools/modustool/main.odin:693

cache-serve

nix develop -c modustool cache-serve

Serves a content-addressed object cache on the host over framed streams: objects by BLAKE3 or tree hash, and signed realisations.

  • --dir <path>: the folder of the store (objects/ and realisations/).
  • --listen <host:port> (optional): the address to listen on; defaults to 127.0.0.1:7200.
  • --signer-key <path> (optional, repeatable): a 64-hex-digit Ed25519 private key file whose derived public key may upload objects and signed realisations.
  • --authorized-key <path> (optional, repeatable): a 64-hex-digit Ed25519 public key file allowed to upload objects and signed realisations.
What modustool help prints
cache-serve --dir <path> [--listen <host:port>] [--signer-key <path>] [--authorized-key <path>] [--status-listen <host:port>] [--endpoint <host:port>] [--site <address>]: serve an object cache of blobs, canonical trees and signed realisations, and with --status-listen its page and status.json over HTTP
Source
tools/modustool/main.odin:705

cache-put

nix develop -c modustool cache-put

The client of an object cache.

  • blob <file>...: puts each file as a blob and prints its hash.
  • release <boot image>: puts each file of the image that the cache does not hold, then the cache test recipe, its output and its realisation signed with the key. The release workflow runs it.

See: The publication of a release to an object cache in the repository

What modustool help prints
cache-put <host:port> --key <seed file> blob <file>... | release <boot image>: put files, or each file of a boot image and the signed realisation of the cache test recipe, on an object cache
Source
tools/modustool/main.odin:712

cache-get

nix develop -c modustool cache-get

Gets from an object cache and checks: a blob against its hash, a realisation against a trusted signer, each file of a boot image and the cache test recipe. The signer is resources/keys/cache_signing_key.public unless --signer names another. It needs the network for a public cache:

nix develop -c modustool cache-get cache.modus.systems:5010 test-recipe
What modustool help prints
cache-get <host:port> blob <hash> [<output file>] | realisation <recipe hash> --signer <public key file> | release <boot image> [--signer <file>] | test-recipe [--signer <file>]: take from an object cache and refuse what does not verify
Source
tools/modustool/main.odin:721

assistant

nix develop -c modustool assistant

Serves the typed host agent bridge over line-delimited JSON-RPC 2.0 on standard input and output, enforcing client-key permissions, remote key uses, active wide-grant window scopes, append-only BLAKE3 act recording, and explicit principal approval for grant-adding plans.

  • --remote-key <64-hex>: public key of remote pinned by the transport.
  • --client-key <64-hex>: client public key authorized by the principal.
  • --socket <path> (optional): path to the call socket of the peer.
  • --principal <id> (optional): principal identifier; defaults to 0.
  • --permissions <csv> (optional): comma-separated subset of eval_lex,read_screen,send_input,read_log_facts.
  • --wide-grant-serial <u64>, --wide-grant-windows <id,...>, --wide-grant-duration-ms <u64> (optional): active wide-grant window scope required for synthetic input.
What modustool help prints
assistant --remote-key <64-hex> --client-key <64-hex> [--socket <path>] [--principal <id>] [--key-variable <NAME>] [--fake <script>] [--once]: the agent runner of the window assistant: it answers each request through remote, a language model and the host agent bridge
Source
tools/modustool/main.odin:736

agent-bridge

nix develop -c modustool agent-bridge

agent-bridge --remote-key <64-hex> --client-key <64-hex> [--socket <path>] [--principal <id>] [--permissions <csv>] [--snapshot-dir <folder>] [--wide-grant-serial <u64> --wide-grant-windows <id,...> [--wide-grant-duration-ms <u64>]]: serve the typed host agent bridge over stdio JSON-RPC 2.0

What modustool help prints
agent-bridge --remote-key <64-hex> --client-key <64-hex> [--socket <path>] [--principal <id>] [--permissions <csv>] [--snapshot-dir <folder>] [--wide-grant-serial <u64> --wide-grant-windows <id,...> [--wide-grant-duration-ms <u64>]]: serve the typed host agent bridge over stdio JSON-RPC 2.0
Source
tools/modustool/main.odin:737

modus_processor_loop_run procedure of the package kernel

modus_processor_loop_run :: proc "c" (step_budget: u64) -> Processor_Loop_Result

modus_processor_loop_run is the one export that a worker calls in its.

src/modulus/processor_loop_wasm64p32.odin:309