What's the point of implementing something like this completely in Javascript? Isn't this a good example of something that should be developed in a lower-level, faster language?
Personally, I avoid languages that require a runtime when developing CLIs. Nothing worse than telling your users "just make sure that you're running the right version of Ruby/Python/Node."
This and other JS CLI libraries are typically used by JS projects that have tooling. Like when create-react-app scaffolds a project and asks you questions to customize it, etc. it's using libraries like this one. For a JS project it's just an easy npm install away as a dependency, and you know your users will have nodejs anyways.
Speed rarely matters for imperative user-facing tools. You're going to be waiting for a user to type and respond far, far longer than making some system calls to write to the shell.
Ink is a more interesting and maintained library to consider though: https://github.com/vadimdemedes/ink It lets you write react-like apps that output to the terminal instead of HTML.
There's similar libraries for python[1], golang[2], rust[3]. Drawing on the terminal isn't that resource intensive so I'd stay in whatever ecosystem I have a reason to be in.
As the other response pointed out it’s not a big deal. Needing a runtime is a small bummer though node is easily installable everywhere now.
What I really like about blessed was it’s api. At one point I made my own fork and was going to try to maintain it. Then I thought I’d try to port it to nim. These days I just use one of the excellent text ui libs in go which is great mostly because of the ecosystem.
The point is this gives you a GUI, but is communicated over a terminal. So if you want a GUI from some Docker instance this is a lot easier to fiddle with on the CLI than x-forwarding.
14 comments
[ 1.6 ms ] story [ 42.4 ms ] threadSpeed rarely matters for imperative user-facing tools. You're going to be waiting for a user to type and respond far, far longer than making some system calls to write to the shell.
Ink is a more interesting and maintained library to consider though: https://github.com/vadimdemedes/ink It lets you write react-like apps that output to the terminal instead of HTML.
1. https://github.com/willmcgugan/rich
2. https://github.com/gizak/termui
3. https://github.com/fdehau/tui-rs
Notably absent is the JVM. Another victim of startup time I imagine.
https://github.com/mabe02/lanterna
What I really like about blessed was it’s api. At one point I made my own fork and was going to try to maintain it. Then I thought I’d try to port it to nim. These days I just use one of the excellent text ui libs in go which is great mostly because of the ecosystem.
I'm working on a go cli project now and I'm looking for a good one, which one are you using?
https://github.com/embarklabs/neo-blessed
However I don't think that CLI should mimic GUI, with boxes, transparent windows, shadows, pop-up menus etc. This is way too much bloat...
Why not simply write a GUI if that's what you want?
https://invisible-island.net/dialog/#screenshot