Cette page est affichée en anglais. Une traduction française est en cours.
ConfigsJul 23, 2026·3 min de lecture

peco — Interactive Filtering Tool for the Unix Pipeline

A Go-based interactive selection tool that lets you filter and pick lines from any command output using fuzzy or regex matching.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
peco Overview
Commande d'installation directe
npx -y tokrepo@latest install 55f1b782-86b7-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

peco is a simplistic interactive filtering tool inspired by Percol. It reads lines from standard input, presents them in an interactive interface where you can type to filter, then outputs the selected line. It fits naturally into Unix pipelines and works with any text-producing command.

What peco Does

  • Reads lines from stdin and presents an interactive selection interface in the terminal
  • Supports fuzzy matching, regular expression, and exact match modes
  • Allows multi-line selection for batch operations
  • Outputs selected lines to stdout for downstream pipeline consumption
  • Provides customizable keybindings and display options via JSON configuration

Architecture Overview

peco is a single Go binary that creates a full-screen terminal UI using escape sequences. Input lines are indexed in memory and filtered in real time as the user types a query. The matching engine supports multiple algorithms (fuzzy, regexp, prefix) and can be switched at runtime. Selected output goes to stdout while the UI renders on stderr, keeping the Unix pipeline contract intact.

Self-Hosting & Configuration

  • Install via Homebrew, apt, pacman, or build from source with Go
  • Configuration lives in ~/.config/peco/config.json
  • Customize keybindings, default matcher, colors, and prompt style
  • Define custom filter modes and external command integrations
  • No daemon or background process required; runs only when invoked

Key Features

  • Single static binary with no runtime dependencies
  • Switchable match modes: fuzzy, regex, and exact match (toggle with Ctrl-R)
  • Multi-select with Ctrl-Space for choosing multiple lines at once
  • Custom actions that pipe selected lines to external commands
  • Fast startup and low memory usage even with large input sets

Comparison with Similar Tools

  • fzf — more widely adopted fuzzy finder with preview support and shell integration; peco is simpler with a different keybinding philosophy
  • percol — Python predecessor that inspired peco; peco is faster due to Go implementation
  • skim — Rust-based fzf alternative; faster than peco in benchmarks but similar workflow
  • dmenu/rofi — graphical selection menus for X11/Wayland; peco stays in the terminal
  • gum filter — Charm's filtering component; more opinionated styling but less standalone

FAQ

Q: How does peco differ from fzf? A: Both are interactive filters, but peco was created independently in Go. fzf has more features (preview windows, shell bindings) while peco prioritizes simplicity and configurability via JSON.

Q: Can I use peco in shell functions? A: Yes. A common pattern is to wrap peco in shell functions for tasks like history search, directory jumping, or process selection.

Q: Does peco work on Windows? A: Yes. The Go binary compiles for Windows and works in PowerShell and cmd terminals.

Q: Can I change the match algorithm at runtime? A: Yes. Press Ctrl-R while peco is running to cycle through fuzzy, regex, and exact match modes.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires