Crates.io | cbor-cli |
lib.rs | cbor-cli |
version | 0.5.0 |
source | src |
created_at | 2024-01-05 14:19:45.214147 |
updated_at | 2024-01-08 06:48:13.380704 |
description | Command line tool for encoding and decoding CBOR using serde. Supports import and export for JSON, YAML, and TOML. Supports deep inspection of CBOR files. |
homepage | |
repository | https://github.com/TakenPilot/cbor-rs/tree/main/cli |
max_upload_size | |
id | 1089753 |
size | 35,017 |
Command line tool for encoding and decoding CBOR using serde. Supports import and export for JSON, YAML, and TOML. Supports deep inspection of CBOR files.
Features:
brew tap takenpilot/cbor
brew install cbor-cli
cargo install cbor-cli
cbor import test.json > test.cbor
Example of exporting to a JSON file:
cbor export --format=json test.cbor > test.json
Example of importing in one format and exporting in another:
cbor import test.json | cbor export --format=yaml > test.yaml
Example of importing stdin and then exporting to stdout:
cat test1.json test2.json | cbor import --format=json | cbor -d=",\n" export --format=json
For debugging, you can dump the structure of one or more CBOR files to stdout.
cbor inspect test.cbor
You can inspect the resulting data across multiple types of files if you pipe to cbor first:
cbor import ../fixtures/test.json ../fixtures/test.yaml | cbor inspect
You can specify a unique delimiter.
cbor export --format=json --delimiter=, test.cbor > test.json