# PathPicker

> Command-line tool (fpp) that parses piped output for file paths, shows a curses selector, and opens the selected files in $EDITOR or runs a command on them.

Stars: 5.2k · Language: Python · License: MIT · Categories: File Management

- Repository: https://github.com/facebook/PathPicker
- Website: https://facebook.github.io/PathPicker/
- Page: https://www.trmn.sh/tools/pathpicker

## Install

- Homebrew: `brew install fpp`

## Overview

PathPicker is a command-line tool, invoked as `fpp`, that reads the output of another program from stdin and extracts entries that look like file paths. It then shows the extracted paths in a curses-based selector UI, where you pick the files you want. Typical inputs are `git status`, `git grep "FooBar"`, `grep -r "FooBar" .`, `git diff HEAD~1 --stat`, `hg status`, `find . -iname "*.js"` and `arc inlines`, each piped into `fpp`.

After selection, you can open the files in your `$EDITOR` or enter an arbitrary command to run against them. By default the selected files are appended to the command prefix (for example a `git checkout` run on the chosen files). If the files need to go in the middle of a command, use the `$F` token, as in `cat $F | wc -l`. By default only paths that exist on the filesystem are selectable; the `--no-file-checks` (`-nfc`) flag disables this, which is useful for picking deleted files from `git status`.

Rather than using a parser per program, PathPicker treats all input as noisy text and extracts candidates with regular expressions. The README notes a known limitation: single-word filenames with no extension and no directory prefix (like `test`) will not match. It is implemented as a bash script plus small Python modules and requires Python 3. Bash is fully supported, zsh is supported without some features such as alias expansion in command line mode, and csh, fish and rc are supported in recent versions. tmux users can add the `tmux-fpp` plugin to run it on the last stdout. Developers who regularly copy paths out of grep, git or find output are the intended users.

### Installation

```bash
# via Homebrew
brew install fpp
```

## Alternatives

- [s3cmd](https://www.trmn.sh/tools/s3cmd.md): Python command line client for uploading, retrieving and managing data in Amazon S3 and S3-compatible storage such as Google Cloud Storage and DreamObjects. (Python, 4.9k stars)
- [trash-cli](https://www.trmn.sh/tools/andreafrancia-trash-cli.md): Command-line interface to the freedesktop.org trashcan: trash, list, restore, and empty files using the same trash as KDE, GNOME, and XFCE. (Python, 4.6k stars)
- [beets](https://www.trmn.sh/tools/beets.md): Command-line music library manager that catalogs collections and autocorrects tags using MusicBrainz, Discogs, and Beatport, extensible through Python plugins. (Python, 16.0k stars)
- [ranger](https://www.trmn.sh/tools/ranger.md): Console file manager with VI key bindings, multi-column display, and file preview capabilities (Python, 17.5k stars)
- [ExifTool](https://www.trmn.sh/tools/exiftool.md): Perl library and command-line app for reading and writing metadata (EXIF, IPTC, XMP, maker notes) in hundreds of image, video, audio, and document formats. (Perl, 5.3k stars)

---

Canonical: https://www.trmn.sh/tools/pathpicker
