Morphix is a Rust-native universal document transformation engine.
It formats, validates, edits, queries, compares, and converts structured documents while preserving source comments and layout where the formats allow it.
morphix fmt config.yaml
morphix format config.yaml
morphix fix config.json
morphix check .
morphix validate config.yaml
morphix convert config.yaml --to toml
morphix migrate config.yaml --to toml
morphix diff old.yaml new.yaml
morphix query config.yaml server.port
morphix set config.toml server.port 9090
morphix delete config.json logging.debug
Use - to read standard input and --from <format> when stdin has no filename:
cat config.yaml | morphix convert - --from yaml --to json
cat records.jsonl | morphix fmt - --from jsonl
Converted documents are written to stdout. Loss reports and metadata diagnostics are written to stderr, keeping pipelines safe.
Morphix currently includes adapters for:
JSON JSONL JSON5 JSONC
YAML TOML RON HCL
XML SVG HTML Markdown
CSV TSV INI Properties
dotenv SQL GraphQL Dockerfile
nginx
JSONL formatting, validation, and JSONL-to-JSONL conversion use streaming paths for files and stdin.
Conversion supports four comment policies:
--comments preserve
--comments drop
--comments error
--comments metadata
Use --report-loss to emit a semantic conversion report on stderr. Formats with incompatible models may receive an explicit fallback projection; the report describes the resulting loss.
cargo build
cargo test
cargo run -- fmt golden/input.yaml
cargo run -- validate golden
Golden inputs and expected outputs live in golden/. The integration suite launches the real Morphix executable and compares its output against those fixtures.
Not yet selected.