convfmt

Crates.ioconvfmt
lib.rsconvfmt
version2.1.0
created_at2022-06-28 12:40:40.174561+00
updated_at2026-01-01 14:42:29.018699+00
descriptioncli tool which can convert different formats
homepagehttps://github.com/oriontvv/convfmt/
repositoryhttps://github.com/oriontvv/convfmt/
max_upload_size
id614810
size1,349,816
Vasiliy Taranov (oriontvv)

documentation

https://docs.rs/convfmt

README

convfmt

Actions Status Coverage badge dependency status Crates.io

convfmt is a command line tool in rust which can convert between formats:

Usage:

$ convfmt --help
cli tool which can convert different formats

Usage: convfmt [OPTIONS] --from <FROM> --to <TO>

Options:
  -f, --from <FROM>  [possible values: bson, csv, hjson, hocon, json, json5, jsonl, plist, ron, toml, toon, xml, yaml]
  -t, --to <TO>      [possible values: bson, csv, hjson, hocon, json, json5, jsonl, plist, ron, toml, toon, xml, yaml]
  -c, --compact
  -h, --help         Print help
  -V, --version      Print version
$ cat cfg.yml | convfmt -f yaml -t toml > cfg.toml
$ convfmt -f json -t json < compact.json > pretty.json
$ curl https://api.github.com/users/oriontvv | convfmt -f json -t json5 > api.json5

By default convfmt uses pretty format. Can't be compacted with --compact option. Beware of nulls, some formats don't support them (e.g. toml).

Installation:

cargo install cargo-binstall && cargo binstall convfmt
  • Build from sources with rust
cargo install convfmt
Commit count: 292

cargo fmt