如果您曾经需要为 ai 任务收集特定的项目文件,context dump 可能会有所帮助。这是一个简单的 cli 工具,用于生成项目结构和内容的 json 转储,以供 ai 使用。
它的作用
允许您使用复选框以交互方式选择文件。
自动忽略 node_modules、.git 或 .gitignore 中的任何文件。
输出包含文件路径和内容的结构化 json 文件。
如何使用
- 安装:
npm install -g context-dump
- 在任意项目目录中运行:
context-dump
json 输出默认保存到 ai_context.json。
- 您还可以:
使用 -o 更改输出文件名。
使用 -e 排除特定文件或文件夹。
示例输出
json 如下所示:
{
"project_structure": ["example.js"],
"file_contents": {
"example.js": {
"content": "console.log('Hello, World!');",
"extension": "js"
}
}
}
在 github 上查看。如果听起来有用,请尝试一下。










