BitcoinDesign / Guide

A free, open-source community resource for designers, developers and others working on non-custodial bitcoin products.
https://bitcoin.design/guide/
Other
457 stars 98 forks source link

Suggestion: Reference Design section for a user friendly command line interfaces (cli) #858

Open kngako opened 2 years ago

kngako commented 2 years ago

A lot of bitcoin tools provide a cli which one could use to interact with the daemon/rpc server. When a user uses the cli tool they will usually see all the available commands fill up the screen (and in some cases struggle to find the command that is relevant to their needs). I suggest the design docs include a cli section to improve the quality of the cli tools.

Suggestion:

I would like to suggest bitcoin cli group commands so that related commands can be accessible from a subcommand of a parent command.

Link to the page

This would be a new page on Bitcoin Design Guide

Why would you like to add the content?

I would like to suggest this addition because more and more bitcoin tools are implementing cli tools that are adopting the flat command structure of Bitcoin core. Lightining cli tools like CLN are also implementing their commands similar to the bitcoin cli leading to a flurry of commands being spat on the screen when a (possibly new) user runs them with the "--help" flag.

Suggestions

Most bitcoin cli tools have commands that can logically be grouped by their purpose.

The Bitcoin Core RPC docs groups rpc commands by the following:

With this suggestion the above list would become commands which would expose the commands listed under them as subcommands. Hopefully making "help" command output more readable.

The lncli and lightning-cli also has similar logical command groupings but when a user runs the help command they are just presented with the full list of commands instead of a short list of logical groupings (with a description of what the subcommands of each grouping would be).

Additional context

Cli tools like docker have this cli command -> subcommand grouping (with the added extra of having the more populare commands accessible as first class commands).

For backward compatibility existing cli tools can keep all commands as first class commands but introduce the logical grouping commands that can then allow a user to more easily find the command they are looking for.

Content guidelines If you're a contributor looking to tackle the issue, you can preview our content guidelines.

johnsBeharry commented 2 years ago

For context around what a designers role / process would look like for such a topic there was a Figma Config talk a few years ago called "Designing for the command line" by Amanda Pinsker.