To be or not to be interactive?
Providing an interactive version of a CLI application certainly enhances the user experience. So, shouldn’t we always provide it? Shouldn’t it be the default version? These are great questions. Thanks for asking! 😊
Let’s start with the first one: shouldn’t we always provide it? We certainly should as it (as mentioned previously) improves the user experience and engagement.
Shouldn’t it be the default version? It could! It depends on your target audience:
- If your CLI application is primarily intended to be run by humans, then yes! You should make the interactive version the default one. In this case, your commands could provide a
--non-interactive
option to disable this interactive behavior when that command is executed by a program (in a CI/CD pipeline, for example). - If your CLI application is primarily intended to be run by programs (such as one for processing a large batch of files or a CI...