8 ms·
Gooey: Turn command line programs into GUI applications
- wlievens 12y agoReally cool. May try to make something like this for jCommander.
- abc_lisper 12y agoClever. However, it is not for any command line program. It works only for python programs that use argument parser. Though, one can write a python argument parser around a cli to make it work.
- dmitshur 12y agoSomething similar could be done for Go. Since most of Go programs simply import the standard "flag" package for their command line parsing, you could have a pretty large coverage.
- mandalar12 12y agoVery cool! Does anything similar exist for Android ? I would love to use some bash scripts but I don't find the terminal editors I tried practical.
- fndrplayer13 12y agoReally pretty neat especially if your tool might be used by less technical folks. I can't count the number of times people in our engineering department have given non-technical people in our company a command line tool because its easier than adding a GUI, be it native or web. I think this will come in handy in those cases.
- wildgift 12y agoThere are tools, at least on Unix, to add guis to command lines. gtkdialog and zenity are the ones I've seen. You need to write a shell script that runs commands to display the gui, and then execute the command.
- nilved 12y agoReally awesome and promising idea, but I think the implementation is limiting. Couldn't it just as well parse help text? It's not guaranteed to be standard, but there are probably more programs that can be parsed that way than use ArgumentParser.
- wickawic 12y agohttp://docopt.org/ http://docopt.org/ This project attempted to make argument parsing and the help string synonymous. I'm not sure if it is being actively maintained.
- T-A 12y agoNice find! https://github.com/docopt/docopt.go https://github.com/docopt/docopt.go was updated 18 days ago, so it does look alive and well.
- the_mitsuhiko 12y agoThe problem with docopt is that it's very hard to process internally. There is no real internal representation. I tried to write a docopt to click converter but I had to give up.
- ridiculous_fish 12y agoI'm not sure quite what you're looking for, but you may be interested in my (not yet announced) docopt parser in C++: https://github.com/ridiculousfish/docopt_fish https://github.com/ridiculousfish/docopt_fish . It's got a richer feature set than the "reference" docopt.
- goostavos 12y agoI actually started out just parsing the help text, but ArgParse gives a ton of extra options that let me better choose the widget type. For instance, things like `Choice` or `Count` options which cue the framework to use dropdowns. Or `StoreTrue` which cues it to generate a CheckBox. Stuff like that. I'm not totally sure how I could get that level of detail without forcing some kind of markup within the help messages. I'm totally open to ideas (and pull requests) though! :)
- xdissent 12y agoI like it! How about an Open/Save button to choose files for stdin/stdout?
- goostavos 12y agoIn the TODO ;)
- manishsp 12y agoHow about converting CLI programs into Web based applications ?!!
- jcagalawan 12y agoWith a REST API you can call from curl !?
- manishsp 12y agoYes, good idea ..! At our workplace, we have whole bunch of administration tool running on unix CLIs. I am thinking of way by which having same experience in browser based apps ..!
- wildgift 12y agoI'm doing an application that runs scripts for a REST API. Using Django REST API to build the service.
- manishsp 12y agoI'm wondering if such app can support some really complex unix cli apps. Like CLI app which runs(around 1500 commands)in fixed window on terminal and asks user input parameters.
- jayvanguard 12y agoGood idea. I wonder if anyone has done this for general unix command-line apps by parsing out the man pages on the fly. It probably wouldn't work for all programs but may be gnu style ones would be consistent enough.
- eldelshell 12y agoI too was expecting something like what you describe but by parsing -h --help output.
- gioele 12y agoThe bash-completion script can deduce which options are supported by an application by parsing the output of --help and of usage lines. In Bash. http://anonscm.debian.org/cgit/bash-completion/bash-completion.git/tree/bash_completion#n771 http://anonscm.debian.org/cgit/bash-completion/bash-completi...
- DennisP 12y agoEither way, it might be neat to do it dynamically, so command-line programs could be turned into guis live by typing "guify xyz". The gui could have labels with the command options, and upon hitting enter they could close and send the command back to the command line, so you're learning the commands as you go.
- naranja 12y agoThe fish shell does this with an explicit command (fish_update_completions) and offers an awesome Tab completion in the current Github version
- jlarocco 12y agoI've done something similar to this a few times, both in Python. Once to create a TkInter GUI for an internal command line app, and once to wrap sg3_utils for use in Python scripts. In general, I think it could "mostly work" a good portion of the time, but it'd be pretty difficult to get working 100% of the time without a lot of tweaking to the parser.
- 12y ago
- eriktrautman 12y agoThat looks awesome. Are there similar implementations native to other languages out there?
- willcodeforfoo 12y agoSomething similar for creating GUIs on Mac OS X http://www.bluem.net/en/mac/pashua/ http://www.bluem.net/en/mac/pashua/
- BoppreH 12y agoNot sure if my fault, by all images are returning errors, and their folder is 400'ing.
- mkopinsky 12y agoHe just committed a fix for this.
- gamesbrainiac 12y agoI'm so glad this is made using python :) I can now hack it to my heart's content.
- gnosek 12y agoLooks like the perfect companion to click: http://click.pocoo.org/ http://click.pocoo.org/
- Gracana 12y agoBack in the days of the classic Mac OS, the Mac Programmer's Workshop included a tool like this, called "commando." One of the neat things about commando was that you could hover over any option to see some descriptive "help" info at the bottom. http://i.imgur.com/Zxx33DU.png http://i.imgur.com/Zxx33DU.png
- agumonkey 12y agoFinally something interesting to bridge the gap between GUI and CLI. What about a reverse operations ? so a `program` can be instanced in any situations without having to write separate (or too much) user input logic ?
- jstoja 12y agoso neat
- Walkman 12y ago> Turn (almost) any command line program into a full GUI application with one line and lose the ability to pipe, check exit status, run from cron, run through ssh or a different machine, call from other scripts... The last couple of months as I know about more and more the command line, and can configure my shell and tools the way I like, I feel I'm more productive with the terminal than any other GUI application.
- hrabago 12y agoI think the creator acknowledged this specifically: If you're building utilities for yourself, other programmers, or something which produces a result that you want capture and pipe over to another console application (e.g. nix philosophy utils), Gooey probably isn't the tool for you. It's still helpful though for other scenarios.
- adambard 12y agoIt's great that you're learning about the command line and you're enthusiastic about it, but what about writing software for the you of more than a couple of months ago? I've written more than a few GUIs that added up to wrappers around a command-line app, this would have been very handy then.
- MateuszMucha 12y agoIt's not meant to be a replacement for CLI. I can imagine lots of use cases, even for me. Example: I used something to bulk convert images (resize, crop, convert from one format to another). I used it maybe three times in my life, every single time I had to read the manual. If there was a simple GUI, I'd save time. My main project is a mobile app that has a bunch of calculators dedicated to specific tasks. Some of this tasks are less-than-trivial, but most of them you'd not look a special tool for (for example VAT calculator). It has 950k downloads, most of its users are very happy with it. But every single time there's a review in the online press I get "this is for morons" comments. Every. Single. Time (unless it's a small blog that doesn't have commenters). When I saw Gooey, I had two thoughts: "Nice" and "Someone will surely try to make a point that this is stupid".
- 12y ago
- jodrellblank 12y ago"Transform your command line apps into user friendly GUIs" - https://raw.githubusercontent.com/chriskiehl/Gooey/master/resources/primary.png https://raw.githubusercontent.com/chriskiehl/Gooey/master/re... Encoder (-e). OpenCV FOURCC Type. {Empty text box}. Just take all possible options and ... shove them right in the user's face. Is that user friendly? Whom is it helping, who doesn't want a CLI but also knows how the CLI program works, but also can't script it?
- goostavos 12y agoYeesh. The picture in readme is one running a fake program I was using for testing. If you'll notice, none of the options particularly make sense -- heck, the output of the program (shown toward the bottom of the readme) is "printing message at: {hash}" If you take another look at the readme, you'll see that it supports `choice` style params. Which reads in the options available and presents them to the user via a dropdown. So, friendly options are a'plenty! :)
- jodrellblank 12y agoIf you'll notice, none of the options particularly make sense That's why I thought it was wrapping a real Linux command line program. ;) If you're wrapping a CLI, there's not much more you can do than take all the CLI options and shove them into a 1990's style window peppered with options. But it's not helping anything - anyone who knows what the options are and do, and who is not put-off by heaps of options, is likely fine with the CLI version. Anyone who is offput by heaps of options isn't going to want to face them in CLI or GUI versions. And anyone who doesn't like facing them, but who can deal with it, will wrap the CLI in a shell script that specifies the options they use most often and hides the rest. The whole thing is missing how and why CLI and GUI programs are different. Chrome isn't a wrapper for WGET, Finder and Explorer are not wrappers for ls/mv/cd, and PhotoShop is not a wrapper screen full of toggle and dropdown options around ImageMagick.
- goostavos 12y agoHmm.. Guess we just have different experiences with the user base this is targeting.
- fyolnish 12y agoSimilar workflow for Macs: http://www.sveinbjorn.org/platypus http://www.sveinbjorn.org/platypus + http://mstratman.github.io/cocoadialog/ http://mstratman.github.io/cocoadialog/ or http://www.bluem.net/en/mac/pashua/ http://www.bluem.net/en/mac/pashua/
- MagerValp 12y agoI've used them all to good effect, but I don't think it's fair to call them similar to Gooey. They require a bit of tinkering to work and your script has to adapt to running with a GUI. Zero effort to turn your ArgumentParser into a GUI is really a brilliant feature.
- diminish 12y agoI had also written something similar 5 years ago when I had jumped from heavy GUI usage to Linux for some linux commands, byusing their man pages, semi-automatically. Interesting enough, now I value the reverse more and I would love to see the Yeeog. Yeoog; Turn GUI programs into command-line
- conductr 12y agoI too would love to see a Yeoog
- mpoloton 12y agoAs much as I like the CLI, I really find this useful, because it takes time to go through document and find the desired option. I think the real solution is that every CLI program comes with a description file (probably in XML) that describes its CLI options, their types, combination, etc. The description file should help automatic GUI creating or shell completion.
- andrewstuart2 12y agoI think you just described a man page. Except for the xml part. That sounds a lot more like something MS would do.
- mpoloton 12y agoThe man pages are intended for human and are not meant to be specs. An advanced NLP program is required to parse man pages and infer appropriate types and combinations and I suspect it would not be perfect. I agree that this might lead to something which is not in Unix spirit but already shell completion provide such information and this shows the need for such specs.
- hueving 12y agoIf only there were an IEEE standard for utility conventions.
- krschultz 12y agoI assume you are referring to the POSIX spec on utilities (http://pubs.opengroup.org/onlinepubs/9699919799/ http://pubs.opengroup.org/onlinepubs/9699919799/), which is helpful but not a full solution to the problem.
- bash-j 12y agoNice. I think this will help me get motivated to start developing GUI apps. Thank you.
- coldtea 12y agoAnother app in this vein was Kaptain (for KDE): http://sourceforge.net/projects/kaptain/ http://sourceforge.net/projects/kaptain/
- zsolt_terek 12y agoThat tool lets you describe a context-free grammar for the command line options, and transforms the options into gui elements. Does not require KDE anymore, compiles with Qt only. http://kaptain.sourceforge.net/ http://kaptain.sourceforge.net/
- pbhjpbhj 12y agoThat looks useful, particularly the supplied find and grep "grammar scripts". I installed Kaptain from the trusty/universe default Ubuntu repos and got the latest version. Only issue so far is that it installs to /usr/bin/kaptain and so the scripts need to be modified slightly (they expect bin in /usr/local/bin/).
- andrewchambers 12y agoImplementing an api compatible wrapper around argparse might have been simpler than parsing the source code.
- chj 12y agoBeautiful idea. I can see this can be a great front end for wget/curl.
- nnnnni 12y agoI was expecting it to merely be a graphical version of "dialog". I was pleasantly surprised!
- devendramistri 12y agoGetting error while generating EXE for my script. I am using py2exe to convert my script into an executable. but getting following error: File "commandui.py", line 1, in <module> File "gooey\init_.pyc", line 1, in <module> File "gooey\gooey_decorator.pyc", line 16, in <module> File "gooey\gui\base_window.pyc", line 16, in <module> File "gooey\gui\header.pyc", line 10, in <module> File "gooey\i18n.pyc", line 37, in <module> File "gooey\i18n.pyc", line 24, in get_path IOError: Could not find english language file
- devendramistri 12y agoCan we have a "Restart" button using last arguments. That will be a great addition and really really useful.
- goostavos 12y agoGood idea! I'll add it to the TODO.