Skip to content

Repository files navigation

pik

demo

Minimal interactive line picker for the command line.

CIStarsLicense: MITMade with RustAUR

Read newline-separated choices from stdin or a file and select one interactively.

Install

cargo install --path .

Usage

pik --file list.txt --prompt "Select:"
cat list.txt | pik
git branch | pik | xargs git checkout

Options

FlagDescription
-p, --prompt <text>Header text
-f, --file <path>Read from file
-V, --versionShow version
-h, --helpShow help

Keybindings

KeyAction
/ kMove up
/ jMove down
Home / gJump to first
End / GJump to last
PageUp / Ctrl+uPage up
PageDown / Ctrl+dPage down
EnterConfirm
Esc / q / Ctrl+cCancel
ClickMove cursor
Double-clickConfirm

Mouse

Mouse capture is enabled automatically.

  • Click a row to move the cursor to it, press Enter to confirm, same as keyboard navigation.
  • Scroll wheel moves the cursor up or down one row at a time.

Exit codes

CodeMeaning
0Selection made
1Error
130Cancelled

License

MIT

Releases

Sponsor this project

Packages

Contributors

Languages