A versatile CLI utility built with Rust for converting configuration files between JSON, YAML, and TOML formats. It automatically detects the format based on file extensions or allows manual specification.
- Multi-Format Support: Convert between JSON, YAML, and TOML.
- Automatic Detection: Infers input and output formats from file extensions.
- Pretty Printing: Generates well-formatted, human-readable output.
- Robust Error Handling: Provides clear error messages for invalid configurations.
To build the tool from source, you need to have Rust and Cargo installed.
git clone https://github.com/rawqubit/rust-config-transformer.git
cd rust-config-transformer
cargo build --releaseThe binary will be available at target/release/rust-config-transformer.
rust-config-transformer --input <INPUT> --output <OUTPUT> [OPTIONS]-i, --input <INPUT>: Input file path.-o, --output <OUTPUT>: Output file path.-f, --from <FORMAT>: Input format (json, yaml, toml).-t, --to <FORMAT>: Output format (json, yaml, toml).-h, --help: Print help information.-V, --version: Print version information.
Convert a JSON file to YAML:
rust-config-transformer --input config.json --output config.yamlConvert a YAML file to TOML, explicitly specifying the formats:
rust-config-transformer --input settings.yml --output settings.toml --from yaml --to toml