360 Secure SkillHub
360 安全技能中心

File Indexer

为本地文件系统建立元数据目录:通过 Python 脚本扫描许可的根目录,将文件名、扩展名、大小和修改日期写入本地 SQLite,支持按名称、类型、大小、日期检索及统计,并可整体重建或增量更新;不读取文件内容,屏蔽若干敏感目录。

lookupmark
lookupmark
热度 45.39
最近更新 2026-05-11 17:40:12
分类:搜索依赖:代码执行 / 读写文件应用场景:工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add lookupmark-file-indexer
Metadata
name
file-indexer
description
Fast filesystem catalog for finding files by name, date, type, or size. Indexes metadata only (no content). Uses SQLite for instant lookups. Triggers on "find file", "where is", "dov'è il file", "search file", "trova documento", "file più grandi", "recent files", "file modificati". NOT for: content-based search (use local-rag), sending files (use file-sender).

File Indexer

Fast metadata-based file catalog. No content indexed — only filenames, sizes, dates, and extensions.

Usage

# Build/rebuild the index (run once, or periodically)
python3 scripts/indexer.py --rebuild

# Update incrementally (fast — adds new, removes deleted)
python3 scripts/indexer.py --update

# Search by filename
python3 scripts/indexer.py --search "budget"

# Filter by extension
python3 scripts/indexer.py --search "report" --ext .pdf

# Filter by size
python3 scripts/indexer.py --search "" --min-size 10485760   # > 10MB

# Filter by date
python3 scripts/indexer.py --search "" --after 2026-03-01

# Index statistics
python3 scripts/indexer.py --stats

Security

  • ALLOWED_ROOTS: Only ~/Documenti and ~/Scaricati — same as RAG
  • BLOCKED_DIRS: .ssh, .gnupg, .config, credentials, .local, .cache, .Trash
  • Zero content: Only metadata (name, size, date, extension) — never reads file contents
  • No secrets: Paths to sensitive dirs are never indexed
  • Local only: SQLite DB at ~/.local/share/file-indexer/catalog.db

What Gets Indexed

Yes No
Filename File contents
Extension Full text
Size Embeddings
Modified date Preview
Directory path Thumbnails

Automation

Add to cron or heartbeat for periodic updates:

python3 scripts/indexer.py --update

Works well alongside local-rag: use this for "where is that file?" and RAG for "what does that file say?"