Optum / dce-cli

Disposable Cloud Environment CLI
Apache License 2.0
37 stars 20 forks source link

Commands should output valid JSON to stdout #11

Open eschwartz opened 4 years ago

eschwartz commented 4 years ago

By default, all CLI commands should output JSON to stdout.

Currently, we have some commands that don't output valid json, eg:

$ dce leases create ...
Lease created: {
        "accountId": "123456789012",
       ...
}

Other commands print valid JSON, but to stderr, for example, dce leases list


I would like to see some standardization around CLI output formatting.

Ideally, we'd have support for both JSON (computer-readable) and column/text (human-readable) formats.

Users could configure the output format via a --output=json CLI flag, or with a output: json config value in dce.yml

See how AWS controls CLI output formatting: https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-output.html

eschwartz commented 4 years ago

Resolved in v0.5.0

We do not yet have custom formatters, but all commands should be printing valid JSON to stdout