platformsh / platformify

Get your project ready to be deployed in Platform.sh
MIT License
2 stars 8 forks source link

Research a Go library to handle interactive CLI commands #3

Closed akalipetis closed 1 year ago

akalipetis commented 1 year ago

We should find a library to interactively ask the user questions to Platformify their project.

Possible solutions could be:

fabpot commented 1 year ago

The clear winner here would be https://github.com/charmbracelet/bubbletea (and its derivative repos)

akalipetis commented 1 year ago

I wasn't aware of that, looks shinny! ❇️ ✨

vintorez commented 1 year ago

Here's what I managed to find out:

  1. promptui ➖ a barely maintained project (the last commit was made more than a year ago) ➖ has problems when working in Windows

  2. survey ➕ simple ➕ full support for windows and posix terminals ➕ all major components included ➖ reading from piped stdin or writing to piped stdout is not supported ➖ young project with more than 20 opened issues labeled as 'bug' ➖ no 'table' component

  3. bubbletea ➕ a mature project that regularly maintained ➕ a lot of different components included ➕ fully documented ➖ too shiny 🙂

Personally speaking, I like how everything looks in survey, because it looks like you are working with a terminal, not a GUI. But I must admit that bubbletea has more advantages. It looks like a project we can rely on.

akalipetis commented 1 year ago

@Vintorez Thanks a lot for the nice review!

I understand that shiny might not be ideal, but it's possible that we can tune-down how shinny it is with better configuration.

Could you please do a quick PoC for the following with both survey and bubbletea (if they're possible out of the box, don't implement things that are not possible)?

Also, if you can think other possible question types feel free to include them as well.

vintorez commented 1 year ago

Prepared the PR that can be used as PoC - https://github.com/platformsh/platformify/pull/12 You can find more detailed information in the description of the PR.

pjcdawkins commented 1 year ago

I used "survey" in hop, FWIW.

Personally speaking, I like how everything looks in survey, because it looks like you are working with a terminal, not a GUI. But I must admit that bubbletea has more advantages. It looks like a project we can rely on.

Agreed

vintorez commented 1 year ago

Information to think about:

Yesterday I decided to look for large projects that use either survey or bubbletea. Below are the lists of projects with more than 14k stars. And, to be honest, the "survey" list looks more impressive...

Survey:

Bubbletea:

akalipetis commented 1 year ago

Ok, I think we have a gravitation towards survey - given that I believe this should be an easy one to swap, let's stick with survey for now and we'll see if this poses an issue.

This does not block us from using all the bells and whistles from https://charm.sh anyway.