Skip to content

Nicer, more helpful CLI interaction #577

@allanday

Description

@allanday

The current toolbox CLI feels a bit immature and like it would benefit from some refinement. From a UX perspective, there are occasions when it feels like it could be more helpful, particularly when it comes to recovering from errors. However, we could also do to look at language and formatting more generally, to make it easy to understand and read.

Current design

Examples from the current CLI, along with comments on where it could be improved.

Missing command

$ toolbox
Error: missing command

create    Create a new toolbox container
enter     Enter an existing toolbox container
list      List all existing toolbox containers and images

Run 'toolbox --help' for usage.
$ ▮

Issues here: it's negative and somewhat accusatory, the list of commands could be easier to distinguish, it could provide some more useful information for the user.

Incorrect toolbox name

$ toolbox enter fedora-toolbox-3
Error: container fedora-toolbox-3 not found
Use the '--container' option to select a toolbox.
Run 'toolbox --help' for usage.
$ ▮

This isn't very helpful. Also, the different parts of the message are lumped together and are hard to differentiate. Saying 'error' feels jarring and unnecessary.

Toolbox create

$ toolbox create fedora-32-2
Created container: fedora-32-2
Enter with: toolbox enter fedora-32-2
$ ▮

The main thing here is formatting. (Do we have style guide for CLI? Seems like we should.) I would generally put instance names in quote marks, when they're part of a sentence.

I would also use indentation and line spaces to delineate different types of information.

Suggested design

Some tentative suggestions for what the CLI could look like.

Missing command

With no toolboxes:

$ toolbox
Common commands:
    create   Create a new toolbox container
    enter    Enter an existing toolbox container
    list     List all existing toolbox containers and images
    
See 'toolbox --help' for more information.

No toolboxes found.
$ ▮

With toolboxes:

$ toolbox
Common commands:
    create   Create a new toolbox container
    enter    Enter an existing toolbox container
    list     List all existing toolbox containers and images
    
See 'toolbox --help' for more information.

Available toolboxes:
    fedora-toolbox-32
    fedora-toolbox-33
$ ▮

Incorrect toolbox name

Single toolbox present:

$ toolbox enter fedor-toolbo-32
'fedor-toolbo-32' not found.

Enter 'fedora-toolbox-32'? [Y/n]: ▮

The nice thing about this is that it's a single key stroke to recover from the error.

Multiple toolboxes present:

$ toolbox enter fedor-toolbo-32
Toolbox 'fedor-toolbo-32' not found.

Available toolboxes:
    1. fedora-toolbox-32
    2. fedora-toolbox-33

Enter number to enter (0 to cancel): ▮

Toolbox create

$ toolbox create fedora-32-2
Created 'fedora-32-2'. To enter, run:
    toolbox enter fedora-32-2
$ ▮

Metadata

Metadata

Assignees

No one assigned

    Labels

    2. CLIIssue is related to the command line interface2. DesignDesign discussion2. Host RealmThe issue is related to what happens on the host machine where Toolbox is executed3. EnhancementImprovement to an existing featureProject Pickle 🥒UX refinement initiative

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions