peco
Interactive line filter written in Go that reads stdin, filters incrementally as you type, and prints selected lines to stdout. Single binary, no dependencies.
peco is an interactive filtering tool for the terminal. It reads lines from stdin or a file, shows them in a TUI, and narrows the list as you type a query. When you press Enter, the selected line is printed to stdout so it can be piped to other commands, for example ps -ef | peco or cd $(ghq list --full-path | peco --query peco). It is a Go rewrite of the Python tool percol, distributed as a single binary.
Queries with multiple terms are AND queries. A term prefixed with - excludes lines (SSO -tests -javadoc), and the prefix can be changed or disabled with --negation-prefix. Filters include IgnoreCase (the default), CaseSensitive, SmartCase, Regexp, IRegexp and Fuzzy, and you can toggle between them or restrict the rotation with --filter or the Filters config section. You can select multiple lines or a range of lines, and the peco.FreezeResults and peco.UnfreezeResults actions let you filter in stages on top of a frozen result set.
Other documented features include ANSI color passthrough (--color=auto by default, --color=none to disable). Matching runs on the stripped text, and the output keeps the original escape codes. peco.ZoomIn and peco.ZoomOut show 3 lines of context around matches, similar to grep -C. peco.ScrollLeft and peco.ScrollRight scroll long lines horizontally. Several of these actions have no default key binding and must be bound in the JSON config file's Keymap section. The config file also controls styles and options such as MaxScanBufferSize and FuzzyLongestSort.
It suits developers and sysadmins who filter logs, process lists, file lists, or git repository lists from the shell, and who combine it with zsh functions or tools like ghq.
Installation
# via Homebrew
brew install peco



Alternatives & related tools
fzf
Command-line fuzzy finder for filtering lists of files, processes, git commits, and other data with fuzzy matching.
skim
Fuzzy finder written in Rust with interactive search capabilities and shell integration
television
Fuzzy finder for the terminal that searches files, text, git repositories, and custom data sources in real-time
rga
Line-oriented search tool that extends ripgrep to search inside PDFs, archives, documents, and multimedia files
howdoi
Command-line tool that provides instant coding answers by querying Stack Overflow without opening a browser.
add a badge to your README
Maintain peco? Show that it's featured on trmn. The badge links back to this page.
[](https://www.trmn.sh/tools/peco?utm_source=badge)<a href="https://www.trmn.sh/tools/peco?utm_source=badge"><img src="https://www.trmn.sh/badge/peco.svg" alt="Featured on trmn" height="20"></a>