# mt schema

`mt schema` prints the JSON Schema of a machine output, generated from the same Rust types that print it. `mt schema --write` records the copies under `schema/output/`, and `mt schema --check` fails when one differs, so a test can compare the tree with the binary. It works outside a project.

Print or check the JSON Schema for a machine output

Bare, it lists each output, its version and the URL its `$schema` names. `mt schema <name>` prints one schema, `--write` records the copies under `schema/output/`, and `--check` fails when one differs. It works outside a project.

`mt schema` prints the JSON Schema of a machine output. Bare, it lists each output, its version and the URL its `$schema` names. `mt schema <name>` prints one, and `--write` records every schema under `schema/output/` in the current directory. `--check` fails, names every missing or changed copy, and doesn’t write anything. It works outside a project.

Runs on one project and refuses a [set](https://mlavrinenko.github.io/mindtape/read-many-projects/index.md).

- `[NAME]`: The output whose schema to print, as `mt schema` lists it
- `--write`: Write every current schema under `schema/output`
- `--check`: Fail when a recorded schema differs from the generated one

Every command also takes the [global flags](https://mlavrinenko.github.io/mindtape/cli/index.md#global-flags).
