• Stars
    star
    8,056
  • Rank 4,624 (Top 0.1 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ultimate Plumber is a tool for writing Linux pipes with instant live preview

up - the Ultimate Plumber

up is the Ultimate Plumber, a tool for writing Linux pipes in a terminal-based UI interactively, with instant live preview of command results.

The main goal of the Ultimate Plumber is to help interactively and incrementally explore textual data in Linux, by making it easier to quickly build complex pipelines, thanks to a fast feedback loop. This is achieved by boosting any typical Linux text-processing utils such as grep, sort, cut, paste, awk, wc, perl, etc., etc., by providing a quick, interactive, scrollable preview of their results.

Usage

Download up for Linux   |   ArchLinux: aur/up   |   FreeBSD: pkg install up   |   macOS: brew install up   |   Other OSes

To start using up, redirect any text-emitting command (or pipeline) into it — for example:

$ lshw |& ./up

then:

  • use PgUp/PgDn and Ctrl-[←]/Ctrl-[→] for basic browsing through the command output;
  • in the input box at the top of the screen, start writing any bash pipeline; then press Enter to execute the command you typed, and the Ultimate Plumber will immediately show you the output of the pipeline in the scrollable window below (replacing any earlier contents)
    • For example, you can try writing: grep network -A2 | grep : | cut -d: -f2- | paste - - — on my computer, after pressing Enter, the screen then shows the pipeline and a scrollable preview of its output like below:

         | grep network -A2 | grep : | cut -d: -f2- | paste - -
         Wireless interface      Centrino Advanced-N 6235
         Ethernet interface      RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
      
    • WARNING: Please be careful when using it! It could be dangerous. In particular, writing "rm" or "dd" into it could be like running around with a chainsaw. But you'd be careful writing "rm" anywhere in Linux anyway, no?

  • when you are satisfied with the result, you can press Ctrl-X to exit the Ultimate Plumber, and the command you built will be written into up1.sh file in the current working directory (or, if it already existed, up2.sh, etc., until 1000, based on Shlemiel the Painter's algorithm). Alternatively, you can press Ctrl-C to quit without saving.
  • If the command you piped into up is long-running (in such case you will see a tilde ~ indicator character in the top-left corner of the screen, meaning that up is still waiting for more input), you may need to press Ctrl-S to temporarily freeze up's input buffer (a freeze will be indicated by a # character in top-left corner), which will inject a fake EOF into the pipeline; otherwise, some commands in the pipeline may not print anything, waiting for full input (especially commands like wc or sort, but grep, perl, etc. may also show incomplete results). To unfreeze back, press Ctrl-Q.

Additional Notes

  • The pipeline is passed verbatim to a bash -c command, so any bash-isms should work.
  • The input buffer of the Ultimate Plumber is currently fixed at 40 MB. If you reach this limit, a + character should get displayed in the top-left corner of the screen. (This is intended to be changed to a dynamically/manually growable buffer in a future version of up.)
  • MacOSX support: I don't have a Mac, thus I have no idea if it works on one. You are welcome to try, and also to send PRs. If you're interested in me providing some kind of official-like support for MacOSX, please consider trying to find a way to send me some usable-enough Mac computer. Please note I'm not trying to "take advantage" of you by this, as I'm actually not at all interested in achieving a Mac otherwise. (Also, trying to commit to this kind of support will be an extra burden and obligation on me. Knowing someone out there cares enough to do a fancy physical gesture would really help alleviate this.) If you're serious enough to consider this option, please contact me by email (mailto:[email protected]) or keybase (https://keybase.io/akavel), so that we could try to research possible ways to achieve this. Thanks for understanding!
  • Prior art: I was surprised no one seemed to write a similar tool before, that I could find. It should have been possible to write this since the dawn of Unix already, or earlier! And indeed, after I announced up, I got enough publicity that my attention was directed to one such earlier project already: Pipecut. Looks interesting! You may like to check it too! (Thanks @TronDD.)
  • Other influences: I don't remember the fact too well already, but I'm rather sure that this must have been inspired in big part by The Bret Victor's Talk(s).

Future Ideas

  • I have quite a lot of ideas for further experimentation of development of up, including but not limited to:
    • RIIR (once I learn enough of Rust... at some point in future... maybe...) — esp. to hopefully make up be a smaller binary (and also to maybe finally learn some Rust); though I'm somewhat afraid if it might ossify the codebase and make harder to develop further..? ...but maybe actually converse?...
    • Maybe it could be made into an UI-less, RPC/REST/socket/text-driven service, like gocode or Language Servers, for integration with editors/IDEs (emacs? vim? VSCode?...) I'd be especially interested in eventually merging it into Luna Studio; RIIR may help in this. (Before this, as a simpler approach, multi-line editing may be needed, or at least left&right scrolling of the command editor input box. Also, some kind of jumping between words in the command line; readline's Alt-b & Alt-f?)
    • Make it possible to capture output of already running processes! (But maybe that could be better made as a separate, composable tool! In Rust?)
    • Adding tests... (ahem; see also #1) ...also write --help...
    • Making it work on Windows, somehow? Also, obviously, would be nice to have some CI infrastructure enabling porting it to MacOSX, BSDs, etc., etc...
    • Integration with fzf and other TUI tools? I only have some vague thoughts and ideas about it as of now, not even sure how this could look like.
    • Adding more previews, for each | in the pipeline; also forking of pipelines, merging, feedback loops, and other mixing and matching (though I'd strongly prefer if Luna was to do it eventually).
  • If you are interested in financing my R&D work, contact me by email at: [email protected], or on keybase.io as akavel. I suppose I will probably be developing the Ultimate Plumber further anyway, but at this time it's purely a hobby project, with all the fun and risks this entails.

Mateusz Czapliński
October 2018

PS. The UP logo was conceived and generously sponsored by Thoai Nguyen and GPU Exchange, with a helping hand from Many Pixels.

More Repositories

1

rsrc

Tool for embedding .ico & manifest resources in Go programs for Windows.
Go
1,084
star
2

goluago

[on hold] Port of Lua 5.1 interpreter to Go Language Toolchain. [Work In Progress.] See also: http://lua.org and http://golang.org
C
175
star
3

hellomello

Experiments with writing Android apps in Nim
C++
77
star
4

polyclip-go

Go library for Boolean operations on 2D polygons.
Go
74
star
5

dali

Indie assembler/linker for Dalvik VM .dex & .apk files (Work In Progress)
Nim
69
star
6

martinez-src

Mirrored implementations of polygon clipping/CSG/operations algorithm, in C (original, by Martínez et al) and ActionScript3 (port, by Mahir Iqbal)
C++
44
star
7

WernessDithering

Copy of dithering code by Brent Werness (Koloth) invented for Obra Dinn
Processing
30
star
8

embd-go

embd-go is an embeddable command-line tool for embedding data files in Go source code, specially crafted for easy use with `go generate`.
Go
25
star
9

sherman

A clone of Joe Marshall's Rebol 1.0 to Scheme compiler.
Lua
17
star
10

winq

Package winq provides functions for quick & dirty WinAPI calls, with easy errors capturing.
Go
16
star
11

neatpad

Archived source code from Neatpad Win32 Text Editor tutorial by James Brown
C
16
star
12

gostdc

C
15
star
13

elm-expo

Elm <-> Expo bridge experiment
JavaScript
14
star
14

myopenlab

Copy of https://sourceforge.net/p/myopenlab3/code/HEAD/tree/; donate 1 € to original author at http://myopenlab.de/downloads.html if you find it any worth!
Java
12
star
15

cvsclone

A fork of an anonymous pserver CVS cloning tool, with a (googled) anti-SEGFAULT patch applied. Nothing here's mine, I'm just publishing work of some great people.
9
star
16

bbb-ipd-vcf

Quick & dirty scripts to convert Address Book (Contacts list) from BlackBerry .bbb/.ipd backup (BB Desktop Software 7.1) to vCard .vcf files (for Android & other civilized phones)
Lua
7
star
17

asciinema2gif

Convert ASCIInema asciicast v2 files to animated GIFs
Go
6
star
18

vfmd

"Vanilla-flavored" Markdown parser in Go -- based on http://www.vfmd.org spec
Go
5
star
19

polyclip.go

Go library for Boolean operations on 2D polygons.
Go
5
star
20

marco

Manifests & resources compiler for .apk files (Work in Progress)
Nim
5
star
21

nix-config

custom user config (~/.nixpkgs/config.nix) for Nix
Nix
4
star
22

svgmath

Tool for rendering MathML into SVG.
Lua
4
star
23

bookwin

Nim
2
star
24

go-hyphen

Text hyphenation, using Frank Liang's algorithm.
Python
2
star
25

maniana-fork

Development fork of Maniana Todo List app for Android http://code.google.com/p/maniana/
Java
2
star
26

l4.nix

Experimental Nix expression/script for building Fiasco.OC microkernel and L4 Runtime Environment (L4Re)
Nix
2
star
27

_test_github_

some tests etc.
1
star
28

scissors

Scissors XML Viewer
Lua
1
star
29

splitsound

Java
1
star
30

homebrew-up

Homebrew package ("tap") for github.com/akavel/up
Ruby
1
star
31

go-explorer-rescued

Some rescued code of github.com/garyburd/go-explorer repository; unknown freshness
Go
1
star
32

backer

Small tool for backups/archiving of photos and other files
Go
1
star
33

go-explorer

Go Explorer is Vim plugin for exploring Go code
Vim Script
1
star
34

mana

Mana controls dotfiles and other aspects of a system. Experimental personal configuration & provisioning.
Lua
1
star
35

graph-mirror2

C++
1
star
36

graph-mirror

C++
1
star
37

pltscheme-cvs-cvs2git-1

Scheme
1
star
38

pltscheme-cvs-cvsimport-1

Scheme
1
star
39

wed-editor

Import of "public domain" code of WED Editor from http://wed.sourceforge.net "Simple programmer's text editor. Multiple clipboards, macro record/ play, UNIX CR/LF auto recognition, clean editing of giant files, unlimited undo/redo Auto Save, auto Backup. Minimal system requirements - will run everywhere."
C++
1
star
40

nixme

Nix minimal effector — receives and unpacks prebuilt Nix derivations from `nix copy --to ssh://...`
Rust
1
star
41

tunnel

Simple TLS connection over insecure network between safe fully controlled endpoints, in Go. DISCLAIMER: No Warranties, this can eat your homework, starve your kittens, etc., etc., use at your own risk.
Go
1
star