← Back to Skills Marketplace
cn-big-cabbage

fzf

by CN-big-cabbage · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ✓ Security Clean
84
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install fzf
Description
fzf - 通用命令行模糊查找器
README (SKILL.md)

fzf 通用命令行模糊查找器

技能概述

本技能帮助用户在命令行中高效使用 fzf 进行模糊查找,适用于以下场景:

  • 文件查找: 快速模糊搜索目录树中的文件并打开
  • 历史命令: 交互式搜索并重用 Shell 历史命令
  • 进程管理: 模糊搜索并终止进程
  • Git 工作流: 交互式选择分支、提交、文件差异
  • 目录跳转: 快速切换工作目录
  • 管道集成: 与任何产生文本输出的命令组合使用

主要特点: 极速模糊匹配、交互式预览、键绑定丰富、与 Shell 深度集成、可嵌入任意脚本

使用流程

AI 助手将引导你完成以下步骤:

  1. 安装 fzf(如未安装)
  2. 配置 Shell 集成(键绑定与补全)
  3. 学习核心用法与快捷键
  4. 结合常用命令构建高效工作流

关键章节导航

AI 助手能力

当你向 AI 描述查找需求时,AI 会:

  • 自动检测系统环境并安装 fzf
  • 根据需求生成最优的 fzf 命令组合
  • 配置 Shell 集成以启用快捷键
  • 构建带预览的交互式文件/内容浏览器
  • 生成可复用的 fzf 函数放入 Shell 配置文件
  • 集成 fzf 到 Git、Docker、kubectl 等工作流
  • 诊断并修复 fzf 配置问题

核心功能

  • 极速模糊匹配(基于 Smith-Waterman 算法的改进)
  • 支持精确模式('word)、前缀匹配(^word)、后缀匹配(word$
  • 多选模式(--multi,Tab 键选择)
  • 实时预览窗口(--preview
  • 支持 ANSI 颜色代码
  • Shell 集成:CTRL-T(文件)、CTRL-R(历史)、ALT-C(目录)
  • 自定义按键绑定与动作
  • 支持 fdripgrepbat 等现代工具联动
  • 支持 Vim/Neovim 插件集成

命令速查表

基础用法

# 启动交互式文件选择(当前目录递归)
fzf

# 从标准输入选择
echo -e "foo\
bar\
baz" | fzf

# 选中后执行命令
vim $(fzf)

# 多选(Tab 选择,Enter 确认)
cat $(fzf --multi)

搜索语法

# 精确匹配(不做模糊)
fzf --query "'exact-word"

# 多词搜索(空格分隔,AND 逻辑)
fzf --query "foo bar"

# OR 逻辑
fzf --query "foo | bar"

# 前缀匹配
fzf --query "^prefix"

# 后缀匹配
fzf --query "suffix$"

# 排除匹配(! 取反)
fzf --query "!unwanted"

预览窗口

# 预览文件内容
fzf --preview 'cat {}'

# 用 bat 高亮预览(推荐)
fzf --preview 'bat --color=always {}'

# 预览窗口位置与大小
fzf --preview 'cat {}' --preview-window=right:50%

# 预览当前行内容
fzf --preview 'echo {}'

Shell 快捷键(安装 Shell 集成后)

# CTRL-T  :在命令行插入选中的文件路径
# CTRL-R  :搜索并重用历史命令
# ALT-C   :cd 进入选中目录

常用参数

# 指定初始查询
fzf --query "initial"

# 反向显示(列表在上,输入框在下)
fzf --reverse

# 显示边框
fzf --border

# 高度模式(不占满全屏)
fzf --height=40%

# 不排序(保持输入顺序)
fzf --no-sort

# 退出码为 0 时清空输出
fzf --exit-0

# 指定分隔符和字段
echo "foo:bar:baz" | fzf --delimiter=: --with-nth=2

安装要求

  • macOS / Linux / Windows(WSL 或 Git Bash)
  • 可选:fd(更快的文件查找)、bat(语法高亮预览)、ripgrep(内容搜索)

许可证

MIT License

项目链接

Usage Guidance
This skill is internally consistent for teaching and automating fzf usage, but it will: (1) run network installs (brew, apt, curl/git clone from GitHub) and may use sudo to move binaries; (2) edit your shell startup files (~/.bashrc, ~/.zshrc) to add eval lines, exports, and functions; (3) provide helper functions that can run destructive commands (kill, rm, docker stop, eval history entries). Before allowing the agent to act: back up your dotfiles, review the exact install commands the agent proposes, verify downloads come from github.com/junegunn/fzf, and be cautious when authorizing actions that require sudo or that execute code from your history or selected items. If you prefer manual control, ask the agent to only show the commands to run (don’t execute them).
Capability Analysis
Type: OpenClaw Skill Name: fzf Version: 0.1.0 The skill bundle is a comprehensive guide and instruction set for the 'fzf' (fuzzy finder) command-line utility. It provides standard installation procedures via well-known package managers (Homebrew, apt, dnf) and official GitHub sources, along with legitimate shell integration scripts and productivity-enhancing functions for Git and Docker. No evidence of malicious intent, data exfiltration, or harmful prompt injection was found; all commands and configurations are consistent with the tool's documented purpose.
Capability Assessment
Purpose & Capability
Name/description (fzf fuzzy finder) match the included content: installation steps, shell integration, examples, and helper scripts. All requested actions (installing fzf, editing shell rc files, integrating with fd/bat/rg/docker/git) are expected for this capability. Minor inconsistency: SKILL.md metadata lists 'requires: fzf' while the registry metadata shows no required binaries — functionally the skill expects fzf to be present or to be installed.
Instruction Scope
Instructions tell the agent to check/install fzf, edit ~/.bashrc|~/.zshrc (eval "$(fzf --bash|--zsh)"), run package manager commands, clone GitHub, download releases, and add many helper functions. Those actions are within the skill's stated purpose. Some helper functions use eval (fh), kill/xargs (fkill), rm (safe_delete), docker exec/stop, and execute bindings — these execute or build commands and thus can perform destructive operations if used incorrectly. This is expected for a CLI toolkit but worth user awareness.
Install Mechanism
There is no formal install spec in the registry; the docs recommend standard, well-known install methods: Homebrew, package managers, git clone from the official GitHub, or GitHub releases (curl from github.com/junegunn/fzf). These are common and traceable installation methods; no obscure download hosts or shortcuts are used.
Credentials
The skill declares no environment variables or credentials. It references common environment variables like EDITOR and standard paths (~/.fzf, ~/.bashrc) which are appropriate. There are no requests for unrelated secrets or external tokens.
Persistence & Privilege
The skill will (per its instructions) modify user shell configuration files, clone into ~/.fzf, and may run installers requiring elevated privileges (sudo mv /usr/local/bin). always is false and the skill is user-invocable. Modifying dotfiles and installing binaries is expected for this skill but is a persistence/privilege-impacting action the user should confirm.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install fzf
  3. After installation, invoke the skill by name or use /fzf
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.0
Initial release - Command-line fuzzy finder skill distilled from github.com/junegunn/fzf (66k+ stars)
Metadata
Slug fzf
Version 0.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is fzf?

fzf - 通用命令行模糊查找器. It is an AI Agent Skill for Claude Code / OpenClaw, with 84 downloads so far.

How do I install fzf?

Run "/install fzf" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is fzf free?

Yes, fzf is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does fzf support?

fzf is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created fzf?

It is built and maintained by CN-big-cabbage (@cn-big-cabbage); the current version is v0.1.0.

💬 Comments