[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-yamadashy--repomix":3,"tool-yamadashy--repomix":61},[4,18,26,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":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},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 真正成长为懂上",154349,2,"2026-04-13T23:32:16",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},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",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},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",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":77,"owner_email":78,"owner_twitter":72,"owner_website":79,"owner_url":80,"languages":81,"stars":105,"forks":106,"last_commit_at":107,"license":108,"difficulty_score":109,"env_os":110,"env_gpu":111,"env_ram":111,"env_deps":112,"category_tags":118,"github_topics":119,"view_count":32,"oss_zip_url":79,"oss_zip_packed_at":79,"status":17,"created_at":140,"updated_at":141,"faqs":142,"releases":172},7313,"yamadashy\u002Frepomix","repomix","📦 Repomix is a powerful tool that packs your entire repository into a single, AI-friendly file. Perfect for when you need to feed your codebase to Large Language Models (LLMs) or other AI tools like Claude, ChatGPT, DeepSeek, Perplexity, Gemini, Gemma, Llama, Grok, and more.","Repomix 是一款专为开发者设计的实用工具，它能将整个代码仓库智能打包成一个单一、紧凑且对人工智能友好的文件。在日常开发中，当我们需要让 Claude、ChatGPT、DeepSeek 等大语言模型（LLM）理解项目全貌时，逐个复制文件或处理复杂的目录结构往往既繁琐又容易出错。Repomix 完美解决了这一痛点，它自动过滤无关文件，将核心代码整理成适合 AI 阅读的格式，让用户只需一次操作即可将完整上下文投喂给 AI 助手。\n\n这款工具特别适合软件工程师、技术研究人员以及需要频繁与 AI 协作进行代码审查、重构或功能开发的团队使用。其独特之处在于高度可定制的配置文件，支持用户灵活指定忽略规则、输出格式以及包含的元数据，确保生成的文件既精准又高效。此外，Repomix 不仅提供命令行版本方便集成到自动化流程中，还推出了在线网页版，无需安装即可快速体验。作为 2025 年 JSNation 开源奖\"AI 驱动”类别的提名项目，Repomix 正成为连接人类代码与机器智能的高效桥梁，让 AI 辅助编程变得更加流畅自然。","\u003Cdiv align=\"center\" markdown=\"1\">\n   \u003Csup>Special thanks to:\u003C\u002Fsup>\n   \u003Cbr>\n   \u003Cbr>\n   \u003Ca href=\"https:\u002F\u002Fgo.warp.dev\u002Frepomix\">\n      \u003Cimg alt=\"Warp sponsorship\" width=\"400\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyamadashy_repomix_readme_d2e6544e71c3.png\">\n   \u003C\u002Fa>\n\n### [Warp, built for coding with multiple AI agents](https:\u002F\u002Fgo.warp.dev\u002Frepomix)\n[Available for MacOS, Linux, & Windows](https:\u002F\u002Fgo.warp.dev\u002Frepomix)\u003Cbr>\n\n\n\u003C\u002Fdiv>\n\n\n\u003Chr \u002F>\n\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Frepomix.com\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyamadashy_repomix_readme_2f014a6e98fd.png\" alt=\"Repomix\" width=\"500\" height=\"auto\" \u002F>\n  \u003C\u002Fa>\n  \u003Cp align=\"center\">\n    \u003Cb>Pack your codebase into AI-friendly formats\u003C\u002Fb>\n  \u003C\u002Fp>\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Frepomix.com\">\u003Cb>Use Repomix online! 👉 repomix.com\u003C\u002Fb>\u003C\u002Fa>\u003Cbr>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  Need discussion? Join us on \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku\">Discord\u003C\u002Fa>!\u003Cbr>\n  \u003Ci>Share your experience and tips\u003C\u002Fi>\u003Cbr>\n  \u003Ci>Stay updated on new features\u003C\u002Fi>\u003Cbr>\n  \u003Ci>Get help with configuration and usage\u003C\u002Fi>\u003Cbr>\n\u003C\u002Fp>\n\n\u003Chr \u002F>\n\n[![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Frepomix.svg?maxAge=1000)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Frepomix)\n[![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fd18m\u002Frepomix)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Frepomix)\n[![Actions Status](https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Factions?query=workflow%3A\"ci\")\n[![codecov](https:\u002F\u002Fcodecov.io\u002Fgithub\u002Fyamadashy\u002Frepomix\u002Fgraph\u002Fbadge.svg?token=PYQHDJ5SHX)](https:\u002F\u002Fcodecov.io\u002Fgithub\u002Fyamadashy\u002Frepomix)\n[![Sponsors](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fsponsors\u002Fyamadashy?logo=github)](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fyamadashy)\n[![Discord](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyamadashy_repomix_readme_51490767ffb8.png)](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku)\n\n[![DeepWiki](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDeepWiki-yamadashy%2Frepomix-blue.svg?logo=data:image\u002Fpng;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK\u002FAIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06\u002Fuv1saEDv4O3n3dV60RfP947Mm9\u002FSQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH\u002F\u002FPB8mnKqScAhsD0kYP3j\u002FYt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY\u002F56ebRWeraTjMt\u002F00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB\u002FimwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h\u002FU4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5\u002FXFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb\u002FvA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26\u002FHfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr\u002FFGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r\u002FcKaoqr+27\u002FXcrS5UwSMbQAAAABJRU5ErkJggg==)](https:\u002F\u002Fdeepwiki.com\u002Fyamadashy\u002Frepomix)\n\u003C!-- DeepWiki badge generated by https:\u002F\u002Fdeepwiki.ryoppippi.com\u002F -->\n\n📦 Repomix is a powerful tool that packs your entire repository into a single, AI-friendly file.  \nIt is perfect for when you need to feed your codebase to Large Language Models (LLMs) or other AI tools like Claude,\nChatGPT, DeepSeek, Perplexity, Gemini, Gemma, Llama, Grok, and more.\n\nPlease consider sponsoring me.\n\n[![Sponsor](.github\u002Fassets\u002Fgithub-like-sponsor-button.svg)](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fyamadashy)\n\n[![Sponsors](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyamadashy_repomix_readme_ef2b067f66b2.png)](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fyamadashy)\n\n## 🏆 Open Source Awards Nomination\n\nWe're honored! Repomix has been nominated for the **Powered by AI** category at the [JSNation Open Source Awards 2025](https:\u002F\u002Fosawards.com\u002Fjavascript\u002F).\n\nThis wouldn't have been possible without all of you using and supporting Repomix. Thank you!\n\n## 🎉 New: Repomix Website & Discord Community!\n\n- Try Repomix in your browser at [repomix.com](https:\u002F\u002Frepomix.com\u002F)\n- Join our [Discord Server](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku) for support and discussion\n\n**We look forward to seeing you there!**\n\n## 🌟 Features\n\n- **AI-Optimized**: Formats your codebase in a way that's easy for AI to understand and process.\n- **Token Counting**: Provides token counts for each file and the entire repository, useful for LLM context limits.\n- **Simple to Use**: You need just one command to pack your entire repository.\n- **Customizable**: Easily configure what to include or exclude.\n- **Git-Aware**: Automatically respects your `.gitignore`, `.ignore`, and `.repomixignore` files.\n- **Security-Focused**: Incorporates [Secretlint](https:\u002F\u002Fgithub.com\u002Fsecretlint\u002Fsecretlint) for robust security checks to detect and prevent inclusion of sensitive information.\n- **Code Compression**: The `--compress` option uses [Tree-sitter](https:\u002F\u002Fgithub.com\u002Ftree-sitter\u002Ftree-sitter) to extract key code elements, reducing token count while preserving structure.\n\n## 🚀 Quick Start\n\n### Using the CLI Tool `>_`\n\nYou can try Repomix instantly in your project directory without installation:\n\n```bash\nnpx repomix@latest\n```\n\nOr install globally for repeated use:\n\n```bash\n# Install using npm\nnpm install -g repomix\n\n# Alternatively using yarn\nyarn global add repomix\n\n# Alternatively using bun\nbun add -g repomix\n\n# Alternatively using Homebrew (macOS\u002FLinux)\nbrew install repomix\n\n# Then run in any project directory\nrepomix\n```\n\nThat's it! Repomix will generate a `repomix-output.xml` file in your current directory, containing your entire\nrepository in an AI-friendly format.\n\nYou can then send this file to an AI assistant with a prompt like:\n\n```\nThis file contains all the files in the repository combined into one.\nI want to refactor the code, so please review it first.\n```\n\n![Repomix File Usage 1](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyamadashy_repomix_readme_55c7d6b63b1b.png)\n\nWhen you propose specific changes, the AI might be able to generate code accordingly. With features like Claude's\nArtifacts, you could potentially output multiple files, allowing for the generation of multiple interdependent pieces of\ncode.\n\n![Repomix File Usage 2](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyamadashy_repomix_readme_e50da17921ea.png)\n\nHappy coding! 🚀\n\n### Using The Website 🌐\n\nWant to try it quickly? Visit the official website at [repomix.com](https:\u002F\u002Frepomix.com). Simply enter your repository\nname, fill in any optional details, and click the **Pack** button to see your generated output.\n\n#### Available Options\n\nThe website offers several convenient features:\n\n- Customizable output format (XML, Markdown, or Plain Text)\n- Instant token count estimation\n- Much more!\n\n### Using The Browser Extension 🧩\n\nGet instant access to Repomix directly from any GitHub repository! Our Chrome extension adds a convenient \"Repomix\" button to GitHub repository pages.\n\n![Repomix Browser Extension](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyamadashy_repomix_readme_e0e1ceb22446.png)\n\n#### Install\n- Chrome Extension: [Repomix - Chrome Web Store](https:\u002F\u002Fchromewebstore.google.com\u002Fdetail\u002Frepomix\u002Ffimfamikepjgchehkohedilpdigcpkoa)\n- Firefox Add-on: [Repomix - Firefox Add-ons](https:\u002F\u002Faddons.mozilla.org\u002Ffirefox\u002Faddon\u002Frepomix\u002F)\n\n#### Features\n- One-click access to Repomix for any GitHub repository\n- More exciting features coming soon!\n\n### Using The VSCode Extension ⚡️\n\nA community-maintained VSCode extension called [Repomix Runner](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=DorianMassoulier.repomix-runner) (created by [massdo](https:\u002F\u002Fgithub.com\u002Fmassdo)) lets you run Repomix right inside your editor with just a few clicks. Run it on any folder, manage outputs seamlessly, and control everything through VSCode's intuitive interface. \n\nWant your output as a file or just the content? Need automatic cleanup? This extension has you covered. Plus, it works smoothly with your existing repomix.config.json.\n\nTry it now on the [VSCode Marketplace](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=DorianMassoulier.repomix-runner)!\nSource code is available on [GitHub](https:\u002F\u002Fgithub.com\u002Fmassdo\u002Frepomix-runner).\n\n### Alternative Tools 🛠️\n\nIf you're using Python, you might want to check out `Gitingest`, which is better suited for Python ecosystem and data\nscience workflows:\nhttps:\u002F\u002Fgithub.com\u002Fcyclotruc\u002Fgitingest\n\n## 📊 Usage\n\nTo pack your entire repository:\n\n```bash\nrepomix\n```\n\nTo pack a specific directory:\n\n```bash\nrepomix path\u002Fto\u002Fdirectory\n```\n\nTo pack specific files or directories\nusing [glob patterns](https:\u002F\u002Fgithub.com\u002Fmrmlnc\u002Ffast-glob?tab=readme-ov-file#pattern-syntax):\n\n```bash\nrepomix --include \"src\u002F**\u002F*.ts,**\u002F*.md\"\n```\n\nTo exclude specific files or directories:\n\n```bash\nrepomix --ignore \"**\u002F*.log,tmp\u002F\"\n```\n\nTo pack a remote repository:\n\n```bash\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\n\n# You can also use GitHub shorthand:\nrepomix --remote yamadashy\u002Frepomix\n\n# You can specify the branch name, tag, or commit hash:\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix --remote-branch main\n\n# Or use a specific commit hash:\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix --remote-branch 935b695\n\n# Another convenient way is specifying the branch's URL\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Ftree\u002Fmain\n\n# Commit's URL is also supported\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fcommit\u002F836abcd7335137228ad77feb28655d85712680f1\n\n```\n\nTo pack files from a file list (pipe via stdin):\n\n```bash\n# Using find command\nfind src -name \"*.ts\" -type f | repomix --stdin\n\n# Using git to get tracked files\ngit ls-files \"*.ts\" | repomix --stdin\n\n# Using grep to find files containing specific content\ngrep -l \"TODO\" **\u002F*.ts | repomix --stdin\n\n# Using ripgrep to find files with specific content\nrg -l \"TODO|FIXME\" --type ts | repomix --stdin\n\n# Using ripgrep (rg) to find files\nrg --files --type ts | repomix --stdin\n\n# Using sharkdp\u002Ffd to find files\nfd -e ts | repomix --stdin\n\n# Using fzf to select from all files\nfzf -m | repomix --stdin\n\n# Interactive file selection with fzf\nfind . -name \"*.ts\" -type f | fzf -m | repomix --stdin\n\n# Using ls with glob patterns\nls src\u002F**\u002F*.ts | repomix --stdin\n\n# From a file containing file paths\ncat file-list.txt | repomix --stdin\n\n# Direct input with echo\necho -e \"src\u002Findex.ts\\nsrc\u002Futils.ts\" | repomix --stdin\n```\n\nThe `--stdin` option allows you to pipe a list of file paths to Repomix, giving you ultimate flexibility in selecting which files to pack.\n\nWhen using `--stdin`, the specified files are effectively added to the include patterns. This means that the normal include and ignore behavior still applies - files specified via stdin will still be excluded if they match ignore patterns.\n\n> [!NOTE]\n> When using `--stdin`, file paths can be relative or absolute, and Repomix will automatically handle path resolution and deduplication.\n\nTo include git logs in the output:\n\n```bash\n# Include git logs with default count (50 commits)\nrepomix --include-logs\n\n# Include git logs with specific commit count\nrepomix --include-logs --include-logs-count 10\n\n# Combine with diffs for comprehensive git context\nrepomix --include-logs --include-diffs\n```\n\nThe git logs include commit dates, messages, and file paths for each commit, providing valuable context for AI analysis of code evolution and development patterns.\n\nTo compress the output:\n\n```bash\nrepomix --compress\n\n# You can also use it with remote repositories:\nrepomix --remote yamadashy\u002Frepomix --compress\n```\n\nTo initialize a new configuration file (`repomix.config.json`):\n\n```bash\nrepomix --init\n```\n\nOnce you have generated the packed file, you can use it with Generative AI tools like ChatGPT, DeepSeek, Perplexity, Gemini, Gemma, Llama, Grok, and more.\n\n### Docker Usage 🐳\n\nYou can also run Repomix using Docker.  \nThis is useful if you want to run Repomix in an isolated environment or prefer using containers.\n\nBasic usage (current directory):\n\n```bash\ndocker run -v .:\u002Fapp -it --rm ghcr.io\u002Fyamadashy\u002Frepomix\n```\n\nTo pack a specific directory:\n\n```bash\ndocker run -v .:\u002Fapp -it --rm ghcr.io\u002Fyamadashy\u002Frepomix path\u002Fto\u002Fdirectory\n```\n\nProcess a remote repository and output to a `output` directory:\n\n```bash\ndocker run -v .\u002Foutput:\u002Fapp -it --rm ghcr.io\u002Fyamadashy\u002Frepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\n```\n\n### Prompt Examples\n\nOnce you have generated the packed file with Repomix, you can use it with AI tools like ChatGPT, DeepSeek, Perplexity, Gemini, Gemma, Llama, Grok, and more.\nHere are some example prompts to get you started:\n\n#### Code Review and Refactoring\n\nFor a comprehensive code review and refactoring suggestions:\n\n```\nThis file contains my entire codebase. Please review the overall structure and suggest any improvements or refactoring opportunities, focusing on maintainability and scalability.\n```\n\n#### Documentation Generation\n\nTo generate project documentation:\n\n```\nBased on the codebase in this file, please generate a detailed README.md that includes an overview of the project, its main features, setup instructions, and usage examples.\n```\n\n#### Test Case Generation\n\nFor generating test cases:\n\n```\nAnalyze the code in this file and suggest a comprehensive set of unit tests for the main functions and classes. Include edge cases and potential error scenarios.\n```\n\n#### Code Quality Assessment\n\nEvaluate code quality and adherence to best practices:\n\n```\nReview the codebase for adherence to coding best practices and industry standards. Identify areas where the code could be improved in terms of readability, maintainability, and efficiency. Suggest specific changes to align the code with best practices.\n```\n\n#### Library Overview\n\nGet a high-level understanding of the library\n\n```\nThis file contains the entire codebase of library. Please provide a comprehensive overview of the library, including its main purpose, key features, and overall architecture.\n```\n\nFeel free to modify these prompts based on your specific needs and the capabilities of the AI tool you're using.\n\n### Community Discussion\n\nCheck out our [community discussion](https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fdiscussions\u002F154) where users share:\n\n- Which AI tools they're using with Repomix\n- Effective prompts they've discovered\n- How Repomix has helped them\n- Tips and tricks for getting the most out of AI code analysis\n\nFeel free to join the discussion and share your own experiences! Your insights could help others make better use of\nRepomix.\n\n### Output File Format\n\nRepomix generates a single file with clear separators between different parts of your codebase.  \nTo enhance AI comprehension, the output file begins with an AI-oriented explanation, making it easier for AI models to\nunderstand the context and structure of the packed repository.\n\n#### XML Format (default)\n\nThe XML format structures the content in a hierarchical manner:\n\n```xml\nThis file is a merged representation of the entire codebase, combining all repository files into a single document.\n\n\u003Cfile_summary>\n  (Metadata and usage AI instructions)\n\u003C\u002Ffile_summary>\n\n\u003Cdirectory_structure>\nsrc\u002F\ncli\u002F\ncliOutput.ts\nindex.ts\n\n(...remaining directories)\n\u003C\u002Fdirectory_structure>\n\n\u003Cfiles>\n\u003Cfile path=\"src\u002Findex.js\">\n  \u002F\u002F File contents here\n\u003C\u002Ffile>\n\n(...remaining files)\n\u003C\u002Ffiles>\n\n\u003Cinstruction>\n(Custom instructions from `output.instructionFilePath`)\n\u003C\u002Finstruction>\n```\n\nFor those interested in the potential of XML tags in AI contexts:  \nhttps:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fbuild-with-claude\u002Fprompt-engineering\u002Fuse-xml-tags\n\n> When your prompts involve multiple components like context, instructions, and examples, XML tags can be a\n> game-changer. They help Claude parse your prompts more accurately, leading to higher-quality outputs.\n\nThis means that the XML output from Repomix is not just a different format, but potentially a more effective way to feed\nyour codebase into AI systems for analysis, code review, or other tasks.\n\n#### Markdown Format\n\nTo generate output in Markdown format, use the `--style markdown` option:\n\n```bash\nrepomix --style markdown\n```\n\nThe Markdown format structures the content in a hierarchical manner:\n\n````markdown\nThis file is a merged representation of the entire codebase, combining all repository files into a single document.\n\n# File Summary\n\n(Metadata and usage AI instructions)\n\n# Repository Structure\n\n```\nsrc\u002F\n  cli\u002F\n    cliOutput.ts\n    index.ts\n```\n\n(...remaining directories)\n\n# Repository Files\n\n## File: src\u002Findex.js\n\n```\n\u002F\u002F File contents here\n```\n\n(...remaining files)\n\n# Instruction\n\n(Custom instructions from `output.instructionFilePath`)\n````\n\nThis format provides a clean, readable structure that is both human-friendly and easily parseable by AI systems.\n\n#### JSON Format\n\nTo generate output in JSON format, use the `--style json` option:\n\n```bash\nrepomix --style json\n```\n\nThe JSON format structures the content as a hierarchical JSON object with camelCase property names:\n\n```json\n{\n  \"fileSummary\": {\n    \"generationHeader\": \"This file is a merged representation of the entire codebase, combined into a single document by Repomix.\",\n    \"purpose\": \"This file contains a packed representation of the entire repository's contents...\",\n    \"fileFormat\": \"The content is organized as follows...\",\n    \"usageGuidelines\": \"- This file should be treated as read-only...\",\n    \"notes\": \"- Some files may have been excluded based on .gitignore, .ignore, and .repomixignore rules...\"\n  },\n  \"userProvidedHeader\": \"Custom header text if specified\",\n  \"directoryStructure\": \"src\u002F\\n  cli\u002F\\n    cliOutput.ts\\n    index.ts\\n  config\u002F\\n    configLoader.ts\",\n  \"files\": {\n    \"src\u002Findex.js\": \"\u002F\u002F File contents here\",\n    \"src\u002Futils.js\": \"\u002F\u002F File contents here\"\n  },\n  \"instruction\": \"Custom instructions from instructionFilePath\"\n}\n```\n\nThis format is ideal for:\n- **Programmatic processing**: Easy to parse and manipulate with JSON libraries\n- **API integration**: Direct consumption by web services and applications  \n- **AI tool compatibility**: Structured format for machine learning and AI systems\n- **Data analysis**: Straightforward extraction of specific information using tools like `jq`\n\n##### Working with JSON Output Using `jq`\n\nThe JSON format makes it easy to extract specific information programmatically:\n\n```bash\n# List all file paths\ncat repomix-output.json | jq -r '.files | keys[]'\n\n# Count total number of files\ncat repomix-output.json | jq '.files | keys | length'\n\n# Extract specific file content\ncat repomix-output.json | jq -r '.files[\"README.md\"]'\ncat repomix-output.json | jq -r '.files[\"src\u002Findex.js\"]'\n\n# Find files by extension\ncat repomix-output.json | jq -r '.files | keys[] | select(endswith(\".ts\"))'\n\n# Get files containing specific text\ncat repomix-output.json | jq -r '.files | to_entries[] | select(.value | contains(\"function\")) | .key'\n\n# Extract directory structure\ncat repomix-output.json | jq -r '.directoryStructure'\n\n# Get file summary information\ncat repomix-output.json | jq '.fileSummary.purpose'\ncat repomix-output.json | jq -r '.fileSummary.generationHeader'\n\n# Extract user-provided header (if exists)\ncat repomix-output.json | jq -r '.userProvidedHeader \u002F\u002F \"No header provided\"'\n\n# Create a file list with sizes\ncat repomix-output.json | jq -r '.files | to_entries[] | \"\\(.key): \\(.value | length) characters\"'\n```\n\n#### Plain Text Format\n\nTo generate output in plain text format, use the `--style plain` option:\n\n```bash\nrepomix --style plain\n```\n\n```text\nThis file is a merged representation of the entire codebase, combining all repository files into a single document.\n\n================================================================\nFile Summary\n================================================================\n(Metadata and usage AI instructions)\n\n================================================================\nDirectory Structure\n================================================================\nsrc\u002F\n  cli\u002F\n    cliOutput.ts\n    index.ts\n  config\u002F\n    configLoader.ts\n\n(...remaining directories)\n\n================================================================\nFiles\n================================================================\n\n================\nFile: src\u002Findex.js\n================\n\u002F\u002F File contents here\n\n================\nFile: src\u002Futils.js\n================\n\u002F\u002F File contents here\n\n(...remaining files)\n\n================================================================\nInstruction\n================================================================\n(Custom instructions from `output.instructionFilePath`)\n```\n\n### Command Line Options\n\n#### Basic Options\n- `-v, --version`: Show version information and exit\n\n#### CLI Input\u002FOutput Options\n\n| Option | Description |\n|--------|-------------|\n| `--verbose` | Enable detailed debug logging (shows file processing, token counts, and configuration details) |\n| `--quiet` | Suppress all console output except errors (useful for scripting) |\n| `--stdout` | Write packed output directly to stdout instead of a file (suppresses all logging) |\n| `--stdin` | Read file paths from stdin, one per line (specified files are processed directly) |\n| `--copy` | Copy the generated output to system clipboard after processing |\n| `--token-count-tree [threshold]` | Show file tree with token counts; optional threshold to show only files with ≥N tokens (e.g., `--token-count-tree 100`) |\n| `--top-files-len \u003Cnumber>` | Number of largest files to show in summary (default: `5`) |\n\n#### Repomix Output Options\n\n| Option | Description |\n|--------|-------------|\n| `-o, --output \u003Cfile>` | Output file path (default: `repomix-output.xml`, use `\"-\"` for stdout) |\n| `--style \u003Cstyle>` | Output format: `xml`, `markdown`, `json`, or `plain` (default: `xml`) |\n| `--parsable-style` | Escape special characters to ensure valid XML\u002FMarkdown (needed when output contains code that breaks formatting) |\n| `--compress` | Extract essential code structure (classes, functions, interfaces) using Tree-sitter parsing |\n| `--output-show-line-numbers` | Prefix each line with its line number in the output |\n| `--no-file-summary` | Omit the file summary section from output |\n| `--no-directory-structure` | Omit the directory tree visualization from output |\n| `--no-files` | Generate metadata only without file contents (useful for repository analysis) |\n| `--remove-comments` | Strip all code comments before packing |\n| `--remove-empty-lines` | Remove blank lines from all files |\n| `--truncate-base64` | Truncate long base64 data strings to reduce output size |\n| `--header-text \u003Ctext>` | Custom text to include at the beginning of the output |\n| `--instruction-file-path \u003Cpath>` | Path to file containing custom instructions to include in output |\n| `--split-output \u003Csize>` | Split output into multiple numbered files (e.g., `repomix-output.1.xml`); size like `500kb`, `2mb`, or `1.5mb` |\n| `--include-empty-directories` | Include folders with no files in directory structure |\n| `--include-full-directory-structure` | Show complete directory tree in output, including files not matched by `--include` patterns |\n| `--no-git-sort-by-changes` | Don't sort files by git change frequency (default: most changed files first) |\n| `--include-diffs` | Add git diff section showing working tree and staged changes |\n| `--include-logs` | Add git commit history with messages and changed files |\n| `--include-logs-count \u003Ccount>` | Number of recent commits to include with `--include-logs` (default: `50`) |\n\n#### File Selection Options\n\n| Option | Description |\n|--------|-------------|\n| `--include \u003Cpatterns>` | Include only files matching these glob patterns (comma-separated, e.g., `\"src\u002F**\u002F*.js,*.md\"`) |\n| `-i, --ignore \u003Cpatterns>` | Additional patterns to exclude (comma-separated, e.g., `\"*.test.js,docs\u002F**\"`) |\n| `--no-gitignore` | Don't use `.gitignore` rules for filtering files |\n| `--no-dot-ignore` | Don't use `.ignore` rules for filtering files |\n| `--no-default-patterns` | Don't apply built-in ignore patterns (`node_modules`, `.git`, build dirs, etc.) |\n\n#### Remote Repository Options\n\n| Option | Description |\n|--------|-------------|\n| `--remote \u003Curl>` | Clone and pack a remote repository (GitHub URL or `user\u002Frepo` format) |\n| `--remote-branch \u003Cname>` | Specific branch, tag, or commit to use (default: repository's default branch) |\n| `--remote-trust-config` | Trust and load config files from remote repositories (disabled by default for security) |\n\n#### Configuration Options\n\n| Option | Description |\n|--------|-------------|\n| `-c, --config \u003Cpath>` | Use custom config file instead of `repomix.config.json` |\n| `--init` | Create a new `repomix.config.json` file with defaults |\n| `--global` | With `--init`, create config in home directory instead of current directory |\n\n#### Security Options\n- `--no-security-check`: Skip scanning for sensitive data like API keys and passwords\n\n#### Token Count Options\n- `--token-count-encoding \u003Cencoding>`: Tokenizer model for counting: o200k_base (GPT-4o), cl100k_base (GPT-3.5\u002F4), etc. (default: o200k_base)\n\n#### MCP\n- `--mcp`: Run as Model Context Protocol server for AI tool integration\n\n#### Agent Skills Generation\n\n| Option | Description |\n|--------|-------------|\n| `--skill-generate [name]` | Generate Claude Agent Skills format output to `.claude\u002Fskills\u002F\u003Cname>\u002F` directory (name auto-generated if omitted) |\n| `--skill-output \u003Cpath>` | Specify skill output directory path directly (skips location prompt) |\n| `-f, --force` | Skip all confirmation prompts (e.g., skill directory overwrite) |\n\n#### Examples\n\n```bash\n# Basic usage\nrepomix\n\n# Custom output\nrepomix -o output.xml --style xml\n\n# Output to stdout\nrepomix --stdout > custom-output.txt\n\n# Send output to stdout, then pipe into another command (for example, simonw\u002Fllm)\nrepomix --stdout | llm \"Please explain what this code does.\"\n\n# Custom output with compression\nrepomix --compress\n\n# Process specific files\nrepomix --include \"src\u002F**\u002F*.ts\" --ignore \"**\u002F*.test.ts\"\n\n# Split output into multiple files (max size per part)\nrepomix --split-output 20mb\n\n# Remote repository with branch\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\u002Ftree\u002Fmain\n\n# Remote repository with commit\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\u002Fcommit\u002F836abcd7335137228ad77feb28655d85712680f1\n\n# Remote repository with shorthand\nrepomix --remote user\u002Frepo\n```\n\n### Updating Repomix\n\nTo update a globally installed Repomix:\n\n```bash\n# Using npm\nnpm update -g repomix\n\n# Using yarn\nyarn global upgrade repomix\n\n# Using bun\nbun update -g repomix\n```\n\nUsing `npx repomix` is generally more convenient as it always uses the latest version.\n\n### Remote Repository Processing\n\nRepomix supports processing remote Git repositories without the need for manual cloning. This feature allows you to\nquickly analyze any public Git repository with a single command.\n\nTo process a remote repository, use the `--remote` option followed by the repository URL:\n\n```bash\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\n```\n\nYou can also use GitHub's shorthand format:\n\n```bash\nrepomix --remote yamadashy\u002Frepomix\n```\n\nYou can specify the branch name, tag, or commit hash:\n\n```bash\n# Using --remote-branch option\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix --remote-branch main\n\n# Using branch's URL\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Ftree\u002Fmain\n```\n\nOr use a specific commit hash:\n\n```bash\n# Using --remote-branch option\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix --remote-branch 935b695\n\n# Using commit's URL\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fcommit\u002F836abcd7335137228ad77feb28655d85712680f1\n```\n\n> [!NOTE]\n> For security, config files (`repomix.config.*`) in remote repositories are not loaded by default. This prevents untrusted repositories from executing code via config files. Your global config and CLI options are still applied. To trust a remote repository's config, use `--remote-trust-config` or set `REPOMIX_REMOTE_TRUST_CONFIG=true`.\n>\n> When using `--config` with `--remote`, an absolute path is required (e.g., `--config \u002Fhome\u002Fuser\u002Frepomix.config.json`).\n\n### Code Compression\n\nThe `--compress` option utilizes [Tree-sitter](https:\u002F\u002Fgithub.com\u002Ftree-sitter\u002Ftree-sitter) to perform intelligent code extraction, focusing on essential function and class signatures while removing implementation details. This can help reduce token count while retaining important structural information.\n\n```bash\nrepomix --compress\n```\n\nFor example, this code:\n\n```typescript\nimport { ShoppingItem } from '.\u002Fshopping-item';\n\n\u002F**\n * Calculate the total price of shopping items\n *\u002F\nconst calculateTotal = (\n  items: ShoppingItem[]\n) => {\n  let total = 0;\n  for (const item of items) {\n    total += item.price * item.quantity;\n  }\n  return total;\n}\n\n\u002F\u002F Shopping item interface\ninterface Item {\n  name: string;\n  price: number;\n  quantity: number;\n}\n```\n\nWill be compressed to:\n\n```typescript\nimport { ShoppingItem } from '.\u002Fshopping-item';\n⋮----\n\u002F**\n * Calculate the total price of shopping items\n *\u002F\nconst calculateTotal = (\n  items: ShoppingItem[]\n) => {\n⋮----\n\u002F\u002F Shopping item interface\ninterface Item {\n  name: string;\n  price: number;\n  quantity: number;\n}\n```\n\n> [!NOTE]\n> This is an experimental feature that we'll be actively improving based on user feedback and real-world usage\n\n### Token Count Optimization\n\nUnderstanding your codebase's token distribution is crucial for optimizing AI interactions. Use the `--token-count-tree` option to visualize token usage across your project:\n\n```bash\nrepomix --token-count-tree\n```\n\nThis displays a hierarchical view of your codebase with token counts:\n\n```\n🔢 Token Count Tree:\n────────────────────\n└── src\u002F (70,925 tokens)\n    ├── cli\u002F (12,714 tokens)\n    │   ├── actions\u002F (7,546 tokens)\n    │   └── reporters\u002F (990 tokens)\n    └── core\u002F (41,600 tokens)\n        ├── file\u002F (10,098 tokens)\n        └── output\u002F (5,808 tokens)\n```\n\nYou can also set a minimum token threshold to focus on larger files:\n\n```bash\nrepomix --token-count-tree 1000  # Only show files\u002Fdirectories with 1000+ tokens\n```\n\nThis helps you:\n- **Identify token-heavy files** that might exceed AI context limits\n- **Optimize file selection** using `--include` and `--ignore` patterns  \n- **Plan compression strategies** by targeting the largest contributors\n- **Balance content vs. context** when preparing code for AI analysis\n\n### Splitting Output for Large Codebases\n\nWhen working with large codebases, the packed output may exceed file size limits imposed by some AI tools (e.g., Google AI Studio's 1MB limit). Use `--split-output` to automatically split the output into multiple files:\n\n```bash\nrepomix --split-output 1mb\n```\n\nThis generates numbered files like:\n- `repomix-output.1.xml`\n- `repomix-output.2.xml`\n- `repomix-output.3.xml`\n\nSize can be specified with units: `500kb`, `1mb`, `2mb`, `1.5mb`, etc. Decimal values are supported.\n\n> [!NOTE]\n> Files are grouped by top-level directory to maintain context. A single file or directory will never be split across multiple output files.\n\n### MCP Server Integration\n\nRepomix supports the [Model Context Protocol (MCP)](https:\u002F\u002Fmodelcontextprotocol.io), allowing AI assistants to directly interact with your codebase. When run as an MCP server, Repomix provides tools that enable AI assistants to package local or remote repositories for analysis without requiring manual file preparation.\n\n```bash\nrepomix --mcp\n```\n\n#### Configuring MCP Servers\n\nTo use Repomix as an MCP server with AI assistants like Claude, you need to configure the MCP settings:\n\n**For VS Code:**\n\nYou can install the Repomix MCP server in VS Code using one of these methods:\n\n1. **Using the Install Badge:**\n\n  [![Install in VS Code](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVS_Code-Install_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https:\u002F\u002Finsiders.vscode.dev\u002Fredirect\u002Fmcp\u002Finstall?name=repomix&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22repomix%22%2C%22--mcp%22%5D%7D)\n  [![Install in VS Code Insiders](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVS_Code_Insiders-Install_Server-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https:\u002F\u002Finsiders.vscode.dev\u002Fredirect\u002Fmcp\u002Finstall?name=repomix&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22repomix%22%2C%22--mcp%22%5D%7D&quality=insiders)\n\n2. **Using the Command Line:**\n\n  ```bash\n  code --add-mcp '{\"name\":\"repomix\",\"command\":\"npx\",\"args\":[\"-y\",\"repomix\",\"--mcp\"]}'\n  ```\n\n  For VS Code Insiders:\n  ```bash\n  code-insiders --add-mcp '{\"name\":\"repomix\",\"command\":\"npx\",\"args\":[\"-y\",\"repomix\",\"--mcp\"]}'\n  ```\n\n**For Cline (VS Code extension):**\n\nEdit the `cline_mcp_settings.json` file:\n```json\n{\n  \"mcpServers\": {\n    \"repomix\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\",\n        \"repomix\",\n        \"--mcp\"\n      ]\n    }\n  }\n}\n```\n\n**For Cursor:**\n\nIn Cursor, add a new MCP server from `Cursor Settings` > `MCP` > `+ Add new global MCP server` with a configuration similar to Cline.\n\n**For Claude Desktop:**\n\nEdit the `claude_desktop_config.json` file with similar configuration to Cline's config.\n\n**For Claude Code:**\n\nTo configure Repomix as an MCP server in [Claude Code](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fclaude-code\u002Foverview), use the following command:\n\n```bash\nclaude mcp add repomix -- npx -y repomix --mcp\n```\n\nAlternatively, you can use the official Repomix plugins (see [Claude Code Plugins](#claude-code-plugins) section below).\n\n**Using Docker instead of npx:**\n\nYou can use Docker as an alternative to npx for running Repomix as an MCP server:\n\n```json\n{\n  \"mcpServers\": {\n    \"repomix-docker\": {\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\",\n        \"-i\",\n        \"--rm\",\n        \"ghcr.io\u002Fyamadashy\u002Frepomix\",\n        \"--mcp\"\n      ]\n    }\n  }\n}\n```\n\nOnce configured, your AI assistant can directly use Repomix's capabilities to analyze codebases without manual file preparation, making code analysis workflows more efficient.\n\n#### Available MCP Tools\n\nWhen running as an MCP server, Repomix provides the following tools:\n\n1. **pack_codebase**: Package a local code directory into a consolidated XML file for AI analysis\n  - Parameters:\n    - `directory`: Absolute path to the directory to pack\n    - `compress`: (Optional, default: false) Enable Tree-sitter compression to extract essential code signatures and structure while removing implementation details. Reduces token usage by ~70% while preserving semantic meaning. Generally not needed since grep_repomix_output allows incremental content retrieval. Use only when you specifically need the entire codebase content for large repositories.\n    - `includePatterns`: (Optional) Specify files to include using fast-glob patterns. Multiple patterns can be comma-separated (e.g., \"**\u002F*.{js,ts}\", \"src\u002F**,docs\u002F**\"). Only matching files will be processed.\n    - `ignorePatterns`: (Optional) Specify additional files to exclude using fast-glob patterns. Multiple patterns can be comma-separated (e.g., \"test\u002F**,*.spec.js\", \"node_modules\u002F**,dist\u002F**\"). These patterns supplement .gitignore, .ignore, and built-in exclusions.\n    - `topFilesLength`: (Optional, default: 10) Number of largest files by size to display in the metrics summary for codebase analysis.\n\n2. **attach_packed_output**: Attach an existing Repomix packed output file for AI analysis\n  - Parameters:\n    - `path`: Path to a directory containing repomix-output.xml or direct path to a packed repository XML file\n    - `topFilesLength`: (Optional, default: 10) Number of largest files by size to display in the metrics summary\n  - Features:\n    - Accepts either a directory containing a repomix-output.xml file or a direct path to an XML file\n    - Registers the file with the MCP server and returns the same structure as the pack_codebase tool\n    - Provides secure access to existing packed outputs without requiring re-processing\n    - Useful for working with previously generated packed repositories\n\n3. **pack_remote_repository**: Fetch, clone, and package a GitHub repository into a consolidated XML file for AI analysis\n  - Parameters:\n    - `remote`: GitHub repository URL or user\u002Frepo format (e.g., \"yamadashy\u002Frepomix\", \"https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\", or \"https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\u002Ftree\u002Fbranch\")\n    - `compress`: (Optional, default: false) Enable Tree-sitter compression to extract essential code signatures and structure while removing implementation details. Reduces token usage by ~70% while preserving semantic meaning. Generally not needed since grep_repomix_output allows incremental content retrieval. Use only when you specifically need the entire codebase content for large repositories.\n    - `includePatterns`: (Optional) Specify files to include using fast-glob patterns. Multiple patterns can be comma-separated (e.g., \"**\u002F*.{js,ts}\", \"src\u002F**,docs\u002F**\"). Only matching files will be processed.\n    - `ignorePatterns`: (Optional) Specify additional files to exclude using fast-glob patterns. Multiple patterns can be comma-separated (e.g., \"test\u002F**,*.spec.js\", \"node_modules\u002F**,dist\u002F**\"). These patterns supplement .gitignore, .ignore, and built-in exclusions.\n    - `topFilesLength`: (Optional, default: 10) Number of largest files by size to display in the metrics summary for codebase analysis.\n\n4. **read_repomix_output**: Read the contents of a Repomix-generated output file. Supports partial reading with line range specification for large files.\n  - Parameters:\n    - `outputId`: ID of the Repomix output file to read\n    - `startLine`: (Optional) Starting line number (1-based, inclusive). If not specified, reads from beginning.\n    - `endLine`: (Optional) Ending line number (1-based, inclusive). If not specified, reads to end.\n  - Features:\n    - Specifically designed for web-based environments or sandboxed applications\n    - Retrieves the content of previously generated outputs using their ID\n    - Provides secure access to packed codebase without requiring file system access\n    - Supports partial reading for large files\n\n5. **grep_repomix_output**: Search for patterns in a Repomix output file using grep-like functionality with JavaScript RegExp syntax\n  - Parameters:\n    - `outputId`: ID of the Repomix output file to search\n    - `pattern`: Search pattern (JavaScript RegExp regular expression syntax)\n    - `contextLines`: (Optional, default: 0) Number of context lines to show before and after each match. Overridden by beforeLines\u002FafterLines if specified.\n    - `beforeLines`: (Optional) Number of context lines to show before each match (like grep -B). Takes precedence over contextLines.\n    - `afterLines`: (Optional) Number of context lines to show after each match (like grep -A). Takes precedence over contextLines.\n    - `ignoreCase`: (Optional, default: false) Perform case-insensitive matching\n  - Features:\n    - Uses JavaScript RegExp syntax for powerful pattern matching\n    - Supports context lines for better understanding of matches\n    - Allows separate control of before\u002Fafter context lines\n    - Case-sensitive and case-insensitive search options\n\n6. **file_system_read_file**: Read a file from the local file system using an absolute path. Includes built-in security validation to detect and prevent access to files containing sensitive information.\n  - Parameters:\n    - `path`: Absolute path to the file to read\n  - Security features:\n    - Implements security validation using [Secretlint](https:\u002F\u002Fgithub.com\u002Fsecretlint\u002Fsecretlint)\n    - Prevents access to files containing sensitive information (API keys, passwords, secrets)\n    - Validates absolute paths to prevent directory traversal attacks\n\n7. **file_system_read_directory**: List the contents of a directory using an absolute path. Returns a formatted list showing files and subdirectories with clear indicators.\n  - Parameters:\n    - `path`: Absolute path to the directory to list\n  - Features:\n    - Shows files and directories with clear indicators (`[FILE]` or `[DIR]`)\n    - Provides safe directory traversal with proper error handling\n    - Validates paths and ensures they are absolute\n    - Useful for exploring project structure and understanding codebase organization\n\n### Claude Code Plugins\n\nRepomix provides official plugins for [Claude Code](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fclaude-code\u002Foverview) that integrate seamlessly with the AI-powered development environment.\n\n#### Installation\n\n**1. Add the Repomix plugin marketplace:**\n\n```text\n\u002Fplugin marketplace add yamadashy\u002Frepomix\n```\n\n**2. Install plugins:**\n\n```text\n# Install MCP server plugin (recommended foundation)\n\u002Fplugin install repomix-mcp@repomix\n\n# Install commands plugin (extends functionality)\n\u002Fplugin install repomix-commands@repomix\n\n# Install repository explorer plugin (AI-powered analysis)\n\u002Fplugin install repomix-explorer@repomix\n```\n\n**Note**: The `repomix-mcp` plugin is recommended as a foundation. The `repomix-commands` plugin provides convenient slash commands, while `repomix-explorer` adds AI-powered analysis capabilities. While you can install them independently, using all three provides the most comprehensive experience.\n\n**Alternatively, use the interactive plugin installer:**\n\n```text\n\u002Fplugin\n```\n\nThis will open an interactive interface where you can browse and install available plugins.\n\n#### Available Plugins\n\n**1. repomix-mcp** (MCP Server Plugin)\n\nFoundation plugin that provides AI-powered codebase analysis through MCP server integration.\n\n**Features:**\n- Pack local and remote repositories\n- Search through packed outputs\n- Read files with built-in security scanning (Secretlint)\n- Automatic Tree-sitter compression (~70% token reduction)\n\n**2. repomix-commands** (Slash Commands Plugin)\n\nProvides convenient slash commands for quick operations with natural language support.\n\n**Available Commands:**\n- `\u002Frepomix-commands:pack-local` - Pack local codebase with various options\n- `\u002Frepomix-commands:pack-remote` - Pack and analyze remote GitHub repositories\n\n**Example usage:**\n```text\n\u002Frepomix-commands:pack-local\nPack this project as markdown with compression\n\n\u002Frepomix-commands:pack-remote yamadashy\u002Frepomix\nPack only TypeScript files from the yamadashy\u002Frepomix repository\n```\n\n**3. repomix-explorer** (AI Analysis Agent Plugin)\n\nAI-powered repository analysis agent that intelligently explores codebases using Repomix CLI.\n\n**Features:**\n- Natural language codebase exploration and analysis\n- Intelligent pattern discovery and code structure understanding\n- Incremental analysis using grep and targeted file reading\n- Automatic context management for large repositories\n\n**Available Commands:**\n- `\u002Frepomix-explorer:explore-local` - Analyze local codebase with AI assistance\n- `\u002Frepomix-explorer:explore-remote` - Analyze remote GitHub repositories with AI assistance\n\n**Example usage:**\n```text\n\u002Frepomix-explorer:explore-local .\u002Fsrc\nFind all authentication-related code\n\n\u002Frepomix-explorer:explore-remote facebook\u002Freact\nShow me the main component architecture\n```\n\nThe agent automatically:\n1. Runs `npx repomix@latest` to pack the repository\n2. Uses Grep and Read tools to efficiently search the output\n3. Provides comprehensive analysis without consuming excessive context\n\n#### Benefits\n\n- **Seamless Integration**: Claude can directly analyze codebases without manual preparation\n- **Natural Language**: Use conversational commands instead of remembering CLI syntax\n- **Always Latest**: Automatically uses `npx repomix@latest` for up-to-date features\n- **Security Built-in**: Automatic Secretlint scanning prevents sensitive data exposure\n- **Token Optimization**: Tree-sitter compression for large codebases\n\nFor more details, see the plugin documentation in the `.claude\u002Fplugins\u002F` directory.\n\n### Agent Skills Generation\n\nRepomix can generate [Claude Agent Skills](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fclaude-code\u002Fskills) format output, creating a structured Skills directory that can be used as a reusable codebase reference for AI assistants. This feature is particularly powerful when you want to reference implementations from remote repositories.\n\n#### Basic Usage\n\n```bash\n# Generate Skills from local directory\nrepomix --skill-generate\n\n# Generate with custom Skills name\nrepomix --skill-generate my-project-reference\n\n# Generate from remote repository\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo --skill-generate\n```\n\nWhen you run the command, Repomix prompts you to choose where to save the Skills:\n\n1. **Personal Skills** (`~\u002F.claude\u002Fskills\u002F`) - Available across all projects on your machine\n2. **Project Skills** (`.claude\u002Fskills\u002F`) - Shared with your team via git\n\n#### Non-Interactive Usage\n\nFor CI pipelines and automation scripts, you can skip all interactive prompts using `--skill-output` and `--force`:\n\n```bash\n# Specify output directory directly\nrepomix --skill-generate --skill-output .\u002Fmy-skills\n\n# Skip overwrite confirmation with --force\nrepomix --skill-generate --skill-output .\u002Fmy-skills --force\n\n# Full non-interactive example\nrepomix --remote user\u002Frepo --skill-generate my-skill --skill-output .\u002Foutput --force\n```\n\n#### Generated Structure\n\nThe Skills are generated with the following structure:\n\n```text\n.claude\u002Fskills\u002F\u003Cskill-name>\u002F\n├── SKILL.md                 # Main Skills metadata & documentation\n└── references\u002F\n    ├── summary.md           # Purpose, format, and statistics\n    ├── project-structure.md # Directory tree with line counts\n    ├── files.md             # All file contents (grep-friendly)\n    └── tech-stacks.md       # Languages, frameworks, dependencies\n```\n\n#### What's Included\n\n- **SKILL.md**: Contains Skills metadata, file\u002Fline\u002Ftoken counts, overview, and usage instructions\n- **summary.md**: Explains the Skills' purpose, usage guidelines, and provides statistics breakdown by file type and language\n- **project-structure.md**: Directory tree with line counts per file for easy file discovery\n- **files.md**: All file contents with syntax highlighting headers, optimized for grep-friendly searching\n- **tech-stacks.md**: Auto-detected tech stack per package from dependency files (`package.json`, `requirements.txt`, `Cargo.toml`, etc.)\n\n#### Auto-Generated Skills Names\n\nIf no name is provided, Repomix auto-generates one:\n\n```bash\nrepomix src\u002F --skill-generate                # → repomix-reference-src\nrepomix --remote user\u002Frepo --skill-generate  # → repomix-reference-repo\nrepomix --skill-generate CustomName          # → custom-name (normalized to kebab-case)\n```\n\n#### Integration with Repomix Features\n\nSkills generation respects all standard Repomix options:\n\n```bash\n# Generate Skills with file filtering\nrepomix --skill-generate --include \"src\u002F**\u002F*.ts\" --ignore \"**\u002F*.test.ts\"\n\n# Generate Skills with compression\nrepomix --skill-generate --compress\n\n# Generate Skills from remote repository\nrepomix --remote yamadashy\u002Frepomix --skill-generate\n```\n\n### Repomix Explorer Skill (Agent Skills)\n\nRepomix provides a ready-to-use **Repomix Explorer** skill that enables AI coding assistants to analyze and explore codebases using Repomix CLI. This skill is designed to work with various AI tools including Claude Code, Cursor, Codex, GitHub Copilot, and more.\n\n#### Quick Install\n\n```bash\nnpx add-skill yamadashy\u002Frepomix --skill repomix-explorer\n```\n\nThis command installs the skill to your AI assistant's skills directory (e.g., `.claude\u002Fskills\u002F`), making it immediately available.\n\n#### What It Does\n\nOnce installed, you can analyze codebases with natural language instructions.\n\nAnalyze remote repositories:\n\n```text\n\"What's the structure of this repo?\nhttps:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\"\n```\n\nExplore local codebases:\n\n```text\n\"What's in this project?\n~\u002Fprojects\u002Fmy-app\"\n```\n\nThis is useful not only for understanding codebases, but also when you want to implement features by referencing your other repositories.\n\n## ⚙️ Configuration\n\nRepomix supports multiple configuration file formats for flexibility and ease of use.\n\n### Configuration File Formats\n\nRepomix will automatically search for configuration files in the following priority order:\n\n1. **TypeScript** (`repomix.config.ts`, `repomix.config.mts`, `repomix.config.cts`)\n2. **JavaScript\u002FES Module** (`repomix.config.js`, `repomix.config.mjs`, `repomix.config.cjs`)\n3. **JSON** (`repomix.config.json5`, `repomix.config.jsonc`, `repomix.config.json`)\n\n#### JSON Configuration\n\nCreate a `repomix.config.json` file in your project root:\n\n```bash\nrepomix --init\n```\n\nThis will create a `repomix.config.json` file with default settings.\n\n#### TypeScript Configuration\n\nTypeScript configuration files provide the best developer experience with full type checking and IDE support.\n\n**Installation:**\n\nTo use TypeScript or JavaScript configuration with `defineConfig`, you need to install Repomix as a dev dependency:\n\n```bash\nnpm install -D repomix\n```\n\n**Example:**\n\n```typescript\n\u002F\u002F repomix.config.ts\nimport { defineConfig } from 'repomix';\n\nexport default defineConfig({\n  output: {\n    filePath: 'output.xml',\n    style: 'xml',\n    removeComments: true,\n  },\n  ignore: {\n    customPatterns: ['**\u002Fnode_modules\u002F**', '**\u002Fdist\u002F**'],\n  },\n});\n```\n\n**Benefits:**\n- ✅ Full TypeScript type checking in your IDE\n- ✅ Excellent IDE autocomplete and IntelliSense\n- ✅ Use dynamic values (timestamps, environment variables, etc.)\n\n**Dynamic Values Example:**\n\n```typescript\n\u002F\u002F repomix.config.ts\nimport { defineConfig } from 'repomix';\n\n\u002F\u002F Generate timestamp-based filename\nconst timestamp = new Date().toISOString().slice(0, 19).replace(\u002F[:.]\u002Fg, '-');\n\nexport default defineConfig({\n  output: {\n    filePath: `output-${timestamp}.xml`,\n    style: 'xml',\n  },\n});\n```\n\n#### JavaScript Configuration\n\nJavaScript configuration files work the same as TypeScript, supporting `defineConfig` and dynamic values.\n\n### Configuration Options\n\nHere's an explanation of the configuration options:\n\n| Option                           | Description                                                                                                                  | Default                |\n|----------------------------------|------------------------------------------------------------------------------------------------------------------------------|------------------------|\n| `input.maxFileSize`              | Maximum file size in bytes to process. Files larger than this will be skipped                                                | `50000000`            |\n| `output.filePath`                | The name of the output file                                                                                                  | `\"repomix-output.xml\"` |\n| `output.style`                   | The style of the output (`xml`, `markdown`, `json`, `plain`)                                                                 | `\"xml\"`                |\n| `output.parsableStyle`           | Whether to escape the output based on the chosen style schema. Note that this can increase token count.                      | `false`                |\n| `output.compress`                | Whether to perform intelligent code extraction to reduce token count                                                         | `false`                |\n| `output.headerText`              | Custom text to include in the file header                                                                                    | `null`                 |\n| `output.instructionFilePath`     | Path to a file containing detailed custom instructions                                                                       | `null`                 |\n| `output.fileSummary`             | Whether to include a summary section at the beginning of the output                                                          | `true`                 |\n| `output.directoryStructure`      | Whether to include the directory structure in the output                                                                     | `true`                 |\n| `output.files`                   | Whether to include file contents in the output                                                                               | `true`                 |\n| `output.removeComments`          | Whether to remove comments from supported file types                                                                         | `false`                |\n| `output.removeEmptyLines`        | Whether to remove empty lines from the output                                                                                | `false`                |\n| `output.showLineNumbers`         | Whether to add line numbers to each line in the output                                                                       | `false`                |\n| `output.truncateBase64`          | Whether to truncate long base64 data strings (e.g., images) to reduce token count                                            | `false`                |\n| `output.copyToClipboard`         | Whether to copy the output to system clipboard in addition to saving the file                                                | `false`                |\n| `output.splitOutput`             | Split output into multiple numbered files by maximum size per part (e.g., `1000000` for ~1MB). Keeps each file under the limit and avoids splitting files across parts | Not set                |\n| `output.topFilesLength`          | Number of top files to display in the summary. If set to 0, no summary will be displayed                                     | `5`                    |\n| `output.tokenCountTree`          | Whether to display file tree with token count summaries. Can be boolean or number (minimum token count threshold)           | `false`                |\n| `output.includeEmptyDirectories` | Whether to include empty directories in the repository structure                                                             | `false`                |\n| `output.includeFullDirectoryStructure` | When using `include` patterns, whether to display the complete directory tree (respecting ignore patterns) while still processing only the included files. Provides full repository context for AI analysis | `false`                |\n| `output.git.sortByChanges`       | Whether to sort files by git change count (files with more changes appear at the bottom)                                     | `true`                 |\n| `output.git.sortByChangesMaxCommits` | Maximum number of commits to analyze for git changes                                                                     | `100`                  |\n| `output.git.includeDiffs`       | Whether to include git diffs in the output (includes both work tree and staged changes separately)                          | `false`                |\n| `output.git.includeLogs`        | Whether to include git logs in the output (includes commit history with dates, messages, and file paths)                   | `false`                |\n| `output.git.includeLogsCount`   | Number of git log commits to include                                                                                         | `50`                   |\n| `include`                        | Patterns of files to include (using [glob patterns](https:\u002F\u002Fgithub.com\u002Fmrmlnc\u002Ffast-glob?tab=readme-ov-file#pattern-syntax))  | `[]`                   |\n| `ignore.useGitignore`            | Whether to use patterns from the project's `.gitignore` file                                                                 | `true`                 |\n| `ignore.useDotIgnore`            | Whether to use patterns from the project's `.ignore` file                                                                    | `true`                 |\n| `ignore.useDefaultPatterns`      | Whether to use default ignore patterns                                                                                       | `true`                 |\n| `ignore.customPatterns`          | Additional patterns to ignore (using [glob patterns](https:\u002F\u002Fgithub.com\u002Fmrmlnc\u002Ffast-glob?tab=readme-ov-file#pattern-syntax)) | `[]`                   |\n| `security.enableSecurityCheck`   | Whether to perform security checks on files                                                                                  | `true`                 |\n| `tokenCount.encoding`            | Token count encoding for OpenAI-compatible tokenization (e.g., `o200k_base` for GPT-4o, `cl100k_base` for GPT-4\u002F3.5). Powered by [gpt-tokenizer](https:\u002F\u002Fgithub.com\u002Fnicolo-ribaudo\u002Fgpt-tokenizer). | `\"o200k_base\"`         |\n\nThe configuration file supports [JSON5](https:\u002F\u002Fjson5.org\u002F) syntax, which allows:\n- Comments (both single-line and multi-line)\n- Trailing commas in objects and arrays\n- Unquoted property names\n- More relaxed string syntax\n\n### Schema Validation\n\nYou can enable schema validation for your configuration file by adding the `$schema` property:\n\n```json\n{\n  \"$schema\": \"https:\u002F\u002Frepomix.com\u002Fschemas\u002Flatest\u002Fschema.json\",\n  \"output\": {\n    \"filePath\": \"repomix-output.xml\",\n    \"style\": \"xml\"\n  }\n}\n```\n\nThis provides auto-completion and validation in editors that support JSON schema.\n\n### Example Configuration\n\nExample configuration:\n\n```json5\n{\n  \"$schema\": \"https:\u002F\u002Frepomix.com\u002Fschemas\u002Flatest\u002Fschema.json\",\n  \"input\": {\n    \"maxFileSize\": 50000000\n  },\n  \"output\": {\n    \"filePath\": \"repomix-output.xml\",\n    \"style\": \"xml\",\n    \"parsableStyle\": false,\n    \"compress\": false,\n    \"headerText\": \"Custom header information for the packed file.\",\n    \"fileSummary\": true,\n    \"directoryStructure\": true,\n    \"files\": true,\n    \"removeComments\": false,\n    \"removeEmptyLines\": false,\n    \"topFilesLength\": 5,\n    \"tokenCountTree\": false, \u002F\u002F or true, or a number like 10 for minimum token threshold\n    \"showLineNumbers\": false,\n    \"truncateBase64\": false,\n    \"copyToClipboard\": false,\n    \"splitOutput\": null, \u002F\u002F or a number like 1000000 for ~1MB per file\n    \"includeEmptyDirectories\": false,\n    \"git\": {\n      \"sortByChanges\": true,\n      \"sortByChangesMaxCommits\": 100,\n      \"includeDiffs\": false,\n      \"includeLogs\": false,\n      \"includeLogsCount\": 50\n    }\n  },\n  \"include\": [\"**\u002F*\"],\n  \"ignore\": {\n    \"useGitignore\": true,\n    \"useDefaultPatterns\": true,\n    \u002F\u002F Patterns can also be specified in .repomixignore\n    \"customPatterns\": [\n      \"additional-folder\",\n      \"**\u002F*.log\"\n    ],\n  },\n  \"security\": {\n    \"enableSecurityCheck\": true\n  },\n  \"tokenCount\": {\n    \"encoding\": \"o200k_base\"\n  }\n}\n```\n\n### Global Configuration\n\nTo create a global configuration file:\n\n```bash\nrepomix --init --global\n```\n\nThe global configuration file will be created in:\n\n- Windows: `%LOCALAPPDATA%\\Repomix\\repomix.config.json`\n- macOS\u002FLinux: `$XDG_CONFIG_HOME\u002Frepomix\u002Frepomix.config.json` or `~\u002F.config\u002Frepomix\u002Frepomix.config.json`\n\nNote: Local configuration (if present) takes precedence over global configuration.\n\n### Include and Ignore\n\n#### Include Patterns\n\nRepomix now supports specifying files to include\nusing [glob patterns](https:\u002F\u002Fgithub.com\u002Fmrmlnc\u002Ffast-glob?tab=readme-ov-file#pattern-syntax). This allows for more\nflexible and powerful file selection:\n\n- Use `**\u002F*.js` to include all JavaScript files in any directory\n- Use `src\u002F**\u002F*` to include all files within the `src` directory and its subdirectories\n- Combine multiple patterns like `[\"src\u002F**\u002F*.js\", \"**\u002F*.md\"]` to include JavaScript files in `src` and all Markdown\n  files\n\n#### Ignore Patterns\n\nRepomix offers multiple methods to set ignore patterns for excluding specific files or directories during the packing\nprocess:\n\n- **.gitignore**: By default, patterns listed in your project's `.gitignore` files and `.git\u002Finfo\u002Fexclude` are used. This behavior can be controlled with the `ignore.useGitignore` setting or the `--no-gitignore` cli option.\n- **.ignore**: You can use a `.ignore` file in your project root, following the same format as `.gitignore`. This file is respected by tools like ripgrep and the silver searcher, reducing the need to maintain multiple ignore files. This behavior can be controlled with the `ignore.useDotIgnore` setting or the `--no-dot-ignore` cli option.\n- **Default patterns**: Repomix includes a default list of commonly excluded files and directories (e.g., node_modules,\n  .git, binary files). This feature can be controlled with the `ignore.useDefaultPatterns` setting or the `--no-default-patterns` cli option. Please\n  see [defaultIgnore.ts](src\u002Fconfig\u002FdefaultIgnore.ts) for more details.\n- **.repomixignore**: You can create a `.repomixignore` file in your project root to define Repomix-specific ignore\n  patterns. This file follows the same format as `.gitignore`.\n- **Custom patterns**: Additional ignore patterns can be specified using the `ignore.customPatterns` option in the\n  configuration file. You can overwrite this setting with the `-i, --ignore` command line option.\n\nPriority Order (from highest to lowest):\n\n1. Custom patterns (`ignore.customPatterns`)\n2. Ignore files (`.repomixignore`, `.ignore`, `.gitignore`, and `.git\u002Finfo\u002Fexclude`):\n   - When in nested directories, files in deeper directories have higher priority\n   - When in the same directory, these files are merged in no particular order\n3. Default patterns (if `ignore.useDefaultPatterns` is true and `--no-default-patterns` is not used)\n\nThis approach allows for flexible file exclusion configuration based on your project's needs. It helps optimize the size\nof the generated pack file by ensuring the exclusion of security-sensitive files and large binary files, while\npreventing the leakage of confidential information.\n\nNote: Binary files are not included in the packed output by default, but their paths are listed in the \"Repository\nStructure\" section of the output file. This provides a complete overview of the repository structure while keeping the\npacked file efficient and text-based.\n\n### Custom Instruction\n\nThe `output.instructionFilePath` option allows you to specify a separate file containing detailed instructions or\ncontext about your project. This allows AI systems to understand the specific context and requirements of your project,\npotentially leading to more relevant and tailored analysis or suggestions.\n\nHere's an example of how you might use this feature:\n\n1. Create a file named `repomix-instruction.md` in your project root:\n\n```markdown\n# Coding Guidelines\n\n- Follow the Airbnb JavaScript Style Guide\n- Suggest splitting files into smaller, focused units when appropriate\n- Add comments for non-obvious logic. Keep all text in English\n- All new features should have corresponding unit tests\n\n# Generate Comprehensive Output\n\n- Include all content without abbreviation, unless specified otherwise\n- Optimize for handling large codebases while maintaining output quality\n```\n\n2. In your `repomix.config.json`, add the `instructionFilePath` option:\n\n```json5\n{\n  \"output\": {\n    \"instructionFilePath\": \"repomix-instruction.md\",\n    \u002F\u002F other options...\n  }\n}\n```\n\nWhen Repomix generates the output, it will include the contents of `repomix-instruction.md` in a dedicated section.\n\nNote: The instruction content is appended at the end of the output file. This placement can be particularly effective\nfor AI systems. For those interested in understanding why this might be beneficial, Anthropic provides some insights in\ntheir documentation:  \nhttps:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fbuild-with-claude\u002Fprompt-engineering\u002Flong-context-tips\n\n> Put long-form data at the top: Place your long documents and inputs (~20K+ tokens) near the top of your prompt, above\n> your query, instructions, and examples. This can significantly improve Claude's performance across all models.\n> Queries at the end can improve response quality by up to 30% in tests, especially with complex, multi-document inputs.\n\n### Comment Removal\n\nWhen `output.removeComments` is set to `true`, Repomix will attempt to remove comments from supported file types. This\nfeature can help reduce the size of the output file and focus on the essential code content.\n\nSupported languages include:  \nHTML, CSS, JavaScript, TypeScript, Vue, Svelte, Python, PHP, Ruby, C, C#, Java, Go, Rust, Swift, Kotlin, Dart, Shell,\nand YAML.\n\nNote: The comment removal process is conservative to avoid accidentally removing code. In complex cases, some comments\nmight be retained.\n\n## 🔍 Security Check\n\nRepomix includes a security check feature that uses [Secretlint](https:\u002F\u002Fgithub.com\u002Fsecretlint\u002Fsecretlint) to detect\npotentially sensitive information in your files. This feature helps you identify possible security risks before sharing\nyour packed repository.\n\nThe security check results will be displayed in the CLI output after the packing process is complete. If any suspicious\nfiles are detected, you'll see a list of these files along with a warning message.\n\nExample output:\n\n```\n🔍 Security Check:\n──────────────────\n2 suspicious file(s) detected:\n1. src\u002Futils\u002Ftest.txt\n2. tests\u002Futils\u002FsecretLintUtils.test.ts\n\nPlease review these files for potentially sensitive information.\n```\n\nBy default, Repomix's security check feature is enabled. You can disable it by setting `security.enableSecurityCheck` to\n`false` in your configuration file:\n\n```json\n{\n  \"security\": {\n    \"enableSecurityCheck\": false\n  }\n}\n```\n\nOr using the `--no-security-check` command line option:\n\n```bash\nrepomix --no-security-check\n```\n\n> [!NOTE]\n> Disabling security checks may expose sensitive information. Use this option with caution and only when necessary, such\n> as when working with test files or documentation that contains example credentials.\n\n## 🤖 Using Repomix with GitHub Actions\n\nYou can also use Repomix in your GitHub Actions workflows. This is useful for automating the process of packing your codebase for AI analysis.\n\nBasic usage:\n\n```yaml\n- name: Pack repository with Repomix\n  uses: yamadashy\u002Frepomix\u002F.github\u002Factions\u002Frepomix@main\n  with:\n    output: repomix-output.xml\n    style: xml\n```\n\nUse `--style` to generate output in different formats:\n\n```yaml\n- name: Pack repository with Repomix\n  uses: yamadashy\u002Frepomix\u002F.github\u002Factions\u002Frepomix@main\n  with:\n    output: repomix-output.md\n    style: markdown\n```\n\n```yaml\n- name: Pack repository with Repomix (JSON format)\n  uses: yamadashy\u002Frepomix\u002F.github\u002Factions\u002Frepomix@main\n  with:\n    output: repomix-output.json\n    style: json\n```\n\nPack specific directories with compression:\n\n```yaml\n- name: Pack repository with Repomix\n  uses: yamadashy\u002Frepomix\u002F.github\u002Factions\u002Frepomix@main\n  with:\n    directories: src tests\n    include: \"**\u002F*.ts,**\u002F*.md\"\n    ignore: \"**\u002F*.test.ts\"\n    output: repomix-output.txt\n    compress: true\n```\n\nUpload the output file as an artifact:\n\n```yaml\n- name: Pack repository with Repomix\n  uses: yamadashy\u002Frepomix\u002F.github\u002Factions\u002Frepomix@main\n  with:\n    directories: src\n    output: repomix-output.txt\n    compress: true\n\n- name: Upload Repomix output\n  uses: actions\u002Fupload-artifact@v4\n  with:\n    name: repomix-output\n    path: repomix-output.txt\n```\n\nComplete workflow example:\n\n```yaml\nname: Pack repository with Repomix\n\non:\n  workflow_dispatch:\n  push:\n    branches: [ main ]\n  pull_request:\n    branches: [ main ]\n\njobs:\n  pack-repo:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout code\n        uses: actions\u002Fcheckout@v4\n\n      - name: Pack repository with Repomix\n        uses: yamadashy\u002Frepomix\u002F.github\u002Factions\u002Frepomix@main\n        with:\n          output: repomix-output.xml\n\n      - name: Upload Repomix output\n        uses: actions\u002Fupload-artifact@v4\n        with:\n          name: repomix-output.xml\n          path: repomix-output.xml\n          retention-days: 30\n```\n\nSee the complete workflow example [here](https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fblob\u002Fmain\u002F.github\u002Fworkflows\u002Fpack-repository.yml).\n\n### Action Inputs\n\n| Name | Description | Default |\n|------|-------------|---------|\n| `directories` | Space-separated list of directories to process (e.g., `src tests docs`) | `.` |\n| `include` | Comma-separated glob patterns to include files (e.g., `**\u002F*.ts,**\u002F*.md`) | `\"\"` |\n| `ignore` | Comma-separated glob patterns to ignore files (e.g., `**\u002F*.test.ts,**\u002Fnode_modules\u002F**`) | `\"\"` |\n| `output` | Relative path for the packed file (extension determines format: `.txt`, `.md`, `.xml`) | `repomix-output.xml` |\n| `compress` | Enable smart compression to reduce output size by pruning implementation details | `true` |\n| `style` | Output style (`xml`, `markdown`, `json`, `plain`) | `xml` |\n| `additional-args` | Extra raw arguments for the repomix CLI (e.g., `--no-file-summary --no-security-check`) | `\"\"` |\n| `repomix-version` | Version of the npm package to install (supports semver ranges, tags, or specific versions like `0.2.25`) | `latest` |\n\n### Action Outputs\n\n| Name | Description |\n|------|-------------|\n| `output_file` | Path to the generated output file. Can be used in subsequent steps for artifact upload, LLM processing, or other operations. The file contains a formatted representation of your codebase based on the specified options. |\n\n## 📚 Using Repomix as a Library\n\nIn addition to using Repomix as a CLI tool, you can also use it as a library in your Node.js applications.\n\n### Installation\n\n```bash\nnpm install repomix\n```\n\n### Basic Usage\n\n```javascript\nimport { runCli, type CliOptions } from 'repomix';\n\n\u002F\u002F Process current directory with custom options\nasync function packProject() {\n  const options = {\n    output: 'output.xml',\n    style: 'xml',\n    compress: true,\n    quiet: true\n  } as CliOptions;\n  \n  const result = await runCli(['.'], process.cwd(), options);\n  return result.packResult;\n}\n```\n\n### Process Remote Repository\n\n```javascript\nimport { runCli, type CliOptions } from 'repomix';\n\n\u002F\u002F Clone and process a GitHub repo\nasync function processRemoteRepo(repoUrl) {\n  const options = {\n    remote: repoUrl,\n    output: 'output.xml',\n    compress: true\n  } as CliOptions;\n  \n  return await runCli(['.'], process.cwd(), options);\n}\n```\n\n### Using Core Components\n\nIf you need more control, you can use the low-level APIs:\n\n```javascript\nimport { searchFiles, collectFiles, processFiles, TokenCounter } from 'repomix';\n\nasync function analyzeFiles(directory) {\n  \u002F\u002F Find and collect files\n  const { filePaths } = await searchFiles(directory, { \u002F* config *\u002F });\n  const rawFiles = await collectFiles(filePaths, directory);\n  const processedFiles = await processFiles(rawFiles, { \u002F* config *\u002F });\n  \n  \u002F\u002F Count tokens\n  const tokenCounter = new TokenCounter('o200k_base');\n  \n  \u002F\u002F Return analysis results\n  return processedFiles.map(file => ({\n    path: file.path,\n    tokens: tokenCounter.countTokens(file.content)\n  }));\n}\n```\n\nFor more examples, check the source code at [website\u002Fserver\u002Fsrc\u002FremoteRepo.ts](https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fblob\u002Fmain\u002Fwebsite\u002Fserver\u002Fsrc\u002FremoteRepo.ts) which demonstrates how repomix.com uses the library.\n\n### Bundling\n\nWhen bundling repomix with tools like Rolldown or esbuild, some dependencies must remain external and WASM files need to be copied:\n\n**External dependencies (cannot be bundled):**\n- `tinypool` - Spawns worker threads using file paths\n\n**WASM files to copy:**\n- `web-tree-sitter.wasm` → Same directory as bundled JS (required for code compression feature)\n- Tree-sitter language files → Directory specified by `REPOMIX_WASM_DIR` environment variable\n\nFor a working example, see [website\u002Fserver\u002Fscripts\u002Fbundle.mjs](https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fblob\u002Fmain\u002Fwebsite\u002Fserver\u002Fscripts\u002Fbundle.mjs).\n\n## 🌍 Community Projects\n\nDiscover amazing projects built by the Repomix community!\n\n- [Repomix Runner](https:\u002F\u002Fgithub.com\u002Fmassdo\u002Frepomix-runner) - VSCode extension for bundling files into a single output for AI processing\n- [Repomix Desktop](https:\u002F\u002Fgithub.com\u002FKevanMacGee\u002FRepomix-Desktop) - GUI desktop application for Repomix built with Python and CustomTkinter\n- [Python Repomix](https:\u002F\u002Fgithub.com\u002FAndersonBY\u002Fpython-repomix) - Python implementation with AST-based compression\n- [Rulefy](https:\u002F\u002Fgithub.com\u002Fniklub\u002Frulefy) - Transform GitHub repos into custom Cursor AI rules using Claude AI\n- [Codebase MCP](https:\u002F\u002Fgithub.com\u002FDeDeveloper23\u002Fcodebase-mcp) - MCP server that uses Repomix for AI-powered codebase analysis\n- [vibe-tools](https:\u002F\u002Fgithub.com\u002Feastlondoner\u002Fvibe-tools) - CLI toolset for AI agents with web search, repo analysis, and browser automation\n\nFor more details, visit our [Community Projects page](https:\u002F\u002Frepomix.com\u002Fguide\u002Fcommunity-projects).\n\n## 🤝 Contribution\n\nWe welcome contributions from the community! To get started, please refer to our [Contributing Guide](CONTRIBUTING.md).\n\n### Contributors\n\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fgraphs\u002Fcontributors\">\n  \u003Cimg alt=\"contributors\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyamadashy_repomix_readme_8a405235fca8.png\"\u002F>\n\u003C\u002Fa>\n\n## 🔒 Privacy Policy\n\nSee our [Privacy Policy](https:\u002F\u002Frepomix.com\u002Fguide\u002Fprivacy).\n\n## 📜 License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n\u003Cp align=\"center\">\n  &nbsp;&nbsp;&nbsp;\n  \u003Ca href=\"#repo-content-pjax-container\" target=\"_blank\">\n    Back To Top\n  \u003C\u002Fa>\n\u003C\u002Fp>\n","\u003Cdiv align=\"center\" markdown=\"1\">\n   \u003Csup>特别感谢：\u003C\u002Fsup>\n   \u003Cbr>\n   \u003Cbr>\n   \u003Ca href=\"https:\u002F\u002Fgo.warp.dev\u002Frepomix\">\n      \u003Cimg alt=\"Warp 赞助\" width=\"400\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyamadashy_repomix_readme_d2e6544e71c3.png\">\n   \u003C\u002Fa>\n\n### [Warp，专为多 AI 代理编码而打造](https:\u002F\u002Fgo.warp.dev\u002Frepomix)\n[适用于 MacOS、Linux 和 Windows](https:\u002F\u002Fgo.warp.dev\u002Frepomix)\u003Cbr>\n\n\n\u003C\u002Fdiv>\n\n\n\u003Chr \u002F>\n\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Frepomix.com\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyamadashy_repomix_readme_2f014a6e98fd.png\" alt=\"Repomix\" width=\"500\" height=\"auto\" \u002F>\n  \u003C\u002Fa>\n  \u003Cp align=\"center\">\n    \u003Cb>将您的代码库打包成适合 AI 的格式\u003C\u002Fb>\n  \u003C\u002Fp>\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Frepomix.com\">\u003Cb>在线使用 Repomix！👉 repomix.com\u003C\u002Fb>\u003C\u002Fa>\u003Cbr>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  需要讨论吗？加入我们的 \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku\">Discord\u003C\u002Fa> 吧！\u003Cbr>\n  \u003Ci>分享您的经验与技巧\u003C\u002Fi>\u003Cbr>\n  \u003Ci>及时了解新功能\u003C\u002Fi>\u003Cbr>\n  \u003Ci>获取配置和使用方面的帮助\u003C\u002Fi>\u003Cbr>\n\u003C\u002Fp>\n\n\u003Chr \u002F>\n\n[![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Frepomix.svg?maxAge=1000)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Frepomix)\n[![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fd18m\u002Frepomix)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Frepomix)\n[![Actions Status](https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Factions?query=workflow%3A\"ci\")\n[![codecov](https:\u002F\u002Fcodecov.io\u002Fgithub\u002Fyamadashy\u002Frepomix\u002Fgraph\u002Fbadge.svg?token=PYQHDJ5SHX)](https:\u002F\u002Fcodecov.io\u002Fgithub\u002Fyamadashy\u002Frepomix)\n[![Sponsors](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fsponsors\u002Fyamadashy?logo=github)](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fyamadashy)\n[![Discord](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyamadashy_repomix_readme_51490767ffb8.png)](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku)\n\n[![DeepWiki](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDeepWiki-yamadashy%2Frepomix-blue.svg?logo=data:image\u002Fpng;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK\u002FAIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06\u002Fuv1saEDv4O3n3dV60RfP947Mm9\u002FSQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH\u002F\u002FPB8mnKqScAhsD0kYP3j\u002FYt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY\u002F56ebRWeraTjMt\u002F00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6V5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB\u002FimwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h\u002FU4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5\u002FXFWLYZRIMpX39AR0tjaGGiGzLVihse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb\u002FvA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26\u002FHfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr\u002FFGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r\u002FcKaoqr+27\u002FXcrS5UwSMbQAAAABJRU5ErkJggg==)](https:\u002F\u002Fdeepwiki.com\u002Fyamadashy\u002Frepomix)\n\u003C!-- DeepWiki badge generated by https:\u002F\u002Fdeepwiki.ryoppippi.com\u002F -->\n\n📦 Repomix 是一款强大的工具，可将您的整个仓库打包成一个单一的、适合 AI 处理的文件。  \n它非常适合在需要将您的代码库输入大型语言模型（LLMs）或其他 AI 工具时使用，例如 Claude、ChatGPT、DeepSeek、Perplexity、Gemini、Gemma、Llama、Grok 等。\n\n请考虑赞助我。\n\n[![赞助](.github\u002Fassets\u002Fgithub-like-sponsor-button.svg)](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fyamadashy)\n\n[![赞助者](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyamadashy_repomix_readme_ef2b067f66b2.png)](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fyamadashy)\n\n## 🏆 开源奖项提名\n\n我们深感荣幸！Repomix 已被提名为 [JSNation 开源大奖 2025](https:\u002F\u002Fosawards.com\u002Fjavascript\u002F) 中的 **Powered by AI** 类别。\n\n这一切都离不开各位用户对 Repomix 的使用和支持。非常感谢！\n\n## 🎉 新：Repomix 官网与 Discord 社区！\n\n- 您可以在浏览器中访问 [repomix.com](https:\u002F\u002Frepomix.com\u002F) 试用 Repomix\n- 加入我们的 [Discord 服务器](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku) 获取支持与交流\n\n**期待在那里见到您！**\n\n## 🌟 功能特性\n\n- **AI 优化**：以易于 AI 理解和处理的方式格式化您的代码库。\n- **Token 计数**：提供每个文件及整个仓库的 token 数量，有助于应对 LLM 的上下文限制。\n- **简单易用**：只需一条命令即可打包整个仓库。\n- **可定制化**：轻松配置包含或排除的内容。\n- **Git 感知**：自动尊重您的 `.gitignore`、`.ignore` 和 `.repomixignore` 文件。\n- **安全优先**：集成 [Secretlint](https:\u002F\u002Fgithub.com\u002Fsecretlint\u002Fsecretlint)，进行强大的安全检查，以检测并防止敏感信息的引入。\n- **代码压缩**：通过 `--compress` 选项，利用 [Tree-sitter](https:\u002F\u002Fgithub.com\u002Ftree-sitter\u002Ftree-sitter) 提取关键代码元素，从而在保留结构的同时减少 token 数量。\n\n## 🚀 快速入门\n\n### 使用 CLI 工具 `>_`\n\n您无需安装即可在项目目录中立即试用 Repomix：\n\n```bash\nnpx repomix@latest\n```\n\n或者全局安装以便重复使用：\n\n```bash\n# 使用 npm 安装\nnpm install -g repomix\n\n# 或者使用 yarn\nyarn global add repomix\n\n# 或者使用 bun\nbun add -g repomix\n\n# 或者使用 Homebrew（macOS\u002FLinux）\nbrew install repomix\n\n# 然后在任何项目目录中运行\nrepomix\n```\n\n就这么简单！Repomix 会在您当前目录下生成一个 `repomix-output.xml` 文件，其中包含了您的整个仓库，并且是以适合 AI 的格式呈现的。\n\n随后，您可以将此文件发送给 AI 助手，并附上类似如下的提示：\n\n```\n该文件包含了仓库中的所有文件，已合并为一个整体。\n我想重构代码，请先审阅一下。\n```\n\n![Repomix 文件使用示例 1](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyamadashy_repomix_readme_55c7d6b63b1b.png)\n\n当您提出具体的修改建议时，AI 很有可能会根据这些建议生成相应的代码。借助 Claude 的 Artifacts 等功能，您甚至可以输出多个文件，从而生成相互依赖的多段代码。\n\n![Repomix 文件使用示例 2](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyamadashy_repomix_readme_e50da17921ea.png)\n\n祝编码愉快！🚀\n\n### 使用官网 🌐\n\n想快速试用吗？请访问官方网站 [repomix.com](https:\u002F\u002Frepomix.com)。只需输入您的仓库名称，填写可选信息，然后点击 **打包** 按钮，即可查看生成的输出。\n\n#### 可用选项\n\n网站提供了多项便捷功能：\n\n- 可自定义的输出格式（XML、Markdown 或纯文本）\n- 即时 token 数量估算\n- 更多功能！\n\n### 使用浏览器扩展 🧩\n\n只需一键，即可从任何 GitHub 仓库直接访问 Repomix！我们的 Chrome 扩展会在 GitHub 仓库页面上添加一个便捷的“Repomix”按钮。\n\n![Repomix 浏览器扩展](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyamadashy_repomix_readme_e0e1ceb22446.png)\n\n#### 安装\n- Chrome 扩展：[Repomix - Chrome 网上应用店](https:\u002F\u002Fchromewebstore.google.com\u002Fdetail\u002Frepomix\u002Ffimfamikepjgchehkohedilpdigcpkoa)\n- Firefox 插件：[Repomix - Firefox 附加组件](https:\u002F\u002Faddons.mozilla.org\u002Ffirefox\u002Faddon\u002Frepomix\u002F)\n\n#### 功能\n- 一键访问任意 GitHub 仓库的 Repomix\n- 更多精彩功能即将推出！\n\n### 使用 VSCode 扩展 ⚡️\n\n由社区维护的 VSCode 扩展 [Repomix Runner](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=DorianMassoulier.repomix-runner)（由 [massdo](https:\u002F\u002Fgithub.com\u002Fmassdo) 创建）让您只需点击几下，就能在编辑器内直接运行 Repomix。您可以对任意文件夹运行它，无缝管理输出，并通过 VSCode 直观的界面控制所有操作。\n\n想将输出保存为文件还是仅获取内容？需要自动清理吗？这款扩展都能满足您的需求。此外，它还能与您现有的 `repomix.config.json` 配置文件顺畅兼容。\n\n立即前往 [VSCode 市场](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=DorianMassoulier.repomix-runner) 体验吧！源代码可在 [GitHub](https:\u002F\u002Fgithub.com\u002Fmassdo\u002Frepomix-runner) 上找到。\n\n### 替代工具 🛠️\n\n如果您使用 Python，不妨试试 `Gitingest`，它更适合 Python 生态系统和数据科学工作流：\nhttps:\u002F\u002Fgithub.com\u002Fcyclotruc\u002Fgitingest\n\n## 📊 使用方法\n\n打包整个仓库：\n\n```bash\nrepomix\n```\n\n打包特定目录：\n\n```bash\nrepomix path\u002Fto\u002Fdirectory\n```\n\n使用 [glob 模式](https:\u002F\u002Fgithub.com\u002Fmrmlnc\u002Ffast-glob?tab=readme-ov-file#pattern-syntax) 打包特定文件或目录：\n\n```bash\nrepomix --include \"src\u002F**\u002F*.ts,**\u002F*.md\"\n```\n\n排除特定文件或目录：\n\n```bash\nrepomix --ignore \"**\u002F*.log,tmp\u002F\"\n```\n\n打包远程仓库：\n\n```bash\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\n\n# 也可以使用 GitHub 的简写方式：\nrepomix --remote yamadashy\u002Frepomix\n\n# 可以指定分支名、标签或提交哈希：\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix --remote-branch main\n\n# 或者使用特定的提交哈希：\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix --remote-branch 935b695\n\n# 另一种便捷的方式是直接指定分支的 URL：\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Ftree\u002Fmain\n\n# 提交的 URL 也同样支持：\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fcommit\u002F836abcd7335137228ad77feb28655d85712680f1\n```\n\n从文件列表中打包文件（通过标准输入管道传递）：\n\n```bash\n# 使用 find 命令\nfind src -name \"*.ts\" -type f | repomix --stdin\n\n# 使用 git 获取已跟踪文件\ngit ls-files \"*.ts\" | repomix --stdin\n\n# 使用 grep 查找包含特定内容的文件\ngrep -l \"TODO\" **\u002F*.ts | repomix --stdin\n\n# 使用 ripgrep 查找包含特定内容的文件\nrg -l \"TODO|FIXME\" --type ts | repomix --stdin\n\n# 使用 ripgrep (rg) 查找文件\nrg --files --type ts | repomix --stdin\n\n# 使用 sharkdp\u002Ffd 查找文件\nfd -e ts | repomix --stdin\n\n# 使用 fzf 从所有文件中选择\nfzf -m | repomix --stdin\n\n# 使用 fzf 进行交互式文件选择\nfind . -name \"*.ts\" -type f | fzf -m | repomix --stdin\n\n# 使用 ls 并结合 glob 模式\nls src\u002F**\u002F*.ts | repomix --stdin\n\n# 从包含文件路径的文件中读取\ncat file-list.txt | repomix --stdin\n\n# 直接使用 echo 输入\necho -e \"src\u002Findex.ts\\nsrc\u002Futils.ts\" | repomix --stdin\n```\n\n`--stdin` 选项允许您将文件路径列表通过管道传递给 Repomix，从而为您提供极大的灵活性来选择要打包的文件。\n\n使用 `--stdin` 时，指定的文件会有效加入包含模式中。这意味着正常的包含和忽略规则仍然适用——如果通过 stdin 指定的文件匹配忽略模式，它们仍会被排除。\n\n> [!注意]\n> 使用 `--stdin` 时，文件路径可以是相对路径或绝对路径，Repomix 会自动处理路径解析和去重。\n\n在输出中包含 Git 日志：\n\n```bash\n# 包含默认数量的 Git 日志（50 条提交）\nrepomix --include-logs\n\n# 包含特定数量的 Git 日志\nrepomix --include-logs --include-logs-count 10\n\n# 结合差异查看，获得更全面的 Git 上下文\nrepomix --include-logs --include-diffs\n```\n\nGit 日志会包含每次提交的日期、消息以及文件路径，为 AI 分析代码演进和开发模式提供宝贵背景信息。\n\n压缩输出：\n\n```bash\nrepomix --compress\n\n# 也可以用于远程仓库：\nrepomix --remote yamadashy\u002Frepomix --compress\n```\n\n初始化新的配置文件 (`repomix.config.json`)：\n\n```bash\nrepomix --init\n```\n\n生成打包文件后，您可以将其用于 ChatGPT、DeepSeek、Perplexity、Gemini、Gemma、Llama、Grok 等生成式 AI 工具。\n\n### Docker 使用 🐳\n\n您也可以通过 Docker 运行 Repomix。这在您希望在一个隔离的环境中运行 Repomix，或者更倾向于使用容器时非常有用。\n\n基本用法（当前目录）：\n\n```bash\ndocker run -v .:\u002Fapp -it --rm ghcr.io\u002Fyamadashy\u002Frepomix\n```\n\n打包特定目录：\n\n```bash\ndocker run -v .:\u002Fapp -it --rm ghcr.io\u002Fyamadashy\u002Frepomix path\u002Fto\u002Fdirectory\n```\n\n处理远程仓库并将输出保存到 `output` 目录：\n\n```bash\ndocker run -v .\u002Foutput:\u002Fapp -it --rm ghcr.io\u002Fyamadashy\u002Frepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\n```\n\n### 提示示例\n\n使用 Repomix 生成打包文件后，您可以将其与 ChatGPT、DeepSeek、Perplexity、Gemini、Gemma、Llama、Grok 等 AI 工具一起使用。\n以下是一些示例提示，帮助您入门：\n\n#### 代码审查与重构\n\n进行全面的代码审查并获取重构建议：\n\n```\n此文件包含我的整个代码库。请审查整体结构，并针对可维护性和可扩展性提出改进建议或重构机会。\n```\n\n#### 文档生成\n\n生成项目文档：\n\n```\n根据此文件中的代码库，请生成一份详细的 README.md 文件，包括项目概述、主要功能、设置说明和使用示例。\n```\n\n#### 测试用例生成\n\n生成测试用例：\n\n```\n分析此文件中的代码，为主要函数和类建议一套全面的单元测试。请包含边界情况和潜在的错误场景。\n```\n\n#### 代码质量评估\n\n评估代码质量和对最佳实践的遵循情况：\n\n```\n审查代码库是否符合编码最佳实践和行业标准。找出在可读性、可维护性和效率方面可以改进的地方。建议具体的更改，使代码更符合最佳实践。\n```\n\n#### 库概览\n\n获取库的高层次理解\n\n```\n此文件包含了整个库的代码库。请提供该库的全面概述，包括其主要用途、关键特性以及整体架构。\n```\n\n您可以根据自己的具体需求和所使用的 AI 工具的功能，自由修改这些提示。\n\n### 社区讨论\n\n查看我们的 [社区讨论](https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fdiscussions\u002F154)，用户们在这里分享：\n\n- 他们正在使用哪些 AI 工具与 Repomix 配合\n- 他们发现的有效提示\n- Repomix 如何帮助了他们\n- 充分利用 AI 代码分析的技巧和窍门\n\n欢迎加入讨论并分享您的经验！您的见解可以帮助其他人更好地使用 Repomix。\n\n### 输出文件格式\n\nRepomix 会生成一个单一文件，其中不同部分的代码库之间有清晰的分隔符。\n为了增强 AI 的理解能力，输出文件以面向 AI 的说明开头，使 AI 模型更容易理解打包仓库的上下文和结构。\n\n#### XML 格式（默认）\n\nXML 格式以层次化的方式组织内容：\n\n```xml\n此文件是整个代码库的合并表示，将所有仓库文件整合为一个文档。\n\n\u003Cfile_summary>\n  （元数据和 AI 使用说明）\n\u003C\u002Ffile_summary>\n\n\u003Cdirectory_structure>\nsrc\u002F\ncli\u002F\ncliOutput.ts\nindex.ts\n\n（...剩余目录）\n\u003C\u002Fdirectory_structure>\n\n\u003Cfiles>\n\u003Cfile path=\"src\u002Findex.js\">\n  \u002F\u002F 文件内容在此处\n\u003C\u002Ffile>\n\n（...剩余文件）\n\u003C\u002Ffiles>\n\n\u003Cinstruction>\n（来自 `output.instructionFilePath` 的自定义指令）\n\u003C\u002Finstruction>\n```\n\n对于那些对 XML 标签在 AI 场景中的潜力感兴趣的人：  \nhttps:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fbuild-with-claude\u002Fprompt-engineering\u002Fuse-xml-tags\n\n> 当您的提示涉及多个组件，如上下文、指令和示例时，XML 标签可能会带来重大改变。它们有助于 Claude 更准确地解析您的提示，从而产生更高质量的输出。\n\n这意味着，Repomix 生成的 XML 输出不仅是一种不同的格式，而且可能是一种更有效的方式，将您的代码库输入到 AI 系统中，用于分析、代码审查或其他任务。\n\n#### Markdown 格式\n\n要以 Markdown 格式生成输出，请使用 `--style markdown` 选项：\n\n```bash\nrepomix --style markdown\n```\n\nMarkdown 格式以层次化的方式组织内容：\n\n````markdown\n此文件是整个代码库的合并表示，将所有仓库文件整合为一个文档。\n\n# 文件摘要\n\n（元数据和 AI 使用说明）\n\n# 仓库结构\n\n```\nsrc\u002F\n  cli\u002F\n    cliOutput.ts\n    index.ts\n```\n\n（...剩余目录）\n\n# 仓库文件\n\n## 文件：src\u002Findex.js\n\n```\n\u002F\u002F 文件内容在此处\n```\n\n（...剩余文件）\n\n# 指令\n\n（来自 `output.instructionFilePath` 的自定义指令）\n````\n\n这种格式提供了清晰、易读的结构，既便于人类阅读，也易于 AI 系统解析。\n\n#### JSON 格式\n\n要以 JSON 格式生成输出，请使用 `--style json` 选项：\n\n```bash\nrepomix --style json\n```\n\nJSON 格式以驼峰命名法的属性名将内容组织成一个层次化的 JSON 对象：\n\n```json\n{\n  \"fileSummary\": {\n    \"generationHeader\": \"此文件是整个代码库的合并表示，由 Repomix 整合为一个文档。\",\n    \"purpose\": \"此文件包含整个仓库内容的打包表示...\",\n    \"fileFormat\": \"内容按如下方式组织...\",\n    \"usageGuidelines\": \"- 此文件应被视为只读...\",\n    \"notes\": \"- 一些文件可能已根据 .gitignore、.ignore 和 .repomixignore 规则被排除...\"\n  },\n  \"userProvidedHeader\": \"如果指定了自定义头部文本\",\n  \"directoryStructure\": \"src\u002F\\n  cli\u002F\\n    cliOutput.ts\\n    index.ts\\n  config\u002F\\n    configLoader.ts\",\n  \"files\": {\n    \"src\u002Findex.js\": \"\u002F\u002F 文件内容在此处\",\n    \"src\u002Futils.js\": \"\u002F\u002F 文件内容在此处\"\n  },\n  \"instruction\": \"来自 instructionFilePath 的自定义指令\"\n}\n```\n\n此格式非常适合：\n- **程序化处理**：易于使用 JSON 库解析和操作\n- **API 集成**：可直接被 Web 服务和应用程序消费\n- **AI 工具兼容性**：适合机器学习和 AI 系统的结构化格式\n- **数据分析**：使用 `jq` 等工具轻松提取特定信息\n\n##### 使用 `jq` 处理 JSON 输出\n\nJSON 格式使得以编程方式提取特定信息变得非常容易：\n\n```bash\n# 列出所有文件路径\ncat repomix-output.json | jq -r '.files | keys[]'\n\n# 统计总文件数\ncat repomix-output.json | jq '.files | keys | length'\n\n# 提取特定文件内容\ncat repomix-output.json | jq -r '.files[\"README.md\"]'\ncat repomix-output.json | jq -r '.files[\"src\u002Findex.js\"]'\n\n# 按扩展名查找文件\ncat repomix-output.json | jq -r '.files | keys[] | select(endswith(\".ts\"))'\n\n# 查找包含特定文本的文件\ncat repomix-output.json | jq -r '.files | to_entries[] | select(.value | contains(\"function\")) | .key'\n\n# 提取目录结构\ncat repomix-output.json | jq -r '.directoryStructure'\n\n# 获取文件摘要信息\ncat repomix-output.json | jq '.fileSummary.purpose'\ncat repomix-output.json | jq -r '.fileSummary.generationHeader'\n\n# 提取用户提供的头部（如果存在）\ncat repomix-output.json | jq -r '.userProvidedHeader \u002F\u002F \"没有提供头部\"'\n\n# 创建包含文件大小的文件列表\ncat repomix-output.json | jq -r '.files | to_entries[] | \"\\(.key): \\(.value | length) characters\"'\n```\n\n#### 纯文本格式\n\n要以纯文本格式生成输出，请使用 `--style plain` 选项：\n\n```bash\nrepomix --style plain\n```\n\n```text\n此文件是整个代码库的合并表示，将所有仓库文件整合为一个文档。\n\n================================================================\n文件摘要\n================================================================\n（元数据和 AI 使用说明）\n\n================================================================\n目录结构\n================================================================\nsrc\u002F\n  cli\u002F\n    cliOutput.ts\n    index.ts\n  config\u002F\n    configLoader.ts\n\n(...剩余目录)\n\n================================================================\n文件\n================================================================\n\n================\n文件：src\u002Findex.js\n================\n\u002F\u002F 文件内容在此处\n\n================\n文件：src\u002Futils.js\n================\n\u002F\u002F 文件内容在此处\n\n(...剩余文件)\n\n================================================================\n指令\n================================================================\n（来自 `output.instructionFilePath` 的自定义指令）\n```\n\n### 命令行选项\n\n#### 基本选项\n- `-v, --version`：显示版本信息并退出\n\n#### CLI 输入\u002F输出选项\n\n| 选项 | 描述 |\n|--------|-------------|\n| `--verbose` | 启用详细的调试日志记录（显示文件处理、令牌计数和配置详情） |\n| `--quiet` | 抑制除错误以外的所有控制台输出（适用于脚本编写） |\n| `--stdout` | 将打包后的输出直接写入标准输出，而不是文件（抑制所有日志记录） |\n| `--stdin` | 从标准输入读取文件路径，每行一个（指定的文件会直接被处理） |\n| `--copy` | 处理完成后将生成的输出复制到系统剪贴板 |\n| `--token-count-tree [threshold]` | 显示带有令牌计数的文件树；可选阈值用于仅显示包含 ≥N 个令牌的文件（例如，`--token-count-tree 100`） |\n| `--top-files-len \u003Cnumber>` | 在摘要中显示的最大文件数量（默认：5） |\n\n#### Repomix 输出选项\n\n| 选项 | 描述 |\n|--------|-------------|\n| `-o, --output \u003Cfile>` | 输出文件路径（默认：`repomix-output.xml`，使用`-`表示标准输出） |\n| `--style \u003Cstyle>` | 输出格式：`xml`、`markdown`、`json` 或 `plain`（默认：`xml`） |\n| `--parsable-style` | 转义特殊字符以确保有效的 XML\u002FMarkdown（当输出包含破坏格式的代码时需要） |\n| `--compress` | 使用 Tree-sitter 解析提取核心代码结构（类、函数、接口等） |\n| `--output-show-line-numbers` | 在输出中每行前添加行号 |\n| `--no-file-summary` | 从输出中省略文件摘要部分 |\n| `--no-directory-structure` | 从输出中省略目录树可视化 |\n| `--no-files` | 仅生成元数据而不包含文件内容（适用于仓库分析） |\n| `--remove-comments` | 在打包前移除所有代码注释 |\n| `--remove-empty-lines` | 移除所有文件中的空行 |\n| `--truncate-base64` | 截断过长的 base64 数据字符串以减小输出大小 |\n| `--header-text \u003Ctext>` | 自定义文本，包含在输出开头 |\n| `--instruction-file-path \u003Cpath>` | 包含自定义指令的文件路径，将这些指令加入输出 |\n| `--split-output \u003Csize>` | 将输出拆分为多个编号文件（例如，`repomix-output.1.xml`）；大小如 `500kb`、`2mb` 或 `1.5mb` |\n| `--include-empty-directories` | 在目录结构中包含没有文件的文件夹 |\n| `--include-full-directory-structure` | 在输出中显示完整的目录树，包括未被 `--include` 模式匹配的文件 |\n| `--no-git-sort-by-changes` | 不按 Git 更改频率排序文件（默认：更改最多的文件排在前面） |\n| `--include-diffs` | 添加 Git 差异部分，显示工作树和暂存更改 |\n| `--include-logs` | 添加 Git 提交历史，包括提交信息和更改的文件 |\n| `--include-logs-count \u003Ccount>` | 使用 `--include-logs` 时包含的最近提交次数（默认：50） |\n\n#### 文件选择选项\n\n| 选项 | 描述 |\n|--------|-------------|\n| `--include \u003Cpatterns>` | 仅包含匹配这些 glob 模式的文件（逗号分隔，例如 `\"src\u002F**\u002F*.js,*.md\"`） |\n| `-i, --ignore \u003Cpatterns>` | 额外的排除模式（逗号分隔，例如 `\"*.test.js,docs\u002F**\"`） |\n| `--no-gitignore` | 不使用 `.gitignore` 规则来过滤文件 |\n| `--no-dot-ignore` | 不使用 `.ignore` 规则来过滤文件 |\n| `--no-default-patterns` | 不应用内置的忽略模式（`node_modules`、`.git`、构建目录等） |\n\n#### 远程仓库选项\n\n| 选项 | 描述 |\n|--------|-------------|\n| `--remote \u003Curl>` | 克隆并打包远程仓库（GitHub URL 或 `user\u002Frepo` 格式） |\n| `--remote-branch \u003Cname>` | 特定分支、标签或提交（默认：仓库的默认分支） |\n| `--remote-trust-config` | 信任并加载来自远程仓库的配置文件（出于安全考虑，默认关闭） |\n\n#### 配置选项\n\n| 选项 | 描述 |\n|--------|-------------|\n| `-c, --config \u003Cpath>` | 使用自定义配置文件，而非 `repomix.config.json` |\n| `--init` | 创建一个新的带有默认设置的 `repomix.config.json` 文件 |\n| `--global` | 使用 `--init` 时，在主目录而非当前目录创建配置文件 |\n\n#### 安全选项\n- `--no-security-check`：跳过对敏感数据（如 API 密钥和密码）的扫描\n\n#### 令牌计数选项\n- `--token-count-encoding \u003Cencoding>`：用于计数的分词器模型：o200k_base（GPT-4o）、cl100k_base（GPT-3.5\u002F4）等（默认：o200k_base）\n\n#### MCP\n- `--mcp`：作为模型上下文协议服务器运行，用于 AI 工具集成\n\n#### 代理技能生成\n\n| 选项 | 描述 |\n|--------|-------------|\n| `--skill-generate [name]` | 生成 Claude 代理技能格式的输出，保存到 `.claude\u002Fskills\u002F\u003Cname>\u002F` 目录（若省略名称，则自动生成） |\n| `--skill-output \u003Cpath>` | 直接指定技能输出目录路径（跳过位置提示） |\n| `-f, --force` | 跳过所有确认提示（例如，覆盖技能目录） |\n\n#### 示例\n\n```bash\n# 基本用法\nrepomix\n\n# 自定义输出\nrepomix -o output.xml --style xml\n\n# 输出到标准输出\nrepomix --stdout > custom-output.txt\n\n# 将输出发送到标准输出，然后通过管道传递给另一个命令（例如 simonw\u002Fllm）\nrepomix --stdout | llm \"请解释这段代码的作用。\"\n\n# 自定义输出并压缩\nrepomix --compress\n\n# 处理特定文件\nrepomix --include \"src\u002F**\u002F*.ts\" --ignore \"**\u002F*.test.ts\"\n\n# 将输出拆分为多个文件（每个部分的最大大小）\nrepomix --split-output 20mb\n\n# 远程仓库及分支\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\u002Ftree\u002Fmain\n\n# 远程仓库与提交\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\u002Fcommit\u002F836abcd7335137228ad77feb28655d85712680f1\n\n# 远程仓库与简写\nrepomix --remote user\u002Frepo\n```\n\n### 更新 Repomix\n\n要更新全局安装的 Repomix：\n\n```bash\n# 使用 npm\nnpm update -g repomix\n\n# 使用 yarn\nyarn global upgrade repomix\n\n# 使用 bun\nbun update -g repomix\n```\n\n通常使用 `npx repomix` 更为方便，因为它始终使用最新版本。\n\n### 远程仓库处理\n\nRepomix 支持无需手动克隆即可处理远程 Git 仓库。此功能允许您通过一条命令快速分析任何公开的 Git 仓库。\n\n要处理远程仓库，请使用 `--remote` 选项并后接仓库 URL：\n\n```bash\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\n```\n\n您也可以使用 GitHub 的简写格式：\n\n```bash\nrepomix --remote yamadashy\u002Frepomix\n```\n\n您可以指定分支名称、标签或提交哈希值：\n\n```bash\n# 使用 --remote-branch 选项\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix --remote-branch main\n\n# 使用分支的 URL\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Ftree\u002Fmain\n```\n\n或者使用特定的提交哈希值：\n\n```bash\n# 使用 --remote-branch 选项\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix --remote-branch 935b695\n\n# 使用提交的 URL\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fcommit\u002F836abcd7335137228ad77feb28655d85712680f1\n```\n\n> [!NOTE]\n> 出于安全考虑，远程仓库中的配置文件（`repomix.config.*`）默认不会被加载。这可以防止不受信任的仓库通过配置文件执行代码。您的全局配置和 CLI 选项仍然会生效。若要信任远程仓库的配置文件，请使用 `--remote-trust-config` 或设置 `REPOMIX_REMOTE_TRUST_CONFIG=true`。\n>\n> 当结合 `--config` 和 `--remote` 使用时，需要提供绝对路径（例如：`--config \u002Fhome\u002Fuser\u002Frepomix.config.json`）。\n\n### 代码压缩\n\n`--compress` 选项利用 [Tree-sitter](https:\u002F\u002Fgithub.com\u002Ftree-sitter\u002Ftree-sitter) 实现智能代码提取，专注于关键函数和类的签名，同时移除实现细节。这有助于减少 token 数量，同时保留重要的结构信息。\n\n```bash\nrepomix --compress\n```\n\n例如，以下代码：\n\n```typescript\nimport { ShoppingItem } from '.\u002Fshopping-item';\n\n\u002F**\n * 计算购物商品的总价\n *\u002F\nconst calculateTotal = (\n  items: ShoppingItem[]\n) => {\n  let total = 0;\n  for (const item of items) {\n    total += item.price * item.quantity;\n  }\n  return total;\n}\n\n\u002F\u002F 购物商品接口\ninterface Item {\n  name: string;\n  price: number;\n  quantity: number;\n}\n```\n\n将被压缩为：\n\n```typescript\nimport { ShoppingItem } from '.\u002Fshopping-item';\n⋮----\n\u002F**\n * 计算购物商品的总价\n *\u002F\nconst calculateTotal = (\n  items: ShoppingItem[]\n) => {\n⋮----\n\u002F\u002F 购物商品接口\ninterface Item {\n  name: string;\n  price: number;\n  quantity: number;\n}\n```\n\n> [!NOTE]\n> 这是一个实验性功能，我们将根据用户反馈和实际使用情况持续改进。\n\n### Token 数优化\n\n了解代码库中 token 的分布对于优化 AI 交互至关重要。使用 `--token-count-tree` 选项可视化项目中各部分的 token 使用情况：\n\n```bash\nrepomix --token-count-tree\n```\n\n这将显示一个包含 token 数量的代码库层级视图：\n\n```\n🔢 Token Count Tree:\n────────────────────\n└── src\u002F (70,925 tokens)\n    ├── cli\u002F (12,714 tokens)\n    │   ├── actions\u002F (7,546 tokens)\n    │   └── reporters\u002F (990 tokens)\n    └── core\u002F (41,600 tokens)\n        ├── file\u002F (10,098 tokens)\n        └── output\u002F (5,808 tokens)\n```\n\n您还可以设置最小 token 阈值，以重点关注较大的文件：\n\n```bash\nrepomix --token-count-tree 1000  # 只显示 1000+ tokens 的文件\u002F目录\n```\n\n这有助于您：\n- **识别 token 较多的文件**，这些文件可能会超出 AI 上下文限制\n- **优化文件选择**，使用 `--include` 和 `--ignore` 模式\n- **规划压缩策略**，针对最大的贡献者\n- **平衡内容与上下文**，在准备代码进行 AI 分析时\n\n### 大型代码库的输出分割\n\n当处理大型代码库时，打包后的输出可能会超过某些 AI 工具对文件大小的限制（例如，Google AI Studio 的 1MB 限制）。使用 `--split-output` 可自动将输出拆分为多个文件：\n\n```bash\nrepomix --split-output 1mb\n```\n\n这将生成编号文件，如：\n- `repomix-output.1.xml`\n- `repomix-output.2.xml`\n- `repomix-output.3.xml`\n\n可以使用单位指定大小：`500kb`、`1mb`、`2mb`、`1.5mb` 等。支持小数。\n\n> [!NOTE]\n> 文件按顶级目录分组，以保持上下文一致性。单个文件或目录绝不会被拆分到多个输出文件中。\n\n### MCP 服务器集成\n\nRepomix 支持 [模型上下文协议 (MCP)](https:\u002F\u002Fmodelcontextprotocol.io)，允许 AI 助手直接与您的代码库交互。作为 MCP 服务器运行时，Repomix 提供工具，使 AI 助手能够打包本地或远程仓库以进行分析，而无需手动准备文件。\n\n```bash\nrepomix --mcp\n```\n\n#### 配置 MCP 服务器\n\n要将 Repomix 用作与 Claude 等 AI 助手兼容的 MCP 服务器，您需要配置 MCP 设置：\n\n**适用于 VS Code：**\n\n您可以通过以下方法之一在 VS Code 中安装 Repomix MCP 服务器：\n\n1. **使用安装徽章：**\n\n  [![在 VS Code 中安装](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVS_Code-Install_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https:\u002F\u002Finsiders.vscode.dev\u002Fredirect\u002Fmcp\u002Finstall?name=repomix&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22repomix%22%2C%22--mcp%22%5D%7D)\n  [![在 VS Code Insiders 中安装](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVS_Code_Insiders-Install_Server-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https:\u002F\u002Finsiders.vscode.dev\u002Fredirect\u002Fmcp\u002Finstall?name=repomix&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22repomix%22%2C%22--mcp%22%5D%7D&quality=insiders)\n\n2. **使用命令行：**\n\n  ```bash\n  code --add-mcp '{\"name\":\"repomix\",\"command\":\"npx\",\"args\":[\"-y\",\"repomix\",\"--mcp\"]}'\n  ```\n\n  对于 VS Code Insiders：\n  ```bash\n  code-insiders --add-mcp '{\"name\":\"repomix\",\"command\":\"npx\",\"args\":[\"-y\",\"repomix\",\"--mcp\"]}'\n  ```\n\n**适用于 Cline（VS Code 扩展）：**\n\n编辑 `cline_mcp_settings.json` 文件：\n```json\n{\n  \"mcpServers\": {\n    \"repomix\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\",\n        \"repomix\",\n        \"--mcp\"\n      ]\n    }\n  }\n}\n```\n\n**适用于 Cursor：**\n\n在 Cursor 中，从 `Cursor Settings` > `MCP` > `+ Add new global MCP server` 添加一个新的 MCP 服务器，配置与 Cline 类似。\n\n**适用于 Claude Desktop：**\n\n编辑 `claude_desktop_config.json` 文件，配置与 Cline 的配置类似。\n\n**适用于 Claude Code：**\n\n要在 [Claude Code](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fclaude-code\u002Foverview) 中将 Repomix 配置为 MCP 服务器，请使用以下命令：\n\n```bash\nclaude mcp add repomix -- npx -y repomix --mcp\n```\n\n或者，您也可以使用官方的 Repomix 插件（请参阅下方的 [Claude Code 插件](#claude-code-plugins) 部分）。\n\n**使用 Docker 替代 npx：**\n\n您可以使用 Docker 作为替代方案，以运行 Repomix 作为 MCP 服务器：\n\n```json\n{\n  \"mcpServers\": {\n    \"repomix-docker\": {\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\",\n        \"-i\",\n        \"--rm\",\n        \"ghcr.io\u002Fyamadashy\u002Frepomix\",\n        \"--mcp\"\n      ]\n    }\n  }\n}\n```\n\n配置完成后，您的 AI 助手可以直接利用 Repomix 的功能来分析代码库，而无需手动准备文件，从而提高代码分析工作流的效率。\n\n#### 可用的 MCP 工具\n\n当作为 MCP 服务器运行时，Repomix 提供以下工具：\n\n1. **pack_codebase**：将本地代码目录打包成一个整合的 XML 文件，用于 AI 分析  \n   - 参数：  \n     - `directory`：要打包的目录的绝对路径  \n     - `compress`：（可选，默认：false）启用 Tree-sitter 压缩，提取核心代码签名和结构，同时移除实现细节。这可将 token 使用量减少约 70%，同时保留语义含义。通常情况下不需要此功能，因为 `grep_repomix_output` 支持增量内容检索。仅在需要完整代码库内容的大规模仓库中才使用此选项。  \n     - `includePatterns`：（可选）使用 fast-glob 模式指定要包含的文件。多个模式可用逗号分隔（例如：“**\u002F*.{js,ts}”、“src\u002F**,docs\u002F**”）。只有匹配的文件会被处理。  \n     - `ignorePatterns`：（可选）使用 fast-glob 模式指定要排除的额外文件。多个模式可用逗号分隔（例如：“test\u002F**,*.spec.js”、“node_modules\u002F**,dist\u002F**”）。这些模式会补充 `.gitignore`、`.ignore` 和内置的排除规则。  \n     - `topFilesLength`：（可选，默认：10）在代码库分析的指标摘要中显示按大小排列的前若干个最大文件。\n\n2. **attach_packed_output**：附加现有的 Repomix 打包输出文件，用于 AI 分析  \n   - 参数：  \n     - `path`：包含 `repomix-output.xml` 文件的目录路径，或直接指向打包后的仓库 XML 文件的路径  \n     - `topFilesLength`：（可选，默认：10）在指标摘要中显示按大小排列的前若干个最大文件  \n   - 特点：  \n     - 接受包含 `repomix-output.xml` 文件的目录，或直接指向 XML 文件的路径  \n     - 将文件注册到 MCP 服务器，并返回与 `pack_codebase` 工具相同的结构  \n     - 提供对现有打包输出的安全访问，无需重新处理  \n     - 适用于处理先前生成的打包仓库。\n\n3. **pack_remote_repository**：从 GitHub 获取、克隆并打包一个仓库，生成用于 AI 分析的整合 XML 文件  \n   - 参数：  \n     - `remote`：GitHub 仓库的 URL 或用户\u002F仓库格式（例如：“yamadashy\u002Frepomix”、“https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo”或“https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\u002Ftree\u002Fbranch”）  \n     - `compress`：（可选，默认：false）启用 Tree-sitter 压缩，提取核心代码签名和结构，同时移除实现细节。这可将 token 使用量减少约 70%，同时保留语义含义。通常情况下不需要此功能，因为 `grep_repomix_output` 支持增量内容检索。仅在需要完整代码库内容的大规模仓库中才使用此选项。  \n     - `includePatterns`：（可选）使用 fast-glob 模式指定要包含的文件。多个模式可用逗号分隔（例如：“**\u002F*.{js,ts}”、“src\u002F**,docs\u002F**”）。只有匹配的文件会被处理。  \n     - `ignorePatterns`：（可选）使用 fast-glob 模式指定要排除的额外文件。多个模式可用逗号分隔（例如：“test\u002F**,*.spec.js”、“node_modules\u002F**,dist\u002F**”）。这些模式会补充 `.gitignore`、`.ignore` 和内置的排除规则。  \n     - `topFilesLength`：（可选，默认：10）在代码库分析的指标摘要中显示按大小排列的前若干个最大文件。\n\n4. **read_repomix_output**：读取 Repomix 生成的输出文件内容。支持对大文件按行范围进行部分读取。  \n   - 参数：  \n     - `outputId`：要读取的 Repomix 输出文件 ID  \n     - `startLine`：（可选）起始行号（从 1 开始，包括该行）。未指定时从开头开始读取。  \n     - `endLine`：（可选）结束行号（从 1 开始，包括该行）。未指定时读取到文件末尾。  \n   - 特点：  \n     - 专为基于 Web 的环境或沙盒应用设计  \n     - 使用文件 ID 检索先前生成的输出内容  \n     - 提供对打包代码库的安全访问，无需文件系统权限  \n     - 支持对大文件的部分读取。\n\n5. **grep_repomix_output**：使用类似 grep 的功能，在 Repomix 输出文件中搜索模式，采用 JavaScript RegExp 语法  \n   - 参数：  \n     - `outputId`：要搜索的 Repomix 输出文件 ID  \n     - `pattern`：搜索模式（JavaScript RegExp 正则表达式语法）  \n     - `contextLines`：（可选，默认：0）在每个匹配结果前后显示的上下文行数。如果指定了 `beforeLines` 或 `afterLines`，则优先使用这些值。  \n     - `beforeLines`：（可选）在每个匹配结果之前显示的上下文行数（类似于 grep -B）。优先于 `contextLines`。  \n     - `afterLines`：（可选）在每个匹配结果之后显示的上下文行数（类似于 grep -A）。优先于 `contextLines`。  \n     - `ignoreCase`：（可选，默认：false）执行不区分大小写的匹配。  \n   - 特点：  \n     - 使用 JavaScript RegExp 语法实现强大的模式匹配  \n     - 支持上下文行显示，便于理解匹配结果  \n     - 可单独控制匹配前后的上下文行数  \n     - 提供区分大小写和不区分大小写的搜索选项。\n\n6. **file_system_read_file**：使用绝对路径从本地文件系统读取文件。内置安全验证机制，可检测并阻止访问包含敏感信息的文件。  \n   - 参数：  \n     - `path`：要读取的文件的绝对路径  \n   - 安全特性：  \n     - 采用 [Secretlint](https:\u002F\u002Fgithub.com\u002Fsecretlint\u002Fsecretlint) 进行安全验证  \n     - 阻止访问包含敏感信息的文件（如 API 密钥、密码、机密等）  \n     - 验证绝对路径，防止目录遍历攻击。\n\n7. **file_system_read_directory**: 使用绝对路径列出目录内容。返回一个格式化的列表，显示文件和子目录，并带有清晰的标识。\n  - 参数：\n    - `path`: 要列出的目录的绝对路径\n  - 特点：\n    - 以清晰的标识（`[FILE]` 或 `[DIR]`）显示文件和目录\n    - 提供安全的目录遍历功能，并进行适当的错误处理\n    - 验证路径是否为绝对路径\n    - 有助于探索项目结构和理解代码库组织\n\n\n\n### Claude Code 插件\n\nRepomix 为 [Claude Code](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fclaude-code\u002Foverview) 提供了官方插件，可与 AI 驱动的开发环境无缝集成。\n\n#### 安装\n\n**1. 添加 Repomix 插件市场：**\n\n```text\n\u002Fplugin marketplace add yamadashy\u002Frepomix\n```\n\n**2. 安装插件：**\n\n```text\n# 安装 MCP 服务器插件（推荐的基础插件）\n\u002Fplugin install repomix-mcp@repomix\n\n# 安装命令插件（扩展功能）\n\u002Fplugin install repomix-commands@repomix\n\n# 安装仓库探索插件（AI 驱动的分析）\n\u002Fplugin install repomix-explorer@repomix\n```\n\n**注意**：推荐将 `repomix-mcp` 插件作为基础。`repomix-commands` 插件提供便捷的斜杠命令，而 `repomix-explorer` 则增加了 AI 驱动的分析能力。虽然可以单独安装，但同时使用这三款插件能带来最全面的体验。\n\n**或者，使用交互式插件安装程序：**\n\n```text\n\u002Fplugin\n```\n\n这将打开一个交互式界面，您可以在其中浏览并安装可用的插件。\n\n#### 可用插件\n\n**1. repomix-mcp**（MCP 服务器插件）\n\n基础插件，通过 MCP 服务器集成提供 AI 驱动的代码库分析功能。\n\n**特点：**\n- 打包本地和远程仓库\n- 搜索打包后的结果\n- 在内置安全扫描（Secretlint）下读取文件\n- 自动 Tree-sitter 压缩（约减少 70% 的标记数量）\n\n**2. repomix-commands**（斜杠命令插件）\n\n提供便捷的斜杠命令，支持自然语言，方便快速操作。\n\n**可用命令：**\n- `\u002Frepomix-commands:pack-local` - 以多种选项打包本地代码库\n- `\u002Frepomix-commands:pack-remote` - 打包并分析远程 GitHub 仓库\n\n**示例用法：**\n```text\n\u002Frepomix-commands:pack-local\n将该项目打包成带压缩的 Markdown 格式\n\n\u002Frepomix-commands:pack-remote yamadashy\u002Frepomix\n仅打包 yamadashy\u002Frepomix 仓库中的 TypeScript 文件\n```\n\n**3. repomix-explorer**（AI 分析代理插件）\n\nAI 驱动的仓库分析代理，利用 Repomix CLI 智能地探索代码库。\n\n**特点：**\n- 以自然语言进行代码库探索和分析\n- 智能发现模式并理解代码结构\n- 使用 grep 和有针对性的文件读取进行增量分析\n- 自动管理大型仓库的上下文\n\n**可用命令：**\n- `\u002Frepomix-explorer:explore-local` - 在 AI 协助下分析本地代码库\n- `\u002Frepomix-explorer:explore-remote` - 在 AI 协助下分析远程 GitHub 仓库\n\n**示例用法：**\n```text\n\u002Frepomix-explorer:explore-local .\u002Fsrc\n查找所有与身份验证相关的代码\n\n\u002Frepomix-explorer:explore-remote facebook\u002Freact\n向我展示主要的组件架构\n```\n\n该代理会自动执行以下步骤：\n1. 运行 `npx repomix@latest` 来打包仓库\n2. 使用 Grep 和 Read 工具高效搜索打包结果\n3. 提供全面的分析，而不会消耗过多的上下文\n\n#### 优势\n- **无缝集成**：Claude 可直接分析代码库，无需手动准备\n- **自然语言**：使用对话式的命令，无需记忆 CLI 语法\n- **始终最新**：自动使用 `npx repomix@latest` 获取最新功能\n- **内置安全性**：自动 Secretlint 扫描防止敏感数据泄露\n- **优化标记数**：Tree-sitter 压缩适用于大型代码库\n\n更多详情，请参阅 `.claude\u002Fplugins\u002F` 目录下的插件文档。\n\n### 代理技能生成\n\nRepomix 可以生成 [Claude 代理技能](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fclaude-code\u002Fskills) 格式的输出，创建一个结构化的 Skills 目录，可用作 AI 助手的可重用代码库参考。此功能在需要引用远程仓库中的实现时尤为强大。\n\n#### 基本用法\n\n```bash\n# 从本地目录生成 Skills\nrepomix --skill-generate\n\n# 生成自定义 Skills 名称\nrepomix --skill-generate my-project-reference\n\n# 从远程仓库生成\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo --skill-generate\n```\n\n运行命令时，Repomix 会提示您选择保存 Skills 的位置：\n\n1. **个人 Skills** (`~\u002F.claude\u002Fskills\u002F`) - 在您机器上的所有项目中均可使用\n2. **项目 Skills** (`.claude\u002Fskills\u002F`) - 可通过 git 与团队共享\n\n#### 非交互式用法\n\n对于 CI 流水线和自动化脚本，您可以使用 `--skill-output` 和 `--force` 跳过所有交互式提示：\n\n```bash\n# 直接指定输出目录\nrepomix --skill-generate --skill-output .\u002Fmy-skills\n\n# 使用 --force 跳过覆盖确认\nrepomix --skill-generate --skill-output .\u002Fmy-skills --force\n\n# 完整的非交互式示例\nrepomix --remote user\u002Frepo --skill-generate my-skill --skill-output .\u002Foutput --force\n```\n\n#### 生成的结构\n\nSkills 以如下结构生成：\n\n```text\n.claude\u002Fskills\u002F\u003Cskill-name>\u002F\n├── SKILL.md                 # 主要的 Skills 元数据及文档\n└── references\u002F\n    ├── summary.md           # 目的、格式和统计信息\n    ├── project-structure.md # 包含行数的目录树\n    ├── files.md             # 所有文件内容（便于 grep 搜索）\n    └── tech-stacks.md       # 使用的语言、框架和依赖项\n```\n\n#### 包含的内容\n- **SKILL.md**：包含 Skills 元数据、文件\u002F行\u002F标记数量、概述以及使用说明\n- **summary.md**：解释 Skills 的目的、使用指南，并按文件类型和语言提供统计分解\n- **project-structure.md**：包含每文件行数的目录树，便于快速查找文件\n- **files.md**：所有文件内容，带有语法高亮标题，优化以便于 grep 搜索\n- **tech-stacks.md**：根据依赖文件（`package.json`、`requirements.txt`、`Cargo.toml` 等）自动检测每个包的技术栈\n\n#### 自动生成 Skills 名称\n如果没有提供名称，Repomix 会自动生成一个：\n\n```bash\nrepomix src\u002F --skill-generate                # → repomix-reference-src\nrepomix --remote user\u002Frepo --skill-generate  # → repomix-reference-repo\nrepomix --skill-generate CustomName          # → custom-name（标准化为 kebab-case）\n```\n\n#### 与 Repomix 功能的集成\n技能生成尊重所有标准的 Repomix 选项：\n\n```bash\n\n# 使用文件过滤生成技能\nrepomix --skill-generate --include \"src\u002F**\u002F*.ts\" --ignore \"**\u002F*.test.ts\"\n\n# 使用压缩生成技能\nrepomix --skill-generate --compress\n\n# 从远程仓库生成技能\nrepomix --remote yamadashy\u002Frepomix --skill-generate\n```\n\n### Repomix Explorer 技能（代理技能）\n\nRepomix 提供了一个开箱即用的 **Repomix Explorer** 技能，使 AI 编码助手能够使用 Repomix CLI 分析和探索代码库。该技能专为与多种 AI 工具配合使用而设计，包括 Claude Code、Cursor、Codex、GitHub Copilot 等。\n\n#### 快速安装\n\n```bash\nnpx add-skill yamadashy\u002Frepomix --skill repomix-explorer\n```\n\n此命令会将该技能安装到你的 AI 助手的技能目录中（例如 `.claude\u002Fskills\u002F`），使其立即可用。\n\n#### 功能简介\n\n安装完成后，你可以通过自然语言指令来分析代码库。\n\n分析远程仓库：\n\n```text\n“这个仓库的结构是怎样的？\nhttps:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact”\n```\n\n探索本地代码库：\n\n```text\n“这个项目里有什么内容？\n~\u002Fprojects\u002Fmy-app”\n```\n\n这不仅有助于理解代码库，还能在需要参考其他仓库实现功能时提供帮助。\n\n## ⚙️ 配置\n\n为了灵活性和易用性，Repomix 支持多种配置文件格式。\n\n### 配置文件格式\n\nRepomix 会按照以下优先级自动查找配置文件：\n\n1. **TypeScript** (`repomix.config.ts`, `repomix.config.mts`, `repomix.config.cts`)\n2. **JavaScript\u002FES 模块** (`repomix.config.js`, `repomix.config.mjs`, `repomix.config.cjs`)\n3. **JSON** (`repomix.config.json5`, `repomix.config.jsonc`, `repomix.config.json`)\n\n#### JSON 配置\n\n在项目根目录下创建一个 `repomix.config.json` 文件：\n\n```bash\nrepomix --init\n```\n\n这将生成一个包含默认设置的 `repomix.config.json` 文件。\n\n#### TypeScript 配置\n\nTypeScript 配置文件提供了最佳的开发体验，支持完整的类型检查和 IDE 支持。\n\n**安装：**\n\n若要使用 TypeScript 或 JavaScript 配置并结合 `defineConfig`，你需要将 Repomix 作为开发依赖项安装：\n\n```bash\nnpm install -D repomix\n```\n\n**示例：**\n\n```typescript\n\u002F\u002F repomix.config.ts\nimport { defineConfig } from 'repomix';\n\nexport default defineConfig({\n  output: {\n    filePath: 'output.xml',\n    style: 'xml',\n    removeComments: true,\n  },\n  ignore: {\n    customPatterns: ['**\u002Fnode_modules\u002F**', '**\u002Fdist\u002F**'],\n  },\n});\n```\n\n**优点：**\n- ✅ 在 IDE 中进行完整的 TypeScript 类型检查\n- ✅ 出色的 IDE 自动补全和 IntelliSense\n- ✅ 可使用动态值（时间戳、环境变量等）\n\n**动态值示例：**\n\n```typescript\n\u002F\u002F repomix.config.ts\nimport { defineConfig } from 'repomix';\n\n\u002F\u002F 生成基于时间戳的文件名\nconst timestamp = new Date().toISOString().slice(0, 19).replace(\u002F[:.]\u002Fg, '-');\n\nexport default defineConfig({\n  output: {\n    filePath: `output-${timestamp}.xml`,\n    style: 'xml',\n  },\n});\n```\n\n#### JavaScript 配置\n\nJavaScript 配置文件的功能与 TypeScript 配置相同，同样支持 `defineConfig` 和动态值。\n\n### 配置选项\n\n以下是配置选项的说明：\n\n| 选项                           | 描述                                                                                                                  | 默认值                |\n|----------------------------------|------------------------------------------------------------------------------------------------------------------------------|------------------------|\n| `input.maxFileSize`              | 要处理的最大文件大小，单位为字节。超过此大小的文件将被跳过                                                | `50000000`            |\n| `output.filePath`                | 输出文件的名称                                                                                                  | `\"repomix-output.xml\"` |\n| `output.style`                   | 输出的格式（`xml`、`markdown`、`json`、`plain`）                                                               | `\"xml\"`                |\n| `output.parsableStyle`           | 是否根据所选的样式模式对输出进行转义。请注意，这可能会增加 token 数量。                                      | `false`                |\n| `output.compress`                | 是否执行智能代码提取以减少 token 数量                                                                         | `false`                |\n| `output.headerText`              | 自定义文本，用于包含在文件头部                                                                                | `null`                 |\n| `output.instructionFilePath`     | 包含详细自定义指令的文件路径                                                                                  | `null`                 |\n| `output.fileSummary`             | 是否在输出开头包含摘要部分                                                                                    | `true`                 |\n| `output.directoryStructure`      | 是否在输出中包含目录结构                                                                                    | `true`                 |\n| `output.files`                   | 是否在输出中包含文件内容                                                                                    | `true`                 |\n| `output.removeComments`          | 是否从支持的文件类型中移除注释                                                                               | `false`                |\n| `output.removeEmptyLines`        | 是否从输出中移除空行                                                                                          | `false`                |\n| `output.showLineNumbers`         | 是否在输出的每一行添加行号                                                                                  | `false`                |\n| `output.truncateBase64`          | 是否截断长的 base64 数据字符串（例如图片），以减少 token 数量                                                | `false`                |\n| `output.copyToClipboard`         | 是否在保存文件的同时，还将输出复制到系统剪贴板                                                                | `false`                |\n| `output.splitOutput`             | 根据每个部分的最大大小（例如 `1000000` 表示约 1MB），将输出拆分为多个带编号的文件。这样可以确保每个文件都小于限制，并避免文件跨部分拆分 | 未设置                |\n| `output.topFilesLength`          | 摘要中要显示的顶级文件数量。如果设置为 0，则不显示摘要                                                       | `5`                    |\n| `output.tokenCountTree`          | 是否显示带有 token 数量摘要的文件树。可以是布尔值或数字（表示最小 token 数量阈值）                           | `false`                |\n| `output.includeEmptyDirectories` | 是否在仓库结构中包含空目录                                                                                    | `false`                |\n| `output.includeFullDirectoryStructure` | 使用 `include` 模式时，是否显示完整的目录树（同时尊重忽略模式），尽管只处理包含的文件。这为 AI 分析提供了完整的仓库上下文 | `false`                |\n| `output.git.sortByChanges`       | 是否按 git 更改次数对文件进行排序（更改次数较多的文件会排在底部）                                             | `true`                 |\n| `output.git.sortByChangesMaxCommits` | 用于分析 git 更改的最大提交次数                                                                             | `100`                  |\n| `output.git.includeDiffs`        | 是否在输出中包含 git 差异（分别包括工作树和暂存区的更改）                                                   | `false`                |\n| `output.git.includeLogs`         | 是否在输出中包含 git 日志（包括提交历史、日期、消息和文件路径）                                              | `false`                |\n| `output.git.includeLogsCount`    | 要包含的 git 日志提交数量                                                                                     | `50`                   |\n| `include`                        | 要包含的文件模式（使用 [glob 模式](https:\u002F\u002Fgithub.com\u002Fmrmlnc\u002Ffast-glob?tab=readme-ov-file#pattern-syntax)）  | `[]`                   |\n| `ignore.useGitignore`            | 是否使用项目 `.gitignore` 文件中的模式                                                                        | `true`                 |\n| `ignore.useDotIgnore`            | 是否使用项目 `.ignore` 文件中的模式                                                                          | `true`                 |\n| `ignore.useDefaultPatterns`      | 是否使用默认的忽略模式                                                                                        | `true`                 |\n| `ignore.customPatterns`          | 额外的忽略模式（使用 [glob 模式](https:\u002F\u002Fgithub.com\u002Fmrmlnc\u002Ffast-glob?tab=readme-ov-file#pattern-syntax)）   | `[]`                   |\n| `security.enableSecurityCheck`   | 是否对文件执行安全检查                                                                                        | `true`                 |\n| `tokenCount.encoding`            | 与 OpenAI 兼容的 tokenization 的编码方式（例如，GPT-4o 使用 `o200k_base`，GPT-4\u002F3.5 使用 `cl100k_base`）。由 [gpt-tokenizer](https:\u002F\u002Fgithub.com\u002Fnicolo-ribaudo\u002Fgpt-tokenizer) 提供支持。 | `\"o200k_base\"`         |\n\n配置文件支持 [JSON5](https:\u002F\u002Fjson5.org\u002F) 语法，该语法允许：\n- 注释（单行和多行）\n- 对象和数组中的尾随逗号\n- 不加引号的属性名\n- 更宽松的字符串语法\n\n### 模式验证\n\n您可以通过添加 `$schema` 属性来为配置文件启用模式验证：\n\n```json\n{\n  \"$schema\": \"https:\u002F\u002Frepomix.com\u002Fschemas\u002Flatest\u002Fschema.json\",\n  \"output\": {\n    \"filePath\": \"repomix-output.xml\",\n    \"style\": \"xml\"\n  }\n}\n```\n\n这将在支持 JSON 模式的编辑器中提供自动补全和验证功能。\n\n### 示例配置\n\n示例配置：\n\n```json5\n{\n  \"$schema\": \"https:\u002F\u002Frepomix.com\u002Fschemas\u002Flatest\u002Fschema.json\",\n  \"input\": {\n    \"maxFileSize\": 50000000\n  },\n  \"output\": {\n    \"filePath\": \"repomix-output.xml\",\n    \"style\": \"xml\",\n    \"parsableStyle\": false,\n    \"compress\": false,\n    \"headerText\": \"打包文件的自定义头部信息。\",\n    \"fileSummary\": true,\n    \"directoryStructure\": true,\n    \"files\": true,\n    \"removeComments\": false,\n    \"removeEmptyLines\": false,\n    \"topFilesLength\": 5,\n    \"tokenCountTree\": false, \u002F\u002F 或 true，或设置一个数字如 10 作为最小标记阈值\n    \"showLineNumbers\": false,\n    \"truncateBase64\": false,\n    \"copyToClipboard\": false,\n    \"splitOutput\": null, \u002F\u002F 或设置一个数字如 1000000 表示每份约 1MB\n    \"includeEmptyDirectories\": false,\n    \"git\": {\n      \"sortByChanges\": true,\n      \"sortByChangesMaxCommits\": 100,\n      \"includeDiffs\": false,\n      \"includeLogs\": false,\n      \"includeLogsCount\": 50\n    }\n  },\n  \"include\": [\"**\u002F*\"],\n  \"ignore\": {\n    \"useGitignore\": true,\n    \"useDefaultPatterns\": true,\n    \u002F\u002F 您也可以在 .repomixignore 文件中指定模式\n    \"customPatterns\": [\n      \"additional-folder\",\n      \"**\u002F*.log\"\n    ],\n  },\n  \"security\": {\n    \"enableSecurityCheck\": true\n  },\n  \"tokenCount\": {\n    \"encoding\": \"o200k_base\"\n  }\n}\n```\n\n### 全局配置\n\n要创建全局配置文件，请运行以下命令：\n\n```bash\nrepomix --init --global\n```\n\n全局配置文件将被创建在以下位置：\n\n- Windows: `%LOCALAPPDATA%\\Repomix\\repomix.config.json`\n- macOS\u002FLinux: `$XDG_CONFIG_HOME\u002Frepomix\u002Frepomix.config.json` 或 `~\u002F.config\u002Frepomix\u002Frepomix.config.json`\n\n注意：如果存在本地配置文件，它将优先于全局配置文件。\n\n### 包含与忽略\n\n#### 包含模式\n\nRepomix 现在支持使用 [glob 模式](https:\u002F\u002Fgithub.com\u002Fmrmlnc\u002Ffast-glob?tab=readme-ov-file#pattern-syntax) 来指定需要包含的文件。这使得文件选择更加灵活和强大：\n\n- 使用 `**\u002F*.js` 可以包含任意目录下的所有 JavaScript 文件。\n- 使用 `src\u002F**\u002F*` 可以包含 `src` 目录及其子目录中的所有文件。\n- 您还可以组合多个模式，例如 `[\"src\u002F**\u002F*.js\", \"**\u002F*.md\"]`，以同时包含 `src` 中的 JavaScript 文件和所有 Markdown 文件。\n\n#### 忽略模式\n\nRepomix 提供了多种方法来设置忽略模式，以便在打包过程中排除特定的文件或目录：\n\n- **.gitignore**：默认情况下，项目中的 `.gitignore` 文件以及 `.git\u002Finfo\u002Fexclude` 中列出的模式会被使用。此行为可以通过 `ignore.useGitignore` 设置或 `--no-gitignore` 命令行选项进行控制。\n- **.ignore**：您可以在项目根目录下使用 `.ignore` 文件，其格式与 `.gitignore` 相同。此类文件通常被 ripgrep 和 silver searcher 等工具所尊重，从而减少维护多个忽略文件的需求。此行为可以通过 `ignore.useDotIgnore` 设置或 `--no-dot-ignore` 命令行选项进行控制。\n- **默认模式**：Repomix 自带一组常用的排除文件和目录列表（例如 node_modules、.git、二进制文件等）。此功能可以通过 `ignore.useDefaultPatterns` 设置或 `--no-default-patterns` 命令行选项进行控制。更多详细信息请参阅 [defaultIgnore.ts](src\u002Fconfig\u002FdefaultIgnore.ts)。\n- **.repomixignore**：您可以在项目根目录下创建 `.repomixignore` 文件，用于定义 Repomix 特有的忽略模式。该文件的格式与 `.gitignore` 相同。\n- **自定义模式**：您还可以通过配置文件中的 `ignore.customPatterns` 选项指定额外的忽略模式。此外，您也可以使用 `-i, --ignore` 命令行选项覆盖此设置。\n\n优先级顺序（从高到低）如下：\n\n1. 自定义模式 (`ignore.customPatterns`)\n2. 忽略文件（`.repomixignore`、`.ignore`、`.gitignore` 和 `.git\u002Finfo\u002Fexclude`）：\n   - 在嵌套目录中，深层目录中的文件具有更高的优先级。\n   - 在同一目录中，这些文件会按任意顺序合并。\n3. 默认模式（如果 `ignore.useDefaultPatterns` 为真且未使用 `--no-default-patterns`）\n\n这种方法允许根据您的项目需求灵活地配置文件排除规则。它有助于优化生成的打包文件大小，确保安全敏感文件和大型二进制文件被排除，同时防止机密信息泄露。\n\n注意：默认情况下，二进制文件不会包含在打包输出中，但它们的路径会在输出文件的“仓库结构”部分列出。这样既提供了完整的仓库结构概览，又保持了打包文件的高效性和文本特性。\n\n### 自定义说明\n\n`output.instructionFilePath` 选项允许您指定一个单独的文件，其中包含关于您项目的详细说明或背景信息。这使 AI 系统能够更好地理解您项目的具体背景和要求，从而可能产生更相关和定制化的分析或建议。\n\n以下是使用此功能的一个示例：\n\n1. 在项目根目录下创建名为 `repomix-instruction.md` 的文件：\n\n```markdown\n# 编码规范\n\n- 遵循 Airbnb JavaScript 风格指南\n- 在适当的情况下，建议将文件拆分为更小、更专注的单元\n- 对不明显的逻辑添加注释。所有文本应使用英语\n- 所有新功能都应附有相应的单元测试\n\n# 生成全面的输出\n\n- 包含所有内容，除非另有说明，否则不得缩写\n- 在保证输出质量的同时，优化对大型代码库的处理\n```\n\n2. 在您的 `repomix.config.json` 中添加 `instructionFilePath` 选项：\n\n```json5\n{\n  \"output\": {\n    \"instructionFilePath\": \"repomix-instruction.md\",\n    \u002F\u002F 其他选项...\n  }\n}\n```\n\n当 Repomix 生成输出时，它会将 `repomix-instruction.md` 的内容插入到专门的部分中。\n\n注意：说明内容会附加在输出文件的末尾。这种放置方式对于 AI 系统尤其有效。Anthropic 在其文档中对此进行了说明：\n\n> 将长篇数据置于顶部：将您的长文档和输入内容（约 20K+ 令牌）放在提示的顶部，位于您的查询、说明和示例之前。这可以显著提升 Claude 在所有模型上的表现。在测试中，将查询放在最后可使响应质量提高多达 30%，尤其是在处理复杂的多文档输入时。\n\n### 注释移除\n\n当 `output.removeComments` 设置为 `true` 时，Repomix 会尝试从支持的文件类型中移除注释。此功能有助于减小输出文件的大小，并专注于代码的核心内容。\n\n支持的语言包括：HTML、CSS、JavaScript、TypeScript、Vue、Svelte、Python、PHP、Ruby、C、C#、Java、Go、Rust、Swift、Kotlin、Dart、Shell 和 YAML。\n\n注意：注释移除过程较为保守，以避免意外移除代码。在复杂情况下，部分注释可能会被保留。\n\n## 🔍 安全检查\n\nRepomix 包含一项安全检查功能，该功能使用 [Secretlint](https:\u002F\u002Fgithub.com\u002Fsecretlint\u002Fsecretlint) 来检测文件中可能包含的敏感信息。此功能可帮助您在共享打包后的仓库之前识别潜在的安全风险。\n\n安全检查结果将在打包过程完成后显示在 CLI 输出中。如果检测到任何可疑文件，您将看到这些文件的列表以及一条警告消息。\n\n示例输出：\n\n```\n🔍 安全检查：\n──────────────────\n检测到 2 个可疑文件：\n1. src\u002Futils\u002Ftest.txt\n2. tests\u002Futils\u002FsecretLintUtils.test.ts\n\n请检查这些文件中是否包含潜在的敏感信息。\n```\n\n默认情况下，Repomix 的安全检查功能是启用的。您可以通过在配置文件中将 `security.enableSecurityCheck` 设置为 `false` 来禁用它：\n\n```json\n{\n  \"security\": {\n    \"enableSecurityCheck\": false\n  }\n}\n```\n\n或者使用命令行选项 `--no-security-check`：\n\n```bash\nrepomix --no-security-check\n```\n\n> [!NOTE]\n> 禁用安全检查可能会暴露敏感信息。请谨慎使用此选项，仅在必要时使用，例如处理包含示例凭据的测试文件或文档时。\n\n## 🤖 使用 Repomix 与 GitHub Actions\n\n您还可以在 GitHub Actions 工作流中使用 Repomix。这对于自动化代码库的打包流程以便进行 AI 分析非常有用。\n\n基本用法：\n\n```yaml\n- name: 使用 Repomix 打包仓库\n  uses: yamadashy\u002Frepomix\u002F.github\u002Factions\u002Frepomix@main\n  with:\n    output: repomix-output.xml\n    style: xml\n```\n\n使用 `--style` 参数生成不同格式的输出：\n\n```yaml\n- name: 使用 Repomix 打包仓库\n  uses: yamadashy\u002Frepomix\u002F.github\u002Factions\u002Frepomix@main\n  with:\n    output: repomix-output.md\n    style: markdown\n```\n\n```yaml\n- name: 使用 Repomix 打包仓库（JSON 格式）\n  uses: yamadashy\u002Frepomix\u002F.github\u002Factions\u002Frepomix@main\n  with:\n    output: repomix-output.json\n    style: json\n```\n\n对特定目录进行压缩打包：\n\n```yaml\n- name: 使用 Repomix 打包仓库\n  uses: yamadashy\u002Frepomix\u002F.github\u002Factions\u002Frepomix@main\n  with:\n    directories: src tests\n    include: \"**\u002F*.ts,**\u002F*.md\"\n    ignore: \"**\u002F*.test.ts\"\n    output: repomix-output.txt\n    compress: true\n```\n\n将输出文件作为构件上传：\n\n```yaml\n- name: 使用 Repomix 打包仓库\n  uses: yamadashy\u002Frepomix\u002F.github\u002Factions\u002Frepomix@main\n  with:\n    directories: src\n    output: repomix-output.txt\n    compress: true\n\n- name: 上传 Repomix 输出\n  uses: actions\u002Fupload-artifact@v4\n  with:\n    name: repomix-output\n    path: repomix-output.txt\n```\n\n完整的工作流示例：\n\n```yaml\nname: 使用 Repomix 打包仓库\n\non:\n  workflow_dispatch:\n  push:\n    branches: [ main ]\n  pull_request:\n    branches: [ main ]\n\njobs:\n  pack-repo:\n    runs-on: ubuntu-latest\n    steps:\n      - name: 检出代码\n        uses: actions\u002Fcheckout@v4\n\n      - name: 使用 Repomix 打包仓库\n        uses: yamadashy\u002Frepomix\u002F.github\u002Factions\u002Frepomix@main\n        with:\n          output: repomix-output.xml\n\n      - name: 上传 Repomix 输出\n        uses: actions\u002Fupload-artifact@v4\n        with:\n          name: repomix-output.xml\n          path: repomix-output.xml\n          retention-days: 30\n```\n\n完整的工作流示例请参见 [此处](https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fblob\u002Fmain\u002F.github\u002Fworkflows\u002Fpack-repository.yml)。\n\n### Action 输入参数\n\n| 名称 | 描述 | 默认值 |\n|------|-------------|---------|\n| `directories` | 要处理的目录列表，以空格分隔（例如 `src tests docs`） | `.` |\n| `include` | 要包含的文件的 glob 模式，以逗号分隔（例如 `**\u002F*.ts,**\u002F*.md`） | `\"\"` |\n| `ignore` | 要忽略的文件的 glob 模式，以逗号分隔（例如 `**\u002F*.test.ts,**\u002Fnode_modules\u002F**`） | `\"\"` |\n| `output` | 打包文件的相对路径（扩展名决定格式：`.txt`、`.md`、`.xml`） | `repomix-output.xml` |\n| `compress` | 启用智能压缩以通过去除实现细节来减小输出大小 | `true` |\n| `style` | 输出样式（`xml`、`markdown`、`json`、`plain`） | `xml` |\n| `additional-args` | 用于 repomix CLI 的额外原始参数（例如 `--no-file-summary --no-security-check`） | `\"\"` |\n| `repomix-version` | 要安装的 npm 包版本（支持 semver 范围、标签或具体版本，如 `0.2.25`） | `latest` |\n\n### Action 输出参数\n\n| 名称 | 描述 |\n|------|-------------|\n| `output_file` | 生成的输出文件路径。可在后续步骤中用于上传构件、LLM 处理或其他操作。该文件包含基于指定选项的代码库格式化表示。 |\n\n## 📚 将 Repomix 用作库\n\n除了将 Repomix 用作 CLI 工具外，您还可以将其作为库集成到您的 Node.js 应用程序中。\n\n### 安装\n\n```bash\nnpm install repomix\n```\n\n### 基本用法\n\n```javascript\nimport { runCli, type CliOptions } from 'repomix';\n\n\u002F\u002F 使用自定义选项处理当前目录\nasync function packProject() {\n  const options = {\n    output: 'output.xml',\n    style: 'xml',\n    compress: true,\n    quiet: true\n  } as CliOptions;\n  \n  const result = await runCli(['.'], process.cwd(), options);\n  return result.packResult;\n}\n```\n\n### 处理远程仓库\n\n```javascript\nimport { runCli, type CliOptions } from 'repomix';\n\n\u002F\u002F 克隆并处理一个 GitHub 仓库\nasync function processRemoteRepo(repoUrl) {\n  const options = {\n    remote: repoUrl,\n    output: 'output.xml',\n    compress: true\n  } as CliOptions;\n  \n  return await runCli(['.'], process.cwd(), options);\n}\n```\n\n### 使用核心组件\n\n如果你需要更精细的控制，可以使用低级 API：\n\n```javascript\nimport { searchFiles, collectFiles, processFiles, TokenCounter } from 'repomix';\n\nasync function analyzeFiles(directory) {\n  \u002F\u002F 查找并收集文件\n  const { filePaths } = await searchFiles(directory, { \u002F* 配置 *\u002F });\n  const rawFiles = await collectFiles(filePaths, directory);\n  const processedFiles = await processFiles(rawFiles, { \u002F* 配置 *\u002F });\n  \n  \u002F\u002F 统计 token 数量\n  const tokenCounter = new TokenCounter('o200k_base');\n  \n  \u002F\u002F 返回分析结果\n  return processedFiles.map(file => ({\n    path: file.path,\n    tokens: tokenCounter.countTokens(file.content)\n  }));\n}\n```\n\n更多示例，请查看源代码中的 [website\u002Fserver\u002Fsrc\u002FremoteRepo.ts](https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fblob\u002Fmain\u002Fwebsite\u002Fserver\u002Fsrc\u002FremoteRepo.ts)，其中展示了 repomix.com 是如何使用该库的。\n\n### 打包\n\n在使用 Rolldown 或 esbuild 等工具打包 repomix 时，某些依赖项必须保持外部引用，并且需要复制 WASM 文件：\n\n**外部依赖（不能打包）：**\n- `tinypool` - 使用文件路径启动工作线程\n\n**需要复制的 WASM 文件：**\n- `web-tree-sitter.wasm` → 与打包后的 JS 文件位于同一目录（用于代码压缩功能）\n- Tree-sitter 语言文件 → 放置在 `REPOMIX_WASM_DIR` 环境变量指定的目录中\n\n有关实际操作示例，请参阅 [website\u002Fserver\u002Fscripts\u002Fbundle.mjs](https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fblob\u002Fmain\u002Fwebsite\u002Fserver\u002Fscripts\u002Fbundle.mjs)。\n\n## 🌍 社区项目\n\n探索由 Repomix 社区打造的精彩项目！\n\n- [Repomix Runner](https:\u002F\u002Fgithub.com\u002Fmassdo\u002Frepomix-runner) - VSCode 插件，用于将文件打包成单个输出以供 AI 处理\n- [Repomix Desktop](https:\u002F\u002Fgithub.com\u002FKevanMacGee\u002FRepomix-Desktop) - 基于 Python 和 CustomTkinter 构建的 Repomix 图形化桌面应用\n- [Python Repomix](https:\u002F\u002Fgithub.com\u002FAndersonBY\u002Fpython-repomix) - 基于 AST 的压缩实现的 Python 版本\n- [Rulefy](https:\u002F\u002Fgithub.com\u002Fniklub\u002Frulefy) - 利用 Claude AI 将 GitHub 仓库转换为自定义 Cursor AI 规则\n- [Codebase MCP](https:\u002F\u002Fgithub.com\u002FDeDeveloper23\u002Fcodebase-mcp) - 使用 Repomix 进行 AI 驱动代码库分析的 MCP 服务器\n- [vibe-tools](https:\u002F\u002Fgithub.com\u002Feastlondoner\u002Fvibe-tools) - 面向 AI 代理的 CLI 工具集，支持网页搜索、代码库分析和浏览器自动化\n\n更多详情，请访问我们的 [社区项目页面](https:\u002F\u002Frepomix.com\u002Fguide\u002Fcommunity-projects)。\n\n## 🤝 贡献\n\n我们欢迎社区的贡献！如需开始，请参阅我们的 [贡献指南](CONTRIBUTING.md)。\n\n### 贡献者\n\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fgraphs\u002Fcontributors\">\n  \u003Cimg alt=\"contributors\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyamadashy_repomix_readme_8a405235fca8.png\"\u002F>\n\u003C\u002Fa>\n\n## 🔒 隐私政策\n\n请参阅我们的 [隐私政策](https:\u002F\u002Frepomix.com\u002Fguide\u002Fprivacy)。\n\n## 📜 许可证\n\n本项目采用 [MIT 许可证](LICENSE)。\n\n\u003Cp align=\"center\">\n  &nbsp;&nbsp;&nbsp;\n  \u003Ca href=\"#repo-content-pjax-container\" target=\"_blank\">\n    返回顶部\n  \u003C\u002Fa>\n\u003C\u002Fp>","# Repomix 快速上手指南\n\nRepomix 是一款强大的工具，可将整个代码仓库打包成单个 AI 友好的文件。它专为将代码库输入大型语言模型（如 Claude、ChatGPT、DeepSeek、Perplexity 等）而设计，支持 Token 计数、安全检查和代码压缩等功能。\n\n## 环境准备\n\n*   **操作系统**：macOS、Linux 或 Windows\n*   **前置依赖**：需安装以下任一运行时环境：\n    *   [Node.js](https:\u002F\u002Fnodejs.org\u002F) (推荐，用于 npm\u002Fyarn\u002Fbun)\n    *   [Homebrew](https:\u002F\u002Fbrew.sh\u002F) (仅限 macOS\u002FLinux)\n    *   [Docker](https:\u002F\u002Fwww.docker.com\u002F) (可选，用于容器化运行)\n\n## 安装步骤\n\n你可以选择无需安装的临时运行方式，或全局安装以便重复使用。\n\n### 方式一：免安装运行（推荐尝试）\n直接使用 `npx` 运行最新版本的 Repomix，无需预先安装：\n\n```bash\nnpx repomix@latest\n```\n\n### 方式二：全局安装\n\n**使用 npm:**\n```bash\nnpm install -g repomix\n```\n\n**使用 yarn:**\n```bash\nyarn global add repomix\n```\n\n**使用 bun:**\n```bash\nbun add -g repomix\n```\n\n**使用 Homebrew (macOS\u002FLinux):**\n```bash\nbrew install repomix\n```\n\n> **提示**：国内用户若遇到下载缓慢，可配置淘宝镜像源：\n> `npm config set registry https:\u002F\u002Fregistry.npmmirror.com`\n\n## 基本使用\n\n安装完成后，在项目根目录下执行以下命令即可开始打包。\n\n### 1. 打包整个仓库\n在当前目录运行以下命令，Repomix 会自动识别 `.gitignore` 等文件并排除无关内容，生成一个名为 `repomix-output.xml` 的文件：\n\n```bash\nrepomix\n```\n\n### 2. 指定目录打包\n打包特定子目录的代码：\n\n```bash\nrepomix path\u002Fto\u002Fdirectory\n```\n\n### 3. 打包远程仓库\n无需克隆代码，直接打包 GitHub 上的远程仓库：\n\n```bash\n# 使用完整 URL\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\n\n# 或使用 GitHub 简写\nrepomix --remote yamadashy\u002Frepomix\n\n# 指定分支\nrepomix --remote yamadashy\u002Frepomix --remote-branch main\n```\n\n### 4. 后续操作\n生成的 `repomix-output.xml` 包含了整理好的代码上下文。你可以将该文件发送给 AI 助手，并配合如下提示词使用：\n\n> \"这个文件包含了一个仓库的所有代码。我想重构这段代码，请先审查它。\"\n\nAI 将基于完整的上下文提供精准的重构建议或代码生成。","某初创团队的后端负责人需要在周末紧急向 AI 助手咨询如何重构一个包含 50+ 文件的遗留微服务架构，以修复严重的性能瓶颈。\n\n### 没有 repomix 时\n- **上下文割裂**：开发者只能逐个复制粘贴文件给 AI，导致模型无法理解模块间的调用关系和依赖逻辑。\n- **操作繁琐易错**：手动筛选核心代码、排除 `node_modules` 和日志文件耗时极长，且容易误删关键配置或遗漏重要接口定义。\n- **提示词质量低**：由于输入信息碎片化，AI 给出的建议往往基于局部代码，产生的重构方案经常引发新的编译错误或逻辑冲突。\n- **协作效率低下**：团队成员间难以统一发送给 AI 的代码版本，导致每个人得到的优化建议不一致，沟通成本激增。\n\n### 使用 repomix 后\n- **全景代码投喂**：运行一条命令即可将整个项目打包成单个结构化文本文件，AI 能瞬间掌握完整的系统架构和数据流向。\n- **智能过滤噪音**：repomix 自动忽略构建产物、依赖包和环境配置文件，确保发送给大模型的每一行都是高价值的业务逻辑。\n- **深度精准分析**：基于完整上下文，AI 能准确识别跨文件的性能热点，提供包含具体修改路径的全局重构方案，准确率大幅提升。\n- **标准化工作流**：团队成员均可快速生成统一的代码包，确保所有人基于同一份“真相”与 AI 对话，加速技术决策落地。\n\nrepomix 通过将分散的代码库转化为 AI 可理解的单一视图，彻底消除了人与大模型之间的“上下文壁垒”，让复杂系统的智能重构变得简单高效。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyamadashy_repomix_55c7d6b6.png","yamadashy","Kazuki Yamada","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fyamadashy_199e0ec3.png","Developer.","@colopl","Tokyo\u002FJapan","koukun0120@gmail.com",null,"https:\u002F\u002Fgithub.com\u002Fyamadashy",[82,86,90,94,98,102],{"name":83,"color":84,"percentage":85},"TypeScript","#3178c6",92,{"name":87,"color":88,"percentage":89},"Vue","#41b883",5.3,{"name":91,"color":92,"percentage":93},"JavaScript","#f1e05a",1.4,{"name":95,"color":96,"percentage":97},"Shell","#89e051",0.5,{"name":99,"color":100,"percentage":101},"Dockerfile","#384d54",0.4,{"name":103,"color":104,"percentage":101},"CSS","#663399",23471,1138,"2026-04-13T19:20:27","MIT",1,"Linux, macOS, Windows","未说明",{"notes":113,"python":111,"dependencies":114},"该工具是基于 Node.js 的命令行工具，可通过 npx 直接运行或使用 npm、yarn、bun 全局安装。macOS\u002FLinux 用户也可通过 Homebrew 安装。支持 Docker 运行。无需 GPU 或特定 Python 环境。主要功能是将代码库打包为 AI 友好的格式（XML\u002FMarkdown\u002FTxt），包含 Token 计数、.gitignore 感知、敏感信息检测及代码压缩功能。",[115,116,117],"Node.js (通过 npm\u002Fyarn\u002Fbun 安装)","Tree-sitter (用于代码压缩)","Secretlint (用于安全检查)",[35,14,13,15],[120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139],"ai","llm","generative-ai","chatgpt","claude","developer-tools","chatbot","gpt","openai","javascript","nodejs","typescript","anthropic","gemini","language-model","artificial-intelligence","genai","deepseek","llama","mcp","2026-03-27T02:49:30.150509","2026-04-14T12:30:14.048098",[143,148,153,158,163,168],{"id":144,"question_zh":145,"answer_zh":146,"source_url":147},32827,"如何在打包远程仓库时指定特定的分支或提交哈希（Commit SHA）？","可以使用 `--remote-branch` 选项来指定分支名或完整的提交哈希。例如：`repomix --remote https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo --branch master` 或使用完整哈希 `repomix --remote https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo --remote-branch b188a6cb39b512a9c6da7235b880af42c78ccd0d`。注意：该功能不支持短哈希（short hash），必须使用完整的 40 位提交哈希，因为 git fetch 不支持短哈希。此功能已在 v0.2.11 版本中发布。","https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fissues\u002F195",{"id":149,"question_zh":150,"answer_zh":151,"source_url":152},32828,"遇到 'MaxPerformanceEntryBufferExceededWarning' 警告且进程无限挂起怎么办？","这通常是由于工具尝试处理 `node_modules` 等大量子目录导致的内存泄漏。维护者已在 v0.1.34 版本中修复了子目录中 `node_modules` 的处理问题。请升级到最新版本（v0.1.34 或更高）。如果问题依旧，可以通过配置文件或命令行忽略特定文件夹（如 `package-lock.json` 或大型依赖目录）。","https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fissues\u002F63",{"id":154,"question_zh":155,"answer_zh":156,"source_url":157},32829,"开启 'removeComments' 选项后，为什么代码块大量丢失？","这是一个在旧版本（v0.1.27 之前）中存在的 Bug，导致移除注释时误删了部分代码逻辑。该问题已在 v0.1.37 版本中通过 PR #81 修复。请务必升级到 v0.1.37 或更高版本以解决此问题。","https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fissues\u002F55",{"id":159,"question_zh":160,"answer_zh":161,"source_url":162},32830,"如何只打包特定类型的文件（例如仅打包 .md 文件）？","可以使用 `include` 过滤器来实现反向筛选。虽然默认支持 `ignore` 忽略文件，但你可以配置 `include` 选项来只包含匹配的文件模式。例如，配置只包含 `*.md` 文件。该功能已作为增强特性被合并并发布。","https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fissues\u002F22",{"id":164,"question_zh":165,"answer_zh":166,"source_url":167},32831,"在 Mac (Apple Silicon) 上使用 bunx 运行时出现 'Not implemented' 错误如何解决？","该问题已在后续版本中修复。用户反馈表明，在更新到修复版本后，命令 `bunx repomix --verbose` 在 Mac M4 芯片上可以正常运行。请确保将 repomix 更新到最新发布的版本。","https:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix\u002Fissues\u002F591",{"id":169,"question_zh":170,"answer_zh":171,"source_url":167},32832,"如何配置输出文件的格式和路径？","可以通过命令行参数或配置文件（`repomix.config.json`）进行配置。默认输出文件为 `repomix-output.xml`。在配置文件中，可以设置 `output.filePath` 改变文件名，`output.style` 改变格式（如 xml, markdown 等），以及 `output.fileSummary`, `output.directoryStructure` 等布尔值来控制是否包含文件摘要和目录结构。",[173,178,183,188,193,198,203,208,213,218,223,228,233,238,243,248,253,258,263,268],{"id":174,"version":175,"summary_zh":176,"released_at":177},247535,"v1.13.1","本次发布修复了 Base64 检测中的误报，并引入了一个更轻量的剪贴板依赖库！\n\n## Bug 修复 🐛\n\n### 修复 Base64 检测误报 (#1307, #1298)\n\n`truncateBase64` 功能曾错误地截断仅包含字母和 `\u002F` 字符的 XPath 和路径类字符串（例如 `postTransactionAmounts\u002FsharesOwnedFollowingTransaction\u002Fvalue`）。\n\n为此我们做了两项改进：\n- 将独立 Base64 检测的最小阈值从 60 字符提高到 256 字符\n- 在启发式规则中增加了对数字的要求——真正的 Base64 编码二进制数据几乎总是包含数字，而路径类字符串通常不包含数字\n\n特别感谢 @NaustudentX14 提供的详细问题报告！🎉\n\n## 改进 ⚡\n\n### 迁移到 tinyclip 处理剪贴板操作 (#1296)\n\n将 `clipboardy` 替换为无依赖的剪贴板库 `tinyclip`。此举移除了 41 个传递性依赖，并将剪贴板相关安装包大小从约 4 MB 减少至约 24 KB。\n\n特别感谢 @florian-lefebvre 的首次贡献！🎉\n\n## 如何更新\n\n```bash\nnpm update -g repomix\n```\n\n---\n\n一如既往，如果您遇到任何问题或有任何建议，请随时在 GitHub Issues 或我们的 Discord 社区（[链接](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku)）中告诉我们。","2026-03-26T14:52:19",{"id":179,"version":180,"summary_zh":181,"released_at":182},247536,"v1.13.0","本次发布通过远程配置沙箱化和更精简的依赖项，进一步增强了安全性，同时在核心流程中实现了显著的性能提升！\n\n## 新功能 🚀\n\n### 阻止远程配置文件执行 (#1292)\n\n此前，在打包远程仓库时，Repomix 会自动加载并执行仓库中任何名为 `repomix.config.ts` 或 `repomix.config.js` 的配置文件。由于这些 TypeScript\u002FJavaScript 配置文件是通过 `jiti` 执行的，恶意仓库可以在其配置文件中嵌入任意代码，从而导致用户机器上的远程代码执行（RCE）。\n\n现在，远程配置文件将**默认被跳过**。如果您信任某个远程仓库并希望使用其配置，可以通过新增的 `--remote-trust-config` 标志来显式启用：\n\n```bash\n# 默认情况下，远程配置已被安全地忽略\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\n\n# 显式信任远程配置\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo --remote-trust-config\n```\n\n## 改进 ⚡\n\n### 使用 fast-xml-builder 替代 fast-xml-parser (#1253, #1219)\n\nRepomix 目前仅将 `XMLBuilder` 用于输出生成，而不涉及 XML 解析。我们直接切换到 `fast-xml-builder`，以消除解析器侧反复出现的 CVE 漏洞，使 `npm audit` 报告的漏洞数降至 **0**，并将依赖项大小从 831KB 减少至 176KB。\n\n### 性能优化 (#1234, #1235, #1255)\n\n对核心流程进行了多项性能改进：\n- **文件树生成**：基于 Map 的 O(1) 子节点查找与单次遍历排序——在处理 10,000 个文件时，`generateFileTree` 提升约 **82%**，`treeToString` 提升约 **70%**。\n- **路径排序**：采用“装饰-排序-去装饰”模式，并预计算 `path.split()` ——速度提升 **6–7 倍**。对于 `filterOutUntrustedFiles`，改用 `Set.has()` 方法后，在处理 10,000 个文件时速度最高可提升 **30 倍**。\n- **编译缓存传播**：自 v1.12.0 引入的 V8 编译缓存现可通过环境变量扩展至 Tinypool 工作进程，而不仅限于主进程。\n\n### 修复闭包内存泄漏 (#1233)\n\n将 `setTimeout` 和 `setInterval` 回调中的箭头函数替换为 `.bind()`，以防止闭包捕获作用域并持有大型对象的引用。同时，添加了适当的 `dispose()` 方法和 `.unref()` 调用，以便进行资源清理。\n\n## 网站增强 🌐\n\n### 土耳其语支持 (#1194)\n\n根据 Google Analytics 数据显示，土耳其语用户参与度较高，因此我们在 [repomix.com](https:\u002F\u002Frepomix.com) 上新增了土耳其语（Türkçe）翻译版本。\n\n### 针对 LLM 的优化：引入 JSON-LD 和 llms.txt (#1236)\n\n添加了 JSON-LD 结构化数据（schema.org 的 `WebSite` 和 `SoftwareApplication` 标记），并生成了 `llms.txt` 和 `llms-full.txt` 文件，以方便 LLM 更好地发现相关文档。\n\n## 更新方法\n\n```bash\nnpm update -g repomix\n```\n\n---\n\n一如既往，如果您遇到任何问题或有任何建议，请随时在 GitHub Issues 或我们的 [Discord 社区](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku) 中告知我们。","2026-03-24T01:27:35",{"id":184,"version":185,"summary_zh":186,"released_at":187},247537,"v1.12.0","本次发布带来了全方位的性能提升——启动更快、文件收集优化、包体积更小——同时还为远程仓库提供了更加流畅的 CLI 体验！\n\n## 新功能 🚀\n\n### 无需 `--remote` 标志即可自动检测远程 URL (#1145)\n\n现在可以直接将 GitHub URL 作为位置参数传递，而无需使用 `--remote` 标志：\n\n```bash\n# 之前\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\n\n# 现在也可以直接使用！\nrepomix https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\n```\n\nCLI 会自动检测位置参数中的明确远程 URL（GitHub、GitLab、Bitbucket 等），并将其视为远程仓库目标。\n\n## 性能改进 ⚡\n\n### Node.js 模块编译缓存，加速启动 (#1181)\n\n启用了 Node.js V8 编译缓存（适用于 Node.js 22.8.0 及以上版本），使启动时间加快约 **10%**。编译后的模块缓存会自动保存，并在后续启动时进一步提速。\n\n### 使用 UTF-8 快速路径优化文件收集 (#1155)\n\n通过两项关键优化提升了文件收集性能：\n- **UTF-8 快速路径**：跳过对有效 UTF-8 文件的昂贵编码检测，而这类文件占源代码文件的绝大多数；\n- **Promise 池**：用轻量级的 Promise 池替代了 Worker 线程，以更好地控制并发。\n\n### 远程仓库的流式 tar.gz 解压 (#1153)\n\n将远程仓库操作中的 ZIP 归档下载替换为 **流式 tar.gz 解压**：\n- 更好地处理大型仓库。\n\n### 更小的 npm 包 (#1092)\n\n移除了 npm 包中未使用的 Source Map，将 `lib\u002F` 目录的大小从 **2.4MB 减少到 1.2MB**，缩减约 50%。\n\n## Bug 修复 🐛\n\n### 归档解压错误时不重试 (#1149)\n\n修复了一个问题：归档解压错误会触发不必要的重试。现在，解压错误被视为不可重试，从而提供更快的错误反馈。\n\n## 如何更新\n\n```bash\nnpm update -g repomix\n```\n\n---\n\n一如既往，如果您有任何问题或建议，请随时在 GitHub Issues 或我们的 [Discord 社区](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku) 中告知我们。","2026-02-28T11:54:34",{"id":189,"version":190,"summary_zh":191,"released_at":192},247538,"v1.11.1","本次发布新增了多根目录标签、非交互式技能生成选项，并提升了远程仓库操作的可靠性！\n\n## 改进 ⚡\n\n### 多根目录标签 (#1024, #1023)\n\n在打包多个目录时，目录树输出现在会显示带标签的部分，以清晰地表明哪些文件属于哪个根目录：\n\n```bash\nrepomix src\u002Fcli src\u002Fconfig\n```\n\n输出现在会显示：\n```\n[cli]\u002F\n├── cliRun.ts\n├── actions\u002F\n│   └── ...\n[config]\u002F\n├── configLoad.ts\n└── ...\n```\n\n特别感谢 @spandan-kumar 的贡献！🎉\n\n### 非交互式技能生成 (#1022, #1012)\n\n新增了 `--skill-output` 和 `--force` 选项，以支持 CI\u002FCD 流水线和脚本中的自动化技能生成：\n\n```bash\n# 用于 CI 或自动化的非交互式执行\nrepomix --skill-generate --skill-output .codebuddy --force\n\n# 使用远程仓库\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo --skill-generate --skill-output .\u002Fskills\u002Frepo-ref -f\n```\n\n- `--skill-output \u003Cpath>`：直接指定技能输出目录路径，跳过交互式位置提示。\n- `-f, --force`：跳过所有确认提示（目前为技能目录覆盖）。\n\n## Bug 修复 🐛\n\n### 修复远程 Git 命令卡死问题 (#1078, #1077)\n\n远程 Git 操作现在增加了 30 秒超时，并禁用了终端提示（`GIT_TERMINAL_PROMPT=0`）。这可以防止在访问不可用仓库（不存在、私有或需要认证）时出现无限等待的情况。\n\n特别感谢 @Pipboyguy 的贡献！🎉\n\n### 修复浅色主题下 CLI 输出可见性问题 (#1088, #1057)\n\n移除了 CLI 输出中硬编码的白色字体颜色，改用终端的默认前景色。这解决了在 Solarized Light 等浅色终端上白色文本难以辨认的问题。\n\n## 文档 📚\n\n### 库打包指南 (#1075)\n\n新增了关于将 Repomix 打包为库的文档，内容包括如何处理 tree-sitter 的 WASM 文件依赖，详见 [Repomix 作为库使用指南](https:\u002F\u002Frepomix.com\u002Fguide\u002Fdevelopment\u002Fusing-repomix-as-a-library#bundling)。\n\n## 更新方法\n\n```bash\nnpm update -g repomix\n```\n\n---\n\n一如既往，如果您有任何问题或建议，请随时在 GitHub Issues 或我们的 Discord 社区（[链接](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku)）中告诉我们。","2026-01-18T15:40:28",{"id":194,"version":195,"summary_zh":196,"released_at":197},247539,"v1.11.0","本次发布引入了 `--split-output` 选项，用于将大型打包输出拆分为多个文件，从而使 Repomix 在面对文件大小限制的 AI 工具时更加实用！\n\n## 新功能 🚀\n\n### 大型代码库的输出拆分 (#1013)\n\n新增了 `--split-output` 选项，在处理大型代码库时，可自动将打包后的输出拆分为多个带编号的文件。这在使用对文件大小有限制的 AI 工具时尤为有用（例如，Google AI Studio 的 1MB 限制）。\n\n```bash\n# 将输出拆分为每个最多 1MB 的文件\nrepomix --split-output 1mb\n\n# 对于需要更大上下文窗口的情况，可以设置更大的块大小\nrepomix --split-output 20mb\n\n# 支持小数单位\nrepomix --split-output 1.5mb\n```\n\n执行后会生成如下带编号的文件：\n- `repomix-output.1.xml`\n- `repomix-output.2.xml`\n- `repomix-output.3.xml`\n\n支持指定带单位的大小，如 `500kb`、`1mb`、`2mb`、`1.5mb` 等，并且也支持小数形式。\n\n> [!NOTE]\n> 文件会按顶级目录进行分组，以保持上下文完整性。单个文件或目录绝不会被拆分到多个输出文件中。\n\n特别感谢 @Dango233 的贡献！🎉\n\n## 更新方法\n\n```bash\nnpm update -g repomix\n```\n\n---\n\n一如既往，如果您遇到任何问题或有任何建议，请随时在 GitHub 问题页面或我们的 [Discord 社区](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku) 中告知我们。","2025-12-23T14:53:07",{"id":199,"version":200,"summary_zh":201,"released_at":202},247540,"v1.10.2","本次发布提升了二进制文件检测、编码检测以及注释移除的可靠性，使 Repomix 在处理多样化代码库时更加稳健！\n\n## Bug 修复 🐛\n\n### 修复注释移除卡死问题 (#975, #1009)\n\n将 `strip-comments` 替换为 `@repomix\u002Fstrip-comments`——一个增强了语言支持并修复了多个 bug 的分支。\n\n解决了在启用 `removeComments: true` 时处理大文件导致程序卡死的问题。\n\n### 修复编码检测问题 (#869, #1007)\n\n移除了 jschardet 中用于判断置信度的检查逻辑，该逻辑曾错误地跳过合法文件。\n\n- **修复 #869**：具有较低置信度分数的合法 Python 文件不再被跳过。\n- **修复 #847**：包含 Thymeleaf 语法（`~{`）的 HTML 文件不再被错误地识别为二进制文件。\n\n## 功能改进 ⚡\n\n### 增强二进制文件检测 (#1006)\n\n将 `istextorbinary` 替换为维护更活跃的替代方案：\n- `is-binary-path`：基于文件扩展名的检测工具，每周下载量达 4700 万次。\n- `isbinaryfile`：基于文件内容的检测工具，无任何依赖。\n\n此次改进将二进制文件扩展名的覆盖范围提升了约 20 倍，从而减少了对常见二进制格式的不必要的内容扫描。\n\n## 如何更新\n\n```bash\nnpm update -g repomix\n```\n\n---\n\n一如既往，如果您遇到任何问题或有任何建议，请随时在 GitHub 问题页面或我们的 [Discord 社区](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku) 中告知我们。","2025-12-16T14:15:59",{"id":204,"version":205,"summary_zh":206,"released_at":207},247541,"v1.10.1","本次发布改进了远程仓库的技能生成功能，使 `--skill-generate --remote` 工作流更加可靠且信息更丰富！\n\n## Bug 修复 🐛\n\n### 修复了远程仓库的项目名称生成问题 (#1001)\n\n此前，项目名称会错误地从临时目录名中推导出来（例如“Repomix HPkbgH”）。现在，它能够正确地从 URL 中提取仓库名称。\n\n```bash\nrepomix --remote https:\u002F\u002Fgithub.com\u002Fvitejs\u002Fvite --skill-generate\n# 之前：SKILL.md 的标题为“Repomix HPkbgH 的参考代码库”\n# 之后：SKILL.md 的标题为“Vite 的参考代码库” ✨\n```\n\n### 修复了 `.claude\u002F` 目录冲突问题 (#1001)\n\n当远程仓库本身包含 `.claude\u002F` 目录（内含命令、代理等）时，现在仅复制 `.claude\u002Fskills\u002F`，以避免与您现有的配置发生冲突。\n\n## 功能改进 ⚡\n\n### 在 SKILL.md 中添加源 URL (#1001)\n\n对于远程仓库，SKILL.md 的页脚现在会包含源 URL，方便查阅：\n- 远程：`此技能由 Repomix 根据 https:\u002F\u002Fgithub.com\u002Fvitejs\u002Fvite 生成`\n- 本地：不包含 URL（以避免暴露个人路径）\n\n## 如何更新\n\n```bash\nnpm update -g repomix\n```\n\n---\n\n一如既往，如果您遇到任何问题或有任何建议，请随时在 GitHub Issues 或我们的 [Discord 社区](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku) 中告诉我们。","2025-12-14T12:08:32",{"id":209,"version":210,"summary_zh":211,"released_at":212},247542,"v1.10.0","本次发布引入了 Claude Agent Skills 生成支持，只需一条命令，即可从任何代码库创建适用于 AI 的参考包！\n\n## 新功能 🚀\n\n### Claude Agent Skills 生成 (#952, #998)\n\n新增了 `--skill-generate` 选项，用于为 Claude Code 创建结构化的 [Agent Skills](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fclaude-code\u002Fskills) 包。Skills 是预打包的代码引用，可帮助 Claude 更高效地理解和处理特定项目。\n\n```bash\n# 从你的代码库生成一个技能\nrepomix --skill-generate\n\n# 从远程仓库并指定自定义名称\nrepomix --remote facebook\u002Freact --skill-generate react-reference\n\n# 仅包含文档的技能\nrepomix --remote anthropics\u002Fclaude-code-action --include \"docs\u002F**\" --skill-generate\n```\n\n这对于引用开源项目的实现特别有用——你可以从任何仓库生成一个技能，Claude 在处理你的代码时就能参考这些模式。\n\n**主要特性：**\n\n- **交互式位置选择**：可以选择团队共享的项目技能（`.claude\u002Fskills\u002F`）或个人使用的个人技能（`~\u002F.claude\u002Fskills\u002F`）\n- **自动命名**：自动生成技能名称，格式为 `repomix-reference-\u003C文件夹名>`\n- **多文件输出结构**：\n  - `SKILL.md` - 入口文件，包含使用指南\n  - `references\u002Fsummary.md` - 技能目的、格式及统计信息\n  - `references\u002Fproject-structure.md` - 目录树及行数统计\n  - `references\u002Ffiles.md` - 所有文件内容\n  - `references\u002Ftech-stack.md` - 使用的语言、框架和依赖项\n- **技术栈检测**：自动检测语言、框架、依赖项、运行时版本（如 `.node-version`、`.tool-versions`）以及配置文件\n- **MCP 工具支持**：新增 `generate_skill` MCP 工具，用于程序化生成技能\n\n更多信息请参阅 [Agent Skills 生成文档](https:\u002F\u002Frepomix.com\u002Fguide\u002Fagent-skills-generation)。\n\n## 安全性 🔒\n\n### npm 受信发布支持 (#974)\n\nRepomix 现在使用 npm 的受信发布功能，并结合 OIDC 身份验证来发布包。这不仅消除了对长期 npm 令牌的需求，还为已发布的包添加了来源证明。\n\n\u003Cimg width=\"142\" height=\"87\" alt=\"image\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F7511038e-e3fc-47f1-9d8a-8d9b387304ef\" \u002F>\n\n**这对用户意味着什么：**\n- 可以通过加密方式验证包确实来自本仓库构建\n- 通过 `npm audit signatures` 验证增强供应链安全\n- 防止令牌泄露及未经授权的发布\n\n## 网站改进 🌐\n\n### 隐私政策页面 (#981)\n\n在网站上新增了专门的 [隐私政策页面](https:\u002F\u002Frepomix.com\u002Fguide\u002Fprivacy)，使隐私信息更加易于访问。该页面涵盖了 CLI、网站、浏览器扩展的数据处理情况，并包含责任免责声明。\n\n## 如何更新\n\n```bash\nnpm update -g repom\n","2025-12-12T14:43:01",{"id":214,"version":215,"summary_zh":216,"released_at":217},247543,"v1.9.2","本次发布改进了 `.gitignore` 的处理方式，使其更符合 Git 的标准行为，并修复了 GitHub Actions 相关的问题！\n\n## 改进 ⚡\n\n### 改进 `.gitignore` 处理 (#964)\n\n升级到 globby v16，并优化了 `.gitignore` 的处理逻辑，以匹配 Git 的标准行为。现在会正确尊重父目录中的 `.gitignore` 文件，从而使文件过滤更加直观，与 Git 本身的运作方式保持一致。\n\n**主要改进：**\n- ✅ 现在会正确尊重父目录的 `.gitignore` 文件\n- ✅ 行为与 Git 的标准忽略模式匹配保持一致\n\n## Bug 修复 🐛\n\n### 修复 GitHub Actions 的 `compress` 选项 (#965)\n\n修复了一个 bug：在 GitHub Actions 中将 `compress: false` 设置时，会错误地添加一个不支持的 `--no-compress` 参数。现已修正相关逻辑，只有在显式启用时才会添加 `--compress` 参数。\n\n特别感谢 @chinchala 的首次贡献！🎉\n\n## 如何更新\n\n```bash\nnpm update -g repomix\n```\n\n---\n\n一如既往，如果您遇到任何问题或有任何建议，请随时在 GitHub Issues 或我们的 [Discord 社区](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku) 中告诉我们。","2025-11-28T07:12:36",{"id":219,"version":220,"summary_zh":221,"released_at":222},247544,"v1.9.1","本次发布修复了 v1.9.0 中引入的输出文件扩展名问题，并减小了软件包体积，使 Repomix 更加直观、高效！\n\n## Bug 修复 🐛\n\n### 修复输出文件扩展名与样式不匹配的问题 (#947)\n\n修复了一个问题：输出文件的扩展名不会自动匹配所选样式。现在，当你使用 `--style markdown`、`--style json` 或 `--style plain` 时，输出文件名会自动采用相应的扩展名（`.md`、`.json` 或 `.txt`）。\n\n**修复前（v1.9.0）：**\n```bash\nrepomix --style markdown\n# 输出：repomix-output.xml（扩展名错误！）\n```\n\n**修复后（v1.9.1）：**\n```bash\nrepomix --style markdown\n# 输出：repomix-output.md ✨\n```\n\n此行为适用于未通过 `--output` 参数或配置文件显式指定输出文件名的情况。\n\n特别感谢 @Ahmad8864 的首次贡献，成功修复了这一问题！🎉\n\n同时，我们也感谢 @pranc1ngpegasus 在 #949 中提出的另一种实现方案，以及对这一问题的深入研究！\n\n## 改进 ⚡\n\n### 减小软件包体积 (#942)\n\n将 `tree-sitter-wasms` 替换为仅包含 Repomix 所需语言解析器的 `@repomix\u002Ftree-sitter-wasms`。这使得整体软件包体积减少了约 **25%**，从而加快了安装速度并降低了磁盘占用。\n\n## 如何更新\n\n```bash\nnpm update -g repomix\n```\n\n---\n\n一如既往，如果您遇到任何问题或有任何建议，请随时在 GitHub 问题页面或我们的 [Discord 社区](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku) 中告诉我们。","2025-11-15T15:01:43",{"id":224,"version":225,"summary_zh":226,"released_at":227},247545,"v1.9.0","This release introduces the Repomix Explorer plugin for advanced AI-powered codebase analysis and .ignore file support, making Repomix more flexible and powerful for development workflows!\r\n\r\n## What's New 🚀\r\n\r\n### `.ignore` File Support (#937, #938)\r\nAdded support for `.ignore` files, which are used by tools like ripgrep and the silver searcher! This allows you to maintain a single `.ignore` file that works across multiple tools.\r\n\r\n```bash\r\n# Enable .ignore file support (enabled by default)\r\nrepomix\r\n\r\n# Disable .ignore file support\r\nrepomix --no-dot-ignore\r\n\r\n# Configure in repomix.config.json\r\n{\r\n  \"ignore\": {\r\n    \"useDotIgnore\": false\r\n  }\r\n}\r\n```\r\n\r\n**Ignore file priority order:**\r\n1. Custom patterns\r\n2. `.repomixignore`\r\n3. **`.ignore`** (new!)\r\n4. `.gitignore`\r\n5. Default patterns\r\n\r\nThis feature is especially useful for users of ripgrep, ag, fd, and other modern search tools, enabling consistent ignore patterns across your entire toolchain.\r\n\r\n### Repomix Explorer Plugin (#908)\r\nAdded the **repomix-explorer** Claude Code plugin that enables intelligent, AI-powered exploration and analysis of codebases using natural language!\r\n\r\n**Installation:**\r\n```bash\r\n\u002Fplugin marketplace add yamadashy\u002Frepomix\r\n\u002Fplugin install repomix-explorer@repomix\r\n```\r\n\r\n**Usage:**\r\n```bash\r\n# Analyze local codebases\r\n\u002Frepomix-explorer:explore-local \u003Cpath-to-repo>\r\n\r\n# Analyze remote GitHub repositories\r\n\u002Frepomix-explorer:explore-remote \u003Crepo-url>\r\n```\r\n\r\nThe agent executes `npx repomix@latest` to pack the repository, then uses intelligent search strategies to provide comprehensive analysis without overwhelming context limits.\r\n\r\nLearn more in the [Claude Code Plugins documentation](https:\u002F\u002Frepomix.com\u002Fguide\u002Fclaude-code-plugins).\r\n\r\n## Bug Fixes 🐛\r\n\r\n### Improved Error Handling for Permission Errors and Special Tokens (#907)\r\n- Improved error messages for permission errors with clear solutions\r\n- Fixed token counting errors when processing special tokens (e.g., `\u003C|endoftext|>` in tokenizer files)\r\n- Resolved issues when processing ML\u002FAI projects with tokenizer configurations\r\n\r\n## Improvements ⚡\r\n\r\n- Upgraded to Zod v4 for improved schema validation (#923)\r\n- Security updates for Vite and Hono dependencies (#913, #917, #920)\r\n\r\n## How to Update\r\n\r\n```bash\r\nnpm update -g repomix\r\n```\r\n\r\n---\r\n\r\nAs always, if you have any issues or suggestions, please let us know on GitHub issues or our [Discord community](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku).\r\n","2025-11-08T12:16:25",{"id":229,"version":230,"summary_zh":231,"released_at":232},247546,"v1.8.0","This release introduces official Claude Code plugins and enhanced directory visibility, making Repomix more powerful for AI-powered development workflows and project exploration!\r\n\r\n## What's New 🚀\r\n\r\n### Repomix Claude Code Plugins (#893)\r\nAdded official Repomix plugins for Claude Code, enabling seamless AI-powered codebase analysis directly within your Claude Code environment!\r\n\r\n**Two complementary plugins:**\r\n- **repomix-mcp**: MCP server integration providing tools for packing, searching, and reading codebases\r\n- **repomix-commands**: Natural language slash commands (`\u002Fpack-local`, `\u002Fpack-remote`) for quick operations\r\n\r\nLearn more in the [Claude Code Plugins documentation](https:\u002F\u002Frepomix.com\u002Fguide\u002Fclaude-code-plugins).\r\n\r\n### Full Directory Structure Display (#896)\r\nAdded the `--include-full-directory-structure` option to display the complete repository directory tree when using `--include` patterns!\r\n\r\n```bash\r\nrepomix --include \"cli\u002F**\u002F*.go\" --include-full-directory-structure\r\n```\r\n\r\nThis shows the full project structure while maintaining focused file selection, providing better context for AI analysis.\r\n\r\nSpecial thanks to @slavakurilyak for their contribution! 🎉\r\n\r\n### Dart Language Support for Tree-sitter Compression (#889)\r\nAdded Dart language support to tree-sitter compression, enabling ~50% token reduction for Dart and Flutter projects!\r\n\r\n## Bug Fixes 🐛\r\n\r\n- Fixed Claude Code plugin marketplace schema validation (#898, #900, #901)\r\n\r\nSpecial thanks to @ramarivera for their contribution! 🎉\r\n\r\n## How to Update\r\n\r\n```bash\r\nnpm update -g repomix\r\n```\r\n\r\n---\r\n\r\nAs always, if you have any issues or suggestions, please let us know on GitHub issues or our [Discord community](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku).\r\n","2025-10-18T15:05:03",{"id":234,"version":235,"summary_zh":236,"released_at":237},247547,"v1.7.0","This release introduces TypeScript\u002FJavaScript config support and Azure DevOps integration, making Repomix more flexible and compatible with enterprise development environments!\r\n\r\n## What's New 🚀\r\n\r\n### TypeScript\u002FJavaScript Config File Support (#870, #886)\r\nAdded support for TypeScript and JavaScript configuration files with a `defineConfig` helper function for better developer experience, similar to Vite and ESLint.\r\n\r\nThis provides a more flexible alternative to static JSON configurations, allowing you to implement any dynamic configuration you need.\r\n\r\n```typescript\r\n\u002F\u002F repomix.config.ts\r\nimport { defineConfig } from 'repomix';\r\n\r\nconst today = new Date().toISOString().slice(0, 10);\r\n\r\nexport default defineConfig({\r\n  output: {\r\n    filePath: `repomix-output-${today}.xml`,\r\n    style: 'xml',\r\n  },\r\n});\r\n```\r\n\r\n**Benefits:**\r\n- Full TypeScript type checking in config files\r\n- Excellent IDE autocomplete and IntelliSense\r\n- Dynamic configuration based on environment (timestamps, environment variables, etc.)\r\n\r\n**Priority Order:**\r\n1. **TypeScript** (`repomix.config.ts`, `repomix.config.mts`, `repomix.config.cts`)\r\n2. **JavaScript\u002FES Module** (`repomix.config.js`, `repomix.config.mjs`, `repomix.config.cjs`)\r\n3. **JSON** (`repomix.config.json5`, `repomix.config.jsonc`, `repomix.config.json`)\r\n\r\n### Azure DevOps Remote Repository Support (#848, #881)\r\nAdded support for Azure DevOps remote repository URLs, making Repomix compatible with enterprise environments using Azure DevOps.\r\n\r\nAzure DevOps uses special URL formats:\r\n- SSH: `git@ssh.dev.azure.com:v3\u002Forg\u002Fproject\u002Frepo`\r\n- HTTPS: `https:\u002F\u002Fdev.azure.com\u002Forganization\u002Fproject\u002F_git\u002Frepo`\r\n\r\nRepomix now correctly parses and processes these URLs when packing remote repositories.\r\n\r\n## Bug Fixes 🐛\r\n\r\n### Binary Files Now Visible in Directory Structure (#841, #883)\r\nFixed a regression where binary files were not appearing in the directory structure section of the output, despite the documentation stating they should be included.\r\n\r\nThis regression was introduced in v0.1.18 (August 2024) when implementing the security check feature. Binary files are now correctly included in the directory structure while remaining properly excluded from the file contents section.\r\n\r\n### Remote Repository Output Path Handling (#873, #885)\r\nFixed an error that occurred when using the remote repository feature with an absolute path specified for the output file. The tool now correctly handles cases where source and target paths resolve to the same location, preventing unnecessary file copy operations.\r\n\r\n## How to Update\r\n\r\n```bash\r\nnpm update -g repomix\r\n```\r\n\r\n---\r\n\r\nAs always, if you have any issues or suggestions, please let us know on GitHub issues or our [Discord community](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku).\r\n","2025-10-12T13:11:59",{"id":239,"version":240,"summary_zh":241,"released_at":242},247548,"v1.6.1","This release fixes a critical bug with the `--stdin` option and includes dependency updates and website improvements.\r\n\r\n## Bug Fixes 🐛\r\n\r\n### Fixed `--stdin` Option Hang in v1.6.0 (#867, #878)\r\nResolved a critical issue where the `--stdin` option would hang when piping file paths to Repomix.\r\n\r\nThe problem occurred because v1.6.0 moved the entire CLI processing to child_process workers for better resource isolation, but child_process workers don't inherit stdin from the parent process by default. This caused commands like `git ls-files | repomix --stdin` to hang indefinitely.\r\n\r\n**The fix:** Stdin processing now happens in the main process before passing file paths to the worker.\r\n\r\nThis ensures that stdin-based workflows work correctly while preserving the stability improvements introduced in v1.6.0.\r\n\r\n## Improvements ⚡\r\n\r\n### Website Enhancements (#864, #865)\r\n- Added cancel functionality for pack requests, allowing users to stop long-running operations\r\n\r\n### CI\u002FCD Improvements (#866)\r\n- Replaced ratchet with pinact for GitHub Actions SHA pinning\r\n\r\n## How to Update\r\n\r\n```bash\r\nnpm update -g repomix\r\n```\r\n\r\n---\r\n\r\nAs always, if you have any issues or suggestions, please let us know on GitHub issues or our [Discord community](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku).\r\n","2025-10-02T15:22:13",{"id":244,"version":245,"summary_zh":246,"released_at":247},247549,"v1.6.0","This release brings enhanced MCP flexibility with output format options and significantly improved performance through worker system optimization!\r\n\r\n## What's New 🚀\r\n\r\n### MCP Output Format Support (#839)\r\nAdded the powerful `style` parameter to MCP tools, allowing users to choose their preferred output format for AI analysis workflows. Now supports XML, Markdown, JSON, and Plain text formats.\r\n\r\n**Available Formats:**\r\n- **XML**: Structured with `\u003Cfile>` tags (default for backward compatibility)\r\n- **Markdown**: Human-readable with `##` headers and code blocks\r\n- **JSON**: Machine-readable with files as key-value pairs, making it easy to extract specific file contents programmatically\r\n- **Plain**: Simple format with separators\r\n\r\n## Improvements ⚡\r\n\r\n### Worker System Performance Optimization (#851)\r\nSignificantly improved Repomix performance through comprehensive worker system refactoring:\r\n\r\n- **1.5-2x faster processing speed** - Consolidating worker lifecycle management and improving concurrency handling\r\n- **Reduced memory usage** - Wrapping the entire processing in child process to minimize main process memory footprint, especially beneficial when using Repomix as a library\r\n\r\nThis addresses the performance regression introduced in v1.2.1's memory optimizations while maintaining the memory improvements and providing better integration experience for library usage.\r\n\r\n### MCP Parameter Handling Fix (#849, #854)\r\nFixed critical bug where the `read_repomix_output` tool wasn't handling string parameters correctly from certain MCP clients like Cursor AI. The tool now properly converts string parameters to numbers, ensuring line range reading works correctly across all clients.\r\n\r\n### Git Log Token Count Display (#852)\r\nEnhanced CLI summary reporting with token count display for git logs when using the `--include-logs` option, providing better visibility into included content size.\r\n\r\n```\r\n📊 Pack Summary:\r\n────────────────\r\n  Total Files: 740 files\r\n Total Tokens: 680,781 tokens\r\n  Total Chars: 2,556,220 chars\r\n       Output: repomix-output.xml\r\n     Security: ✔ No suspicious files detected\r\n     Git Logs: ✔ Git logs included (3,203 tokens)\r\n```\r\n\r\nThis maintains consistency with the existing git diffs token count display and helps users understand the token impact of including git history.\r\n\r\n## How to Update\r\n\r\n```bash\r\nnpm update -g repomix\r\n```\r\n\r\n---\r\n\r\nAs always, if you have any issues or suggestions, please let us know on GitHub issues or our [Discord community](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku).\r\n","2025-09-21T13:12:04",{"id":249,"version":250,"summary_zh":251,"released_at":252},247550,"v1.5.0","This release brings comprehensive JSON output format support with jq integration, making Repomix more efficient and versatile for AI analysis!\r\n\r\n## What's New 🚀\r\n\r\n### JSON Output Format Support (#837)\r\nAdded the powerful `--style json` option that generates structured, programmatically-friendly JSON output with hierarchical data structure and camelCase properties!\r\n\r\n```bash\r\n# Generate JSON output\r\nrepomix --style json\r\n\r\n# Via configuration file\r\n{\r\n  \"output\": {\r\n    \"style\": \"json\"\r\n  }\r\n}\r\n```\r\n\r\nThe JSON format provides a clean structure:\r\n```json5\r\n{\r\n  \"fileSummary\": { \u002F* metadata and usage guidelines *\u002F },\r\n  \"directoryStructure\": \"src\u002F\\n  cli\u002F\\n    ...\",\r\n  \"files\": {\r\n    \"src\u002Findex.js\": \"\u002F\u002F File contents here\"\r\n  }\r\n}\r\n```\r\n\r\nPerfect for programmatic processing with `jq`:\r\n```bash\r\n# Extract file list\r\ncat repomix-output.json | jq -r '.files | keys[]'\r\n\r\n# Get specific file content\r\ncat repomix-output.json | jq -r '.files[\"src\u002Findex.js\"]'\r\n```\r\n\r\nThis JSON format is particularly easy to handle with `jq`, enabling AI agents to efficiently extract specific parts without processing the entire output.\r\n\r\nFor detailed JSON format documentation and more examples, see: https:\u002F\u002Frepomix.com\u002Fguide\u002Foutput#json-format\r\n\r\n## Improvements ⚡\r\n\r\n### CLI Help Text Enhancement (#831)\r\nImproved CLI help text clarity and accuracy with corrected default values and better descriptions, making it easier for AI agents to handle Repomix more accurately when assisting users.\r\n\r\n## Bug Fixes 🐛\r\n\r\n### MCP Server Error Response Fix (#834)\r\nFixed MCP server error responses by removing redundant `structuredContent` that was incorrectly returning schema non-compliant content during errors.\r\n\r\nSpecial thanks to @huy-trn for spotting this issue and providing the fix!\r\n\r\n\r\n## How to Update\r\n\r\n```bash\r\nnpm update -g repomix\r\n```\r\n\r\n---\r\n\r\nAs always, if you have any issues or suggestions, please let us know on GitHub issues or our [Discord community](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku).\r\n","2025-09-14T10:00:31",{"id":254,"version":255,"summary_zh":256,"released_at":257},247551,"v1.4.2","This release fixes critical Go code processing issues and improves binary file reporting for better user experience!\r\n\r\n## Bug Fixes 🐛\r\n\r\n### Fix Go Code `--remove-comments` Processing (#814)\r\nFixed a critical hang issue when processing Go files containing backtick raw string literals in function calls. This specific pattern in Go syntax wasn't being handled correctly by our comment removal logic, causing infinite loops.\r\n\r\nThis made Repomix completely unusable for a few Go projects, as the process would hang indefinitely. \r\n\r\n**Problematic pattern that caused hangs:**\r\n```go\r\nfunc example() {\r\n    fmt.Fprintln(out, heredoc.Doc(`\r\n        Multi-line raw string content\r\n    `))\r\n}\r\n```\r\n\r\n### Binary File Detection Reporting (#815)\r\nFixed confusing relative path display in binary file detection reports. Now shows clear full paths to make it easier to identify excluded files.\r\n\r\n## How to Update\r\n\r\n```bash\r\nnpm update -g repomix\r\n```\r\n\r\n---\r\n\r\nAs always, if you have any issues or suggestions, please let us know on GitHub issues or our [Discord community](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku).\r\n","2025-09-01T15:32:04",{"id":259,"version":260,"summary_zh":261,"released_at":262},247552,"v1.4.1","This maintenance release focuses on improving the `--remote` option reliability.\r\n\r\n## Improvements ⚡\r\n\r\n### Remote Repository Processing (#777, #806)\r\nThe `--remote` option now automatically detects the default branch instead of assuming `main`:\r\n\r\n- Works with repositories using `main`, `master`, or custom default branches\r\n- No longer fails on repositories with non-standard default branch names\r\n\r\n## How to Update\r\n\r\n```bash\r\nnpm update -g repomix\r\n```\r\n\r\n---\r\n\r\nAs always, if you have any issues or suggestions, please let us know on GitHub issues or our [Discord community](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku).\r\n","2025-08-30T04:44:17",{"id":264,"version":265,"summary_zh":266,"released_at":267},247553,"v1.4.0","This release introduces git commit history integration and enhanced binary file detection, making Repomix more informative for AI analysis and user visibility!\r\n\r\n## What's New 🚀\r\n\r\n### Git Commit History Integration (#793)\r\nAdded the powerful `--include-logs` option that includes git commit history in the output to help AI systems understand development patterns and file change relationships.\r\n\r\n```bash\r\n# Include last 50 commits (default)\r\nrepomix --include-logs\r\n\r\n# Include specific number of commits\r\nrepomix --include-logs --include-logs-count 10\r\n\r\n# Via configuration file\r\n{\r\n  \"output\": {\r\n    \"git\": {\r\n      \"includeLogs\": true,\r\n      \"includeLogsCount\": 25\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n### Binary File Detection Reporting (#752, #798)\r\nRepomix now reports files detected as binary by content inspection, providing better visibility into excluded files.\r\n\r\n```\r\n📄 Binary Files Detected:\r\n─────────────────────────\r\n3 files detected as binary by content inspection:\r\n1. config\u002Fcorrupted.txt\r\n2. data\u002Fmalformed.json  \r\n3. logs\u002Foutput.log\r\n\r\nThese files have been excluded from the output.\r\nPlease review these files if you expected them to contain text content.\r\n```\r\n\r\nThis helps users understand why files with text extensions might be excluded when they contain binary data.\r\n\r\n## Improvements ⚡\r\n\r\n### Security Enhancements (#774)\r\n- Secured git command execution with enhanced safety measures\r\n\r\nSpecial thanks to @szepeviktor for these important security improvements!\r\n\r\n## Internal Changes 🔧\r\n\r\n### CI\u002FCD Improvements (#778)\r\n- Schema updates on main branch\r\n\r\nSpecial thanks to @BBboy01 for their first contribution with schema updates!\r\n\r\n## Website Enhancements 🌐\r\n\r\n### URL Parameter Support (#764, #775)\r\nThe Repomix website now supports URL query string parameters, allowing users to:\r\n- Bookmark configurations with preset options\r\n- Share links with predefined settings\r\n\r\nExample URLs with preset configurations:\r\n- https:\u002F\u002Frepomix.com\u002F?format=markdown&include=**%2F*.ts&ignore=**%2F*.test.ts\r\n- https:\u002F\u002Frepomix.com\u002F?repo=yamadashy%2Frepomix&format=markdown&include=**%2F*.ts&ignore=**%2F*.test.ts\r\n\r\nThis makes the web interface more user-friendly and shareable.\r\n\r\n## How to Update\r\n\r\n```bash\r\nnpm update -g repomix\r\n```\r\n\r\n---\r\n\r\nAs always, if you have any issues or suggestions, please let us know on GitHub issues or our [Discord community](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku).\r\n","2025-08-23T06:50:13",{"id":269,"version":270,"summary_zh":271,"released_at":272},247554,"v1.3.0","This release introduces token count analysis tools and MCP server enhancements, making it easier to analyze and optimize your codebase processing.\r\n\r\n## What's New 🚀\r\n\r\n### Token Count Summarization (#747)\r\nAdded the powerful `--token-count-tree` option that displays token usage in a hierarchical tree view! This feature helps identify which files and directories consume the most tokens, making it easier to optimize your Repomix output.\r\n\r\n```bash\r\nrepomix --token-count-tree\r\n```\r\n\r\nDisplays a tree structure showing token usage:\r\n```\r\n🔢 Token Count Tree:\r\n────────────────────\r\n├── tsconfig.json (177 tokens)\r\n├── typos.toml (80 tokens)\r\n├── vitest.config.ts (89 tokens)\r\n├── .agents\u002F (2874 tokens)\r\n│   └── rules\u002F (2874 tokens)\r\n│       ├── base.md (1988 tokens)\r\n│       ├── browser-extension.md (453 tokens)\r\n│       └── website.md (433 tokens)\r\n```\r\n\r\nYou can also set a minimum threshold to only show files above a certain token count:\r\n```bash\r\nrepomix --token-count-tree 1000\r\n```\r\n\r\nSpecial thanks to @gudber for this incredibly useful feature!\r\n\r\n### MCP Server: Attach Packed Output Tool (#756)\r\nAdded the `attach_packed_output` tool to the MCP server, enabling AI assistants to import and analyze previously generated Repomix XML files.\r\n\r\nThis tool accepts either a directory containing `repomix-output.xml` or a direct path to an XML file, providing the same structured analysis capabilities as freshly packed repositories without the need to reprocess the codebase.\r\n\r\nFor detailed MCP documentation, see:\r\nhttps:\u002F\u002Fgithub.com\u002Fyamadashy\u002Frepomix?tab=readme-ov-file#available-mcp-tools\r\n\r\nSpecial thanks to @petrarca for this valuable MCP enhancement!\r\n\r\n## How to Update\r\n\r\n```bash\r\nnpm update -g repomix\r\n```\r\n\r\n---\r\n\r\nAs always, if you have any issues or suggestions, please let us know on GitHub issues or our [Discord community](https:\u002F\u002Fdiscord.gg\u002FwNYzTwZFku).\r\n","2025-08-11T15:14:52"]