fzf is a fuzzy finder for the terminal. Run it and you get an interactive list you can filter by typing. Select an entry and it prints the result to stdout. That makes it a composable building block. Pipe anything into it, use the output in any command.

The simplest use case: open a file.

Install fzf

winget install junegunn.fzf

Open a file with its default app

& $(fzf)

fzf walks the current directory recursively, shows you the files, and you pick one. The & call operator invokes whatever path comes back. On Windows this triggers the default file association, so .py opens in your IDE, .docx opens in Word, and so on.

Invoke-Item does the same thing and is more explicit:

Invoke-Item $(fzf)

Both are equivalent. & is shorter to type; Invoke-Item reads more clearly in scripts.

Open in a specific app

code $(fzf)       # VS Code
notepad $(fzf)    # Notepad

The pattern is always the same: <command> $(fzf). The command receives the selected path as its argument.

Reuse the selected path

Store the result in a variable when you want to use it more than once:

$file = fzf
code $file
git add $file

Make it a function

Add this to your PowerShell profile ($PROFILE) so it’s always available:

function of { Invoke-Item $(fzf) }    # "open file", default app
function vf { code $(fzf) }           # VS Code
function nf { notepad $(fzf) }        # Notepad

Then just type of to fuzzy-pick and open, vf to open in VS Code, and so on.

Preview files while browsing

fzf has a built-in --preview flag. Pair it with bat for syntax-highlighted previews as you move through the list:

winget install sharkdp.bat
& $(fzf --preview 'bat --color=always {}')

{} is replaced by the currently highlighted entry.