Skip to content

Latest commit

 

History

History
105 lines (75 loc) · 2.79 KB

File metadata and controls

105 lines (75 loc) · 2.79 KB

pik

demo

Minimal interactive line picker for the command line.

CI Stars License: MIT Made with Rust

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

Install

From crates.io

cargo install pik-cli

Prebuilt binaries

Grab the binary for your platform from the latest release on GitHub.

Linux (x86_64)

curl -sSLo pik https://github.com/programmersd21/pik/releases/latest/download/pik-linux-x86_64
chmod +x pik
sudo mv pik /usr/local/bin/

macOS (Intel)

curl -sSLo pik https://github.com/programmersd21/pik/releases/latest/download/pik-macos-x86_64
chmod +x pik
sudo mv pik /usr/local/bin/

macOS (Apple Silicon)

curl -sSLo pik https://github.com/programmersd21/pik/releases/latest/download/pik-macos-aarch64
chmod +x pik
sudo mv pik /usr/local/bin/

Windows (PowerShell)

Invoke-WebRequest -Uri https://github.com/programmersd21/pik/releases/latest/download/pik-windows-x86_64.exe -OutFile pik.exe

Usage

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

Options

Flag Description
-p, --prompt <text> Header text
-f, --file <path> Read from file
-V, --version Show version
-h, --help Show help

Keybindings

Key Action
/ k Move up
/ j Move down
Home / g Jump to first
End / G Jump to last
PageUp / Ctrl+u Page up
PageDown / Ctrl+d Page down
Enter Confirm
Esc / q / Ctrl+c Cancel
Click Move cursor
Double-click Confirm

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

Code Meaning
0 Selection made
1 Error
130 Cancelled

License

MIT