DeepVista 文件导入:索引本地代码库 - Openclaw Skills

作者:互联网

2026-04-12

AI教程

什么是 DeepVista Recipe: Import Files?

deepvista-recipe-import-files skill 是为需要将本地文件系统转换为结构化、可搜索知识库的用户设计的专用 recipe。通过利用 Openclaw Skills,此工具可递归扫描目录、读取文件内容并在 DeepVista 生态系统中创建单个上下文卡片,确保您的代码库或文档库完全被索引以进行 AI 辅助研究。

该 skill 通过使用直接文件路径引用来优先考虑数据完整性,避免了导入过程中常见的文本截断或摘要陷阱。它充当本地开发环境与 DeepVista 云之间的桥梁,通过高级搜索和 AI 上下文层使本地项目智能变得触手可及。

下载入口:https://github.com/openclaw/skills/tree/main/skills/jingconan/deepvista-recipe-import-files

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install deepvista-recipe-import-files

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 deepvista-recipe-import-files。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

DeepVista Recipe: Import Files 应用场景

  • 索引整个代码库,为 AI 编码助手提供上下文。
  • 批量上传 markdown 文档或文本笔记到中心化知识库。
  • 创建配置文件或项目日志的可搜索索引以进行审计。
  • 将本地研究论文和文本文件迁移到 DeepVista 以实现更好的组织。
DeepVista Recipe: Import Files 工作原理
  1. 用户通过请求目录索引或文件导入来触发该 skill。
  2. 该 skill 明确范围,包括特定目录、文件扩展名和排除模式(如 node_modules)。
  3. 它利用 shell 命令进行发现阶段,列出所有有效、非二进制文件,同时遵守大小限制。
  4. 对于每个发现的文件,该 skill 执行一个创建命令,将相对路径映射到卡片标题,并指向内容摄取的绝对路径。
  5. 实时报告进度,并为每个创建的卡片提供 ID。
  6. 生成最终总结,详细说明成功导入、跳过的文件和错误。

DeepVista Recipe: Import Files 配置指南

要使用此 Openclaw Skills recipe,您必须安装并配置 DeepVista CLI。请确保您已按照共享配置中的身份验证步骤进行操作。

# Install the DeepVista CLI
uv tool install deepvista-cli

# Verify installation
deepvista --help

DeepVista Recipe: Import Files 数据架构与分类体系

该 skill 将导入的数据组织到 DeepVista 内一致的分类体系中,以确保易于检索。

Attribute Mapping / Value
Card Type file
Title 相对文件路径 (例如, src/main.py)
Content 通过 --content-file 的原始文件内容
Tags ["imported"] (外加可选自定义标签)
Metadata 自动创建可搜索的文件上下文
name: deepvista-recipe-import-files
description: |
  Recipe: Import files from the current directory (recursively) as context cards in DeepVista.
  TRIGGER when: user wants to import files as cards, "index this folder", "add files to DeepVista", "import codebase as context", "upload files as knowledge cards", "add all files in this directory to my knowledge base", or any request to bulk-import local files into DeepVista.
  DO NOT TRIGGER when: user wants to create a single note or card manually; or when working with non-file card types.
metadata:
  openclaw:
    category: recipe
    requires:
      bins:
        - deepvista
      skills:
        - deepvista-shared
    install:
      - kind: uv
        package: deepvista-cli
        bins: [deepvista]
    homepage: https://cli.deepvista.ai
    cliHelp: "deepvista card create --help"

Import Files as Context Cards

PREREQUISITE: Read deepvista-shared for auth, profiles, and global flags.

Walk the current directory recursively, read each file, and create a DeepVista context card with type=file for each one. The result is a searchable knowledge base of all files in the project.

[!CAUTION] Bulk write operation — confirm with the user before starting. Ask whether they want to filter by extension, skip certain directories, or limit the number of files imported.

Steps

1. Clarify scope with the user

Before running, confirm:

  • Directory: current working directory (or a subdirectory they specify)
  • File filter: all files, or specific extensions (e.g. *.py, *.md, *.ts)?
  • Exclusions: skip common noise directories by default (node_modules, .git, __pycache__, .venv, dist, build, .next)
  • Limit: warn if more than 50 files are matched — ask before proceeding

2. Discover files

Use the Glob or Bash tool to list all matching files recursively, excluding noise directories. Example shell command for reference:

find . -type f r
  -not -path '*/.git/*' r
  -not -path '*/node_modules/*' r
  -not -path '*/__pycache__/*' r
  -not -path '*/.venv/*' r
  -not -path '*/dist/*' r
  -not -path '*/build/*' r
  -not -path '*/.next/*' r
  | sort

For extension filtering, add -name "*.py" (or the relevant extension).

3. Read and create cards

For each file discovered:

  1. Read the file content using the Read tool (skip binary files — if content is not valid UTF-8 text, skip with a note to the user).

  2. Create a card with type file, using the relative file path as the title.

    Always use --content-file to read the file directly from disk — never paste file content inline via --content:

deepvista card create r
  --type file r
  --title "" r
  --content-file "" r
  --tags '["imported"]'
  • Use the relative path from the root of the scanned directory as the title (e.g. src/utils/helpers.py).
  • Use --content-file with the absolute file path so the CLI reads the file directly from disk. This guarantees the full, exact content is stored — no summarization or truncation by the agent.
  • Add --tags '["imported"]' so the user can find all imported cards with deepvista card +search "imported".
  • If the user wants to tag by language or project name, add those tags too.
  1. Report progress: after each card is created, print the card ID and title. If creation fails, log the error and continue with the next file — do not abort the whole batch.

4. Summarize results

After processing all files, report:

  • Total files found
  • Total cards created successfully
  • Any files skipped (binary, too large, or errors)

Example summary:

Import complete.
  ? 34 cards created
  - 2 files skipped (binary)
  - 1 file skipped (error: content too large)

Search your imported files:
  deepvista card +search "" --type file

5. Verify (optional)

The user can search across the newly imported files:

deepvista card +search "" --type file

Tips

  • Large repos: For repos with hundreds of files, import only the most relevant directories (e.g. src/) rather than the entire tree.
  • Re-import / updates: There is no deduplication — running the recipe twice will create duplicate cards. Warn the user if they are re-importing a directory they may have imported before.
  • Tags for organization: Encourage the user to pass a project-specific tag (e.g. ["imported", "my-project"]) so they can filter cards per project later.
  • Skip lock files and generated files: Suggest skipping *.lock, *.min.js, *.map, package-lock.json, yarn.lock by default.

Examples

# After creating a card, view it in the app:
# https://app.deepvista.ai/cards/

# Search imported files
deepvista card +search "authentication" --type file

# List all imported file cards
deepvista card list --type file

See Also

  • deepvista-shared — Auth and global flags
  • deepvista-vistabase — Search and manage all card types
  • deepvista-notes — Create notes (type=note) for summaries