There are many commands whose output is simple and small, where text output would typically be expected unless --json is applied. For example, right now, elastic version returns JSON by default, which is unexpected at best:
❯ elastic version
{
"version": "0.2.1"
}
Requirements
- Audit all commands that will always have a simple output, and evaluate what their default output is when
--json is not used.
- Ensure the output is rendered in a way that is pleasing to the eye when printing to an interactive TTY using colors, bold, table borders, etc, and in easily-parsed tabular format when piped to another process
"Simple" is a blurry boundary, but typically anything that could easily be printed as tabular data (array of strings; array of flat, homogeneous objects) or a single value should be printed in a way that's pleasing to the eye and easy to pipe into other Unix commands that expect plaintext input.
Currently src/output.ts is responsible for handling some of this, but the CLI has evolved quite a bit since it was implemented, so it may not be working as effectively as it could be. I'd start investigation there when establishing a plan of attack.
The ultimate goal of this effort is ensuring human-readable outputs are likeable, pleasant to read, and send the message that the CLI is not just for agents. 🖤
There are many commands whose output is simple and small, where text output would typically be expected unless
--jsonis applied. For example, right now,elastic versionreturns JSON by default, which is unexpected at best:❯ elastic version { "version": "0.2.1" }Requirements
--jsonis not used."Simple" is a blurry boundary, but typically anything that could easily be printed as tabular data (array of strings; array of flat, homogeneous objects) or a single value should be printed in a way that's pleasing to the eye and easy to pipe into other Unix commands that expect plaintext input.
Currently
src/output.tsis responsible for handling some of this, but the CLI has evolved quite a bit since it was implemented, so it may not be working as effectively as it could be. I'd start investigation there when establishing a plan of attack.The ultimate goal of this effort is ensuring human-readable outputs are likeable, pleasant to read, and send the message that the CLI is not just for agents. 🖤