CLI usage
Run tosd --help to display the command summary or tosd --version to display the installed version.
Validate with an explicit schema
Pass the schema first and the TOML document second:
tosd validate config.tosd config.toml
A successful validation prints config.toml is valid. Validation errors and warnings are written to standard error, making the command suitable for local scripts and CI.
Validate with schema discovery
A TOML document can identify its schema with reserved metadata:
[toml-schema]
location = "config.tosd"
version = "1.0.0"
Then pass only the document:
tosd validate config.toml
Relative schema locations resolve from the document's directory. Absolute local paths and hierarchical file URIs are also supported; other URI schemes are rejected. The optional version must use a compatible major TOML Schema version.
Extract a starter schema
Generate a .tosd schema from the value types and structure of an existing TOML document:
tosd extract config.toml config.generated.tosd
Extraction omits the reserved [toml-schema] metadata from the inferred document shape and does not invent default values. Review and refine the generated constraints before adopting the schema.
Command reference
| Command | Purpose |
|---|---|
tosd validate <schema.tosd> <document.toml> | Validate with an explicit schema. |
tosd validate <document.toml> | Discover the schema from [toml-schema].location and validate. |
tosd extract <document.toml> <schema.tosd> | Write an inferred starter schema. |
tosd --help | Print command usage. |
tosd --version | Print the installed CLI version. |
Exit codes
| Code | Meaning |
|---|---|
0 | The command completed successfully; for validation, the document is valid. |
1 | Validation failed, or an extraction input could not be read or parsed. |
2 | The command usage, schema loading or discovery, or extraction output failed. |