Skip to content

omnist CLI Reference

omnist CLI reference documentation for omnist-j.


Overview & Invocation

The CLI executable fat jar can be invoked via:

java -jar target/omnist-j-0.0.2-alpha.jar <command> [subcommand] [options]

Or via ./run-conformance / shell wrapper omnist:

omnist <command> [subcommand] [options]

Commands & Subcommands

1. format

Formats input text between OML, JSON, YAML, TOML, or XML.

$ omnist format - --to json < input.oml
{"name":"Alice","age":30}

2. validate

Validates an input document against an OSD schema.

$ omnist validate input.oml --schema schema.osd --json
{"ok":true}

3. convert (materialize)

Upgrades scalar string values to typed dates/datetimes per schema target types.

$ omnist convert input.oml --schema schema.osd
created: 2024-01-01

4. schema normalize

Merges isomorphic record types in an OSD schema.

$ omnist schema normalize schema.osd
record Person {
  "name": string,
}
root Person

5. schema prune

Removes unreachable record definitions from an OSD schema.

$ omnist schema prune schema.osd
record Root {
  "id": integer,
}
root Root

6. schema extract

Extracts a sub-schema projecting specified field paths.

$ omnist schema extract schema.osd --keep id
record Person {
  "id": integer,
}
root Person

7. schema is-empty

Checks if an OSD schema is empty (satisfiable by zero documents).

$ omnist schema is-empty schema.osd --result-format json
{"empty":false}

8. schema compatible-with

Checks if schema S1 is compatible forward with schema S2.

$ omnist schema compatible-with schema1.osd schema2.osd --result-format json
{"compatible":true}

9. schema equivalent

Checks set-theoretic equivalence between two OSD schemas.

$ omnist schema equivalent schema1.osd schema2.osd --result-format json
{"equivalent":true}

10. schema lint

Runs static analysis lint rules against an OSD schema. --severity info|warning sets the minimum finding severity to report (default info, i.e. everything); the exit code and ok/--json result reflect only the findings that pass this filter.

$ omnist schema lint schema.osd
WARNING [lint.unreachable-record] at $: Unreachable record Dead
$ omnist schema lint schema.osd --severity warning
WARNING [lint.unreachable-record] at $: Unreachable record Dead

11. infer

Infers a structural OSD schema from document samples.

$ omnist infer sample1.oml sample2.oml
record R {
  "id": integer,
  "name": string,
}
root R