You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating new resources (or making modifications), we require all parameters to be set through flags. While this is great for automation and experienced users, I believe that its not the best UX for new users, as they usually do not know which flags are available and must/should be set. Even I sometimes fallback into a loop of specifying a flag, sending the command and then getting an error that another flag is required, repeat 2-3 times. Another issue is that the list of possible values for flags is sometimes not obvious, some things are hardcoded, some are queried from the API. Both issues are already improved through autocomplete, but not everyone has this installed.
Suggested Solution
An interactive mode, where the CLI prompts the user for all possible inputs could help with this. This prompt could include a list of possible values where it makes sense (ie. Server Types, Images, SSH Keys when creating a new server).
Cherry-on-top would be to allow flags & only ask for fields that are still missing, or at least pre-select the values from the flags.
This mode should be explicitly enabled through setting a -i/--interactive flag. If we introduce some more settings (#434), this could become a configurable default.
Related Refactorings
While working on this, it might make sense to refactor the flags and prompts to be defined in a single source of truth, instead of duplicating the definitions for both in their respective formats.
It might also make sense to formalize the createOptsFromFlags pattern and employ it in all create commands to help with the previous refactor.
Reasonably mature full blown TUI framework, very useful for building full applications in the terminal. IMO a little bit overcomplex for the simple use case of prompting some variables. I did some experiments with it earlier this year.
Background
When creating new resources (or making modifications), we require all parameters to be set through flags. While this is great for automation and experienced users, I believe that its not the best UX for new users, as they usually do not know which flags are available and must/should be set. Even I sometimes fallback into a loop of specifying a flag, sending the command and then getting an error that another flag is required, repeat 2-3 times. Another issue is that the list of possible values for flags is sometimes not obvious, some things are hardcoded, some are queried from the API. Both issues are already improved through autocomplete, but not everyone has this installed.
Suggested Solution
An interactive mode, where the CLI prompts the user for all possible inputs could help with this. This prompt could include a list of possible values where it makes sense (ie. Server Types, Images, SSH Keys when creating a new server).
Cherry-on-top would be to allow flags & only ask for fields that are still missing, or at least pre-select the values from the flags.
This mode should be explicitly enabled through setting a
-i
/--interactive
flag. If we introduce some more settings (#434), this could become a configurable default.Related Refactorings
While working on this, it might make sense to refactor the flags and prompts to be defined in a single source of truth, instead of duplicating the definitions for both in their respective formats.
It might also make sense to formalize the
createOptsFromFlags
pattern and employ it in allcreate
commands to help with the previous refactor.Possible Tools
The text was updated successfully, but these errors were encountered: