← 返回 Skills 市场
cn-big-cabbage

fzf

作者 CN-big-cabbage · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ✓ 安全检测通过
84
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install fzf
功能描述
fzf - 通用命令行模糊查找器
使用说明 (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

项目链接

安全使用建议
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).
功能分析
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install fzf
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /fzf 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial release - Command-line fuzzy finder skill distilled from github.com/junegunn/fzf (66k+ stars)
元数据
Slug fzf
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

fzf 是什么?

fzf - 通用命令行模糊查找器. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 84 次。

如何安装 fzf?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install fzf」即可一键安装,无需额外配置。

fzf 是免费的吗?

是的,fzf 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

fzf 支持哪些平台?

fzf 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 fzf?

由 CN-big-cabbage(@cn-big-cabbage)开发并维护,当前版本 v0.1.0。

💬 留言讨论