Minimal web app to run scripts.
Put anything executable in the
It'll show up as a button in the web UI.
Then, you can push a button!
In a shell, run the following:
mkdir smalltasks && cd smalltasks curl -L -o pushabutton https://github.com/engagespark/pushabutton/releases/download/0.0.2/pushabutton-0.0.2-x86-64-glibc chmod u+x pushabutton ./pushabutton setup ./pushabutton serve
Now, visit http://localhost:8080/.
For more info, run
For example, let's create a “date” button that runs the
To do this, we create a link to the executable in the buttons dir:
smalltasks$ cd buttons && ln -s $(which date)
Looking at the web-UI, you immediately get a button that you can click.
After clicking, the executable is run and you get a log:
Remember what command you ran yesterday? No worries,
Oh, and then there's parameters! Let's say you're interested in running the
id command from the web, to find the IDs of users:
$ ln -s $(which id)
Now, you need to pass a username. Add a textfile
$ cat id.parameters username
When clicking the button, you'll get a modal asking for the username:
- Add descriptions to parameters
- Make the user choose a value for a parameter with a drop-down list.
- Determine the valid choice at runtime (by running a script).
How to configure these, see the examples after running setup.
What it is and what it's not
Pushabutton is about enabling non-techies to use your simple helper scripts, too. You copy the binary, you dump the script in the buttons dir, you run the webserver. Then you paste the link in the mail to your colleague, and that's it — done. You can do simple parameters, you have a simple log — but that's it. Pushabutton fills a gap at the low-effort, simple-need end of the spectrum.
It will not be enough for many use cases, and in fact it is not meant to be. Pushabutton does not care about:
- Authorization (this user can do this, the other one cannot)
- Scheduling (at 5pm tomorrow do this and at every 2nd Sunday do that)
- Editing from the web
- Conditional logic
- Branding and themes
If you need any of those, then Pushabutton is not for you. There are other tools where you can run something from a web-UI, and that do those things well:
Setup & Running & Uninstalling
Run the setup command:
$ ./pushabutton setup
This will setup the necessary directories and some demo scripts:
$ tree . ├── buttons │ ├── what_is_the_current_date.sh │ ├── write-message-to-logged-in-user.sh │ ├── write-message-to-logged-in-user.sh.parameters │ └── write-message-to-logged-in-user.sh.parameters.user-tty.choices.sh ├── logs └── pushabutton
What did we get?
buttonsis where your scripts live. Link them or drop them there — as long as it's executable, Pushabutton will make a button out of it. At the beginning, two scripts demonstrate how to create your own buttons.
logsthat's where, for every button push, log files are stored. The
journal.logis the file that indexes the rest.
Run the server:
$ ./pushabutton serve Running server on :8080
Want to uninstall? Simple. Just delete the entire directory. There's nothing else.
MIT, see LICENSE file
Dependencies, their license & thanks!
We're using the following libraries directly:
Thru the vendor directory, we're redistributing source code of the following projects:
$ govend -tv
- github.com/nu7hatch/gouuid MIT
- gopkg.in/alecthomas/kingpin.v2 MIT
- github.com/alecthomas/units MIT
- github.com/alecthomas/template GO license
- github.com/alecthomas/template/parse GO license
- github.com/alecthomas/assert MIT