TOML Schema
Command-line interface

tosd CLI

Validate TOML documents against a TOML Schema or extract a starter schema from an existing document.

Install 1.0.0-rc.2 Prerelease
curl -fsSL https://tomlschema.org/cli/releases/rust-v1.0.0-rc.2/install-tosd.sh | bash

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

CommandPurpose
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 --helpPrint command usage.
tosd --versionPrint the installed CLI version.

Exit codes

CodeMeaning
0The command completed successfully; for validation, the document is valid.
1Validation failed, or an extraction input could not be read or parsed.
2The command usage, schema loading or discovery, or extraction output failed.
Downloads

Release archives

Versioned, checksum-protected binaries for Linux, Apple Silicon macOS, and Windows.

tosd CLI

1.0.0-rc.2

LatestPrerelease

Published August 20, 2026 · Release notes

SHA-256 checksums · Installer script