[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-simonw--files-to-prompt":3,"tool-simonw--files-to-prompt":61},[4,17,27,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",159636,2,"2026-04-17T23:33:34",[13,14,15],"开发框架","Agent","语言模型","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},8272,"opencode","anomalyco\u002Fopencode","OpenCode 是一款开源的 AI 编程助手（Coding Agent），旨在像一位智能搭档一样融入您的开发流程。它不仅仅是一个代码补全插件，而是一个能够理解项目上下文、自主规划任务并执行复杂编码操作的智能体。无论是生成全新功能、重构现有代码，还是排查难以定位的 Bug，OpenCode 都能通过自然语言交互高效完成，显著减少开发者在重复性劳动和上下文切换上的时间消耗。\n\n这款工具专为软件开发者、工程师及技术研究人员设计，特别适合希望利用大模型能力来提升编码效率、加速原型开发或处理遗留代码维护的专业人群。其核心亮点在于完全开源的架构，这意味着用户可以审查代码逻辑、自定义行为策略，甚至私有化部署以保障数据安全，彻底打破了传统闭源 AI 助手的“黑盒”限制。\n\n在技术体验上，OpenCode 提供了灵活的终端界面（Terminal UI）和正在测试中的桌面应用程序，支持 macOS、Windows 及 Linux 全平台。它兼容多种包管理工具，安装便捷，并能无缝集成到现有的开发环境中。无论您是追求极致控制权的资深极客，还是渴望提升产出的独立开发者，OpenCode 都提供了一个透明、可信",144296,1,"2026-04-16T14:50:03",[14,26],"插件",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":10,"last_commit_at":33,"category_tags":34,"status":16},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[26,14,35,13],"图像",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":10,"last_commit_at":42,"category_tags":43,"status":16},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[26,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":50,"last_commit_at":51,"category_tags":52,"status":16},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,3,"2026-04-06T11:19:32",[15,35,14,13],{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":16},8553,"spec-kit","github\u002Fspec-kit","Spec Kit 是一款专为提升软件开发效率而设计的开源工具包，旨在帮助团队快速落地“规格驱动开发”（Spec-Driven Development）模式。传统开发中，需求文档往往与代码实现脱节，导致沟通成本高且结果不可控；而 Spec Kit 通过将规格说明书转化为可执行的指令，让 AI 直接依据明确的业务场景生成高质量代码，从而减少从零开始的随意编码，确保产出结果的可预测性。\n\n该工具特别适合希望利用 AI 辅助编程的开发者、技术负责人及初创团队。无论是启动全新项目还是在现有工程中引入规范化流程，用户只需通过简单的命令行操作，即可初始化项目并集成主流的 AI 编程助手。其核心技术亮点在于“规格即代码”的理念，支持社区扩展与预设模板，允许用户根据特定技术栈定制开发流程。此外，Spec Kit 强调官方维护的安全性，提供稳定的版本管理，帮助开发者在享受 AI 红利的同时，依然牢牢掌握架构设计的主动权，真正实现从“凭感觉写代码”到“按规格建系统”的转变。",88749,"2026-04-17T09:48:14",[15,35,14,13],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":77,"owner_location":78,"owner_email":76,"owner_twitter":73,"owner_website":79,"owner_url":80,"languages":81,"stars":86,"forks":87,"last_commit_at":88,"license":89,"difficulty_score":23,"env_os":90,"env_gpu":91,"env_ram":91,"env_deps":92,"category_tags":97,"github_topics":76,"view_count":10,"oss_zip_url":76,"oss_zip_packed_at":76,"status":16,"created_at":98,"updated_at":99,"faqs":100,"releases":135},9005,"simonw\u002Ffiles-to-prompt","files-to-prompt","Concatenate a directory full of files into a single prompt for use with LLMs","files-to-prompt 是一款专为大型语言模型（LLM）设计的命令行工具，它能将指定目录下的多个文件内容快速合并为一个完整的提示词（Prompt）。在处理代码库分析、文档总结或上下文学习等任务时，开发者往往需要让 AI 理解整个项目的结构，但手动复制粘贴大量文件既低效又容易出错。files-to-prompt 完美解决了这一痛点，自动遍历文件夹，按相对路径整理文件内容，并用清晰的分隔符串联输出，让用户能一键生成高质量的输入素材。\n\n这款工具特别适合开发者、AI 研究人员以及需要频繁与代码交互的技术人员使用。它不仅支持通过文件扩展名筛选内容、忽略临时文件或日志，还能灵活处理隐藏文件和 `.gitignore` 规则，确保只纳入有效信息。其独特的技术亮点在于多样化的输出格式：既支持原生的文本拼接，也能直接生成适配 Claude 模型的 XML 格式或带有语法高亮的 Markdown 代码块，甚至可以为文件内容添加行号以便精准定位。此外，它还兼容标准输入流，方便与其他命令组合使用。通过简单的 pip 安装即可上手，files-to-prompt 以极简的方式打通了本地文件系统与大模型","files-to-prompt 是一款专为大型语言模型（LLM）设计的命令行工具，它能将指定目录下的多个文件内容快速合并为一个完整的提示词（Prompt）。在处理代码库分析、文档总结或上下文学习等任务时，开发者往往需要让 AI 理解整个项目的结构，但手动复制粘贴大量文件既低效又容易出错。files-to-prompt 完美解决了这一痛点，自动遍历文件夹，按相对路径整理文件内容，并用清晰的分隔符串联输出，让用户能一键生成高质量的输入素材。\n\n这款工具特别适合开发者、AI 研究人员以及需要频繁与代码交互的技术人员使用。它不仅支持通过文件扩展名筛选内容、忽略临时文件或日志，还能灵活处理隐藏文件和 `.gitignore` 规则，确保只纳入有效信息。其独特的技术亮点在于多样化的输出格式：既支持原生的文本拼接，也能直接生成适配 Claude 模型的 XML 格式或带有语法高亮的 Markdown 代码块，甚至可以为文件内容添加行号以便精准定位。此外，它还兼容标准输入流，方便与其他命令组合使用。通过简单的 pip 安装即可上手，files-to-prompt 以极简的方式打通了本地文件系统与大模型之间的桥梁，显著提升了工作效率。","# files-to-prompt\n\n[![PyPI](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Ffiles-to-prompt.svg)](https:\u002F\u002Fpypi.org\u002Fproject\u002Ffiles-to-prompt\u002F)\n[![Changelog](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fv\u002Frelease\u002Fsimonw\u002Ffiles-to-prompt?include_prereleases&label=changelog)](https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Freleases)\n[![Tests](https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Factions\u002Fworkflows\u002Ftest.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Factions\u002Fworkflows\u002Ftest.yml)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache%202.0-blue.svg)](https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Fblob\u002Fmaster\u002FLICENSE)\n\nConcatenate a directory full of files into a single prompt for use with LLMs\n\nFor background on this project see [Building files-to-prompt entirely using Claude 3 Opus](https:\u002F\u002Fsimonwillison.net\u002F2024\u002FApr\u002F8\u002Ffiles-to-prompt\u002F).\n\n## Installation\n\nInstall this tool using `pip`:\n\n```bash\npip install files-to-prompt\n```\n\n## Usage\n\nTo use `files-to-prompt`, provide the path to one or more files or directories you want to process:\n\n```bash\nfiles-to-prompt path\u002Fto\u002Ffile_or_directory [path\u002Fto\u002Fanother\u002Ffile_or_directory ...]\n```\n\nThis will output the contents of every file, with each file preceded by its relative path and separated by `---`.\n\n### Options\n\n- `-e\u002F--extension \u003Cextension>`: Only include files with the specified extension. Can be used multiple times.\n\n  ```bash\n  files-to-prompt path\u002Fto\u002Fdirectory -e txt -e md\n  ```\n\n- `--include-hidden`: Include files and folders starting with `.` (hidden files and directories).\n\n  ```bash\n  files-to-prompt path\u002Fto\u002Fdirectory --include-hidden\n  ```\n\n- `--ignore \u003Cpattern>`: Specify one or more patterns to ignore. Can be used multiple times. Patterns may match file names and directory names, unless you also specify `--ignore-files-only`. Pattern syntax uses [fnmatch](https:\u002F\u002Fdocs.python.org\u002F3\u002Flibrary\u002Ffnmatch.html), which supports `*`, `?`, `[anychar]`, `[!notchars]` and `[?]` for special character literals.\n  ```bash\n  files-to-prompt path\u002Fto\u002Fdirectory --ignore \"*.log\" --ignore \"temp*\"\n  ```\n\n- `--ignore-files-only`: Include directory paths which would otherwise be ignored by an `--ignore` pattern.\n\n  ```bash\n  files-to-prompt path\u002Fto\u002Fdirectory --ignore-files-only --ignore \"*dir*\"\n  ```\n\n- `--ignore-gitignore`: Ignore `.gitignore` files and include all files.\n\n  ```bash\n  files-to-prompt path\u002Fto\u002Fdirectory --ignore-gitignore\n  ```\n\n- `-c\u002F--cxml`: Output in Claude XML format.\n\n  ```bash\n  files-to-prompt path\u002Fto\u002Fdirectory --cxml\n  ```\n\n- `-m\u002F--markdown`: Output as Markdown with fenced code blocks.\n\n  ```bash\n  files-to-prompt path\u002Fto\u002Fdirectory --markdown\n  ```\n\n- `-o\u002F--output \u003Cfile>`: Write the output to a file instead of printing it to the console.\n\n  ```bash\n  files-to-prompt path\u002Fto\u002Fdirectory -o output.txt\n  ```\n\n- `-n\u002F--line-numbers`: Include line numbers in the output.\n\n  ```bash\n  files-to-prompt path\u002Fto\u002Fdirectory -n\n  ```\n  Example output:\n  ```\n  files_to_prompt\u002Fcli.py\n  ---\n    1  import os\n    2  from fnmatch import fnmatch\n    3\n    4  import click\n    ...\n  ```\n\n- `-0\u002F--null`: Use NUL character as separator when reading paths from stdin. Useful when filenames may contain spaces.\n\n  ```bash\n  find . -name \"*.py\" -print0 | files-to-prompt --null\n  ```\n\n### Example\n\nSuppose you have a directory structure like this:\n\n```\nmy_directory\u002F\n├── file1.txt\n├── file2.txt\n├── .hidden_file.txt\n├── temp.log\n└── subdirectory\u002F\n    └── file3.txt\n```\n\nRunning `files-to-prompt my_directory` will output:\n\n```\nmy_directory\u002Ffile1.txt\n---\nContents of file1.txt\n---\nmy_directory\u002Ffile2.txt\n---\nContents of file2.txt\n---\nmy_directory\u002Fsubdirectory\u002Ffile3.txt\n---\nContents of file3.txt\n---\n```\n\nIf you run `files-to-prompt my_directory --include-hidden`, the output will also include `.hidden_file.txt`:\n\n```\nmy_directory\u002F.hidden_file.txt\n---\nContents of .hidden_file.txt\n---\n...\n```\n\nIf you run `files-to-prompt my_directory --ignore \"*.log\"`, the output will exclude `temp.log`:\n\n```\nmy_directory\u002Ffile1.txt\n---\nContents of file1.txt\n---\nmy_directory\u002Ffile2.txt\n---\nContents of file2.txt\n---\nmy_directory\u002Fsubdirectory\u002Ffile3.txt\n---\nContents of file3.txt\n---\n```\n\nIf you run `files-to-prompt my_directory --ignore \"sub*\"`, the output will exclude all files in `subdirectory\u002F` (unless you also specify `--ignore-files-only`):\n\n```\nmy_directory\u002Ffile1.txt\n---\nContents of file1.txt\n---\nmy_directory\u002Ffile2.txt\n---\nContents of file2.txt\n---\n```\n\n### Reading from stdin\n\nThe tool can also read paths from standard input. This can be used to pipe in the output of another command:\n\n```bash\n# Find files modified in the last day\nfind . -mtime -1 | files-to-prompt\n```\n\nWhen using the `--null` (or `-0`) option, paths are expected to be NUL-separated (useful when dealing with filenames containing spaces):\n\n```bash\nfind . -name \"*.txt\" -print0 | files-to-prompt --null\n```\n\nYou can mix and match paths from command line arguments and stdin:\n\n```bash\n# Include files modified in the last day, and also include README.md\nfind . -mtime -1 | files-to-prompt README.md\n```\n\n### Claude XML Output\n\nAnthropic has provided [specific guidelines](https:\u002F\u002Fdocs.anthropic.com\u002Fclaude\u002Fdocs\u002Flong-context-window-tips) for optimally structuring prompts to take advantage of Claude's extended context window.\n\nTo structure the output in this way, use the optional `--cxml` flag, which will produce output like this:\n\n```xml\n\u003Cdocuments>\n\u003Cdocument index=\"1\">\n\u003Csource>my_directory\u002Ffile1.txt\u003C\u002Fsource>\n\u003Cdocument_content>\nContents of file1.txt\n\u003C\u002Fdocument_content>\n\u003C\u002Fdocument>\n\u003Cdocument index=\"2\">\n\u003Csource>my_directory\u002Ffile2.txt\u003C\u002Fsource>\n\u003Cdocument_content>\nContents of file2.txt\n\u003C\u002Fdocument_content>\n\u003C\u002Fdocument>\n\u003C\u002Fdocuments>\n```\n\n## --markdown fenced code block output\n\nThe `--markdown` option will output the files as fenced code blocks, which can be useful for pasting into Markdown documents.\n\n```bash\nfiles-to-prompt path\u002Fto\u002Fdirectory --markdown\n```\nThe language tag will be guessed based on the filename.\n\nIf the code itself contains triple backticks the wrapper around it will use one additional backtick.\n\nExample output:\n`````\nmyfile.py\n```python\ndef my_function():\n    return \"Hello, world!\"\n```\nother.js\n```javascript\nfunction myFunction() {\n    return \"Hello, world!\";\n}\n```\nfile_with_triple_backticks.md\n````markdown\nThis file has its own\n```\nfenced code blocks\n```\nInside it.\n````\n`````\n\n## Development\n\nTo contribute to this tool, first checkout the code. Then create a new virtual environment:\n\n```bash\ncd files-to-prompt\npython -m venv venv\nsource venv\u002Fbin\u002Factivate\n```\n\nNow install the dependencies and test dependencies:\n\n```bash\npip install -e '.[test]'\n```\n\nTo run the tests:\n\n```bash\npytest\n```\n","# files-to-prompt\n\n[![PyPI](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Ffiles-to-prompt.svg)](https:\u002F\u002Fpypi.org\u002Fproject\u002Ffiles-to-prompt\u002F)\n[![Changelog](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fv\u002Frelease\u002Fsimonw\u002Ffiles-to-prompt?include_prereleases&label=changelog)](https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Freleases)\n[![Tests](https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Factions\u002Fworkflows\u002Ftest.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Factions\u002Fworkflows\u002Ftest.yml)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache%202.0-blue.svg)](https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Fblob\u002Fmaster\u002FLICENSE)\n\n将一个包含多个文件的目录合并为一个可用于大语言模型的单一提示文本。\n\n有关该项目的背景信息，请参阅 [完全使用 Claude 3 Opus 构建 files-to-prompt](https:\u002F\u002Fsimonwillison.net\u002F2024\u002FApr\u002F8\u002Ffiles-to-prompt\u002F)。\n\n## 安装\n\n使用 `pip` 安装此工具：\n\n```bash\npip install files-to-prompt\n```\n\n## 使用方法\n\n要使用 `files-to-prompt`，请提供您想要处理的一个或多个文件或目录的路径：\n\n```bash\nfiles-to-prompt path\u002Fto\u002Ffile_or_directory [path\u002Fto\u002Fanother\u002Ffile_or_directory ...]\n```\n\n这将输出每个文件的内容，每个文件前面会加上其相对路径，并用 `---` 分隔。\n\n### 选项\n\n- `-e\u002F--extension \u003Cextension>`：仅包含具有指定扩展名的文件。可以多次使用。\n  \n  ```bash\n  files-to-prompt path\u002Fto\u002Fdirectory -e txt -e md\n  ```\n\n- `--include-hidden`：包含以 `.` 开头的文件和文件夹（隐藏文件和目录）。\n  \n  ```bash\n  files-to-prompt path\u002Fto\u002Fdirectory --include-hidden\n  ```\n\n- `--ignore \u003Cpattern>`：指定一个或多个要忽略的模式。可以多次使用。模式可以匹配文件名和目录名，除非同时指定了 `--ignore-files-only`。模式语法使用 [fnmatch](https:\u002F\u002Fdocs.python.org\u002F3\u002Flibrary\u002Ffnmatch.html)，支持 `*`、`?`、`[anychar]`、`[!notchars]` 和 `[?]` 用于特殊字符字面量。\n  \n  ```bash\n  files-to-prompt path\u002Fto\u002Fdirectory --ignore \"*.log\" --ignore \"temp*\"\n  ```\n\n- `--ignore-files-only`：包含那些本会被 `--ignore` 模式忽略的目录路径。\n  \n  ```bash\n  files-to-prompt path\u002Fto\u002Fdirectory --ignore-files-only --ignore \"*dir*\"\n  ```\n\n- `--ignore-gitignore`：忽略 `.gitignore` 文件并包含所有文件。\n  \n  ```bash\n  files-to-prompt path\u002Fto\u002Fdirectory --ignore-gitignore\n  ```\n\n- `-c\u002F--cxml`：以 Claude XML 格式输出。\n  \n  ```bash\n  files-to-prompt path\u002Fto\u002Fdirectory --cxml\n  ```\n\n- `-m\u002F--markdown`：以带有围栏代码块的 Markdown 格式输出。\n  \n  ```bash\n  files-to-prompt path\u002Fto\u002Fdirectory --markdown\n  ```\n\n- `-o\u002F--output \u003Cfile>`：将输出写入文件，而不是打印到控制台。\n  \n  ```bash\n  files-to-prompt path\u002Fto\u002Fdirectory -o output.txt\n  ```\n\n- `-n\u002F--line-numbers`：在输出中包含行号。\n  \n  ```bash\n  files-to-prompt path\u002Fto\u002Fdirectory -n\n  ```\n  示例输出：\n  ```\n  files_to_prompt\u002Fcli.py\n  ---\n    1  import os\n    2  from fnmatch import fnmatch\n    3\n    4  import click\n    ...\n  ```\n\n- `-0\u002F--null`：从标准输入读取路径时，使用 NUL 字符作为分隔符。当文件名可能包含空格时非常有用。\n  \n  ```bash\n  find . -name \"*.py\" -print0 | files-to-prompt --null\n  ```\n\n### 示例\n\n假设您有一个如下所示的目录结构：\n\n```\nmy_directory\u002F\n├── file1.txt\n├── file2.txt\n├── .hidden_file.txt\n├── temp.log\n└── subdirectory\u002F\n    └── file3.txt\n```\n\n运行 `files-to-prompt my_directory` 将输出：\n\n```\nmy_directory\u002Ffile1.txt\n---\nfile1.txt 的内容\n---\nmy_directory\u002Ffile2.txt\n---\nfile2.txt 的内容\n---\nmy_directory\u002Fsubdirectory\u002Ffile3.txt\n---\nfile3.txt 的内容\n---\n```\n\n如果您运行 `files-to-prompt my_directory --include-hidden`，输出还将包括 `.hidden_file.txt`：\n\n```\nmy_directory\u002F.hidden_file.txt\n---\n.hidden_file.txt 的内容\n---\n...\n```\n\n如果您运行 `files-to-prompt my_directory --ignore \"*.log\"`，输出将不包含 `temp.log`：\n\n```\nmy_directory\u002Ffile1.txt\n---\nfile1.txt 的内容\n---\nmy_directory\u002Ffile2.txt\n---\nfile2.txt 的内容\n---\nmy_directory\u002Fsubdirectory\u002Ffile3.txt\n---\nfile3.txt 的内容\n---\n```\n\n如果您运行 `files-to-prompt my_directory --ignore \"sub*\"`，输出将不包含 `subdirectory\u002F` 中的所有文件（除非您还指定了 `--ignore-files-only`）：\n\n```\nmy_directory\u002Ffile1.txt\n---\nfile1.txt 的内容\n---\nmy_directory\u002Ffile2.txt\n---\nfile2.txt 的内容\n---\n```\n\n### 从标准输入读取\n\n该工具也可以从标准输入读取路径。这可用于将另一个命令的输出通过管道传递进来：\n\n```bash\n# 查找过去一天内修改过的文件\nfind . -mtime -1 | files-to-prompt\n```\n\n当使用 `--null`（或 `-0`）选项时，路径应以 NUL 字符分隔（处理包含空格的文件名时很有用）：\n\n```bash\nfind . -name \"*.txt\" -print0 | files-to-prompt --null\n```\n\n您可以混合使用命令行参数和标准输入中的路径：\n\n```bash\n# 包括过去一天内修改过的文件，并且还包括 README.md\nfind . -mtime -1 | files-to-prompt README.md\n```\n\n### Claude XML 输出\n\nAnthropic 提供了 [特定指南](https:\u002F\u002Fdocs.anthropic.com\u002Fclaude\u002Fdocs\u002Flong-context-window-tips) 来优化提示的结构，以便充分利用 Claude 的扩展上下文窗口。\n\n要以这种方式组织输出，请使用可选的 `--cxml` 标志，它将生成如下输出：\n\n```xml\n\u003Cdocuments>\n\u003Cdocument index=\"1\">\n\u003Csource>my_directory\u002Ffile1.txt\u003C\u002Fsource>\n\u003Cdocument_content>\nfile1.txt 的内容\n\u003C\u002Fdocument_content>\n\u003C\u002Fdocument>\n\u003Cdocument index=\"2\">\n\u003Csource>my_directory\u002Ffile2.txt\u003C\u002Fsource>\n\u003Cdocument_content>\nfile2.txt 的内容\n\u003C\u002Fdocument_content>\n\u003C\u002Fdocument>\n\u003C\u002Fdocuments>\n```\n\n## --markdown 围栏代码块输出\n\n`--markdown` 选项会将文件以围栏代码块的形式输出，这对于粘贴到 Markdown 文档中非常有用。\n\n```bash\nfiles-to-prompt path\u002Fto\u002Fdirectory --markdown\n```\n语言标签将根据文件名自动推断。\n\n如果代码本身包含三重反引号，则其外层将多使用一个反引号。\n\n示例输出：\n````\nmyfile.py\n```python\ndef my_function():\n    return \"Hello, world!\"\n```\nother.js\n```javascript\nfunction myFunction() {\n    return \"Hello, world!\";\n}\n```\nfile_with_triple_backticks.md\n````markdown\n这个文件有自己的\n```\n围栏代码块\n```\n在里面。\n````\n````\n\n## 开发\n\n要为此工具做出贡献，首先克隆代码库。然后创建一个新的虚拟环境：\n\n```bash\ncd files-to-prompt\npython -m venv venv\nsource venv\u002Fbin\u002Factivate\n```\n\n现在安装依赖项和测试依赖项：\n\n```bash\npip install -e '.[test]'\n```\n\n运行测试：\n\n```bash\npytest\n```","# files-to-prompt 快速上手指南\n\n`files-to-prompt` 是一个命令行工具，用于将目录中的多个文件内容合并为一个单一的提示词（Prompt），专为大型语言模型（LLM）设计。它支持自动添加文件路径分隔符、忽略特定文件、输出为 Claude XML 格式或 Markdown 代码块等功能。\n\n## 环境准备\n\n- **操作系统**：Linux、macOS 或 Windows（需安装 Python 环境）\n- **Python 版本**：建议 Python 3.8 及以上\n- **前置依赖**：无特殊系统依赖，仅需 `pip` 包管理器\n\n> 💡 国内用户建议使用清华或阿里镜像源加速安装：\n> ```bash\n> pip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple files-to-prompt\n> ```\n\n## 安装步骤\n\n使用 `pip` 一键安装：\n\n```bash\npip install files-to-prompt\n```\n\n如需使用国内镜像源加速：\n\n```bash\npip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple files-to-prompt\n```\n\n## 基本使用\n\n### 最简单用法\n\n将指定目录下的所有文件内容合并输出到终端：\n\n```bash\nfiles-to-prompt path\u002Fto\u002Fyour\u002Fdirectory\n```\n\n输出示例：\n```\npath\u002Fto\u002Fyour\u002Fdirectory\u002Ffile1.txt\n---\n文件 1 的内容\n---\npath\u002Fto\u002Fyour\u002Fdirectory\u002Ffile2.py\n---\n文件 2 的内容\n---\n```\n\n### 常用选项示例\n\n- **仅处理特定扩展名文件**（如 `.py` 和 `.md`）：\n  ```bash\n  files-to-prompt src\u002F -e py -e md\n  ```\n\n- **忽略日志文件和临时文件**：\n  ```bash\n  files-to-prompt project\u002F --ignore \"*.log\" --ignore \"temp*\"\n  ```\n\n- **输出为 Markdown 格式**（适合粘贴到文档中）：\n  ```bash\n  files-to-prompt code\u002F --markdown\n  ```\n\n- **输出为 Claude XML 格式**（优化长上下文提示）：\n  ```bash\n  files-to-prompt docs\u002F --cxml\n  ```\n\n- **包含行号**：\n  ```bash\n  files-to-prompt src\u002F -n\n  ```\n\n- **将结果保存到文件**：\n  ```bash\n  files-to-prompt project\u002F -o prompt.txt\n  ```\n\n### 结合其他命令使用\n\n通过管道动态选择文件（例如最近一天修改过的文件）：\n\n```bash\nfind . -mtime -1 | files-to-prompt\n```\n\n处理含空格的文件名时推荐使用 `-0` 选项：\n\n```bash\nfind . -name \"*.txt\" -print0 | files-to-prompt --null\n```","一位全栈开发者正在重构一个遗留的 Python 微服务项目，需要让 AI 助手基于现有代码库生成详细的重构方案和技术文档。\n\n### 没有 files-to-prompt 时\n- **手动复制效率极低**：开发者必须逐个打开十几个 `.py` 和 `.md` 文件，手动复制粘贴内容到对话框，耗时且容易遗漏关键文件。\n- **上下文结构混乱**：直接粘贴的代码缺乏文件路径标识，AI 难以区分不同模块的归属，导致生成的建议张冠李戴。\n- **干扰信息过多**：本地目录混杂着 `.log` 日志文件和 `__pycache__` 缓存，人工筛选费时费力，稍不注意就会把这些无用信息喂给 AI，浪费 Token 并干扰判断。\n- **格式兼容性问题**：纯文本粘贴丢失了代码块标记，AI 识别代码语法的准确率下降，往往需要多次追问才能修正。\n\n### 使用 files-to-prompt 后\n- **一键聚合代码库**：只需运行 `files-to-prompt src\u002F -e py -e md --ignore \"*.log\"`，瞬间将整个项目核心代码合并为一段结构化文本，直接填入提示词。\n- **自动标注文件来源**：输出内容自动在每段代码前加上相对路径（如 `src\u002Futils\u002Fauth.py`）并用 `---` 分隔，AI 能精准定位每个函数的所属模块。\n- **智能过滤噪音**：通过扩展名筛选和忽略模式，自动排除日志、缓存等无关文件，确保输入给 AI 的每一个字符都高价值且相关。\n- **优化模型解析效果**：配合 `-m` 参数输出带围栏的代码块（Markdown fenced blocks），LLM 能立即识别代码语言，生成的重构方案逻辑严密且可直接运行。\n\nfiles-to-prompt 将繁琐的文件整理工作转化为一条命令，让开发者能轻松将完整的本地代码上下文“喂”给大模型，极大提升了复杂任务的处理效率与准确性。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsimonw_files-to-prompt_6cb599b5.png","simonw","Simon Willison","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fsimonw_1c2d8190.jpg",null,"Datasette","Half Moon Bay, California","https:\u002F\u002Fsimonwillison.net\u002F","https:\u002F\u002Fgithub.com\u002Fsimonw",[82],{"name":83,"color":84,"percentage":85},"Python","#3572A5",100,2646,161,"2026-04-17T07:30:29","Apache-2.0","Linux, macOS, Windows","未说明",{"notes":93,"python":91,"dependencies":94},"该工具是一个命令行实用程序，用于将目录中的文件合并为单个提示符以供 LLM 使用。可通过 pip 安装。支持通过标准输入读取路径，支持忽略特定模式文件，支持输出为 Claude XML 格式或 Markdown 代码块格式。开发时需安装测试依赖并运行 pytest 进行测试。",[95,96],"click","fnmatch",[15,26],"2026-03-27T02:49:30.150509","2026-04-18T17:04:04.747964",[101,106,111,116,121,126,131],{"id":102,"question_zh":103,"answer_zh":104,"source_url":105},40390,"如何将 LLM 生成的代码块直接提取并保存为文件？","可以使用 `llm` 工具的 `-x` 选项来提取第一个围栏代码块，或使用 `--extract-last` 提取最后一个。例如：`llm 'Python code to reverse a list' -x`。此外，社区也有其他工具如 `chatgptextractcodeblock` 可用于此目的。","https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Fissues\u002F14",{"id":107,"question_zh":108,"answer_zh":109,"source_url":110},40391,"为什么使用 --ignore 参数无法忽略 venv 或 node_modules 目录？","目前 `files-to-prompt` 在处理类似路径的忽略条目时存在限制。建议依赖项目根目录下的 `.gitignore` 文件来忽略 `node_modules` 或 `venv` 等目录，将需要忽略的路径写入该文件即可生效。","https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Fissues\u002F7",{"id":112,"question_zh":113,"answer_zh":114,"source_url":115},40392,"如何一次性处理多个文件或目录？","该工具支持在命令行中直接传递多个文件和目录作为参数。例如：`files-to-prompt app.py utils.py` 或 `files-to-prompt files_to_prompt tests`，工具会自动处理所有指定的路径。","https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Fissues\u002F2",{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},40393,"是否有选项可以将输出格式化为 Markdown 代码块（带三重反引号）？","是的，可以使用 `--markdown` 选项。启用后，工具会将每个文件的内容包裹在三重反引号代码块中，并根据文件扩展名自动添加语言标签（如 ```python）。如果文件内容本身包含三重反引号，工具会自动增加反引号层级以避免冲突。","https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Fissues\u002F42",{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},40394,"如何让输出格式更适合 Claude 长上下文窗口？","可以使用 `--xml` 标志。该选项会将文件内容包裹在 XML 标签中（如 `\u003Cdocuments>` 和 `\u003Cdocument path=\"...\">`），这符合 Anthropic 官方关于优化长上下文提示的建议，有助于模型更准确地识别文档边界。","https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Fissues\u002F15",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},40395,"是否支持通过 fsspec 访问远程文件系统？","维护者表示欢迎此类功能的贡献（PR）。虽然核心功能主要针对本地文件，但社区正在探索集成 `fsspec` 以支持更通用的文件系统后端（如 S3、GitHub 仓库等），具体实现可参考相关讨论或提交 PR。","https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Fissues\u002F33",{"id":132,"question_zh":133,"answer_zh":134,"source_url":130},40396,"有没有其他类似的工具可以将整个仓库转换为提示词？","有的，社区推荐了 `copychat` (https:\u002F\u002Fgithub.com\u002Fjlowin\u002Fcopychat) 这个仓库，它专门用于将代码仓库内容转换为适合 LLM 的提示词格式。此外，还有 `AIGenPipeline` 等工具支持更系统的文件生成和构建流程集成。",[136,141,146,151,156,161,166],{"id":137,"version":138,"summary_zh":139,"released_at":140},323766,"0.6","- 新增 `-m\u002F--markdown` 选项，可将输出结果以 Markdown 格式呈现，每个文件包裹在代码块中。#42\n- 支持从标准输入读取文件列表。感谢 [Ankit Shankar](https:\u002F\u002Fgithub.com\u002Fthelastnode)！#44\n  以下是如何仅处理过去一天内修改过的文件：\n  ```bash\n  find . -mtime -1 | files-to-prompt\n  ```\n  你还可以使用 `-0\u002F--null` 标志来接受以空字符分隔的文件路径列表，这在处理包含空格的文件名时非常有用：\n  ```bash\n  find . -name \"*.txt\" -print0 | files-to-prompt -0\n  ```","2025-02-19T05:57:43",{"id":142,"version":143,"summary_zh":144,"released_at":145},323767,"0.5","- 新增 `-n\u002F--line-numbers` 标志，用于在输出中包含行号。感谢 [Dan Clayton](https:\u002F\u002Fgithub.com\u002Fdanclaytondev)。#38\n- 修复了 Windows 上的 UTF-8 编码处理问题。感谢 [David Jarman](https:\u002F\u002Fgithub.com\u002Fdavid-jarman)。#36\n- `--ignore` 模式现在不仅会匹配文件名，还会匹配目录名，除非您使用新的 `--ignore-files-only` 标志。感谢 [Nick Powell](https:\u002F\u002Fgithub.com\u002Fnmpowell)。#30","2025-02-14T04:05:26",{"id":147,"version":148,"summary_zh":149,"released_at":150},323768,"0.4","- 新增 `-e\u002F--extension \u003Cext>` 选项，用于筛选具有一个或多个指定扩展名的文件。例如，`files-to-prompt . -e md -e py` 可以在当前目录中查找所有 Markdown 和 Python 文件。[#28](https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Fissues\u002F28)","2024-10-16T23:25:24",{"id":152,"version":153,"summary_zh":154,"released_at":155},323769,"0.3","- 新增 `-o\u002F--output \u003Cfile>` 选项，用于将输出写入文件。[#9](https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Fissues\u002F9)\n- 新增 `-c\u002F--cxml` 选项，以 Claude 的 XML 风格格式输出，[说明见此处](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fbuild-with-claude\u002Fprompt-engineering\u002Flong-context-tips#essential-tips-for-long-context-prompts)。感谢 [Lex Herbert](https:\u002F\u002Fgithub.com\u002Flexh)。[#15](https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Fissues\u002F15)","2024-09-09T05:46:16",{"id":157,"version":158,"summary_zh":159,"released_at":160},323770,"0.2.1","- 遇到非 UTF-8 编码的文件时发出警告并跳过，而不是直接崩溃。警告信息将输出到标准错误流。[#5](https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Fissues\u002F5)","2024-04-08T06:04:50",{"id":162,"version":163,"summary_zh":164,"released_at":165},323771,"0.2","- 新增 `--ignore '*.md'` 多选项，用于指定额外的忽略模式。感谢 [Dipam Vasani](https:\u002F\u002Fgithub.com\u002Fdipam7)！[#1](https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Fissues\u002F1)\n- `files-to-prompt` 现在可以接受多个文件和目录作为参数，例如 `files-to-prompt my_app.py tests\u002F`。[#2](https:\u002F\u002Fgithub.com\u002Fsimonw\u002Ffiles-to-prompt\u002Fissues\u002F2)","2024-04-08T05:39:55",{"id":167,"version":168,"summary_zh":169,"released_at":170},323772,"0.1","- 初始发布。运行 `files-to-prompt .` 将当前目录下的所有文件内容拼接成一个适合管道输入大语言模型的提示。","2024-03-22T15:48:04"]