0.2.1 • Published 3 months ago

lineselect v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

LineSelect

A shell utility to interactively select lines from stdin and output them to stdout. This allows you to effectively pause the pipeline to make a manual selection before the pipeline, or other composed command, continues.

graph LR;
  a[some pipeline]-->|some lines| lineselect;
  lineselect-->|a subset of those lines| b[some other pipeline];

The applications are end-less

For example, select files to delete

ls | lineselect | xargs rm

Select files from a list sorted by size and delete those files

ls -lS | lineselect | tr -s ' ' | cut -d ' ' -f 9 | xargs rm

Select docker containers to stop:

docker stop $(docker ps | lineselect  | cut -d ' ' -f 1)

(z)Grep some some log files of interest:

ls dpkg.log* | lineselect | xargs zgrep upgrade

Demo Video

Demo

Install

$ npm install -g lineselect

Acknowledgements

Built using the amazing React-for-CLI 🌈 Ink library . With the key insight of writing directly to the TTY, by-passing stdout, to render the TUI without messing up the eventual output to stdout taken from https://github.com/geier/choose and https://superuser.com/a/742789/282396 🙏.

0.2.1

3 months ago

0.2.0

3 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.0

11 months ago

0.0.1

11 months ago