filecoin-project / lotus

Reference implementation of the Filecoin protocol, written in Go
https://lotus.filecoin.io/
Other
2.84k stars 1.26k forks source link

Standardise a top level output format for all lotus CLIs #12616

Open masih opened 6 days ago

masih commented 6 days ago

Lotus CLI commands currently use a variety of formats to output information. These commands are often used by operators in scripts where a whole bunch of string manipulations are required to get to desired output.

The proposal here is to introduce a top-level flag, --output where once set it affects the output format of all sub commands, with initial support for two formats: json and text.

This way, it would be much easier to programmatically use the lotus CLIs, e.g. via pipe to jq etc.

masih commented 3 days ago

Also see prior work on introducing global flags: https://github.com/filecoin-project/lotus/pull/6743