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