file-indexer

智能文件索引与检索系统 - 自动监控文件变化,快速查找代码文件、脚本和技能。支持关键词搜索、意图推荐、文件统计。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "file-indexer" with this command: npx skills add zgbin/zgbin-file-indexer

File Indexer - 智能文件索引与检索

核心功能

  • 自动索引: 实时监控文件变化,自动记录新建、修改、删除的文件
  • 快速搜索: 根据文件名、内容摘要、描述等关键词查找
  • 意图理解: 根据功能描述(如"加密"、"网络")推荐相关文件
  • 实时同步: 通过文件系统监控实时更新索引
  • Agent 集成: 可作为工具被其他 agent 自动调用

使用场景

1. 查找特定功能的代码

用户:"帮我找一下加密相关的代码文件" → 自动搜索并返回 SM1 算法库等文件

2. 发现相关脚本

用户:"有没有处理 CSV 的脚本?" → 返回所有 CSV 处理相关的脚本

3. 定位文件位置

用户:"我之前写过一个 SM1 加密算法,在哪里?" → 返回文件路径和说明

4. 项目文件管理

用户:"扫描一下我的工作区,看看有哪些新文件" → 自动扫描并更新索引

技术实现

  • 语言: Python 3
  • 数据库: SQLite3 (file_index.db)
  • 监控方式: watchdog (实时) 或 轮询 (降级模式)
  • 索引字段: 路径、文件名、类型、描述、内容摘要、标签、创建/修改时间
  • 搜索算法: 关键词匹配 + 意图相似度评分

包含文件

file-indexer/
├── indexer.py       # 核心索引管理模块
├── searcher.py      # 文件搜索模块
├── watcher.py       # 文件监控模块
├── hook_handler.py  # Agent Hook 处理器
├── __main__.py      # 主程序入口
├── file_index.db    # SQLite 数据库 (自动创建)
└── README.md        # 完整使用文档

安装与使用

方式 1: 作为 OpenClaw 技能自动使用

安装后,当用户说"找文件"、"搜索"、"帮我找一下 XXX"时,Agent 会自动调用此技能。

方式 2: 命令行手动使用

# 查看统计
python3 __main__.py stats

# 搜索文件
python3 __main__.py search "关键词"

# 意图推荐
python3 __main__.py intent "功能描述"

# 添加文件到索引
python3 __main__.py add /path/to/file

# 扫描目录
python3 __main__.py scan /dir/path

# 标记删除
python3 __main__.py delete /path/to/file

配置说明

  • 工作空间: /home/t/cc_workspace/file_indexer/
  • 数据库路径: file_index.db (自动创建)
  • 监控目录:
    • /home/t/.openclaw/workspace/
    • /home/t/cc_workspace/
    • 可自定义添加更多目录

依赖要求

  • Python 3.8+
  • SQLite3 (Python 内置)
  • watchdog (可选,用于实时监控)

注意事项

  1. 首次使用: 需要扫描目录建立初始索引
  2. 性能: 索引文件越多,搜索速度越快(使用 SQLite 全文索引)
  3. 自动监控: 如未安装 watchdog,会降级为轮询模式(每分钟检查一次)
  4. 数据安全: 所有索引数据存储在本地 SQLite 数据库,不上传云端

最佳实践

  1. 定期扫描: 使用 scan 命令确保索引最新
  2. 清理删除: 使用 delete 标记删除的文件,保持索引准确
  3. 意图查询: 优先使用 intent 而非 search,获得更精准的结果
  4. 批量操作: 扫描整个项目目录比逐个添加文件更高效

版本: 1.0.0
作者: OpenClaw Agent
许可证: MIT
适用场景: 个人项目、团队协作、企业知识库管理

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Huo15 Openclaw Enhance

火一五·克劳德·龙虾增强插件 v5.7.8 — 全面适配 openclaw 2026.4.24:peerDep ^4.24 + build/compat 同步到 4.24 + 14 处 api.on 全部去掉 as any 改成 typed hook(hookName 联合类型 + handler 自动推断 Pl...

Registry SourceRecently Updated
General

Content Trend Analyzer

Aggregates and analyzes content trends across platforms to identify hot topics, user intent, content gaps, and generates data-driven article outlines.

Registry SourceRecently Updated
General

Prompt Debugger

Debug prompts that produce unexpected AI outputs — diagnose failure modes, identify ambiguity and conflicting instructions, test variations, compare model re...

Registry SourceRecently Updated
General

Indie Maker News

独行者 Daily - 变现雷达。读对一条新闻,少走一年弯路。每天5分钟,给创业者装上商业雷达。聚焦一人公司、副业、创业变现资讯,智能分类,行动导向。用户下载即能用,无需本地部署!

Registry SourceRecently Updated