Re-imagining the work environment for Unix pipelines

From the early days of Unix, the command shell and filter utilities have been combined by using the pipe (|) symbol, and the pipe(2) libc function / system call.

Building up an effective command line requires familiarity with common Unix utilities, knowing the types of data transformation that are available, and developing a facility with command line editing to work with data in its initial state, and gradually progress it towards the desired output format.

Pipecut tries to facilitate the development of pipelines by letting you see your data and your shell commands at the same time, eliminating the back and forth editing cycle of entering and quitting more(or less), then recalling and editing the command line. Since pipecut has an AST view of the Unix command line, it can provide shortcuts, optimizations, and do code generation that would not be possible otherwise.

Lastly, pipecut provides interactive as-you-type help (e.g. interactive highlighting of regular expressions as you type them) for some of the most common Unix commands, and will add support for more commands over time. For a good example, see RE mode.

Version 1.2 - Updated January 23rd, 2015

Pipecut Terminology and Name

Terminology

Pipecut needs names for certain objects, to make it easier to explain and discuss them.

cat file.txt | egrep -v 'foo' | sort

The above line is called a 'toolset' in pipecut lingo. Each component of a toolset is called a 'blade'.

Pipecut is a modal environment, like vi, but in pipecut, the tool can flow from one mode to another depending on the keys you press, without the user actively selecting the mode. Some modes are explicitly activated by the user (e.g. the Look-ahead (LA) and Regular Expression (RE) modes).

See Also: The Lexicon of Pipecut

Why is it called pipecut?

One of the cuts in the name pipecut refers to the ability to quickly browse a toolset and view the state of the data at any stage of processing - cutting in to see what the pipe sees.

Another meaning of cut in pipecut's name is that the full-screen vi-like interface shows you a cut of just one screenful of data from the input file. The user can browse up and down in the file, but by default, pipecut operates on a small slice of data, which keeps the UI very snappy and responsive.

Finally, pipecut cuts down the effort to develop pipelines, and can shorten them in terms of runtime (See: Optimizations) or length (See: Use Case #3).

What's on the Roadmap?

It's a long list. There's a separate document for that. (See: Roadmap)

Recent Feature Request(s):
• Emacs key bindings.
• Recording of pipecut sessions, export as iPython 'Notebook' format.
• Hotkey to activate RE highlighting during entry of Blackbox commands.
• Optimizations (internal version) for 'cut' utility.

What does it do (already)?

Sample Features

  • Add data transformation filters with a single keypress (See: hotkeys)
  • Works with every current and future Unix filter utility. (Works even better with well-known ones)
  • Name toolsets you develop. Save them for use later. Share them with others.
  • Use saved toolsets as Unix filters. pipecut -t toolsetname
  • Modify existing blades with the intuitive dash-letter keystroke
  • Delete blades from the end of your toolset with Backspace.
  • Delete blades from the middle of your toolset with Delete.
  • Browse the view of the data at any point in the toolset by navigating through it with the left and right cursor keys.
  • Use the Lookahead (LA) mode to see which lines will be affected by the subsequent blade.
  • Use the Regular Expression (RE) mode to see matches highlighted in real time as you type.
  • Run your entire datafile through the standard system tools your toolset represents, with one keypress (|)
  • Instantly generate a shell script equivalent to your toolset (!)
  • Work in your shell first, then create a pipecut toolset with 'history | pipecut' (See: history)

Pipecut was first displayed in a presentation Nov 1, 2014 at MeetBSD California. Pipecut was created by David W. Maxwell