360 Secure SkillHub
360 安全技能中心

Deepvista Recipe Import Files

核心功能:递归扫描本地目录,筛选文本文件(支持扩展名过滤、排除噪音目录),批量创建DeepVista的file类型知识卡片并添加标签,提供进度反馈与结果汇总。典型场景:用户需将代码库、文档目录导入知识库,如提出“index this folder”等请求。操作前会确认导入范围,输入为用户的导入需求,输出为卡片创建结果及搜索指引。

jingconan
jingconan
热度 27.43
最近更新 2026-05-20 03:35:49
分类:知识依赖:代码执行 / 读写文件 / 第三方 API应用场景:工作流 / 笔记整理

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add deepvista-recipe-import-files
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 \
  -not -path '*/.git/*' \
  -not -path '*/node_modules/*' \
  -not -path '*/__pycache__/*' \
  -not -path '*/.venv/*' \
  -not -path '*/dist/*' \
  -not -path '*/build/*' \
  -not -path '*/.next/*' \
  | 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 \
  --type file \
  --title "<relative/path/to/file>" \
  --content-file "<absolute/path/to/file>" \
  --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 "<query>" --type file

5. Verify (optional)

The user can search across the newly imported files:

deepvista card +search "<keyword>" --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/<id>

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

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

See Also