Mastering fzf filters for workflow automation
·
#cli#automation#fzf

The problem
Every morning I run the same five commands: jump to project, search for a file, grep for a pattern, open in editor, deploy. That's five keyboard-full commands before any real work starts.
Enter fzf
fzf is a general-purpose fuzzy finder that turns any list into an interactive search. Pipe a list, type a pattern, and the match narrows in real time.
bash
git log --oneline | fzf --preview 'git show {1}'
This lets you scroll through commits with a live diff preview. Select one and hit enter — now you've got the commit hash ready to pipe into another command.
Building a pipeline
The real power comes from chaining:
bash
# Interactive file search with preview
function ff() {
local file
file=$(fd --type f | fzf --preview 'bat --color=always {}')
[ -n "$file" ] && $EDITOR "$file"
}
This single function replaces find, grep, and manual file navigation.
Key takeaways
- Start with
--preview— it's the killer feature - Pipe selections into subsequent commands for chaining
- Use
fd(notfind) for faster file discovery