cli-fzf
Skill3 starsChanged 7 months agoMITView on GitHub
Covers effective use of fzf (fuzzy finder) for interactive filtering of files, command history, processes, git branches, and any line-oriented data. Activates when the user asks about fzf, interactive selection from lists, fuzzy searching, or filtering command output interactively.
- Reads credentials
- Installs packages
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 228
fd (cli-fd): Use fd to generate a file list respecting .gitignore, pipe into fzf for interactive selection — far faster than find | fzf
- Distinctive: line 229
ripgrep (cli-ripgrep): Use rg to search file contents, pipe results into fzf for interactive navigation to the exact line
- Very specific: line 230
bat: Use --preview 'bat --color=always {}' for syntax-highlighted file previews in fzf
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
fzf — Fuzzy Finder
Repo: https://github.com/junegunn/fzf
Interactive fuzzy finder for the terminal. Pipe anything into fzf and get an interactive, filterable selection UI. Works with files, history, processes, git refs, environment variables, and any line-oriented data.
When to Activate
Manual triggers:
- "How do I use fzf?"
- "Fuzzy find files"
- "Interactive selection from a list"
- "Filter command output interactively"
Auto-detect triggers:
- User wants to interactively select from a large list of items
- User wants to search command history interactively
- User is combining fd/ripgrep output with selection
- User wants to kill a process by fuzzy-searching ps output
- User wants to switch git branches interactively
Key Commands
Basic Usage
fzf # Fuzzy find files in current directory
fzf --height 40% # Use only 40% of terminal height
fzf --reverse # Put input at top (prompt at top)
fzf --border # Draw border around finder
fzf --query "foo" # Pre-fill the search query
fzf --filter "foo" # Non-interactive: filter and print matches
fzf -m # Multi-select (Tab to select, Enter to confirm)
fzf --select-1 # Auto-select if only one match
fzf --exit-0 # Exit immediately if no matchesShell Integration (set up in .bashrc/.zshrc)
# CTRL-R — fuzzy history search (replaces default reverse-i-search)
# CTRL-T — fuzzy file paste (paste selected file path into command line)
# ALT-C — fuzzy cd (cd into selected directory)
$(brew install fzf && $(brew --prefix)/opt/fzf/install) # installs key bindingsPreview Window
fzf --preview 'cat {}' # Preview file contents
fzf --preview 'bat --color=always {}' # Preview with syntax highlighting
fzf --preview 'head -50 {}' # Preview first 50 lines
fzf --preview-window=right:60% # Preview on right, 60% width
fzf --preview-window=up:30% # Preview at top, 30% height
fzf --preview 'ls -la {}' # Preview directory contentsKey Bindings
fzf --bind 'ctrl-a:select-all' # CTRL-A selects all
fzf --bind 'ctrl-d:deselect-all' # CTRL-D deselects all
fzf --bind 'ctrl-/:toggle-preview' # Toggle preview window
fzf --bind 'ctrl-y:execute(echo {} | pbcopy)' # Copy selection to clipboard
fzf --bind 'ctrl-o:execute(open {})' # Open selected fileAdvanced Patterns
Integration with fd (faster find)
# Use fd as fzf's default file finder (faster, respects .gitignore)
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
# Interactive file selection using fd
fd --type f | fzf --preview 'bat --color=always {}'Integration with ripgrep (search then select)
# Search file contents, then select a match
rg --line-number '' | fzf --delimiter ':' --preview 'bat --color=always --highlight-line {2} {1}'
# Live ripgrep as you type (reload on query change)
fzf --disabled --ansi \
--bind "change:reload:rg --color=always --line-number {q} || true" \
--delimiter ':' \
--preview 'bat --color=always --highlight-line {2} {1}'Kill a Process
# Fuzzy-select a process and kill it
kill -9 $(ps aux | fzf | awk '{print $2}')
# More user-friendly version
ps aux | fzf --header-lines=1 | awk '{print $2}' | xargs kill -9Git Branch Switching
# Interactively checkout a git branch
git branch | fzf | xargs git checkout
# Include remote branches
git branch -a | sed 's/remotes\/origin\///' | fzf | xargs git checkout
# With diff preview
git branch | fzf --preview 'git log --oneline --graph --date=short --color=always {}'Git Log Navigation
# Browse git log and show diff on preview
git log --oneline --color=always | \
fzf --ansi --preview 'git show --color=always {1}' | \
awk '{print $1}' | xargs git showEnvironment Variable Selection
# Select and print an environment variable
env | fzf | cut -d= -f1
printenv $(env | fzf | cut -d= -f1)SSH Host Selection
# Fuzzy-select an SSH host from known_hosts
ssh $(awk '{print $1}' ~/.ssh/known_hosts | tr ',' '\n' | fzf)Docker Container/Image Selection
# Select and exec into a running container
docker exec -it $(docker ps | fzf --header-lines=1 | awk '{print $1}') bash
# Remove docker images interactively
docker images | fzf -m --header-lines=1 | awk '{print $3}' | xargs docker rmitmux Integration
# Switch tmux sessions interactively
tmux list-sessions | fzf | cut -d: -f1 | xargs tmux switch-client -t
# Switch tmux windows
tmux list-windows | fzf | cut -d: -f1 | xargs tmux select-window -tPractical Examples
Daily Workflows
# Open a file in your editor (fuzzy search project files)
$EDITOR $(fzf --preview 'bat --color=always {}')
# cd into any directory under current path
cd $(find . -type d | fzf)
# Copy file path to clipboard
fzf | pbcopy
# Source a shell script after selecting it
source $(find . -name '*.sh' | fzf)FZF with Custom Input
# Select from a custom list
echo -e "option1\noption2\noption3" | fzf
# Select from array
items=("apple" "banana" "cherry")
printf '%s\n' "${items[@]}" | fzf
# Confirm before running: select npm script to run
cat package.json | jq -r '.scripts | keys[]' | fzf | xargs npm runUseful Shell Functions
# Add to .bashrc/.zshrc
# fcd: fuzzy cd
fcd() { cd "$(find ${1:-.} -type d | fzf)" }
# fkill: fuzzy kill
fkill() { kill -9 $(ps aux | fzf | awk '{print $2}') }
# flog: fuzzy git log with checkout
flog() {
git log --oneline --color=always | fzf --ansi | awk '{print $1}' | xargs git checkout
}
# fenv: fuzzy env var lookup
fenv() { printenv $(env | fzf | cut -d= -f1) }Configuration (~/.fzf.bash or ~/.fzf.zsh)
# Default options
export FZF_DEFAULT_OPTS='
--height 40%
--layout=reverse
--border
--preview-window=right:50%:wrap
--bind ctrl-/:toggle-preview
'
# Use fd for file finding
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND='fd --type d --hidden --follow --exclude .git'Chaining with Other Skills
- fd (cli-fd): Use fd to generate a file list respecting .gitignore, pipe into fzf for interactive selection — far faster than
find | fzf - ripgrep (cli-ripgrep): Use rg to search file contents, pipe results into fzf for interactive navigation to the exact line
- bat: Use
--preview 'bat --color=always {}'for syntax-highlighted file previews in fzf - git/gh: Pipe
git branch,git log,gh pr listinto fzf for interactive git workflows
In this repository98 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-architectSkill
- architect-plan-for-dispatchSkill
- automate-auditSkill
- brain-dumpSkill
- chat-to-code-promptSkill
- cli-apifySkill
- cli-batSkill
- cli-duckdbSkill
- cli-fdSkill
- cli-ffmpegSkill
- cli-ghSkill
- cli-httpieSkill
- cli-imagemagickSkill
- cli-jqSkill
- cli-lazygitSkill
- cli-pandocSkill
- cli-playwrightSkill
- cli-ripgrepSkill
- cli-sqliteSkill
- cli-yqSkill
- cli-yt-dlpSkill
- codebase-reviewSkill
- context-summarySkill
- decomposeSkill
- delegateSkill
- design-a-systemSkill
- design-doc-reviewSkill
- devils-advocateSkill
- gh-repo-createSkill
- ig-savesSkill
- interrogateSkill
- mentor-aristotleSkill
- mentor-attiaSkill
- mentor-aureliusSkill
- mentor-bloomSkill
- mentor-brownSkill
- mentor-buffettSkill
- mentor-builderSkill
- mentor-carnegieSkill
- mentor-clearSkill
- mentor-councilSkill
- mentor-cunninghamSkill
- mentor-dalioSkill
- mentor-davinciSkill
- mentor-demingSkill
- mentor-ferrissSkill
- mentor-feynmanSkill
- mentor-franklSkill
- mentor-garyveeSkill
- mentor-godinSkill
- mentor-gogginsSkill
- mentor-greeneSkill
- mentor-holidaySkill
- mentor-hormoziSkill
- mentor-houselSkill
- mentor-jockoSkill
- mentor-jungSkill
- mentor-kahnemanSkill
- mentor-kingSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

