Skip to content

A CLI tool to convert between JSON, TOML, and YAML.

License

Notifications You must be signed in to change notification settings

0x6b/transformer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

transformer

A CLI tool to convert from JSON|TOML|YAML to JSON|TOML|YAML|Rust serde structs.

I'm an avid user of https://transform.tools/ to convert between JSON, TOML, YAML, and Rust serde structs from time to time. However, I wanted a CLI tool that could do the same thing offline, saving me the hassle of copy-pasting.

Usage

A CLI tool to convert from JSON|TOML|YAML to JSON|TOML|YAML|Rust serde structs.

Usage: transformer [OPTIONS] [COMMAND]

Commands:
  json   Convert the input to JSON. This is the default if no subcommand is provided
  toml   Convert the input to TOML
  yaml   Convert the input to YAML
  serde  Convert the input to Rust serde struct
  help   Print this message or the help of the given subcommand(s)

Options:
  -f, --from <FROM>  Optional input format. Supported format: json, toml, or yaml. If
                     not provided, the format will be guessed
  -h, --help         Print help
  -V, --version      Print version

i.e.

$ # gives you a JSON equivalent of the input
$ cat Cargo.toml | transformer

Contributing

There should be similar and/or capable tools available in every language, so if you have a better option, feel free to keep using it. I wrote this one for quick access. While I don't expect any issues or pull requests, you're welcome to fork it and modify it as you see fit.

License

MIT. See LICENSE for details.

About

A CLI tool to convert between JSON, TOML, and YAML.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages