orion-server fmt
Formats definition files to the house style, the way cargo fmt formats Rust. One style, nothing to configure; the style itself is documented on Definition Style. Needs no config, database, or server.
Synopsis
orion-server fmt [PATH]... [--check] [--stdin]
Description
Files are rewritten atomically: a sibling temp file is renamed over the original, permissions preserved. The write happens only after the formatted output has been parsed again and compared with the input as the runtime sees it. A formatter that could change what a workflow means would not be safe to run from a pre-commit hook. A file that is not strict JSON, has a duplicate key, or nests too deep for the parser is reported with its line and column. It is left untouched.
Options
| Flag | Description |
|---|---|
PATH | Files or directories (default: .). Every .json under a directory is formatted — entities, shared documents, *.case.json files and fixtures alike. Hidden entries, target/ and node_modules/ are skipped; symlinked directories are not followed. |
--check | Write nothing. Print a unified diff for every file that is not in the house style and exit 1 if there is one — the CI form. |
--stdin | Format one document from stdin to stdout, for editor integration. On a parse error nothing reaches stdout. |
Returns
| Exit code | Meaning |
|---|---|
0 | Every file is formatted, or has been written by this run. |
1 | --check found at least one file it would rewrite. |
2 | A file could not be read, parsed or written. The other files are still processed. |
Examples
$ orion-server fmt --check ./definitions
--- a/definitions/orders/channel.json
+++ b/definitions/orders/channel.json
@@ -3,9 +3,7 @@
"name": "orders",
"channel_type": "sync",
"protocol": "rest",
- "methods": [
- "POST"
- ],
+ "methods": ["POST"],
"route_pattern": "/orders",
1 file(s) would be reformatted, 61 unchanged
orion-server fmt ./definitions && orion-server lint ./definitions
Related
- Definition style (
fmt): the one layout this command writes. - Test a workflow offline:
fmt --checkbesidelintin a CI gate. orion-server lint: the check that usually follows a format.orion-servercommands: everyorion-serversubcommand.
Last verified 14 September 2026