by crazygringo · 6y ago · 0 comments
Perhaps this is slightly off-topic, but my dream is an interface that combines the best of both worlds.
Kind of an automated GUI-builder for command-line tools, that analyzes the combinations of options used most, breaks them down into workflows with options (that can be manually named), and you can thus execute one-off commands easily and quickly without having to hunt through man pages, but still export the command as a command-line incantation for reuse, to use in a script, etc.
Here's the demo: https://jonbo.github.io/project/simply/
There's also a small ffmpeg example. (If you click the fetch button, on the demo.) The schema "recipes" for it are just a basic JSON format and can be seen here https://gist.github.com/jonbo/c4067cd18e5fa687e896b2358aaf9e... and https://github.com/jonbo/simply.recipes/blob/master/docs/REA...
I never did publish the (non-bundled) source code for the demo, since it was done in a hurry (spaghetti), but I might if there's interest.
Maybe this will inspire somebody else to build something better!
Seems like you'd need a universal CLI tool usage traverser and parser to figure out what's possible. Likely this would produce a decision tree of sorts with different modes and options excluding or including new options. We'd need a way to show all this, maybe nested tabs for modes and check boxes and other inputs at each appropriate level.
Layer on this a way to optimize for the most common cases like you said. Further, if this becomes popular, CLI tools could emit some sort of standard description language that would optionally customize the GUI. The GUI's output should be both the text command it constructed and the ability to run that command directly.
More future steps would be a way to reason about multiple commands, pipes, and other combinators.
Adding this to my side projects backlog. Thanks for the idea!
A tool to automatically parse `man` pages or help prompts from tools would be a dream come true, basically.
Apart from the possible commands, it may be useful for the GUI to also show some kind of state, for example filesize (akin to invoking `ls` before `ffmpeg`, as you would normally do on the CLI).
Done with the right abstractions, command combinations should come almost for free.
[0] https://magit.vc/ [1] https://en.wikipedia.org/wiki/Dired
I (selfishly) hope you build it, since I don't have the time!
ffmpeg mymovie.mov -w 720 mymovie.mp4
Should do what you expect