Cool experiment. I see s slow but steady trend over the last 5-10 years to bring more interactivity and user-friendlyness to the terminal. Point and click UIs have dominated and taken over everything because of their intuitiveness and because they are discovered. But once a user got into it, they were held hostage of horrible ergonomy and caped att the poor productivity of a mouse interaction.
Terminal UX has been getting better. One example is fish shell, which does much of what this project does, albeit with a more implicit/minimal interface.
This project closes the gap of discovering a cli tool with an UI as intuitive as a point and click one, while retaining the old rock solid standards or cli apps, and without needing to mode the hands from the keyboard.
Wel done.
Realistically, once one is familiar with a cli program, there is no reason anymore to use this as one can just enter the commands on the prompt. But this is great for exploring a new one.
I would love to hear from the author behind Textualize and from the folks behind Charm about how viable such efforts to re-vitalize the terminal are. It seems from the outside that a lot of these projects fall more into the camp of “we do it because we can/it’s cool”, which may be enough, but they seem to also convey some notion that it improves the state of affairs. How much though?
That may not be feasible, since usually you build the argparser in code and then execute it, whereas click works by decorating functions at the toplevel. There’s a moment to introspect with click that doesn’t exist with argparse.
I think you could still do it something like this:
import argparse
parser = argparse.ArgumentParser(
prog="ProgramName",
description="What the program does",
epilog="Text at the bottom of help"
)
parser.add_argument("filename")
parser.add_argument("-c", "--count")
parser.add_argument("-v", "--verbose", action="store_true")
argparse_tui(parser)
PowerShell is nice in this regard. All cmdlets advertise their arguments and types and if you run a cmdlet without arguments then it will give you an interactive prompt for each of them. Tab completion also works to show all of the arguments. The place PowerShell fails is that they went with a verb-noun convention that makes discovering cmdlets very hard.
Wow, this is pretty cool! From the screenshots, it looks like for larger applications it will become rather messy quickly, but I think it’s still a worthwhile attempt to make the CLI more discoverable.
clap author here. There are a few third party crates that can gererate both TUIs and GUIs from clap CLIs since clap exposes all the info for reflection in order to enable things like manpage or shell completion generation. I haven’t personally used them though, so I can’t speak to their completeness. We’ve toyed with the idea a few times of doing an “official” crate but never had the time to sit down and do a full implementation.
good idea, and I agree with lack of discoverabilty in CLI.
Another gap is the ‘ready-to-use’ examples of a CLI for well known use cases.
It should not be necessary to reach to ChatGPT or StackOverflow to learn how to use find or how to update/modify files by a similar pattern recursively.
So a ‘tutorial’ style command line help that ‘links’ multiple commands together – would be of great help too.
I realize that at some point this type of ‘knowledge’ should be stored somewhere before Trogon can use it, but may be Trogon can come up with a policy / best UX practices guide that informs CLI tools developers and the numerous CLI-argument-parsing-libraries of best practices, and that can somehow be used as a reference implementation, across newly created apps (or enriching existing apps).
Cool experiment. I see s slow but steady trend over the last 5-10 years to bring more interactivity and user-friendlyness to the terminal. Point and click UIs have dominated and taken over everything because of their intuitiveness and because they are discovered. But once a user got into it, they were held hostage of horrible ergonomy and caped att the poor productivity of a mouse interaction.
Terminal UX has been getting better. One example is fish shell, which does much of what this project does, albeit with a more implicit/minimal interface. This project closes the gap of discovering a cli tool with an UI as intuitive as a point and click one, while retaining the old rock solid standards or cli apps, and without needing to mode the hands from the keyboard. Wel done.
Realistically, once one is familiar with a cli program, there is no reason anymore to use this as one can just enter the commands on the prompt. But this is great for exploring a new one.
I would love to hear from the author behind Textualize and from the folks behind Charm about how viable such efforts to re-vitalize the terminal are. It seems from the outside that a lot of these projects fall more into the camp of “we do it because we can/it’s cool”, which may be enough, but they seem to also convey some notion that it improves the state of affairs. How much though?
Incorrectly assumed this worked by parsing manpages and help strings. I see it is compatible with python library click.
A couple of suggestions:
That may not be feasible, since usually you build the argparser in code and then execute it, whereas click works by decorating functions at the toplevel. There’s a moment to introspect with click that doesn’t exist with argparse.
I think you could still do it something like this:
https://github.com/chriskiehl/Gooey (CLI to GUI) works for the
argparse
moduleI wonder if the next step in UI is having an LLM that you chat to, and it writes a CLI-ish command to execute.
PowerShell is nice in this regard. All cmdlets advertise their arguments and types and if you run a cmdlet without arguments then it will give you an interactive prompt for each of them. Tab completion also works to show all of the arguments. The place PowerShell fails is that they went with a verb-noun convention that makes discovering cmdlets very hard.
This is really neat.
I added it to my sqlite-utils CLI tool and the whole feature was six lines of code: https://github.com/simonw/sqlite-utils/commit/ec12b780d5dcd64b348986b083394bd805de5fe7
Here’s the documentation and a screenshot: https://sqlite-utils.datasette.io/en/stable/cli.html#experimental-tui
Very cool, reminds me of smitty, which I miss from AIX, https://youtu.be/MFnbAKYkisc?t=743
Wow, this is pretty cool! From the screenshots, it looks like for larger applications it will become rather messy quickly, but I think it’s still a worthwhile attempt to make the CLI more discoverable.
Oooh, brilliant idea. I wonder if one could make something like this in Rust that works with
clap
orargh
…clap author here. There are a few third party crates that can gererate both TUIs and GUIs from clap CLIs since clap exposes all the info for reflection in order to enable things like manpage or shell completion generation. I haven’t personally used them though, so I can’t speak to their completeness. We’ve toyed with the idea a few times of doing an “official” crate but never had the time to sit down and do a full implementation.
good idea, and I agree with lack of discoverabilty in CLI. Another gap is the ‘ready-to-use’ examples of a CLI for well known use cases.
It should not be necessary to reach to ChatGPT or StackOverflow to learn how to use
find
or how to update/modify files by a similar pattern recursively.So a ‘tutorial’ style command line help that ‘links’ multiple commands together – would be of great help too.
I realize that at some point this type of ‘knowledge’ should be stored somewhere before Trogon can use it, but may be Trogon can come up with a policy / best UX practices guide that informs CLI tools developers and the numerous CLI-argument-parsing-libraries of best practices, and that can somehow be used as a reference implementation, across newly created apps (or enriching existing apps).