diff --git a/typos.toml b/typos.toml new file mode 100644 index 000000000..794677b36 --- /dev/null +++ b/typos.toml @@ -0,0 +1,4 @@ +[files] +extend-exclude = [ + "website/client/src/**/*.md" +] diff --git a/website/client/.vitepress/config.ts b/website/client/.vitepress/config.ts index 300f18b81..cf730e195 100644 --- a/website/client/.vitepress/config.ts +++ b/website/client/.vitepress/config.ts @@ -1,95 +1,20 @@ import { defineConfig } from 'vitepress'; -import { configEn } from './config/configEn'; +import { configEnUs } from './config/configEnUs'; +import { configEs } from './config/configEs'; +import { configJa } from './config/configJa'; +import { configKo } from './config/configKo'; +import { configPtBr } from './config/configPtBr'; +import { configShard } from './config/configShard'; +import { configZhCn } from './config/configZhCn'; -const googleAnalyticsTag = 'G-7PTT4PLC69'; - -/** - * Vitepress Configuration - * - * Reference - * see: https://github.com/vuejs/vitepress/tree/main/docs - */ export default defineConfig({ - title: 'Repomix', - - srcDir: 'src', - - rewrites: { - // rewrite to `en` locale - 'en/:rest*': ':rest*', - }, - - lastUpdated: true, - cleanUrls: true, - metaChunk: true, - - sitemap: { - hostname: 'http://repomix.com/', - }, - - // Shared configuration - themeConfig: { - logo: { src: '/images/repomix-logo.svg', width: 24, height: 24 }, - search: { - provider: 'local', - }, - socialLinks: [ - { icon: 'discord', link: 'https://discord.gg/wNYzTwZFku' }, - { icon: 'github', link: 'https://github.com/yamadashy/repomix' }, - ], - footer: { - message: 'Released under the MIT License.', - copyright: 'Copyright © 2024 Kazuki Yamada', - }, - }, - - // i18n configuration + ...configShard, locales: { - root: { - label: 'English', - lang: 'en-US', - ...configEn, - }, + root: { label: 'English', ...configEnUs }, + 'zh-cn': { label: '简体中文', ...configZhCn }, + ja: { label: '日本語', ...configJa }, + es: { label: 'Español', ...configEs }, + 'pt-br': { label: 'Português', ...configPtBr }, + ko: { label: '한국어', ...configKo }, }, - - head: [ - // Favicon - ['link', { rel: 'icon', href: '/images/repomix-logo.svg' }], - - // OGP - ['meta', { property: 'og:type', content: 'website' }], - ['meta', { property: 'og:locale', content: 'en' }], - ['meta', { property: 'og:title', content: 'Repomix' }], - ['meta', { property: 'og:site_name', content: 'Repomix' }], - ['meta', { property: 'og:image', content: 'https://repomix.com/images/og-image-large.png' }], - ['meta', { property: 'og:url', content: 'https://repomix.com' }], - ['meta', { property: 'og:description', content: 'Pack your codebase into AI-friendly formats' }], - ['meta', { name: 'twitter:card', content: 'summary_large_image' }], - ['meta', { property: 'twitter:domain', content: 'https://repomix.com' }], - ['meta', { property: 'twitter:url', content: 'https://repomix.com' }], - ['meta', { name: 'twitter:title', content: 'Repomix' }], - ['meta', { name: 'twitter:description', content: 'Pack your codebase into AI-friendly formats' }], - ['meta', { name: 'twitter:image', content: 'https://repomix.com/images/og-image-large.png' }], - ['meta', { name: 'thumbnail', content: 'https://repomix.com/images/og-image-large.png' }], - - // PWA - ['meta', { name: 'theme-color', content: '#f97316' }], - - // Google Analytics - [ - 'script', - { - async: true, - src: `https://www.googletagmanager.com/gtag/js?id=${googleAnalyticsTag}`, - }, - ], - [ - 'script', - {}, - `window.dataLayer = window.dataLayer || []; - function gtag(){dataLayer.push(arguments);} - gtag('js', new Date()); - gtag('config', '${googleAnalyticsTag}');`, - ], - ], }); diff --git a/website/client/.vitepress/config/configEn.ts b/website/client/.vitepress/config/configEnUs.ts similarity index 97% rename from website/client/.vitepress/config/configEn.ts rename to website/client/.vitepress/config/configEnUs.ts index 614ae7af3..cec0c4779 100644 --- a/website/client/.vitepress/config/configEn.ts +++ b/website/client/.vitepress/config/configEnUs.ts @@ -1,6 +1,6 @@ import { defineConfig } from 'vitepress'; -export const configEn = defineConfig({ +export const configEnUs = defineConfig({ lang: 'en-US', description: 'Pack your codebase into AI-friendly formats', themeConfig: { diff --git a/website/client/.vitepress/config/configEs.ts b/website/client/.vitepress/config/configEs.ts new file mode 100644 index 000000000..4a5bf92d3 --- /dev/null +++ b/website/client/.vitepress/config/configEs.ts @@ -0,0 +1,44 @@ +import { defineConfig } from 'vitepress'; + +export const configEs = defineConfig({ + lang: 'es', + description: 'Empaqueta tu código en formatos compatibles con la inteligencia artificial', + themeConfig: { + nav: [ + // guía + { text: 'Guía', link: '/es/guide/' }, + { text: 'Únete a Discord', link: 'https://discord.gg/wNYzTwZFku' }, + ], + sidebar: { + '/es/guide/': [ + { + text: 'Guía', + items: [ + { text: 'Introducción', link: '/es/guide/' }, + { text: 'Instalación', link: '/es/guide/installation' }, + { text: 'Uso Básico', link: '/es/guide/usage' }, + { text: 'Ejemplos de Prompt', link: '/es/guide/prompt-examples' }, + { text: 'Formatos de Salida', link: '/es/guide/output' }, + { text: 'Opciones de Línea de Comando', link: '/es/guide/command-line-options' }, + { text: 'Procesamiento de Repositorios Remotos', link: '/es/guide/remote-repository-processing' }, + { text: 'Configuración', link: '/es/guide/configuration' }, + { text: 'Instrucciones Personalizadas', link: '/es/guide/custom-instructions' }, + { text: 'Eliminación de Comentarios', link: '/es/guide/comment-removal' }, + { text: 'Seguridad', link: '/es/guide/security' }, + { + text: 'Consejos y Trucos', + items: [{ text: 'Mejores Prácticas', link: '/es/guide/tips/best-practices' }], + }, + { + text: 'Desarrollo', + items: [ + { text: 'Contribuir', link: '/es/guide/development/' }, + { text: 'Configuración Inicial', link: '/es/guide/development/setup' }, + ], + }, + ], + }, + ], + }, + }, +}); diff --git a/website/client/.vitepress/config/configJa.ts b/website/client/.vitepress/config/configJa.ts new file mode 100644 index 000000000..c3767f333 --- /dev/null +++ b/website/client/.vitepress/config/configJa.ts @@ -0,0 +1,43 @@ +import { defineConfig } from 'vitepress'; + +export const configJa = defineConfig({ + lang: 'ja', + description: 'コードベースをAIフレンドリーな形式にパッケージング', + themeConfig: { + nav: [ + { text: '使い方', link: '/ja/guide/' }, + { text: 'Discordに参加', link: 'https://discord.gg/wNYzTwZFku' }, + ], + sidebar: { + '/ja/guide/': [ + { + text: '使い方', + items: [ + { text: 'はじめに', link: '/ja/guide/' }, + { text: 'インストール', link: '/ja/guide/installation' }, + { text: '基本的な使い方', link: '/ja/guide/usage' }, + { text: 'プロンプト例', link: '/ja/guide/prompt-examples' }, + { text: '出力フォーマット', link: '/ja/guide/output' }, + { text: 'コマンドラインオプション', link: '/ja/guide/command-line-options' }, + { text: 'リモートリポジトリの処理', link: '/ja/guide/remote-repository-processing' }, + { text: '設定', link: '/ja/guide/configuration' }, + { text: 'カスタム指示', link: '/ja/guide/custom-instructions' }, + { text: 'コメントの削除', link: '/ja/guide/comment-removal' }, + { text: 'セキュリティ', link: '/ja/guide/security' }, + { + text: 'ヒント&テクニック', + items: [{ text: 'ベストプラクティス', link: '/ja/guide/tips/best-practices' }], + }, + { + text: '開発', + items: [ + { text: '開発への貢献', link: '/ja/guide/development/' }, + { text: '環境構築', link: '/ja/guide/development/setup' }, + ], + }, + ], + }, + ], + }, + }, +}); diff --git a/website/client/.vitepress/config/configKo.ts b/website/client/.vitepress/config/configKo.ts new file mode 100644 index 000000000..1ce657c74 --- /dev/null +++ b/website/client/.vitepress/config/configKo.ts @@ -0,0 +1,43 @@ +import { defineConfig } from 'vitepress'; + +export const configKo = defineConfig({ + lang: 'ko-KR', + description: '코드베이스를 AI 친화적인 형식으로 패키징', + themeConfig: { + nav: [ + { text: '가이드', link: '/ko/guide/' }, + { text: 'Discord 참여', link: 'https://discord.gg/wNYzTwZFku' }, + ], + sidebar: { + '/ko/guide/': [ + { + text: '가이드', + items: [ + { text: '시작하기', link: '/ko/guide/' }, + { text: '설치', link: '/ko/guide/installation' }, + { text: '기본 사용법', link: '/ko/guide/usage' }, + { text: '프롬프트 예제', link: '/ko/guide/prompt-examples' }, + { text: '출력 형식', link: '/ko/guide/output' }, + { text: '명령행 옵션', link: '/ko/guide/command-line-options' }, + { text: '원격 저장소 처리', link: '/ko/guide/remote-repository-processing' }, + { text: '설정', link: '/ko/guide/configuration' }, + { text: '사용자 지정 지시사항', link: '/ko/guide/custom-instructions' }, + { text: '주석 제거', link: '/ko/guide/comment-removal' }, + { text: '보안', link: '/ko/guide/security' }, + { + text: '팁과 요령', + items: [{ text: '모범 사례', link: '/ko/guide/tips/best-practices' }], + }, + { + text: '개발', + items: [ + { text: '기여하기', link: '/ko/guide/development/' }, + { text: '환경 설정', link: '/ko/guide/development/setup' }, + ], + }, + ], + }, + ], + }, + }, +}); diff --git a/website/client/.vitepress/config/configPtBr.ts b/website/client/.vitepress/config/configPtBr.ts new file mode 100644 index 000000000..91b1c1ccb --- /dev/null +++ b/website/client/.vitepress/config/configPtBr.ts @@ -0,0 +1,44 @@ +import { defineConfig } from 'vitepress'; + +export const configPtBr = defineConfig({ + lang: 'pt-br', + description: 'Empacote seu código em formatos compatíveis com IA', + themeConfig: { + nav: [ + // guia + { text: 'Guia', link: '/pt-br/guide/' }, + { text: 'Entrar no Discord', link: 'https://discord.gg/wNYzTwZFku' }, + ], + sidebar: { + '/pt-br/guide/': [ + { + text: 'Guia', + items: [ + { text: 'Introdução', link: '/pt-br/guide/' }, + { text: 'Instalação', link: '/pt-br/guide/installation' }, + { text: 'Uso Básico', link: '/pt-br/guide/usage' }, + { text: 'Exemplos de Prompt', link: '/pt-br/guide/prompt-examples' }, + { text: 'Formatos de Saída', link: '/pt-br/guide/output' }, + { text: 'Opções de Linha de Comando', link: '/pt-br/guide/command-line-options' }, + { text: 'Processamento de Repositórios Remotos', link: '/pt-br/guide/remote-repository-processing' }, + { text: 'Configuração', link: '/pt-br/guide/configuration' }, + { text: 'Instruções Personalizadas', link: '/pt-br/guide/custom-instructions' }, + { text: 'Remoção de Comentários', link: '/pt-br/guide/comment-removal' }, + { text: 'Segurança', link: '/pt-br/guide/security' }, + { + text: 'Dicas e Truques', + items: [{ text: 'Melhores Práticas', link: '/pt-br/guide/tips/best-practices' }], + }, + { + text: 'Desenvolvimento', + items: [ + { text: 'Contribuindo', link: '/pt-br/guide/development/' }, + { text: 'Configuração Inicial', link: '/pt-br/guide/development/setup' }, + ], + }, + ], + }, + ], + }, + }, +}); diff --git a/website/client/.vitepress/config/configShard.ts b/website/client/.vitepress/config/configShard.ts new file mode 100644 index 000000000..3df610734 --- /dev/null +++ b/website/client/.vitepress/config/configShard.ts @@ -0,0 +1,132 @@ +import { defineConfig } from 'vitepress'; + +const googleAnalyticsTag = 'G-7PTT4PLC69'; + +export const configShard = defineConfig({ + title: 'Repomix', + + srcDir: 'src', + + rewrites: { + // rewrite to `en` locale + 'en/:rest*': ':rest*', + }, + + lastUpdated: true, + cleanUrls: true, + metaChunk: true, + + sitemap: { + hostname: 'http://repomix.com/', + }, + + // Shared configuration + themeConfig: { + logo: { src: '/images/repomix-logo.svg', width: 24, height: 24 }, + search: { + provider: 'local', + options: { + locales: { + root: { + translations: { + button: { + buttonText: 'Search', + buttonAriaLabel: 'Search', + }, + modal: { + noResultsText: 'No results', + resetButtonTitle: 'Reset search', + footer: { + selectText: 'to select', + navigateText: 'to navigate', + }, + }, + }, + }, + ja: { + translations: { + button: { + buttonText: '検索', + buttonAriaLabel: '検索', + }, + modal: { + noResultsText: '検索結果がありません', + resetButtonTitle: '検索をリセット', + footer: { + selectText: '選択', + navigateText: '移動', + }, + }, + }, + }, + 'zh-cn': { + translations: { + button: { + buttonText: '搜索', + buttonAriaLabel: '搜索', + }, + modal: { + noResultsText: '未找到结果', + resetButtonTitle: '重置搜索', + footer: { + selectText: '选择', + navigateText: '导航', + }, + }, + }, + }, + }, + }, + }, + socialLinks: [ + { icon: 'discord', link: 'https://discord.gg/wNYzTwZFku' }, + { icon: 'github', link: 'https://github.com/yamadashy/repomix' }, + ], + footer: { + message: 'Released under the MIT License.', + copyright: 'Copyright © 2024 Kazuki Yamada', + }, + // Language selection + langMenuLabel: 'Languages', + }, + + head: [ + // Favicon + ['link', { rel: 'icon', href: '/images/repomix-logo.svg' }], + + // OGP + ['meta', { property: 'og:type', content: 'website' }], + ['meta', { property: 'og:title', content: 'Repomix' }], + ['meta', { property: 'og:site_name', content: 'Repomix' }], + ['meta', { property: 'og:image', content: 'https://repomix.com/images/og-image-large.png' }], + ['meta', { property: 'og:url', content: 'https://repomix.com' }], + ['meta', { property: 'og:description', content: 'Pack your codebase into AI-friendly formats' }], + ['meta', { name: 'twitter:card', content: 'summary_large_image' }], + ['meta', { property: 'twitter:domain', content: 'https://repomix.com' }], + ['meta', { property: 'twitter:url', content: 'https://repomix.com' }], + ['meta', { name: 'twitter:title', content: 'Repomix' }], + ['meta', { name: 'twitter:description', content: 'Pack your codebase into AI-friendly formats' }], + ['meta', { name: 'twitter:image', content: 'https://repomix.com/images/og-image-large.png' }], + ['meta', { name: 'thumbnail', content: 'https://repomix.com/images/og-image-large.png' }], + + // PWA + ['meta', { name: 'theme-color', content: '#f97316' }], + + // Google Analytics + [ + 'script', + { + async: true, + src: `https://www.googletagmanager.com/gtag/js?id=${googleAnalyticsTag}`, + }, + ], + [ + 'script', + {}, + `window.dataLayer = window.dataLayer || []; + function gtag(){dataLayer.push(arguments);} + gtag('js', new Date()); + gtag('config', '${googleAnalyticsTag}');`, + ], + ], +}); diff --git a/website/client/.vitepress/config/configZhCn.ts b/website/client/.vitepress/config/configZhCn.ts new file mode 100644 index 000000000..39f8734fc --- /dev/null +++ b/website/client/.vitepress/config/configZhCn.ts @@ -0,0 +1,43 @@ +import { defineConfig } from 'vitepress'; + +export const configZhCn = defineConfig({ + lang: 'zh-cn', + description: '将代码库打包成AI友好的格式', + themeConfig: { + nav: [ + { text: '指南', link: '/zh-cn/guide/' }, + { text: '加入Discord', link: 'https://discord.gg/wNYzTwZFku' }, + ], + sidebar: { + '/zh-cn/guide/': [ + { + text: '指南', + items: [ + { text: '入门指南', link: '/zh-cn/guide/' }, + { text: '安装', link: '/zh-cn/guide/installation' }, + { text: '基本用法', link: '/zh-cn/guide/usage' }, + { text: '提示示例', link: '/zh-cn/guide/prompt-examples' }, + { text: '输出格式', link: '/zh-cn/guide/output' }, + { text: '命令行选项', link: '/zh-cn/guide/command-line-options' }, + { text: '远程仓库处理', link: '/zh-cn/guide/remote-repository-processing' }, + { text: '配置', link: '/zh-cn/guide/configuration' }, + { text: '自定义指令', link: '/zh-cn/guide/custom-instructions' }, + { text: '注释移除', link: '/zh-cn/guide/comment-removal' }, + { text: '安全性', link: '/zh-cn/guide/security' }, + { + text: '技巧与窍门', + items: [{ text: '最佳实践', link: '/zh-cn/guide/tips/best-practices' }], + }, + { + text: '开发', + items: [ + { text: '参与贡献', link: '/zh-cn/guide/development/' }, + { text: '环境搭建', link: '/zh-cn/guide/development/setup' }, + ], + }, + ], + }, + ], + }, + }, +}); diff --git a/website/client/.vitepress/theme/custom.css b/website/client/.vitepress/theme/custom.css index 52e941105..c30bda115 100644 --- a/website/client/.vitepress/theme/custom.css +++ b/website/client/.vitepress/theme/custom.css @@ -10,3 +10,23 @@ --vp-home-hero-image-background-image: linear-gradient(-45deg, rgba(249, 115, 22, 0.3) 30%, rgba(249, 115, 22, 0.1)); --vp-home-hero-image-filter: blur(96px); } + +.hero-description__accent { + color: var(--vp-c-brand-1); +} +.cli-section { + padding-top: 64px; + margin-bottom: 32px; + max-width: 800px; + margin-left: auto; + margin-right: auto; +} + +.cli-section h2 { + font-size: 2rem; + font-weight: 600; + margin-bottom: 1.5rem; + background: linear-gradient(120deg, #f97316 30%, #ffb25c); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; +} diff --git a/website/client/src/en/guide/tips/best-practices.md b/website/client/src/en/guide/tips/best-practices.md index fe2fdeb61..a18b35e0d 100644 --- a/website/client/src/en/guide/tips/best-practices.md +++ b/website/client/src/en/guide/tips/best-practices.md @@ -1,75 +1,35 @@ -# Best Practices for AI-Assisted Development: A Modular Approach +# AI-Assisted Development Best Practices: From My Experience -Although I haven’t successfully completed a large-scale development project using AI, I can share my current perspective as a starting point. The key is to begin with core functionality and gradually expand, while maintaining a modular design. +While I haven't successfully completed a large-scale project using AI yet, I'd like to share what I've learned so far from my experience working with AI in development. -## 1. **Start Small and Focus on Core Functionality** +## Basic Development Approach -When working with AI, it’s crucial to start with the core functionality of your project. Trying to tackle too many features or domains at once can lead to unexpected and often incorrect code. AI models, while powerful, can struggle when asked to handle multiple interconnected domains simultaneously. +When working with AI, attempting to implement all features at once can lead to unexpected issues and project stagnation. That's why it's more effective to start with core functionality and build each feature one at a time, ensuring solid implementation before moving forward. -### Why This Works: -- **Reduced Complexity**: By focusing on one core feature at a time, you minimize the risk of the AI producing convoluted or incorrect code. -- **Easier Debugging**: Smaller, focused tasks are easier to debug and refine, both for you and the AI. -- **Iterative Improvement**: Starting small allows you to iteratively build and improve your project, ensuring each component works as expected before moving on to the next. +### The Power of Existing Code -## 2. **Adopt a Modular Design** +This approach is effective because implementing core functionality allows you to materialize your ideal design and coding style through actual code. The most effective way to communicate your project vision is through code that reflects your standards and preferences. -One of the most effective strategies when working with AI is to adopt a **modular design**. Break your project into smaller, self-contained modules that can be developed and tested independently. +By starting with core features and ensuring each component works properly before moving on, the entire project maintains consistency, making it easier for AI to generate more appropriate code. -### Benefits of Modular Design: -- **Clear Boundaries**: Each module has a well-defined purpose and interface, making it easier for the AI to generate correct and relevant code. -- **Reusability**: Modular components can be reused across different parts of the project, reducing redundancy and improving consistency. -- **Easier Maintenance**: When issues arise, they can be isolated to specific modules, making debugging and updates more manageable. +## The Modular Approach -### Example: -Instead of asking the AI to generate an entire web application at once, break it down into modules like: -- **Authentication Module** -- **Database Interface Module** -- **User Interface Components** +Breaking code into smaller modules is crucial. In my experience, keeping files around 250 lines of code makes it easier to give clear instructions to AI and makes the trial-and-error process more efficient. While token count would be a more accurate metric, line count is more practical for human developers to work with, so we use that as a guideline. -## 3. **Avoid Overlapping Domains** +This modularization isn't just about separating frontend, backend, and database components - it's about breaking down functionality at a much finer level. For example, within a single feature, you might separate validation, error handling, and other specific functionalities into distinct modules. Of course, high-level separation is also important, and implementing this modular approach gradually helps maintain clear instructions and enables AI to generate more appropriate code. This approach is effective not just for AI but for human developers as well. -In my experience, when you ask generative AI to handle multiple domains simultaneously (e.g., frontend, backend, and database logic), it often produces unexpected or incorrect code. Correcting these issues through dialogue can be extremely challenging. +## Ensuring Quality Through Testing -### Best Practice: -- **Separate Concerns**: Clearly separate different domains (e.g., frontend, backend, database) and work on them independently. -- **Use AI for Specific Tasks**: Instead of asking the AI to handle everything, use it for specific, well-defined tasks within a single domain. +I consider testing to be crucial in AI-assisted development. Tests serve not only as quality assurance measures but also as documentation that clearly demonstrates code intentions. When asking AI to implement new features, existing test code effectively acts as a specification document. -## 4. **Plan First, Code Later** +Tests are also an excellent tool for validating the correctness of AI-generated code. For instance, when having AI implement new functionality for a module, writing test cases beforehand allows you to objectively evaluate whether the generated code behaves as expected. This aligns well with Test-Driven Development (TDD) principles and is particularly effective when collaborating with AI. -For slightly larger-scale tasks, it can be effective to first consult with the AI about the overall plan. Have the AI help you compile the specifications and design the architecture before diving into coding. +## Balancing Planning and Implementation -### Steps: -1. **Consult with AI**: Discuss the project requirements and goals with the AI to create a high-level plan. -2. **Generate Specifications**: Use the AI to generate detailed specifications or pseudocode for each module. -3. **Implement Separately**: Use the specifications to update the project in a separate chat or session. This ensures that the AI focuses on one task at a time. +Before implementing large-scale features, I recommend first discussing the plan with AI. Organizing requirements and considering architecture leads to smoother implementation. A good practice is to compile requirements first, then move to a separate chat session for implementation work. -### Why This Works: -- **Clear Direction**: Having a well-defined plan reduces the risk of the AI going off-track. -- **Better Quality**: The AI produces more accurate and relevant code when it has clear instructions. -- **Easier Adjustments**: If the output isn’t perfect, it’s easier to make adjustments when you have a clear plan to refer to. - -## 5. **Human Oversight is Essential** - -While AI can significantly speed up development, the quality of its output is typically moderate and requires human adjustment. However, even with these adjustments, using AI is often faster than writing everything from scratch. - -### Best Practices for Human Oversight: -- **Review AI Output**: Always review the code generated by the AI to ensure it meets your standards and requirements. -- **Refine and Optimize**: Use your expertise to refine and optimize the AI-generated code. -- **Iterate**: Work in iterations, continuously improving the codebase with each cycle. - -## 6. **Leverage AI for Repetitive Tasks** - -AI excels at handling repetitive or boilerplate tasks, such as: -- Generating CRUD (Create, Read, Update, Delete) operations. -- Writing unit tests. -- Creating documentation. - -By offloading these tasks to the AI, you can focus on more complex and creative aspects of your project. +It's essential to have human review of AI output and make adjustments as needed. While the quality of AI-generated code is generally moderate, it still accelerates development compared to writing everything from scratch. ## Conclusion -AI-assisted development can be a powerful tool, but it requires a thoughtful and structured approach. By starting small, adopting a modular design, and planning ahead, you can maximize the effectiveness of AI while minimizing the risk of errors. Remember, human oversight is essential to ensure the final output meets your standards. - -While AI can’t replace human developers, it can significantly accelerate the development process, allowing you to focus on higher-level tasks and creative problem-solving. With these best practices in mind, you’ll be well-equipped to tackle your next project with AI as your assistant. - -Happy coding! 🚀 +By following these practices, you can leverage AI's strengths while building a consistent, high-quality codebase. Even as your project grows in size, each component remains well-defined and manageable. diff --git a/website/client/src/en/index.md b/website/client/src/en/index.md index aa9e1a22c..0c95990e9 100644 --- a/website/client/src/en/index.md +++ b/website/client/src/en/index.md @@ -190,25 +190,3 @@ Create a `repomix.config.json` for persistent settings: ::: - - diff --git a/website/client/src/es/guide/command-line-options.md b/website/client/src/es/guide/command-line-options.md new file mode 100644 index 000000000..fb523d0ed --- /dev/null +++ b/website/client/src/es/guide/command-line-options.md @@ -0,0 +1,71 @@ +# Opciones de línea de comandos + +## Opciones básicas + +```bash +repomix [directorio] # Procesa un directorio específico (por defecto: ".") +``` + +## Opciones de salida + +| Opción | Descripción | Predeterminado | +|--------|-------------|---------| +| `-o, --output ` | Nombre del archivo de salida | `repomix-output.txt` | +| `--style ` | Estilo de salida (`plain`, `xml`, `markdown`) | `plain` | +| `--output-show-line-numbers` | Añadir números de línea | `false` | +| `--copy` | Copiar al portapapeles | `false` | +| `--no-file-summary` | Desactivar el resumen de archivos | `true` | +| `--no-directory-structure` | Desactivar la estructura de directorios | `true` | +| `--remove-comments` | Eliminar comentarios | `false` | +| `--remove-empty-lines` | Eliminar líneas vacías | `false` | + +## Opciones de filtrado + +| Opción | Descripción | +|--------|-------------| +| `--include ` | Patrones a incluir (separados por comas) | +| `-i, --ignore ` | Patrones a ignorar (separados por comas) | + +## Repositorio remoto + +| Opción | Descripción | +|--------|-------------| +| `--remote ` | Procesar un repositorio remoto | +| `--remote-branch ` | Especificar rama/etiqueta/commit | + +## Configuración + +| Opción | Descripción | +|--------|-------------| +| `-c, --config ` | Ruta al archivo de configuración personalizado | +| `--init` | Crear archivo de configuración | +| `--global` | Usar configuración global | + +## Seguridad + +| Opción | Descripción | Predeterminado | +|--------|-------------|---------| +| `--no-security-check` | Desactivar la comprobación de seguridad | `true` | + +## Otras opciones + +| Opción | Descripción | +|--------|-------------| +| `-v, --version` | Mostrar versión | +| `--verbose` | Habilitar el registro detallado | +| `--top-files-len ` | Número de archivos principales a mostrar | `5` | + +## Ejemplos + +```bash +# Uso básico +repomix + +# Salida personalizada +repomix -o salida.xml --style xml + +# Procesar archivos específicos +repomix --include "src/**/*.ts" --ignore "**/*.test.ts" + +# Repositorio remoto +repomix --remote usuario/repositorio --remote-branch main diff --git a/website/client/src/es/guide/comment-removal.md b/website/client/src/es/guide/comment-removal.md new file mode 100644 index 000000000..80b808a19 --- /dev/null +++ b/website/client/src/es/guide/comment-removal.md @@ -0,0 +1,53 @@ +# Eliminación de comentarios + +Repomix puede eliminar automáticamente los comentarios de tu código al generar el archivo de salida. Esto puede ayudar a reducir el ruido y centrarse en el código real. + +## Uso + +Para habilitar la eliminación de comentarios, establece la opción `removeComments` a `true` en tu archivo `repomix.config.json`: + +```json +{ + "output": { + "removeComments": true + } +} +``` + +## Lenguajes soportados + +Repomix soporta la eliminación de comentarios para una amplia gama de lenguajes de programación, incluyendo: + +- JavaScript/TypeScript (`//`, `/* */`) +- Python (`#`, `"""`, `'''`) +- Java (`//`, `/* */`) +- C/C++ (`//`, `/* */`) +- HTML (``) +- CSS (`/* */`) +- Y muchos más... + +## Ejemplo + +Dado el siguiente código JavaScript: + +```javascript +// Este es un comentario de una sola línea +function test() { + /* Este es un + comentario multilínea */ + return true; +} +``` + +Con la eliminación de comentarios habilitada, la salida será: + +```javascript +function test() { + return true; +} +``` + +## Notas + +- La eliminación de comentarios se realiza antes que otros pasos de procesamiento, como la adición de números de línea. +- Algunos comentarios, como los comentarios JSDoc, pueden conservarse dependiendo del lenguaje y el contexto. diff --git a/website/client/src/es/guide/configuration.md b/website/client/src/es/guide/configuration.md new file mode 100644 index 000000000..3af8b4878 --- /dev/null +++ b/website/client/src/es/guide/configuration.md @@ -0,0 +1,84 @@ +# Configuración + +## Inicio rápido + +Crear archivo de configuración: +```bash +repomix --init +``` + +## Archivo de configuración + +`repomix.config.json`: +```json +{ + "output": { + "filePath": "repomix-output.xml", + "style": "xml", + "headerText": "Texto de encabezado personalizado", + "instructionFilePath": "repomix-instruction.md", + "fileSummary": true, + "directoryStructure": true, + "removeComments": false, + "removeEmptyLines": false, + "topFilesLength": 5, + "showLineNumbers": false, + "copyToClipboard": false, + "includeEmptyDirectories": false + }, + "include": ["**/*"], + "ignore": { + "useGitignore": true, + "useDefaultPatterns": true, + "customPatterns": ["tmp/", "*.log"] + }, + "security": { + "enableSecurityCheck": true + } +} +``` + +## Configuración global + +Crear configuración global: +```bash +repomix --init --global +``` + +Ubicación: +- Windows: `%LOCALAPPDATA%\Repomix\repomix.config.json` +- macOS/Linux: `~/.config/repomix/repomix.config.json` + +## Patrones de ignorar + +Orden de prioridad: +1. Opciones de CLI (`--ignore`) +2. .repomixignore +3. .gitignore +4. Patrones predeterminados + +Ejemplo de `.repomixignore`: +```text +# Directorios de caché +.cache/ +tmp/ + +# Salidas de compilación +dist/ +build/ + +# Registros +*.log +``` + +## Patrones de ignorar predeterminados + +Patrones comunes incluidos por defecto: +```text +node_modules/** +.git/** +coverage/** +dist/** +``` + +Lista completa: [defaultIgnore.ts](https://github.com/yamadashy/repomix/blob/main/src/config/defaultIgnore.ts) diff --git a/website/client/src/es/guide/custom-instructions.md b/website/client/src/es/guide/custom-instructions.md new file mode 100644 index 000000000..da1812b39 --- /dev/null +++ b/website/client/src/es/guide/custom-instructions.md @@ -0,0 +1,42 @@ +# Instrucciones personalizadas + +Repomix te permite proporcionar instrucciones personalizadas que se incluirán en el archivo de salida. Esto puede ser útil para agregar contexto o pautas específicas para los sistemas de IA que procesan el repositorio. + +## Uso + +Para incluir una instrucción personalizada, crea un archivo markdown (por ejemplo, `repomix-instruction.md`) en la raíz de tu repositorio. Luego, especifica la ruta a este archivo en tu `repomix.config.json`: + +```json +{ + "output": { + "instructionFilePath": "repomix-instruction.md" + } +} +``` + +El contenido de este archivo se incluirá en la salida bajo la sección "Instruction". + +## Ejemplo + +```markdown +# Instrucciones del repositorio + +Este repositorio contiene el código fuente de la herramienta Repomix. Por favor, sigue estas pautas al analizar el código: + +1. Concéntrate en la funcionalidad principal en el directorio `src/core`. +2. Presta especial atención a las comprobaciones de seguridad en `src/core/security`. +3. Ignora cualquier archivo en el directorio `tests`. +``` + +Esto resultará en la siguiente sección en la salida: + +```xml + +# Instrucciones del repositorio + +Este repositorio contiene el código fuente de la herramienta Repomix. Por favor, sigue estas pautas al analizar el código: + +1. Concéntrate en la funcionalidad principal en el directorio `src/core`. +2. Presta especial atención a las comprobaciones de seguridad en `src/core/security`. +3. Ignora cualquier archivo en el directorio `tests`. + diff --git a/website/client/src/es/guide/development/index.md b/website/client/src/es/guide/development/index.md new file mode 100644 index 000000000..34fd7bf3f --- /dev/null +++ b/website/client/src/es/guide/development/index.md @@ -0,0 +1,42 @@ +# Contribuir a Repomix + +## Inicio rápido + +```bash +git clone https://github.com/yamadashy/repomix.git +cd repomix +npm install +``` + +## Comandos de desarrollo + +```bash +# Ejecutar CLI +npm run cli-run + +# Ejecutar pruebas +npm run test +npm run test-coverage + +# Linting de código +npm run lint +``` + +## Estilo de código + +- Usa [Biome](https://biomejs.dev/) para linting y formateo +- Inyección de dependencias para la testabilidad +- Mantén los archivos por debajo de las 250 líneas +- Agrega pruebas para las nuevas funciones + +## Pautas para Pull Requests + +1. Ejecuta todas las pruebas +2. Pasa las comprobaciones de linting +3. Actualiza la documentación +4. Sigue el estilo de código existente + +## ¿Necesitas ayuda? + +- [Abre un issue](https://github.com/yamadashy/repomix/issues) +- [Únete a Discord](https://discord.gg/wNYzTwZFku) diff --git a/website/client/src/es/guide/development/setup.md b/website/client/src/es/guide/development/setup.md new file mode 100644 index 000000000..871b07c34 --- /dev/null +++ b/website/client/src/es/guide/development/setup.md @@ -0,0 +1,73 @@ +# Configuración del entorno de desarrollo + +## Requisitos previos + +- Node.js ≥ 18.0.0 +- Git +- npm + +## Desarrollo local + +```bash +# Clonar el repositorio +git clone https://github.com/yamadashy/repomix.git +cd repomix + +# Instalar dependencias +npm install + +# Ejecutar CLI +npm run cli-run +``` + +## Desarrollo con Docker + +```bash +# Construir la imagen +docker build -t repomix . + +# Ejecutar el contenedor +docker run -v ./:/app -it --rm repomix +``` + +## Estructura del proyecto + +``` +src/ +├── cli/ # Implementación de la CLI +├── config/ # Manejo de la configuración +├── core/ # Funcionalidad principal +└── shared/ # Utilidades compartidas +``` + +## Pruebas + +```bash +# Ejecutar pruebas +npm run test + +# Cobertura de pruebas +npm run test-coverage + +# Linting +npm run lint-biome +npm run lint-ts +npm run lint-secretlint +``` + +## Proceso de lanzamiento + +1. Actualizar la versión +```bash +npm version patch # o minor/major +``` + +2. Ejecutar pruebas y construir +```bash +npm run test-coverage +npm run build +``` + +3. Publicar +```bash +npm publish diff --git a/website/client/src/es/guide/index.md b/website/client/src/es/guide/index.md new file mode 100644 index 000000000..b2051a1e5 --- /dev/null +++ b/website/client/src/es/guide/index.md @@ -0,0 +1,60 @@ +# Primeros pasos con Repomix + +Repomix es una herramienta que empaqueta todo tu repositorio en un solo archivo amigable para la IA. Está diseñado para ayudarte a alimentar tu código a modelos de lenguaje grandes (LLMs) como Claude, ChatGPT y Gemini. + +## Inicio rápido + +Ejecuta este comando en el directorio de tu proyecto: + +```bash +npx repomix +``` + +¡Eso es todo! Encontrarás un archivo `repomix-output.txt` que contiene todo tu repositorio en un formato amigable para la IA. + +Luego puedes enviar este archivo a un asistente de IA con un prompt como: + +``` +Este archivo contiene todos los archivos del repositorio combinados en uno. +Quiero refactorizar el código, así que por favor revísalo primero. +``` + +La IA analizará todo tu código y proporcionará información completa: + +![Repomix File Usage 1](/images/docs/repomix-file-usage-1.png) + +Al discutir cambios específicos, la IA puede ayudar a generar código. Con funciones como los Artefactos de Claude, incluso puedes recibir múltiples archivos interdependientes: + +![Repomix File Usage 2](/images/docs/repomix-file-usage-2.png) + +¡Feliz programación! 🚀 + +## Características principales + +- **Salida optimizada para IA**: Formatea tu código para un fácil procesamiento por parte de la IA +- **Conteo de tokens**: Realiza un seguimiento del uso de tokens para los límites de contexto de los LLM +- **Compatible con Git**: Respeta tus archivos .gitignore +- **Enfocado en la seguridad**: Detecta información sensible +- **Múltiples formatos de salida**: Elige entre texto plano, XML o Markdown + +## ¿Qué sigue? + +- [Guía de instalación](installation.md): Diferentes formas de instalar Repomix +- [Guía de uso](usage.md): Aprende sobre las funciones básicas y avanzadas +- [Configuración](configuration.md): Personaliza Repomix para tus necesidades +- [Funciones de seguridad](security.md): Aprende sobre las comprobaciones de seguridad + +## Comunidad + +Únete a nuestra [comunidad de Discord](https://discord.gg/wNYzTwZFku) para: +- Obtener ayuda con Repomix +- Compartir tus experiencias +- Sugerir nuevas funciones +- Conectarte con otros usuarios + +## Soporte + +¿Encontraste un error o necesitas ayuda? +- [Abre un issue en GitHub](https://github.com/yamadashy/repomix/issues) +- Únete a nuestro servidor de Discord +- Consulta la [documentación](https://repomix.com) diff --git a/website/client/src/es/guide/installation.md b/website/client/src/es/guide/installation.md new file mode 100644 index 000000000..25ca8874f --- /dev/null +++ b/website/client/src/es/guide/installation.md @@ -0,0 +1,52 @@ +# Instalación + +## Usando npx (no requiere instalación) + +```bash +npx repomix +``` + +## Instalación global + +### npm +```bash +npm install -g repomix +``` + +### Yarn +```bash +yarn global add repomix +``` + +### Homebrew (macOS) +```bash +brew install repomix +``` + +## Instalación con Docker + +Extrae y ejecuta la imagen de Docker: + +```bash +# Directorio actual +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix + +# Directorio específico +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix ruta/al/directorio + +# Repositorio remoto +docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix --remote yamadashy/repomix +``` + +## Requisitos del sistema + +- Node.js: ≥ 18.0.0 +- Git: Requerido para el procesamiento de repositorios remotos + +## Verificación + +Después de la instalación, verifica que Repomix esté funcionando: + +```bash +repomix --version +repomix --help diff --git a/website/client/src/es/guide/output.md b/website/client/src/es/guide/output.md new file mode 100644 index 000000000..bdb74bead --- /dev/null +++ b/website/client/src/es/guide/output.md @@ -0,0 +1,120 @@ +# Formatos de salida + +Repomix admite tres formatos de salida: +- Texto sin formato (predeterminado) +- XML +- Markdown + +## Formato de texto sin formato + +```bash +repomix --style plain +``` + +Estructura de salida: +```text +Este archivo es una representación fusionada de toda la base de código... + +================ +Resumen de archivos +================ +(Metadatos e instrucciones de IA) + +================ +Estructura de directorios +================ +src/ + index.ts + utils/ + helper.ts + +================ +Archivos +================ + +================ +Archivo: src/index.ts +================ +// Contenido del archivo aquí +``` + +## Formato XML + +```bash +repomix --style xml +``` + +El formato XML está optimizado para el procesamiento de IA: + +```xml +Este archivo es una representación fusionada de toda la base de código... + + +(Metadatos e instrucciones de IA) + + + +src/ + index.ts + utils/ + helper.ts + + + + +// Contenido del archivo aquí + + +``` + +::: tip ¿Por qué XML? +Las etiquetas XML ayudan a los modelos de IA como Claude a analizar el contenido con mayor precisión. La [documentación de Claude](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/use-xml-tags) recomienda usar etiquetas XML para prompts estructurados. +::: + +## Formato Markdown + +```bash +repomix --style markdown +``` + +Markdown proporciona un formato legible: + +```markdown +Este archivo es una representación fusionada de toda la base de código... + +# Resumen de archivos +(Metadatos e instrucciones de IA) + +# Estructura de directorios +``` +src/ +index.ts +utils/ +helper.ts +``` + +# Archivos + +## Archivo: src/index.ts +```typescript +// Contenido del archivo aquí +``` +``` + +## Uso con modelos de IA + +Cada formato funciona bien con modelos de IA, pero considera: +- Usar XML para Claude (mejor precisión de análisis) +- Usar Markdown para legibilidad general +- Usar texto sin formato para simplicidad y compatibilidad universal + +## Personalización + +Establece el formato predeterminado en `repomix.config.json`: +```json +{ + "output": { + "style": "xml", + "filePath": "output.xml" + } +} diff --git a/website/client/src/es/guide/prompt-examples.md b/website/client/src/es/guide/prompt-examples.md new file mode 100644 index 000000000..22e47553e --- /dev/null +++ b/website/client/src/es/guide/prompt-examples.md @@ -0,0 +1,124 @@ +# Ejemplos de prompts + +## Revisión de código + +### Revisión de arquitectura +``` +Analiza la arquitectura de esta base de código: +1. Evalúa la estructura general y los patrones +2. Identifica posibles problemas de arquitectura +3. Sugiere mejoras para la escalabilidad +4. Señala las áreas que siguen las mejores prácticas + +Concéntrate en la mantenibilidad y la modularidad. +``` + +### Revisión de seguridad +``` +Realiza una revisión de seguridad de esta base de código: +1. Identifica posibles vulnerabilidades de seguridad +2. Busca antipatrones de seguridad comunes +3. Revisa el manejo de errores y la validación de entradas +4. Evalúa la seguridad de las dependencias + +Proporciona ejemplos específicos y pasos de remediación. +``` + +### Revisión de rendimiento +``` +Revisa el rendimiento de la base de código: +1. Identifica cuellos de botella de rendimiento +2. Comprueba la utilización de recursos +3. Revisa la eficiencia algorítmica +4. Evalúa las estrategias de almacenamiento en caché + +Incluye recomendaciones de optimización específicas. +``` + +## Generación de documentación + +### Documentación de API +``` +Genera documentación de API completa: +1. Enumera y describe todos los endpoints públicos +2. Documenta los formatos de solicitud/respuesta +3. Incluye ejemplos de uso +4. Señala cualquier limitación o restricción +``` + +### Guía para desarrolladores +``` +Crea una guía para desarrolladores que cubra: +1. Instrucciones de configuración +2. Descripción general de la estructura del proyecto +3. Flujo de trabajo de desarrollo +4. Enfoque de pruebas +5. Pasos comunes para la solución de problemas +``` + +### Documentación de arquitectura +``` +Documenta la arquitectura del sistema: +1. Descripción general de alto nivel +2. Interacciones entre componentes +3. Diagramas de flujo de datos +4. Decisiones de diseño y justificación +5. Restricciones y limitaciones del sistema +``` + +## Análisis y mejora + +### Análisis de dependencias +``` +Analiza las dependencias del proyecto: +1. Identifica paquetes obsoletos +2. Busca vulnerabilidades de seguridad +3. Sugiere paquetes alternativos +4. Revisa los patrones de uso de dependencias + +Incluye recomendaciones de actualización específicas. +``` + +### Cobertura de pruebas +``` +Revisa la cobertura de pruebas: +1. Identifica componentes no probados +2. Sugiere casos de prueba adicionales +3. Revisa la calidad de las pruebas +4. Recomienda estrategias de prueba +``` + +### Calidad del código +``` +Evalúa la calidad del código y sugiere mejoras: +1. Revisa las convenciones de nomenclatura +2. Comprueba la organización del código +3. Evalúa el manejo de errores +4. Revisa las prácticas de comentarios + +Proporciona ejemplos específicos de patrones buenos y problemáticos. +``` + +## Consejos para obtener mejores resultados + +1. **Sé específico**: Incluye objetivos claros y criterios de evaluación +2. **Establece el contexto**: Especifica tu rol y el nivel de experiencia necesario +3. **Solicita un formato**: Define cómo quieres que se estructure la respuesta +4. **Prioriza**: Indica qué aspectos son más importantes + +## Notas específicas del modelo + +### Claude +- Usa el formato de salida XML +- Coloca las instrucciones importantes al final +- Especifica la estructura de la respuesta + +### ChatGPT +- Usa el formato Markdown +- Divide las bases de código grandes en secciones +- Incluye prompts de rol del sistema + +### Gemini +- Funciona con todos los formatos +- Concéntrate en áreas específicas por solicitud +- Usa un análisis paso a paso diff --git a/website/client/src/es/guide/remote-repository-processing.md b/website/client/src/es/guide/remote-repository-processing.md new file mode 100644 index 000000000..5fc957141 --- /dev/null +++ b/website/client/src/es/guide/remote-repository-processing.md @@ -0,0 +1,68 @@ +# Procesamiento de repositorios remotos + +## Uso básico + +Procesar repositorios públicos: +```bash +# Usando URL completo +repomix --remote https://github.com/usuario/repositorio + +# Usando la abreviatura de GitHub +repomix --remote usuario/repositorio +``` + +## Selección de rama y commit + +```bash +# Rama específica +repomix --remote usuario/repositorio --remote-branch main + +# Etiqueta +repomix --remote usuario/repositorio --remote-branch v1.0.0 + +# Hash de commit +repomix --remote usuario/repositorio --remote-branch 935b695 +``` + +## Requisitos + +- Git debe estar instalado +- Conexión a Internet +- Acceso de lectura al repositorio + +## Control de salida + +```bash +# Ubicación de salida personalizada +repomix --remote usuario/repositorio -o salida-personalizada.xml + +# Con formato XML +repomix --remote usuario/repositorio --style xml + +# Eliminar comentarios +repomix --remote usuario/repositorio --remove-comments +``` + +## Uso de Docker + +```bash +# Procesar y generar la salida en el directorio actual +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix \ + --remote usuario/repositorio + +# Generar la salida en un directorio específico +docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix \ + --remote usuario/repositorio +``` + +## Problemas comunes + +### Problemas de acceso +- Asegúrate de que el repositorio sea público +- Comprueba la instalación de Git +- Verifica la conexión a Internet + +### Repositorios grandes +- Usa `--include` para seleccionar rutas específicas +- Habilita `--remove-comments` +- Procesa las ramas por separado diff --git a/website/client/src/es/guide/security.md b/website/client/src/es/guide/security.md new file mode 100644 index 000000000..22cc42d8f --- /dev/null +++ b/website/client/src/es/guide/security.md @@ -0,0 +1,65 @@ +# Seguridad + +## Función de verificación de seguridad + +Repomix utiliza [Secretlint](https://github.com/secretlint/secretlint) para detectar información sensible en tus archivos: +- Claves de API +- Tokens de acceso +- Credenciales +- Claves privadas +- Variables de entorno + +## Configuración + +Las verificaciones de seguridad están habilitadas de forma predeterminada. + +Deshabilitar a través de CLI: +```bash +repomix --no-security-check +``` + +O en `repomix.config.json`: +```json +{ + "security": { + "enableSecurityCheck": false + } +} +``` + +## Medidas de seguridad + +1. **Exclusión de archivos binarios**: Los archivos binarios no se incluyen en la salida +2. **Compatible con Git**: Respeta los patrones de `.gitignore` +3. **Detección automatizada**: Busca problemas de seguridad comunes: + - Credenciales de AWS + - Cadenas de conexión de bases de datos + - Tokens de autenticación + - Claves privadas + +## Cuando la verificación de seguridad encuentra problemas + +Ejemplo de salida: +```bash +🔍 Verificación de seguridad: +────────────────── +2 archivo(s) sospechoso(s) detectado(s) y excluido(s): +1. config/credentials.json + - Se encontró la clave de acceso de AWS +2. .env.local + - Se encontró la contraseña de la base de datos +``` + +## Mejores prácticas + +1. Siempre revisa la salida antes de compartirla +2. Usa `.repomixignore` para rutas sensibles +3. Mantén las verificaciones de seguridad habilitadas +4. Elimina los archivos sensibles del repositorio + +## Reportar problemas de seguridad + +¿Encontraste una vulnerabilidad de seguridad? Por favor: +1. No abras un issue público +2. Envía un correo electrónico a: koukun0120@gmail.com +3. O usa [GitHub Security Advisories](https://github.com/yamadashy/repomix/security/advisories/new) diff --git a/website/client/src/es/guide/tips/best-practices.md b/website/client/src/es/guide/tips/best-practices.md new file mode 100644 index 000000000..beae69964 --- /dev/null +++ b/website/client/src/es/guide/tips/best-practices.md @@ -0,0 +1,35 @@ +# Mejores prácticas para el desarrollo asistido por IA: Desde mi experiencia + +Aunque todavía no he completado con éxito un proyecto a gran escala utilizando IA, me gustaría compartir lo que he aprendido hasta ahora de mi experiencia trabajando con IA en el desarrollo. + +## Enfoque de desarrollo básico + +Cuando se trabaja con IA, intentar implementar todas las funciones a la vez puede llevar a problemas inesperados y al estancamiento del proyecto. Por eso es más efectivo comenzar con la funcionalidad principal y construir cada función una por una, asegurando una implementación sólida antes de seguir adelante. + +### El poder del código existente + +Este enfoque es efectivo porque implementar la funcionalidad principal te permite materializar tu diseño ideal y estilo de codificación a través de código real. La forma más efectiva de comunicar la visión de tu proyecto es a través de código que refleje tus estándares y preferencias. + +Al comenzar con las funciones principales y asegurar que cada componente funcione correctamente antes de continuar, todo el proyecto mantiene la consistencia, lo que facilita que la IA genere código más apropiado. + +## El enfoque modular + +Dividir el código en módulos más pequeños es crucial. En mi experiencia, mantener los archivos alrededor de 250 líneas de código facilita dar instrucciones claras a la IA y hace que el proceso de prueba y error sea más eficiente. Si bien el recuento de tokens sería una métrica más precisa, el recuento de líneas es más práctico para los desarrolladores humanos, por lo que lo usamos como una guía. + +Esta modularización no se trata solo de separar los componentes de frontend, backend y base de datos, sino de desglosar la funcionalidad a un nivel mucho más fino. Por ejemplo, dentro de una sola función, podrías separar la validación, el manejo de errores y otras funcionalidades específicas en módulos distintos. Por supuesto, la separación de alto nivel también es importante, e implementar este enfoque modular gradualmente ayuda a mantener instrucciones claras y permite que la IA genere código más apropiado. Este enfoque es efectivo no solo para la IA sino también para los desarrolladores humanos. + +## Asegurar la calidad a través de las pruebas + +Considero que las pruebas son cruciales en el desarrollo asistido por IA. Las pruebas no solo sirven como medidas de garantía de calidad, sino también como documentación que demuestra claramente las intenciones del código. Al pedirle a la IA que implemente nuevas funciones, el código de prueba existente actúa efectivamente como un documento de especificación. + +Las pruebas también son una excelente herramienta para validar la corrección del código generado por IA. Por ejemplo, al hacer que la IA implemente una nueva funcionalidad para un módulo, escribir casos de prueba de antemano te permite evaluar objetivamente si el código generado se comporta como se espera. Esto se alinea bien con los principios de desarrollo basado en pruebas (TDD) y es particularmente efectivo cuando se colabora con la IA. + +## Equilibrar la planificación y la implementación + +Antes de implementar funciones a gran escala, recomiendo discutir primero el plan con la IA. Organizar los requisitos y considerar la arquitectura conduce a una implementación más fluida. Una buena práctica es compilar primero los requisitos y luego pasar a una sesión de chat separada para el trabajo de implementación. + +Es esencial que un humano revise el resultado de la IA y haga los ajustes necesarios. Si bien la calidad del código generado por IA es generalmente moderada, aún acelera el desarrollo en comparación con escribir todo desde cero. + +## Conclusión + +Siguiendo estas prácticas, puedes aprovechar las fortalezas de la IA mientras construyes una base de código consistente y de alta calidad. Incluso a medida que tu proyecto crece en tamaño, cada componente permanece bien definido y manejable. diff --git a/website/client/src/es/guide/usage.md b/website/client/src/es/guide/usage.md new file mode 100644 index 000000000..f7f8b710d --- /dev/null +++ b/website/client/src/es/guide/usage.md @@ -0,0 +1,87 @@ +# Uso básico + +## Inicio rápido + +Empaqueta todo tu repositorio: +```bash +repomix +``` + +## Casos de uso comunes + +### Empaquetar directorios específicos +```bash +repomix ruta/al/directorio +``` + +### Incluir archivos específicos +Usa [patrones glob](https://github.com/mrmlnc/fast-glob?tab=readme-ov-file#pattern-syntax): +```bash +repomix --include "src/**/*.ts,**/*.md" +``` + +### Excluir archivos +```bash +repomix --ignore "**/*.log,tmp/" +``` + +### Repositorios remotos +```bash +# Usando la URL de GitHub +repomix --remote https://github.com/usuario/repositorio + +# Usando la abreviatura +repomix --remote usuario/repositorio + +# Rama/etiqueta/commit específico +repomix --remote usuario/repositorio --remote-branch main +repomix --remote usuario/repositorio --remote-branch 935b695 +``` + +## Formatos de salida + +### Texto sin formato (predeterminado) +```bash +repomix --style plain +``` + +### XML +```bash +repomix --style xml +``` + +### Markdown +```bash +repomix --style markdown +``` + +## Opciones adicionales + +### Eliminar comentarios +```bash +repomix --remove-comments +``` + +### Mostrar números de línea +```bash +repomix --output-show-line-numbers +``` + +### Copiar al portapapeles +```bash +repomix --copy +``` + +### Deshabilitar la verificación de seguridad +```bash +repomix --no-security-check +``` + +## Configuración + +Inicializar el archivo de configuración: +```bash +repomix --init +``` + +Consulta la [Guía de configuración](/guide/configuration) para obtener opciones detalladas. diff --git a/website/client/src/es/index.md b/website/client/src/es/index.md new file mode 100644 index 000000000..0b3d92034 --- /dev/null +++ b/website/client/src/es/index.md @@ -0,0 +1,191 @@ +--- +layout: home +title: Repomix +titleTemplate: Empaqueta tu código en formatos amigables para la IA +aside: false +editLink: false + +features: + - icon: 🤖 + title: Optimizado para IA + details: Formatea tu código de una manera que sea fácil de entender y procesar para la IA. + + - icon: ⚙️ + title: Compatible con Git + details: Respeta automáticamente tus archivos .gitignore. + + - icon: 🛡️ + title: Enfocado en la seguridad + details: Incorpora Secretlint para realizar robustas comprobaciones de seguridad que detectan y previenen la inclusión de información sensible. + + - icon: 📊 + title: Conteo de tokens + details: Proporciona recuentos de tokens para cada archivo y para todo el repositorio, útil para los límites de contexto de los LLM. + +--- + +
+ +## Inicio rápido + +Una vez que hayas generado un archivo empaquetado (`repomix-output.txt`) usando Repomix, puedes enviarlo a un asistente de IA con un prompt como: + +``` +Este archivo contiene todos los archivos del repositorio combinados en uno. +Quiero refactorizar el código, así que por favor revísalo primero. +``` + +La IA analizará todo tu código y proporcionará información completa: + +![Repomix File Usage 1](/images/docs/repomix-file-usage-1.png) + +Al discutir cambios específicos, la IA puede ayudar a generar código. Con funciones como los Artefactos de Claude, incluso puedes recibir múltiples archivos interdependientes: + +![Repomix File Usage 2](/images/docs/repomix-file-usage-2.png) + +¡Feliz programación! 🚀 + + + +## Guía para usuarios avanzados + +Para los usuarios avanzados que necesitan más control, Repomix ofrece amplias opciones de personalización a través de su interfaz de línea de comandos. + +### Inicio rápido + +Puedes probar Repomix instantáneamente en el directorio de tu proyecto sin necesidad de instalación: + +```bash +npx repomix +``` + +O instalarlo globalmente para uso repetido: + +```bash +# Instalar usando npm +npm install -g repomix + +# Alternativamente usando yarn +yarn global add repomix + +# Alternativamente usando Homebrew (macOS) +brew install repomix + +# Luego ejecutar en cualquier directorio de proyecto +repomix +``` + +¡Eso es todo! Repomix generará un archivo `repomix-output.txt` en tu directorio actual, que contendrá todo tu repositorio en un formato amigable para la IA. + + + +### Uso + +Para empaquetar todo tu repositorio: + +```bash +repomix +``` + +Para empaquetar un directorio específico: + +```bash +repomix ruta/al/directorio +``` + +Para empaquetar archivos o directorios específicos usando [patrones glob](https://github.com/mrmlnc/fast-glob?tab=readme-ov-file#pattern-syntax): + +```bash +repomix --include "src/**/*.ts,**/*.md" +``` + +Para excluir archivos o directorios específicos: + +```bash +repomix --ignore "**/*.log,tmp/" +``` + +Para empaquetar un repositorio remoto: +```bash +repomix --remote https://github.com/yamadashy/repomix + +# También puedes usar la abreviatura de GitHub: +repomix --remote yamadashy/repomix + +# Puedes especificar el nombre de la rama, la etiqueta o el hash de confirmación: +repomix --remote https://github.com/yamadashy/repomix --remote-branch main + +# O usar un hash de confirmación específico: +repomix --remote https://github.com/yamadashy/repomix --remote-branch 935b695 +``` + +Para inicializar un nuevo archivo de configuración (`repomix.config.json`): + +```bash +repomix --init +``` + +Una vez que hayas generado el archivo empaquetado, puedes usarlo con herramientas de IA generativa como Claude, ChatGPT y Gemini. + +#### Uso de Docker + +También puedes ejecutar Repomix usando Docker 🐳 +Esto es útil si deseas ejecutar Repomix en un entorno aislado o prefieres usar contenedores. + +Uso básico (directorio actual): + +```bash +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix +``` + +Para empaquetar un directorio específico: +```bash +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix ruta/al/directorio +``` + +Procesar un repositorio remoto y generar la salida en un directorio `output`: + +```bash +docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix --remote https://github.com/yamadashy/repomix +``` + +### Formatos de salida + +Elige tu formato de salida preferido: + +```bash +# Formato XML (predeterminado) +repomix --style xml + +# Formato Markdown +repomix --style markdown + +# Formato de texto plano +repomix --style plain +``` + +### Personalización + +Crea un archivo `repomix.config.json` para configuraciones persistentes: + +```json +{ + "output": { + "style": "markdown", + "filePath": "custom-output.md", + "removeComments": true, + "showLineNumbers": true, + "topFilesLength": 10 + }, + "ignore": { + "customPatterns": ["*.test.ts", "docs/**"] + } +} +``` + +### Más ejemplos +::: tip +💡 ¡Consulta nuestro [repositorio de GitHub](https://github.com/yamadashy/repomix) para obtener la documentación completa y más ejemplos! +::: + +
diff --git a/website/client/src/ja/guide/command-line-options.md b/website/client/src/ja/guide/command-line-options.md new file mode 100644 index 000000000..8f2d7d0f9 --- /dev/null +++ b/website/client/src/ja/guide/command-line-options.md @@ -0,0 +1,72 @@ +# コマンドラインオプション + +## 基本オプション + +```bash +repomix [directory] # 特定のディレクトリを処理(指定しない場合はカレントディレクトリ) +``` + +## 出力オプション + +| オプション | 説明 | デフォルト | +|--------|-------------|---------| +| `-o, --output ` | 出力ファイル名 | `repomix-output.txt` | +| `--style ` | 出力形式(`plain`, `xml`, `markdown`) | `plain` | +| `--output-show-line-numbers` | 行番号を追加 | `false` | +| `--copy` | クリップボードにコピー | `false` | +| `--no-file-summary` | ファイルサマリーを無効化 | `true` | +| `--no-directory-structure` | ディレクトリ構造を無効化 | `true` | +| `--remove-comments` | コメントを削除 | `false` | +| `--remove-empty-lines` | 空行を削除 | `false` | + +## フィルターオプション + +| オプション | 説明 | +|--------|-------------| +| `--include ` | 指定したファイルまたはディレクトリをパッケージング対象に含める | +| `-i, --ignore ` | 指定したファイルまたはディレクトリをパッケージング対象から除外する | + +## リモートリポジトリ + +| オプション | 説明 | +|--------|-------------| +| `--remote ` | 指定したリモートリポジトリをパッケージングする | +| `--remote-branch ` | リモートリポジトリの特定のブランチ、タグ、またはコミットハッシュを指定する | + +## 設定 + +| オプション | 説明 | +|--------|-------------| +| `-c, --config ` | カスタム設定ファイルのパス | +| `--init` | 設定ファイルを作成 | +| `--global` | グローバル設定を使用 | + +## セキュリティ + +| オプション | 説明 | デフォルト | +|--------|-------------|---------| +| `--no-security-check` | セキュリティチェックを無効化 | `true` | + +## その他のオプション + +| オプション | 説明 | +|--------|-------------| +| `-v, --version` | バージョンを表示 | +| `--verbose` | 詳細なログ出力を有効化 | +| `--top-files-len ` | 上位何件のファイルを詳細出力するかを指定する | `5` | + +## 使用例 + +```bash +# 基本的な使用方法 +repomix + +# 出力ファイル名とフォーマットを指定 +repomix -o output.xml --style xml + +# 特定のファイルを含める、または除外する +repomix --include "src/**/*.ts" --ignore "**/*.test.ts" + +# リモートリポジトリをパッケージングする +repomix --remote user/repo --remote-branch main +``` diff --git a/website/client/src/ja/guide/comment-removal.md b/website/client/src/ja/guide/comment-removal.md new file mode 100644 index 000000000..a8b79d003 --- /dev/null +++ b/website/client/src/ja/guide/comment-removal.md @@ -0,0 +1,53 @@ +# ソースコード中のコメント削除 + +Repomixは、パッケージング時に、ソースコード中のコメントを自動的に削除する機能を提供します。これにより、出力ファイルからノイズを減らし、実際のコードに焦点を当てることができます。 + +## 使用方法 + +コメントの削除を有効にするには、`repomix.config.json`で`removeComments`オプションを`true`に設定します。 + +```json +{ + "output": { + "removeComments": true + } +} +``` + +## サポートされている言語 + +Repomixは以下を含む多くのプログラミング言語のコメント削除をサポートしています。 + +- JavaScript/TypeScript (`//`, `/* */`) +- Python (`#`, `"""`, `'''`) +- Java (`//`, `/* */`) +- C/C++ (`//`, `/* */`) +- HTML (``) +- CSS (`/* */`) +- その他多数の言語 + +## 使用例と出力例 + +以下のようなJavaScriptコードがある場合 + +```javascript +// これは単一行コメントです +function test() { + /* これは + 複数行コメントです */ + return true; +} +``` + +コメント削除を有効にすると、出力は以下のようになります。 + +```javascript +function test() { + return true; +} +``` + +## 制限事項 + +- コメントの削除は、行番号の追加など、他の処理よりも先に行われます。 +- JSDocコメントなど、一部のコメントは削除されない場合があります。 diff --git a/website/client/src/ja/guide/configuration.md b/website/client/src/ja/guide/configuration.md new file mode 100644 index 000000000..f2b9ded5a --- /dev/null +++ b/website/client/src/ja/guide/configuration.md @@ -0,0 +1,89 @@ +# 設定 + +## クイックスタート + +設定ファイルの作成。 + +```bash +repomix --init +``` + +## 設定ファイル (`repomix.config.json`) + +```json +{ + "output": { + "filePath": "repomix-output.xml", + "style": "xml", + "headerText": "カスタムヘッダーテキスト", + "instructionFilePath": "repomix-instruction.md", + "fileSummary": true, + "directoryStructure": true, + "removeComments": false, + "removeEmptyLines": false, + "topFilesLength": 5, + "showLineNumbers": false, + "copyToClipboard": false, + "includeEmptyDirectories": false + }, + "include": ["**/*"], + "ignore": { + "useGitignore": true, + "useDefaultPatterns": true, + "customPatterns": ["tmp/", "*.log"] + }, + "security": { + "enableSecurityCheck": true + } +} +``` + +## グローバル設定ファイル + +グローバル設定ファイルの作成。 + +```bash +repomix --init --global +``` + +設定ファイルの場所。 + +- Windows: `%LOCALAPPDATA%\\Repomix\\repomix.config.json` +- macOS/Linux: `~/.config/repomix/repomix.config.json` + +## 除外パターン (`.repomixignore`) + +優先順位 + +1. CLIオプション(`--ignore`) +2. .repomixignore +3. .gitignore +4. デフォルトパターン + +`.repomixignore`の例 + +```text +# キャッシュディレクトリ +.cache/ +tmp/ + +# ビルド出力 +dist/ +build/ + +# ログ +*.log +``` + +## デフォルトの除外パターン + +デフォルトで含まれる一般的なパターン + +```text +node_modules/** +.git/** +coverage/** +dist/** +``` + +完全なリスト:[defaultIgnore.ts](https://github.com/yamadashy/repomix/blob/main/src/config/defaultIgnore.ts) diff --git a/website/client/src/ja/guide/custom-instructions.md b/website/client/src/ja/guide/custom-instructions.md new file mode 100644 index 000000000..c648011e3 --- /dev/null +++ b/website/client/src/ja/guide/custom-instructions.md @@ -0,0 +1,57 @@ +# カスタム指示 + +Repomixでは、出力ファイルに含めるカスタム指示(独自の指示)を提供することができます。これは、AIシステムにプロジェクトの特定のコンテキストや要件を理解させるのに役立ちます。 + +## 使用方法 + +カスタム指示を含めるには、リポジトリのルートにマークダウンファイル(例:`repomix-instruction.md`)を作成し、`repomix.config.json`でそのパスを指定します。 + +```json +{ + "output": { + "instructionFilePath": "repomix-instruction.md" + } +} +``` + +このファイルの内容は出力の「Instruction」セクションに含まれます。 + +## 使用例 + +```markdown +# コーディングガイドライン + +- Airbnb JavaScript スタイルガイドに従う +- 適切な場合は、ファイルを小さな単位に分割する +- 自明でないロジックにはコメントを追加。すべてのテキストは英語で記述 +- すべての新機能には対応するユニットテストを作成する + +# 生成内容について + +- 特に指定がない限り、すべての内容を省略せずに含める +- 大規模なコードベースを処理しながら、出力の品質を維持する +``` + +これは出力ファイルで以下のように表示されます。 + +```xml + +# コーディングガイドライン + +- Airbnb JavaScript スタイルガイドに従う +- 適切な場合は、ファイルを小さな単位に分割する +- 自明でないロジックにはコメントを追加。すべてのテキストは英語で記述 +- すべての新機能には対応するユニットテストを作成する + +# 生成内容について + +- 特に指定がない限り、すべての内容を省略せずに含める +- 大規模なコードベースを処理しながら、出力の品質を維持する + +``` + +## 注意点 + +- カスタム指示は出力ファイルの`Instruction`セクションに含まれます。 +- カスタム指示は適切な長さに保つことを推奨します。過度に長い指示は逆効果になる場合があります。 +- プロジェクト固有のガイドラインや要件に焦点を当てることで、AIがプロジェクトのコンテキストを理解しやすくなり、より効果的な結果が得られます。 diff --git a/website/client/src/ja/guide/development/index.md b/website/client/src/ja/guide/development/index.md new file mode 100644 index 000000000..44aeb511f --- /dev/null +++ b/website/client/src/ja/guide/development/index.md @@ -0,0 +1,42 @@ +# Repomixへの貢献 + +## クイックスタート + +```bash +git clone https://github.com/yamadashy/repomix.git +cd repomix +npm install +``` + +## 開発コマンド + +```bash +# CLIを実行 +npm run cli-run + +# テストを実行 +npm run test +npm run test-coverage + +# コードのリント +npm run lint +``` + +## コーディングスタイル + +- [Biome](https://biomejs.dev/)を使用してリントとフォーマットを行う +- テスト可能性のために依存性注入を使用 +- ファイルは250行以下に保つ +- 新機能には必ずテストを追加 + +## プルリクエストのガイドライン + +1. 全てのテストを実行 +2. リントチェックをパス +3. ドキュメントを更新 +4. 既存のコードスタイルに従う + +## サポートが必要な場合 + +- [イシューを作成](https://github.com/yamadashy/repomix/issues) +- [Discordに参加](https://discord.gg/wNYzTwZFku) diff --git a/website/client/src/ja/guide/development/setup.md b/website/client/src/ja/guide/development/setup.md new file mode 100644 index 000000000..b9ea0a0a1 --- /dev/null +++ b/website/client/src/ja/guide/development/setup.md @@ -0,0 +1,74 @@ +# 開発環境のセットアップ + +## 前提条件 + +- Node.js ≥ 18.0.0 +- Git +- npm + +## ローカル開発 + +```bash +# リポジトリのクローン +git clone https://github.com/yamadashy/repomix.git +cd repomix + +# 依存関係のインストール +npm install + +# CLIの実行 +npm run cli-run +``` + +## Docker開発 + +```bash +# イメージのビルド +docker build -t repomix . + +# コンテナの実行 +docker run -v ./:/app -it --rm repomix +``` + +## プロジェクト構造 + +``` +src/ +├── cli/ # CLI実装 +├── config/ # 設定の処理 +├── core/ # コア機能 +└── shared/ # 共有ユーティリティ +``` + +## テスト + +```bash +# テストの実行 +npm run test + +# テストカバレッジ +npm run test-coverage + +# リント +npm run lint-biome +npm run lint-ts +npm run lint-secretlint +``` + +## リリースプロセス + +1. バージョンの更新 +```bash +npm version patch # または minor/major +``` + +2. テストとビルドの実行 +```bash +npm run test-coverage +npm run build +``` + +3. 公開 +```bash +npm publish +``` diff --git a/website/client/src/ja/guide/index.md b/website/client/src/ja/guide/index.md new file mode 100644 index 000000000..9416c97e2 --- /dev/null +++ b/website/client/src/ja/guide/index.md @@ -0,0 +1,53 @@ +# Repomixとは + +Repomixは、リポジトリ全体をAIフレンドリーな単一ファイルにパッケージングするツールです。Claude、ChatGPT、Geminiなどの大規模言語モデル(LLM)にコードベースを提供するために設計されています。 + +## クイックスタート + +プロジェクトディレクトリで以下のコマンドを実行するだけです。 + +```bash +npx repomix +``` + +これだけで、`repomix-output.txt`ファイルにAIが理解しやすい形式でリポジトリ全体がまとめられます。 + +このファイルを以下のようなプロンプトとともにAIアシスタントに送信できます。 + +``` +このファイルはリポジトリ内のすべてのファイルを1つにまとめたものです。 +コードのリファクタリングを行いたいので、まずはコードレビューをお願いします。 +``` + +すると、AIはコードベース全体を分析し、包括的な洞察を提供してくれます。 + +![Repomixの使用例1](/images/docs/repomix-file-usage-1.png) + +具体的な変更点を議論する際には、AIはコードの生成をサポートしてくれます。例えば、Claudeのアーティファクト機能などを使用すると、相互に依存する複数のファイルを一度に生成することも可能です。 + +![Repomixの使用例2](/images/docs/repomix-file-usage-2.png) + +良いコーディング体験を!🚀 + +## 主な機能 + +- **AI最適化**: コードベースをAIが理解しやすい形式にフォーマット化 +- **トークンカウント**: LLMのコンテキスト制限に対応するためのトークン数を計測 +- **Git対応**: .gitignoreファイルを自動的に認識してパッケージング対象から除外 +- **セキュリティ重視**: [Secretlint](https://github.com/secretlint/secretlint)を使用した機密情報の検出と保護 +- **複数の出力形式**: プレーンテキスト、XML、Markdownの出力形式を選択可能 + +## 次のステップ + +- [インストールガイド](installation.md): Repomixをインストールするにはこちら +- [使用方法](usage.md): 基本的な使い方から高度な使い方まで +- [設定](configuration.md): Repomixをカスタマイズするにはこちら +- [セキュリティ機能](security.md): セキュリティチェックの詳細はこちら + +## コミュニティ + +[Discordコミュニティ](https://discord.gg/wNYzTwZFku)に参加して、Repomixの使い方について質問したり、経験やノウハウを共有したり、新機能を提案したり、他のユーザーと交流しましょう。 + +## サポート + +バグを見つけた場合や支援が必要な場合は、[GitHubでイシューを作成](https://github.com/yamadashy/repomix/issues)するか、Discordサーバーに参加してください。 diff --git a/website/client/src/ja/guide/installation.md b/website/client/src/ja/guide/installation.md new file mode 100644 index 000000000..f415e94f0 --- /dev/null +++ b/website/client/src/ja/guide/installation.md @@ -0,0 +1,53 @@ +# インストール + +## npx を使用する方法 (インストール不要) + +```bash +npx repomix +``` + +## グローバルインストール + +### npm +```bash +npm install -g repomix +``` + +### Yarn +```bash +yarn global add repomix +``` + +### Homebrew(macOS) +```bash +brew install repomix +``` + +## Dockerを使用する方法 + +以下のコマンドで Docker イメージをプルして実行できます。 + +```bash +# カレントディレクトリを処理 +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix + +# 特定のディレクトリを処理 +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix path/to/directory + +# リモートリポジトリを処理 +docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix --remote yamadashy/repomix +``` + +## システム要件 + +- Node.js: 18.0.0 以上 +- Git: リモートリポジトリを処理する場合はインストールしてください + +## インストールの確認 + +インストール後、以下のコマンドで Repomix が正常に動作することを確認できます。 + +```bash +repomix --version +repomix --help +``` diff --git a/website/client/src/ja/guide/output.md b/website/client/src/ja/guide/output.md new file mode 100644 index 000000000..01df2d0ef --- /dev/null +++ b/website/client/src/ja/guide/output.md @@ -0,0 +1,130 @@ +# 出力フォーマット + +Repomixは3つの出力フォーマットをサポートしています。 +- プレーンテキスト(デフォルト) +- XML +- Markdown + +## プレーンテキストフォーマット + +```bash +repomix --style plain +``` + +出力の構造 +```text +このファイルは、コードベース全体を1つのドキュメントにまとめた表現です... + +================ +ファイルサマリー +================ +(メタデータとAI向けの使用説明) + +================ +ディレクトリ構造 +================ +src/ + index.ts + utils/ + helper.ts + +================ +ファイル +================ + +================ +File: src/index.js +================ +// ファイルの内容がここに表示されます + +================ +File: src/utils.js +================ +// ファイルの内容がここに表示されます +``` + +## XMLフォーマット + +```bash +repomix --style xml +``` + +XMLフォーマットはAI処理に最適化されています。 + +```xml +このファイルは、コードベース全体を1つのドキュメントにまとめた表現です... + + +(メタデータとAI向けの使用説明) + + + +src/ + index.ts + utils/ + helper.ts + + + + +// ファイルの内容がここに表示されます + + + + +(output.instructionFilePathで指定されたカスタム指示) + +``` + +::: tip なぜXML? +XMLタグはClaudeなどのAIモデルがコンテンツをより正確に解析するのに役立ちます。[Claude公式ドキュメント](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/use-xml-tags)では、構造化されたプロンプトにXMLタグを使用することを推奨しています。 +::: + +## Markdownフォーマット + +```bash +repomix --style markdown +``` + +Markdownは読みやすいフォーマットを提供します。 + +```markdown +このファイルは、コードベース全体を1つのドキュメントにまとめた表現です... + +# ファイルサマリー +(メタデータとAI向けの使用説明) + +# ディレクトリ構造 +``` +src/ +index.ts +utils/ +helper.ts +``` + +# ファイル + +## File: src/index.ts +```typescript +// ファイルの内容がここに表示されます +``` +``` + +## AIモデルとの使用 + +各フォーマットはAIモデルで問題なく動作しますが、以下の点を考慮してください。 +- XMLはClaude用に最適化(最も正確な解析) +- Markdownは一般的な読みやすさを重視 +- プレーンテキストはシンプルさと互換性を重視 + +## カスタマイズ + +`repomix.config.json`でデフォルトのフォーマットを設定 +```json +{ + "output": { + "style": "xml", + "filePath": "output.xml" + } +} +``` diff --git a/website/client/src/ja/guide/prompt-examples.md b/website/client/src/ja/guide/prompt-examples.md new file mode 100644 index 000000000..2eeec5909 --- /dev/null +++ b/website/client/src/ja/guide/prompt-examples.md @@ -0,0 +1,126 @@ +# プロンプト例 + +## コードレビュー + +### アーキテクチャレビュー +``` +このコードベースのアーキテクチャを分析してください。 +1. 全体的な構造とパターンを評価 +2. アーキテクチャ上の潜在的な問題点を特定 +3. スケーラビリティ向上のための改善案を提案 +4. ベストプラクティスに従っている部分を指摘 + +保守性とモジュール性に特に注目してください。 +``` + +### セキュリティレビュー +``` +このコードベースのセキュリティレビューを実施してください。 +1. 潜在的なセキュリティ脆弱性の特定 +2. 一般的なセキュリティアンチパターンのチェック +3. エラー処理と入力バリデーションの確認 +4. 依存関係のセキュリティ評価 + +具体的な例と対策手順を含めてください。 +``` + +### パフォーマンスレビュー +``` +パフォーマンスの観点からコードベースをレビューしてください。 +1. パフォーマンスのボトルネックを特定 +2. リソース使用状況の確認 +3. アルゴリズムの効率性の評価 +4. キャッシュ戦略の評価 + +具体的な最適化の推奨事項を含めてください。 +``` + +## ドキュメント生成 + +### API ドキュメント +``` +包括的なAPIドキュメントを生成してください。 +1. すべてのパブリックエンドポイントをリストアップし説明 +2. リクエスト/レスポンスのフォーマットを文書化 +3. 使用例を含める +4. 制限事項や制約を記載 +``` + +### 開発者ガイド +``` +以下の内容を含む開発者ガイドを作成してください。 +1. セットアップ手順 +2. プロジェクト構造の概要 +3. 開発ワークフロー +4. テストアプローチ +5. 一般的なトラブルシューティング手順 +``` + +### アーキテクチャドキュメント +``` +システムアーキテクチャを文書化してください。 +1. 高レベルの概要 +2. コンポーネント間の相互作用 +3. データフロー図 +4. 設計上の決定と根拠 +5. システムの制約と制限事項 +``` + +## 分析と改善 + +### 依存関係の分析 +``` +プロジェクトの依存関係を分析してください。 +1. 古くなったパッケージの特定 +2. セキュリティ脆弱性のチェック +3. 代替パッケージの提案 +4. 依存関係の使用パターンの確認 + +具体的なアップグレード推奨事項を含めてください。 +``` + +### テストカバレッジ +``` +テストカバレッジを確認してください。 +1. テストされていないコンポーネントの特定 +2. 追加のテストケースの提案 +3. テストの品質の確認 +4. テスト戦略の推奨 + +具体的な改善案を提供してください。 +``` + +### コード品質 +``` +コード品質を評価し、改善点を提案してください。 +1. 命名規則の確認 +2. コード構成の確認 +3. エラー処理の評価 +4. コメントの実践の確認 + +良いパターンと問題のあるパターンの具体例を提供してください。 +``` + +## より良い結果を得るためのヒント + +1. **具体的に**: 明確な目標と評価基準を含める +2. **コンテキストを設定**: あなたの役割と必要な専門知識レベルを指定 +3. **レスポンス形式**: 希望する回答の構造を指定 +4. **優先順位**: どの側面が最も重要かを示す + +## モデル別の注意点 + +### Claude +- XML出力形式を使用 +- 重要な指示を最後に配置 +- レスポンス構造を指定 + +### ChatGPT +- Markdown形式を使用 +- 大規模なコードベースはセクションに分割 +- システムロールプロンプトを含める + +### Gemini +- すべての形式で動作 +- 特定の領域に焦点を絞る +- ステップバイステップの分析を使用 diff --git a/website/client/src/ja/guide/remote-repository-processing.md b/website/client/src/ja/guide/remote-repository-processing.md new file mode 100644 index 000000000..c99e21f74 --- /dev/null +++ b/website/client/src/ja/guide/remote-repository-processing.md @@ -0,0 +1,68 @@ +# リモートリポジトリの処理 + +## 基本的な使用方法 + +パブリックリポジトリを処理 +```bash +# 完全なURLを使用 +repomix --remote https://github.com/user/repo + +# GitHubのショートハンド形式を使用 +repomix --remote user/repo +``` + +## ブランチとコミットの選択 + +```bash +# 特定のブランチ +repomix --remote user/repo --remote-branch main + +# タグ +repomix --remote user/repo --remote-branch v1.0.0 + +# コミットハッシュ +repomix --remote user/repo --remote-branch 935b695 +``` + +## 必要条件 + +- Gitがインストールされていること +- インターネット接続があること +- リポジトリへの読み取りアクセス権があること + +## 出力の制御 + +```bash +# 出力先のカスタマイズ +repomix --remote user/repo -o custom-output.xml + +# XML形式で出力 +repomix --remote user/repo --style xml + +# コメントを削除 +repomix --remote user/repo --remove-comments +``` + +## Docker使用時 + +```bash +# カレントディレクトリに出力 +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix \ + --remote user/repo + +# 特定のディレクトリに出力 +docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix \ + --remote user/repo +``` + +## 一般的な問題 + +### アクセスの問題 +- リポジトリがパブリックであることを確認 +- Gitのインストールを確認 +- インターネット接続を確認 + +### 大規模リポジトリの処理 +- `--include`で特定のパスを選択 +- `--remove-comments`を有効化 +- ブランチごとに個別に処理 diff --git a/website/client/src/ja/guide/security.md b/website/client/src/ja/guide/security.md new file mode 100644 index 000000000..338fb0034 --- /dev/null +++ b/website/client/src/ja/guide/security.md @@ -0,0 +1,65 @@ +# セキュリティ + +## セキュリティチェック機能 + +Repomixは[Secretlint](https://github.com/secretlint/secretlint)を使用して、ファイル内の機密情報を検出します: +- APIキー +- アクセストークン +- 認証情報 +- 秘密鍵 +- 環境変数 + +## 設定 + +セキュリティチェックはデフォルトで有効になっています。 + +CLIで無効化する場合 +```bash +repomix --no-security-check +``` + +または`repomix.config.json`で +```json +{ + "security": { + "enableSecurityCheck": false + } +} +``` + +## セキュリティ対策 + +1. **バイナリファイルの除外**: バイナリファイルは出力に含まれません +2. **Git対応**: `.gitignore`パターンを尊重します +3. **自動検出**: 以下を含む一般的なセキュリティ問題を検出 + - AWSの認証情報 + - データベース接続文字列 + - 認証トークン + - 秘密鍵 + +## セキュリティチェックで問題が見つかった場合 + +出力例 +```bash +🔍 Security Check: +────────────────── +2 suspicious file(s) detected and excluded: +1. config/credentials.json + - Found AWS access key +2. .env.local + - Found database password +``` + +## ベストプラクティス + +1. 共有する前に必ず出力を確認 +2. `.repomixignore`を使用して機密性のあるパスを除外 +3. セキュリティチェックを有効に保つ +4. 機密ファイルをリポジトリから削除 + +## セキュリティ問題の報告 + +セキュリティ脆弱性を発見した場合は +1. パブリックなイシューは作成しないでください +2. メール: koukun0120@gmail.com +3. または[GitHub Security Advisories](https://github.com/yamadashy/repomix/security/advisories/new)を使用 diff --git a/website/client/src/ja/guide/tips/best-practices.md b/website/client/src/ja/guide/tips/best-practices.md new file mode 100644 index 000000000..fb4e4f349 --- /dev/null +++ b/website/client/src/ja/guide/tips/best-practices.md @@ -0,0 +1,41 @@ +# AI支援開発のベストプラクティス:私の経験から + +私はまだAIを使用した大規模な開発を経験したわけではありませんが、これまでの経験から学んだことを共有したいと思います。 + +## 開発の基本アプローチ + +AIと共に開発を進める際、一度にすべての機能を実装しようとすると、予期せぬ問題が発生し、プロジェクト全体が行き詰まってしまうことがあります。そのため、コア機能から始めて一つ一つの機能を確実に作り上げていく方法が効果的です。 + +### 既存コードの重要性 + +この方法が効果的な理由は、コア機能の実装を通じて、あなたの理想とする設計やコーディングスタイルをコードとして具体化できる点にあります。 +プロジェクトのビジョンを最も効果的に伝えるのは、あなたの基準や好みを反映したコードそのものなのです。 + +コア機能から始めつつ、一つ一つの機能を確実に動く状態にしてから次の機能に進むことで、プロジェクト全体が一貫性を持ち、AIがより適切なコードを生成しやすくなります。 + +## モジュール分割のアプローチ + +また、コードは小さなモジュールに分割することが重要です。私の経験では、行数を250行程度に抑えることで結果的にAIに明確な指示を与えやすくなり、試行錯誤のプロセスも効率的になります。実際にはトークン数のほうが指標として正しいのですが、人間に判断しやすいのは行数なので、ここでは行数としています。 + +これはフロントエンド、バックエンド、データベースなどの大きな単位の話ではなく、もっと小さな単位、例えば一つの機能の中でもバリデーションやエラーハンドリングなど、個別の機能をモジュールとして分割することが重要です。 + +もちろん大きな単位で分けるのも重要で、段階的にモジュールを分割しておくことで、指示も明確になり、AIがより適切なコードを生成しやすくなります。AIに限らず人間にも効果的なアプローチですね。 + + +## テストを通じた品質の確保 +私はテストも重要だと考えています。 +テストは単なる品質保証の手段としてだけでなく、コードの意図を明確に示すドキュメントとしても機能します。AIに新しい機能の実装を依頼する際、既存のテストコードは実装すべき機能の仕様書として働きます。 + +また、AIが生成したコードの正しさを判断する際、テストは非常に効果的なツールとなります。例えば、あるモジュールの新しい機能をAIに実装してもらう場合、テストケースを先に書いておくことで、生成されたコードが期待通りの動作をするかを客観的に評価できます。これはテスト駆動開発(TDD)の考え方とも親和性が高く、AIとの協業において特に有効です。 + + +## 計画と実装のバランス + +大規模な機能を実装する前には、まずAIと計画について話し合うことをお勧めします。要件を整理し、アーキテクチャを検討することで、後の実装がスムーズになります。要件をまずまとめて、別のチャットに移動して実装を進めるのも良いでしょう。 +また、AIの出力は必ず人間がレビューし、必要に応じて調整を加えることが重要です。AIの出力の品質は一般的に中程度ですが、それでも一からコードを書くよりも開発速度は向上します。 + + + +## まとめ + +この方法を実践することで、AIの強みを活かしながら、一貫性のある高品質なコードベースを構築できます。プロジェクトの規模が大きくなっても、各部分が明確に定義され、管理しやすい状態を維持できるでしょう。 diff --git a/website/client/src/ja/guide/usage.md b/website/client/src/ja/guide/usage.md new file mode 100644 index 000000000..f47fe6844 --- /dev/null +++ b/website/client/src/ja/guide/usage.md @@ -0,0 +1,87 @@ +# 基本的な使い方 + +## クイックスタート + +リポジトリ全体をパッケージング +```bash +repomix +``` + +## 一般的な使用例 + +### 特定のディレクトリをパッケージング +```bash +repomix path/to/directory +``` + +### 特定のファイルを含める +[globパターン](https://github.com/mrmlnc/fast-glob?tab=readme-ov-file#pattern-syntax)を使用 +```bash +repomix --include "src/**/*.ts,**/*.md" +``` + +### ファイルを除外 +```bash +repomix --ignore "**/*.log,tmp/" +``` + +### リモートリポジトリを処理 +```bash +# GitHubのURLを使用 +repomix --remote https://github.com/user/repo + +# 省略形を使用 +repomix --remote user/repo + +# 特定のブランチ/タグ/コミット +repomix --remote user/repo --remote-branch main +repomix --remote user/repo --remote-branch 935b695 +``` + +## 出力フォーマット + +### プレーンテキスト(デフォルト) +```bash +repomix --style plain +``` + +### XML +```bash +repomix --style xml +``` + +### Markdown +```bash +repomix --style markdown +``` + +## その他のオプション + +### コメントを削除 +```bash +repomix --remove-comments +``` + +### 行番号を表示 +```bash +repomix --output-show-line-numbers +``` + +### クリップボードにコピー +```bash +repomix --copy +``` + +### セキュリティチェックを無効化 +```bash +repomix --no-security-check +``` + +## 設定 + +設定ファイルを初期化 +```bash +repomix --init +``` + +詳細な設定オプションについては[設定ガイド](/ja/guide/configuration)をご覧ください。 diff --git a/website/client/src/ja/index.md b/website/client/src/ja/index.md new file mode 100644 index 000000000..a6ab0f29e --- /dev/null +++ b/website/client/src/ja/index.md @@ -0,0 +1,191 @@ +--- +layout: home +title: Repomix +titleTemplate: コードベースをAIフレンドリーな形式にパッケージング +aside: false +editLink: false + +features: + - icon: 🤖 + title: AI最適化 + details: コードベースをAIが理解・処理しやすい形式にフォーマット + + - icon: ⚙️ + title: Git対応 + details: .gitignoreファイルを自動的に認識し、適切なファイル除外 + + - icon: 🛡️ + title: セキュリティ重視 + details: Secretlintを組み込み、機密情報の検出と除外 + + - icon: 📊 + title: トークンカウント + details: ファイルごとおよびコードベース全体のトークン数を計測し、LLMのコンテキスト制限に対応 + +--- + +
+ +## クイックスタート + +Repomixを使用すると、コードベース全体を1ファイル(`repomix-output.txt`)にできます。 + +そのまま Claude に次のようなプロンプトと一緒に送ると、 + +``` +このファイルはコードベース内のファイルを1つにまとめたものです。 +コードのリファクタリングを行いたいので、まずはコードレビューをお願いします。 +``` + +全体の内容を理解した上で、リファクタリングなどを進めることができます。 + +![Repomixの使用例1](/images/docs/repomix-file-usage-1.png) + +具体的な内容を提案すると、それに従って良い感じのコードを生成してくれます。Claude だと Artifacts 機能で複数のファイルが出力できるため、依存関係にある複数のコードも一緒に生成できます。 + +![Repomixの使用例2](/images/docs/repomix-file-usage-2.png) + +良いコーディング体験を!🚀 + +## より凝った使い方をしたい方へ + +Repomix はCLIでも使えます。 + +ウェブ上では簡単な設定しかできませんが、より詳細な設定で実行したい場合はCLIを使うことをお勧めします。 + +### クイックスタート + +任意のディレクトリで以下のコマンドを実行すると、 `repomix-output.txt` が生成され、それ以降の使い方は同様です。 + +```bash +npx repomix +``` + +または、グローバルにインストールして繰り返し使用することもできます。 + +```bash +# npmを使用してインストール +npm install -g repomix + +# または、yarnを使用 +yarn global add repomix + +# または、Homebrewを使用(macOS) +brew install repomix + +# その後、任意のプロジェクトディレクトリで実行 +repomix +``` + + +### CLIの使用方法 + +カレントディレクトリ全体をまとめる。 + +```bash +repomix +``` + +特定のディレクトリをまとめる。 + +```bash +repomix path/to/directory +``` + +[glob パターン](https://github.com/mrmlnc/fast-glob?tab=readme-ov-file#pattern-syntax)を使用して特定のファイルやディレクトリを指定。 + +```bash +repomix --include "src/**/*.ts,**/*.md" +``` + +特定のファイルやディレクトリを除外。 + +```bash +repomix --ignore "**/*.log,tmp/" +``` + +リモートリポジトリをまとめる。 + +```bash +repomix --remote https://github.com/yamadashy/repomix + +# GitHubショートハンド形式も使用可能 +repomix --remote yamadashy/repomix + +# ブランチ名、タグ、コミットハッシュを指定可能 +repomix --remote https://github.com/yamadashy/repomix --remote-branch main + +# または特定のコミットハッシュを使用 +repomix --remote https://github.com/yamadashy/repomix --remote-branch 935b695 +``` + +設定ファイル(`repomix.config.json`)の初期化 + +```bash +repomix --init +``` + +生成されたファイルは、Claude、ChatGPT、Geminiなどの生成AIツールで使用できます。 + +### Docker使用方法 🐳 + +Dockerを使用してRepomixを実行することも可能で、分離された環境でRepomixを実行したい場合に便利です。 + +基本的な使用方法 + +```bash +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix +``` + +特定のディレクトリをまとめる +```bash +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix path/to/directory +``` + +リモートリポジトリを処理し、`output`ディレクトリに出力 + +```bash +docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix --remote https://github.com/yamadashy/repomix +``` + +### 出力フォーマット + +出力フォーマットは3種類あり、`xml`, `markdown`, `plain` を選択できます。 +LLMによっては得意・不得意があるので、適切なフォーマットを選択してください。 + +```bash +# プレーンテキストフォーマット(デフォルト) +repomix --style plain + +# XMLフォーマット +repomix --style xml + +# Markdownフォーマット +repomix --style markdown +``` + +### カスタマイズ + +フォルダごとの永続的な設定のために`repomix --init`で`repomix.config.json`を作成できます。 + +```json +{ + "output": { + "style": "markdown", + "filePath": "custom-output.md", + "removeComments": true, + "showLineNumbers": true, + "topFilesLength": 10 + }, + "ignore": { + "customPatterns": ["*.test.ts", "docs/**"] + } +} +``` + +### その他の例 +::: tip +💡 詳細なドキュメントと更なる例については、[GitHubリポジトリ](https://github.com/yamadashy/repomix)をご覧ください! +::: + +
diff --git a/website/client/src/ko/guide/command-line-options.md b/website/client/src/ko/guide/command-line-options.md new file mode 100644 index 000000000..655b75352 --- /dev/null +++ b/website/client/src/ko/guide/command-line-options.md @@ -0,0 +1,72 @@ +# 명령행 옵션 + +## 기본 옵션 + +```bash +repomix [directory] # 특정 디렉토리 처리 (기본값: ".") +``` + +## 출력 옵션 + +| 옵션 | 설명 | 기본값 | +|--------|-------------|---------| +| `-o, --output ` | 출력 파일 이름 | `repomix-output.txt` | +| `--style ` | 출력 형식 (`plain`, `xml`, `markdown`) | `plain` | +| `--output-show-line-numbers` | 행 번호 추가 | `false` | +| `--copy` | 클립보드에 복사 | `false` | +| `--no-file-summary` | 파일 요약 비활성화 | `true` | +| `--no-directory-structure` | 디렉토리 구조 비활성화 | `true` | +| `--remove-comments` | 주석 제거 | `false` | +| `--remove-empty-lines` | 빈 줄 제거 | `false` | + +## 필터 옵션 + +| 옵션 | 설명 | +|--------|-------------| +| `--include ` | 포함할 패턴 (쉼표로 구분) | +| `-i, --ignore ` | 제외할 패턴 (쉼표로 구분) | + +## 원격 저장소 + +| 옵션 | 설명 | +|--------|-------------| +| `--remote ` | 원격 저장소 처리 | +| `--remote-branch ` | 브랜치/태그/커밋 지정 | + +## 설정 + +| 옵션 | 설명 | +|--------|-------------| +| `-c, --config ` | 사용자 정의 설정 파일 경로 | +| `--init` | 설정 파일 생성 | +| `--global` | 전역 설정 사용 | + +## 보안 + +| 옵션 | 설명 | 기본값 | +|--------|-------------|---------| +| `--no-security-check` | 보안 검사 비활성화 | `true` | + +## 기타 옵션 + +| 옵션 | 설명 | +|--------|-------------| +| `-v, --version` | 버전 표시 | +| `--verbose` | 상세 로그 활성화 | +| `--top-files-len ` | 표시할 상위 파일 수 | `5` | + +## 사용 예시 + +```bash +# 기본 사용법 +repomix + +# 사용자 정의 출력 +repomix -o output.xml --style xml + +# 특정 파일 처리 +repomix --include "src/**/*.ts" --ignore "**/*.test.ts" + +# 원격 저장소 처리 +repomix --remote user/repo --remote-branch main +``` diff --git a/website/client/src/ko/guide/comment-removal.md b/website/client/src/ko/guide/comment-removal.md new file mode 100644 index 000000000..4fabd654e --- /dev/null +++ b/website/client/src/ko/guide/comment-removal.md @@ -0,0 +1,53 @@ +# 주석 제거 + +Repomix는 출력 파일을 생성할 때 코드베이스에서 주석을 자동으로 제거할 수 있습니다. 이를 통해 노이즈를 줄이고 실제 코드에 집중할 수 있습니다. + +## 사용법 + +주석 제거를 활성화하려면 `repomix.config.json`에서 `removeComments` 옵션을 `true`로 설정합니다. + +```json +{ + "output": { + "removeComments": true + } +} +``` + +## 지원되는 언어 + +Repomix는 다음을 포함한 광범위한 프로그래밍 언어에 대한 주석 제거를 지원합니다. + +- JavaScript/TypeScript (`//`, `/* */`) +- Python (`#`, `"""`, `'''`) +- Java (`//`, `/* */`) +- C/C++ (`//`, `/* */`) +- HTML (``) +- CSS (`/* */`) +- 그리고 더 많은 언어들... + +## 예시 + +다음 JavaScript 코드가 주어졌을 때: + +```javascript +// 이것은 한 줄 주석입니다 +function test() { + /* 이것은 + 여러 줄 주석입니다 */ + return true; +} +``` + +주석 제거를 활성화하면 출력은 다음과 같습니다. + +```javascript +function test() { + return true; +} +``` + +## 참고 + +- 주석 제거는 행 번호 추가와 같은 다른 처리 단계 전에 수행됩니다. +- JSDoc 주석과 같은 일부 주석은 언어 및 컨텍스트에 따라 보존될 수 있습니다. diff --git a/website/client/src/ko/guide/configuration.md b/website/client/src/ko/guide/configuration.md new file mode 100644 index 000000000..f97155d69 --- /dev/null +++ b/website/client/src/ko/guide/configuration.md @@ -0,0 +1,84 @@ +# 설정 + +## 빠른 시작 + +설정 파일 생성: +```bash +repomix --init +``` + +## 설정 파일 + +`repomix.config.json`: +```json +{ + "output": { + "filePath": "repomix-output.xml", + "style": "xml", + "headerText": "사용자 정의 헤더 텍스트", + "instructionFilePath": "repomix-instruction.md", + "fileSummary": true, + "directoryStructure": true, + "removeComments": false, + "removeEmptyLines": false, + "topFilesLength": 5, + "showLineNumbers": false, + "copyToClipboard": false, + "includeEmptyDirectories": false + }, + "include": ["**/*"], + "ignore": { + "useGitignore": true, + "useDefaultPatterns": true, + "customPatterns": ["tmp/", "*.log"] + }, + "security": { + "enableSecurityCheck": true + } +} +``` + +## 전역 설정 + +전역 설정 생성: +```bash +repomix --init --global +``` + +설정 파일 위치: +- Windows: `%LOCALAPPDATA%\\Repomix\\repomix.config.json` +- macOS/Linux: `~/.config/repomix/repomix.config.json` + +## 제외 패턴 + +우선순위 순서: +1. 명령행 옵션 (`--ignore`) +2. .repomixignore +3. .gitignore +4. 기본 패턴 + +`.repomixignore` 예시: +```text +# 캐시 디렉토리 +.cache/ +tmp/ + +# 빌드 출력 +dist/ +build/ + +# 로그 +*.log +``` + +## 기본 제외 패턴 + +기본적으로 포함되는 일반적인 패턴: +```text +node_modules/** +.git/** +coverage/** +dist/** +``` + +전체 목록: [defaultIgnore.ts](https://github.com/yamadashy/repomix/blob/main/src/config/defaultIgnore.ts) diff --git a/website/client/src/ko/guide/custom-instructions.md b/website/client/src/ko/guide/custom-instructions.md new file mode 100644 index 000000000..9189e363b --- /dev/null +++ b/website/client/src/ko/guide/custom-instructions.md @@ -0,0 +1,66 @@ +# 사용자 정의 지시사항 + +Repomix는 출력 파일에 포함될 사용자 정의 지시사항을 제공할 수 있게 해줍니다. 이는 AI 시스템이 프로젝트의 특정 맥락이나 요구 사항을 이해하는 데 도움이 됩니다. + +## 사용법 + +사용자 정의 지시사항을 포함하려면 저장소의 루트에 마크다운 파일(예: `repomix-instruction.md`)을 생성하고, `repomix.config.json`에서 해당 파일의 경로를 지정하세요: + +```json +{ + "output": { + "instructionFilePath": "repomix-instruction.md" + } +} +``` + +이 파일의 내용은 출력의 "Instruction" 섹션에 포함됩니다. + +## 사용 예시 + +```markdown +# 코딩 지침 + +- Airbnb JavaScript 스타일 가이드를 따르세요. +- 필요한 경우 파일을 더 작은 단위로 분할하세요. +- 불분명한 로직에는 주석을 추가하세요. 모든 텍스트는 영어로 작성하세요. +- 모든 새로운 기능에 대해 해당 단위 테스트를 작성하세요. + +## 생성된 콘텐츠에 대하여 + +- 특별한 지정이 없는 한, 모든 콘텐츠를 생략 없이 포함하세요. +- 대규모 코드베이스를 처리할 때도 출력 품질을 유지하세요. +``` + +이는 출력 파일에서 다음과 같이 표시됩니다: + +```xml + +# 코딩 가이드라인 + +- Airbnb JavaScript 스타일 가이드를 따릅니다 +- 필요한 경우 파일을 작은 단위로 분할합니다 +- 명확하지 않은 로직에는 주석을 추가합니다. 모든 텍스트는 영어로 작성합니다 +- 모든 새로운 기능에는 해당하는 단위 테스트를 작성합니다 + +## 생성 내용에 대해 + +- 특별한 지정이 없는 한, 모든 내용은 축약하지 않고 포함합니다 +- 대규모 코드베이스를 처리하면서도 출력의 품질을 유지합니다 + +``` + +## 모범 사례 + +1. **간결하고 명확하게**: 지시사항은 간결하되, 필요한 세부 사항은 모두 포함해야 합니다. +2. **구체적인 예시 제공**: 적절한 경우 코드 예시를 사용하여 설명을 보완합니다. +3. **우선순위 설정**: 가장 중요한 지시사항을 문서 앞부분에 배치하여 강조합니다. +4. **맥락 포함**: 프로젝트의 배경과 중요한 고려사항을 제공하여 AI가 작업을 더 잘 이해하도록 돕습니다. +5. **구조화된 콘텐츠**: 제목과 목록을 사용하여 지시사항을 체계적으로 구성하고 가독성을 높입니다. + +## 주의 사항 + +- 지시사항에 민감한 정보를 포함하지 마세요 +- 프로젝트의 변화를 반영하여 정기적으로 지시사항을 업데이트하세요 +- 지시사항이 프로젝트의 다른 문서와 일관성을 유지하도록 하세요 +- 명확한 계층 구조를 사용하여 콘텐츠를 구성하세요 diff --git a/website/client/src/ko/guide/development/index.md b/website/client/src/ko/guide/development/index.md new file mode 100644 index 000000000..6a0e325bf --- /dev/null +++ b/website/client/src/ko/guide/development/index.md @@ -0,0 +1,42 @@ +# Repomix에 기여하기 + +## 빠른 시작 + +```bash +git clone https://github.com/yamadashy/repomix.git +cd repomix +npm install +``` + +## 개발 명령어 + +```bash +# CLI 실행 +npm run cli-run + +# 테스트 실행 +npm run test +npm run test-coverage + +# 코드 린트 +npm run lint +``` + +## 코드 스타일 + +- 린트 및 포맷팅에 [Biome](https://biomejs.dev/)을 사용합니다. +- 테스트 용이성을 위해 의존성 주입을 사용합니다. +- 파일 길이를 250줄 미만으로 유지합니다. +- 새로운 기능에 대한 테스트를 추가합니다. + +## Pull Request 가이드라인 + +1. 모든 테스트를 실행합니다. +2. 린트 검사를 통과합니다. +3. 문서를 업데이트합니다. +4. 기존 코드 스타일을 따릅니다. + +## 도움이 필요하신가요? + +- [이슈 열기](https://github.com/yamadashy/repomix/issues) +- [Discord 참여](https://discord.gg/wNYzTwZFku) diff --git a/website/client/src/ko/guide/development/setup.md b/website/client/src/ko/guide/development/setup.md new file mode 100644 index 000000000..9b5f849ec --- /dev/null +++ b/website/client/src/ko/guide/development/setup.md @@ -0,0 +1,73 @@ +# 개발 환경 설정 + +## 필수 구성 요소 + +- Node.js ≥ 18.0.0 +- Git +- npm + +## 로컬 개발 + +```bash +# 저장소 복제 +git clone https://github.com/yamadashy/repomix.git +cd repomix + +# 의존성 설치 +npm install + +# CLI 실행 +npm run cli-run +``` + +## Docker 개발 + +```bash +# 이미지 빌드 +docker build -t repomix . + +# 컨테이너 실행 +docker run -v ./:/app -it --rm repomix +``` + +## 프로젝트 구조 + +``` +src/ +├── cli/ # CLI 구현 +├── config/ # 구성 처리 +├── core/ # 핵심 기능 +└── shared/ # 공유 유틸리티 +``` + +## 테스트 + +```bash +# 테스트 실행 +npm run test + +# 테스트 커버리지 +npm run test-coverage + +# 린트 +npm run lint-biome +npm run lint-ts +npm run lint-secretlint +``` + +## 릴리스 프로세스 + +1. 버전 업데이트 +```bash +npm version patch # 또는 minor/major +``` + +2. 테스트 및 빌드 실행 +```bash +npm run test-coverage +npm run build +``` + +3. 게시 +```bash +npm publish diff --git a/website/client/src/ko/guide/index.md b/website/client/src/ko/guide/index.md new file mode 100644 index 000000000..91f9ee608 --- /dev/null +++ b/website/client/src/ko/guide/index.md @@ -0,0 +1,60 @@ +# Repomix 시작하기 + +Repomix는 전체 저장소를 AI 친화적인 단일 파일로 패키징하는 도구입니다. Claude, ChatGPT, Gemini와 같은 대규모 언어 모델(LLM)에 코드베이스를 제공하는 데 도움이 되도록 설계되었습니다. + +## 빠른 시작 + +프로젝트 디렉토리에서 다음 명령을 실행하세요. + +```bash +npx repomix +``` + +이게 전부입니다! AI 친화적인 형식으로 전체 저장소를 포함하는 `repomix-output.txt` 파일이 생성됩니다. + +그런 다음 이 파일을 다음과 같은 프롬프트와 함께 AI 어시스턴트에 보낼 수 있습니다. + +``` +이 파일에는 저장소의 모든 파일이 하나로 결합되어 있습니다. +코드를 리팩터링하고 싶으니 먼저 검토해 주세요. +``` + +AI는 전체 코드베이스를 분석하고 포괄적인 인사이트를 제공합니다. + +![Repomix 파일 사용 예시 1](/images/docs/repomix-file-usage-1.png) + +특정 변경 사항을 논의할 때 AI가 코드 생성을 도울 수 있습니다. Claude의 Artifacts와 같은 기능을 사용하면 상호 의존적인 여러 파일을 받을 수도 있습니다. + +![Repomix 파일 사용 예시 2](/images/docs/repomix-file-usage-2.png) + +즐거운 코딩 되세요! 🚀 + +## 핵심 기능 + +- **AI 최적화 출력**: AI 처리에 용이한 형식으로 코드베이스를 구성합니다. +- **토큰 계산**: LLM 컨텍스트 제한을 위한 토큰 사용량을 추적합니다. +- **Git 인식**: .gitignore 파일을 존중합니다. +- **보안 중심**: 민감한 정보를 탐지합니다. +- **다양한 출력 형식**: 일반 텍스트, XML, Markdown 중에서 선택할 수 있습니다. + +## 다음 단계 + +- [설치 가이드](installation.md): Repomix를 설치하는 다양한 방법 +- [사용 가이드](usage.md): 기본 및 고급 기능에 대해 알아보기 +- [구성](configuration.md): 필요에 맞게 Repomix를 사용자 정의하기 +- [보안 기능](security.md): 보안 검사에 대해 알아보기 + +## 커뮤니티 + +[Discord 커뮤니티](https://discord.gg/wNYzTwZFku)에 참여하세요: +- Repomix에 대한 도움 받기 +- 경험 공유 +- 새로운 기능 제안 +- 다른 사용자와 소통 + +## 지원 + +버그를 발견했거나 도움이 필요하신가요? +- [GitHub에 이슈 열기](https://github.com/yamadashy/repomix/issues) +- Discord 서버에 참여하기 +- [문서 확인하기](https://repomix.com) diff --git a/website/client/src/ko/guide/installation.md b/website/client/src/ko/guide/installation.md new file mode 100644 index 000000000..a347d77b0 --- /dev/null +++ b/website/client/src/ko/guide/installation.md @@ -0,0 +1,53 @@ +# 설치 + +## npx 사용 (설치 불필요) + +```bash +npx repomix +``` + +## 전역 설치 + +### npm +```bash +npm install -g repomix +``` + +### Yarn +```bash +yarn global add repomix +``` + +### Homebrew (macOS) +```bash +brew install repomix +``` + +## Docker 설치 + +Docker를 사용하면 환경 설정 문제를 피할 수 있어 가장 편리한 방법 중 하나입니다. 아래와 같이 실행하세요: + +```bash +# 현재 디렉토리 처리 +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix + +# 특정 디렉토리 처리 +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix path/to/directory + +# 원격 저장소 처리 +docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix --remote yamadashy/repomix +``` + +## 시스템 요구 사항 + +- Node.js: 18.0.0 이상 +- Git: 원격 저장소 처리 시 필요 + +## 설치 확인 + +설치가 완료된 후, 다음 명령어로 Repomix가 정상적으로 작동하는지 확인하세요: + +```bash +repomix --version +repomix --help +``` diff --git a/website/client/src/ko/guide/output.md b/website/client/src/ko/guide/output.md new file mode 100644 index 000000000..f59729e62 --- /dev/null +++ b/website/client/src/ko/guide/output.md @@ -0,0 +1,121 @@ +# 출력 형식 + +Repomix는 세 가지 출력 형식을 지원합니다: +- 일반 텍스트 (기본값) +- XML +- Markdown + +## 일반 텍스트 형식 + +```bash +repomix --style plain +``` + +출력 구조: +```text +이 파일은 전체 코드베이스를 하나의 문서로 통합한 것입니다... + +================ +파일 요약 +================ +(메타데이터 및 AI 지시사항) + +================ +디렉토리 구조 +================ +src/ + index.ts + utils/ + helper.ts + +================ +파일 +================ + +================ +File: src/index.ts +================ +// 파일 내용 +``` + +## XML 형식 + +```bash +repomix --style xml +``` + +XML 형식은 AI 처리에 최적화되어 있습니다: + +```xml +이 파일은 전체 코드베이스를 하나의 문서로 통합한 것입니다... + + +(메타데이터 및 AI 지시사항) + + + +src/ + index.ts + utils/ + helper.ts + + + + +// 파일 내용 + + +``` + +::: tip XML을 사용하는 이유 +XML 태그는 Claude와 같은 AI 모델이 내용을 더 정확하게 파싱하는 데 도움이 됩니다. [Claude 공식 문서](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/use-xml-tags)에서는 구조화된 프롬프트에 XML 태그 사용을 권장하고 있습니다. +::: + +## Markdown 형식 + +```bash +repomix --style markdown +``` + +Markdown은 읽기 쉬운 형식을 제공합니다: + +```markdown +이 파일은 전체 코드베이스를 하나의 문서로 통합한 것입니다... + +# 파일 요약 +(메타데이터 및 AI 지시사항) + +# 디렉토리 구조 +``` +src/ +index.ts +utils/ +helper.ts +``` + +# 파일 + +## File: src/index.ts +```typescript +// 파일 내용 +``` +``` + +## AI 모델과의 사용 + +각 형식은 AI 모델에서 잘 작동하지만, 다음 사항을 고려하세요: +- Claude에는 XML 사용 (가장 정확한 파싱) +- 일반적인 가독성을 위해서는 Markdown +- 단순성과 호환성을 위해서는 일반 텍스트 + +## 사용자 정의 + +`repomix.config.json`에서 기본 형식 설정: +```json +{ + "output": { + "style": "xml", + "filePath": "output.xml" + } +} +``` diff --git a/website/client/src/ko/guide/prompt-examples.md b/website/client/src/ko/guide/prompt-examples.md new file mode 100644 index 000000000..56cc97307 --- /dev/null +++ b/website/client/src/ko/guide/prompt-examples.md @@ -0,0 +1,124 @@ +# Prompt Examples + +## Code Review + +### Architecture Review +``` +Analyze this codebase's architecture: +1. Evaluate the overall structure and patterns +2. Identify potential architectural issues +3. Suggest improvements for scalability +4. Note areas that follow best practices + +Focus on maintainability and modularity. +``` + +### Security Review +``` +Perform a security review of this codebase: +1. Identify potential security vulnerabilities +2. Check for common security anti-patterns +3. Review error handling and input validation +4. Assess dependency security + +Provide specific examples and remediation steps. +``` + +### Performance Review +``` +Review the codebase for performance: +1. Identify performance bottlenecks +2. Check resource utilization +3. Review algorithmic efficiency +4. Assess caching strategies + +Include specific optimization recommendations. +``` + +## Documentation Generation + +### API Documentation +``` +Generate comprehensive API documentation: +1. List and describe all public endpoints +2. Document request/response formats +3. Include usage examples +4. Note any limitations or constraints +``` + +### Developer Guide +``` +Create a developer guide covering: +1. Setup instructions +2. Project structure overview +3. Development workflow +4. Testing approach +5. Common troubleshooting steps +``` + +### Architecture Documentation +``` +Document the system architecture: +1. High-level overview +2. Component interactions +3. Data flow diagrams +4. Design decisions and rationale +5. System constraints and limitations +``` + +## Analysis and Improvement + +### Dependency Analysis +``` +Analyze the project dependencies: +1. Identify outdated packages +2. Check for security vulnerabilities +3. Suggest alternative packages +4. Review dependency usage patterns + +Include specific upgrade recommendations. +``` + +### Test Coverage +``` +Review the test coverage: +1. Identify untested components +2. Suggest additional test cases +3. Review test quality +4. Recommend testing strategies +``` + +### Code Quality +``` +Assess code quality and suggest improvements: +1. Review naming conventions +2. Check code organization +3. Evaluate error handling +4. Review commenting practices + +Provide specific examples of good and problematic patterns. +``` + +## Tips for Better Results + +1. **Be Specific**: Include clear objectives and evaluation criteria +2. **Set Context**: Specify your role and expertise level needed +3. **Request Format**: Define how you want the response structured +4. **Prioritize**: Indicate which aspects are most important + +## Model-Specific Notes + +### Claude +- Use XML output format +- Place important instructions at the end +- Specify response structure + +### ChatGPT +- Use Markdown format +- Break large codebases into sections +- Include system role prompts + +### Gemini +- Works with all formats +- Focus on specific areas per request +- Use step-by-step analysis diff --git a/website/client/src/ko/guide/remote-repository-processing.md b/website/client/src/ko/guide/remote-repository-processing.md new file mode 100644 index 000000000..4bd3d81ba --- /dev/null +++ b/website/client/src/ko/guide/remote-repository-processing.md @@ -0,0 +1,68 @@ +# Remote Repository Processing + +## Basic Usage + +Process public repositories: +```bash +# Using full URL +repomix --remote https://github.com/user/repo + +# Using GitHub shorthand +repomix --remote user/repo +``` + +## Branch and Commit Selection + +```bash +# Specific branch +repomix --remote user/repo --remote-branch main + +# Tag +repomix --remote user/repo --remote-branch v1.0.0 + +# Commit hash +repomix --remote user/repo --remote-branch 935b695 +``` + +## Requirements + +- Git must be installed +- Internet connection +- Read access to repository + +## Output Control + +```bash +# Custom output location +repomix --remote user/repo -o custom-output.xml + +# With XML format +repomix --remote user/repo --style xml + +# Remove comments +repomix --remote user/repo --remove-comments +``` + +## Docker Usage + +```bash +# Process and output to current directory +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix \ + --remote user/repo + +# Output to specific directory +docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix \ + --remote user/repo +``` + +## Common Issues + +### Access Issues +- Ensure repository is public +- Check Git installation +- Verify internet connection + +### Large Repositories +- Use `--include` to select specific paths +- Enable `--remove-comments` +- Process branches separately diff --git a/website/client/src/ko/guide/security.md b/website/client/src/ko/guide/security.md new file mode 100644 index 000000000..3012c465e --- /dev/null +++ b/website/client/src/ko/guide/security.md @@ -0,0 +1,65 @@ +# 보안 + +## 보안 검사 기능 + +Repomix는 [Secretlint](https://github.com/secretlint/secretlint)를 사용하여 파일 내의 민감한 정보를 감지합니다: +- API 키 +- 액세스 토큰 +- 인증 정보 +- 개인 키 +- 환경 변수 + +## 설정 + +보안 검사는 기본적으로 활성화되어 있습니다. + +명령행에서 비활성화: +```bash +repomix --no-security-check +``` + +또는 `repomix.config.json`에서 설정: +```json +{ + "security": { + "enableSecurityCheck": false + } +} +``` + +## 보안 조치 + +1. **바이너리 파일 제외**: 출력에 바이너리 파일이 포함되지 않음 +2. **Git 인식**: `.gitignore` 패턴을 준수 +3. **자동 감지**: 다음과 같은 일반적인 보안 문제를 스캔: + - AWS 자격 증명 + - 데이터베이스 연결 문자열 + - 인증 토큰 + - 개인 키 + +## 보안 검사에서 문제가 발견된 경우 + +출력 예시: +```bash +🔍 Security Check: +────────────────── +2 suspicious file(s) detected and excluded: +1. config/credentials.json + - Found AWS access key +2. .env.local + - Found database password +``` + +## 모범 사례 + +1. 공유하기 전에 반드시 출력 내용 검토 +2. `.repomixignore`를 사용하여 민감한 경로 제외 +3. 보안 검사 기능 활성화 유지 +4. 저장소에서 민감한 파일 제거 + +## 보안 문제 보고 + +보안 취약점을 발견하셨다면: +1. 공개 이슈를 생성하지 마세요 +2. 이메일: koukun0120@gmail.com +3. 또는 [GitHub 보안 권고](https://github.com/yamadashy/repomix/security/advisories/new) 사용 diff --git a/website/client/src/ko/guide/tips/best-practices.md b/website/client/src/ko/guide/tips/best-practices.md new file mode 100644 index 000000000..a5d1baa46 --- /dev/null +++ b/website/client/src/ko/guide/tips/best-practices.md @@ -0,0 +1,35 @@ +# AI 지원 개발 모범 사례: 나의 경험으로부터 + +저는 아직 AI를 사용하여 대규모 프로젝트를 성공적으로 완료하지는 못했지만, 지금까지 개발 과정에서 AI와 함께 작업하면서 배운 점을 공유하고자 합니다. + +## 기본 개발 접근 방식 + +AI와 함께 작업할 때, 모든 기능을 한 번에 구현하려고 하면 예상치 못한 문제와 프로젝트 정체로 이어질 수 있습니다. 그렇기 때문에 핵심 기능부터 시작하여 각 기능을 하나씩 구축하고, 다음 단계로 넘어가기 전에 견고한 구현을 보장하는 것이 더 효과적입니다. + +### 기존 코드의 힘 + +이 접근 방식이 효과적인 이유는 핵심 기능을 구현하면 실제 코드를 통해 이상적인 설계와 코딩 스타일을 구체화할 수 있기 때문입니다. 프로젝트 비전을 전달하는 가장 효과적인 방법은 표준과 선호도를 반영하는 코드를 작성하는 것입니다. + +핵심 기능부터 시작하여 각 구성 요소가 제대로 작동하는지 확인한 후 다음 단계로 진행하면 전체 프로젝트의 일관성이 유지되므로 AI가 더 적절한 코드를 생성하기 쉬워집니다. + +## 모듈식 접근 방식 + +코드를 더 작은 모듈로 나누는 것이 중요합니다. 제 경험상, 파일을 약 250줄 정도로 유지하면 AI에게 명확한 지침을 제공하기 쉽고 시행착오 프로세스가 더 효율적입니다. 토큰 수가 더 정확한 지표가 될 수 있지만, 줄 수는 개발자가 작업하기에 더 실용적이므로 이를 지침으로 사용합니다. + +이러한 모듈화는 단순히 프런트엔드, 백엔드, 데이터베이스 구성 요소를 분리하는 것뿐만 아니라 훨씬 더 세분화된 수준에서 기능을 분리하는 것입니다. 예를 들어, 단일 기능 내에서 유효성 검사, 오류 처리 및 기타 특정 기능을 별개의 모듈로 분리할 수 있습니다. 물론, 높은 수준의 분리도 중요하며, 이러한 모듈식 접근 방식을 점진적으로 구현하면 명확한 지침을 유지하고 AI가 더 적절한 코드를 생성할 수 있습니다. 이 접근 방식은 AI뿐만 아니라 사람 개발자에게도 효과적입니다. + +## 테스트를 통한 품질 보장 + +저는 AI 지원 개발에서 테스트가 매우 중요하다고 생각합니다. 테스트는 품질 보장 수단일 뿐만 아니라 코드 의도를 명확하게 보여주는 문서 역할도 합니다. AI에게 새로운 기능 구현을 요청할 때, 기존 테스트 코드는 사실상 사양 문서 역할을 합니다. + +테스트는 또한 AI가 생성한 코드의 정확성을 검증하는 훌륭한 도구입니다. 예를 들어, AI에게 모듈에 대한 새로운 기능 구현을 요청할 때, 테스트 케이스를 미리 작성하면 생성된 코드가 예상대로 작동하는지 객관적으로 평가할 수 있습니다. 이는 테스트 주도 개발(TDD) 원칙과 잘 부합하며 AI와 협업할 때 특히 효과적입니다. + +## 계획과 구현의 균형 + +대규모 기능을 구현하기 전에 먼저 AI와 계획에 대해 논의하는 것이 좋습니다. 요구 사항을 정리하고 아키텍처를 고려하면 구현이 더 원활해집니다. 좋은 방법은 먼저 요구 사항을 정리한 다음 별도의 대화 세션으로 이동하여 구현 작업을 수행하는 것입니다. + +AI의 출력을 사람이 검토하고 필요에 따라 조정하는 것이 중요합니다. AI가 생성한 코드의 품질은 일반적으로 보통 수준이지만, 모든 것을 처음부터 작성하는 것보다 개발 속도를 높여줍니다. + +## 결론 + +이러한 관행을 따르면 AI의 강점을 활용하면서 일관성 있고 고품질의 코드베이스를 구축할 수 있습니다. 프로젝트 규모가 커지더라도 각 구성 요소는 잘 정의되고 관리하기 쉬운 상태로 유지됩니다. diff --git a/website/client/src/ko/guide/usage.md b/website/client/src/ko/guide/usage.md new file mode 100644 index 000000000..40f71405f --- /dev/null +++ b/website/client/src/ko/guide/usage.md @@ -0,0 +1,87 @@ +# 기본 사용법 + +## 빠른 시작 + +저장소 전체를 패키징: +```bash +repomix +``` + +## 일반적인 사용 사례 + +### 특정 디렉토리 패키징 +```bash +repomix path/to/directory +``` + +### 특정 파일 포함 +[glob 패턴](https://github.com/mrmlnc/fast-glob?tab=readme-ov-file#pattern-syntax) 사용: +```bash +repomix --include "src/**/*.ts,**/*.md" +``` + +### 파일 제외 +```bash +repomix --ignore "**/*.log,tmp/" +``` + +### 원격 저장소 처리 +```bash +# GitHub URL 사용 +repomix --remote https://github.com/user/repo + +# 단축형 사용 +repomix --remote user/repo + +# 특정 브랜치/태그/커밋 +repomix --remote user/repo --remote-branch main +repomix --remote user/repo --remote-branch 935b695 +``` + +## 출력 형식 + +### 일반 텍스트 (기본값) +```bash +repomix --style plain +``` + +### XML +```bash +repomix --style xml +``` + +### Markdown +```bash +repomix --style markdown +``` + +## 추가 옵션 + +### 주석 제거 +```bash +repomix --remove-comments +``` + +### 행 번호 표시 +```bash +repomix --output-show-line-numbers +``` + +### 클립보드에 복사 +```bash +repomix --copy +``` + +### 보안 검사 비활성화 +```bash +repomix --no-security-check +``` + +## 설정 + +설정 파일 초기화: +```bash +repomix --init +``` + +더 자세한 설정 옵션은 [설정 가이드](/ko/guide/configuration)를 참조하세요. diff --git a/website/client/src/ko/index.md b/website/client/src/ko/index.md new file mode 100644 index 000000000..165eb3e9c --- /dev/null +++ b/website/client/src/ko/index.md @@ -0,0 +1,191 @@ +--- +layout: home +title: Repomix +titleTemplate: 코드베이스를 AI 친화적인 형식으로 패키징 +aside: false +editLink: false + +features: + - icon: 🤖 + title: AI 최적화 + details: 코드베이스를 AI가 이해하고 처리하기 쉬운 형식으로 변환합니다. + + - icon: ⚙️ + title: Git 인식 + details: .gitignore 파일을 자동으로 인식하고 처리합니다. + + - icon: 🛡️ + title: 보안 중심 + details: Secretlint를 통합하여 민감한 정보를 감지하고 보호합니다. + + - icon: 📊 + title: 토큰 카운팅 + details: LLM 컨텍스트 제한을 위한 파일별 및 전체 토큰 수를 제공합니다. + +--- + +
+ +## 빠른 시작 + +Repomix를 사용하여 패키지 파일(`repomix-output.txt`)을 생성한 후, 다음과 같은 프롬프트와 함께 AI 어시스턴트에게 전송할 수 있습니다: + +``` +이 파일은 저장소의 모든 파일을 하나로 통합한 것입니다. +코드를 리팩터링하고 싶으니 먼저 검토해 주세요. +``` + +AI는 전체 코드베이스를 분석하고 포괄적인 인사이트를 제공할 것입니다: + +![Repomix 사용 예시 1](/images/docs/repomix-file-usage-1.png) + +구체적인 변경 사항을 논의할 때는 AI가 코드 생성을 도와줍니다. Claude의 Artifacts와 같은 기능을 사용하면 상호 의존적인 여러 파일도 한 번에 받을 수 있습니다: + +![Repomix 사용 예시 2](/images/docs/repomix-file-usage-2.png) + +즐거운 코딩 되세요! 🚀 + + + +## 파워 유저 가이드 + +고급 사용자를 위해 Repomix는 CLI 인터페이스를 통해 다양한 사용자 정의 옵션을 제공합니다. + +### 빠른 시작 + +프로젝트 디렉토리에서 설치 없이 바로 Repomix를 시작할 수 있습니다: + +```bash +npx repomix +``` + +또는 반복 사용을 위해 전역 설치: + +```bash +# npm으로 설치 +npm install -g repomix + +# 또는 yarn으로 설치 +yarn global add repomix + +# 또는 Homebrew로 설치 (macOS) +brew install repomix + +# 그런 다음 아무 프로젝트 디렉토리에서 실행 +repomix +``` + +이게 전부입니다! Repomix가 현재 디렉토리에 `repomix-output.txt` 파일을 생성하며, 이 파일에는 AI 친화적인 형식으로 정리된 전체 코드베이스가 포함됩니다. + + + +### 사용법 + +전체 저장소를 패키징: + +```bash +repomix +``` + +특정 디렉토리를 패키징: + +```bash +repomix path/to/directory +``` + +[glob 패턴](https://github.com/mrmlnc/fast-glob?tab=readme-ov-file#pattern-syntax)을 사용하여 특정 파일이나 디렉토리를 지정: + +```bash +repomix --include "src/**/*.ts,**/*.md" +``` + +특정 파일이나 디렉토리 제외: + +```bash +repomix --ignore "**/*.log,tmp/" +``` + +원격 저장소 처리: +```bash +repomix --remote https://github.com/yamadashy/repomix + +# GitHub 단축형도 사용 가능: +repomix --remote yamadashy/repomix + +# 브랜치명, 태그, 또는 커밋 해시 지정 가능: +repomix --remote https://github.com/yamadashy/repomix --remote-branch main + +# 또는 특정 커밋 해시 사용: +repomix --remote https://github.com/yamadashy/repomix --remote-branch 935b695 +``` + +새 설정 파일(`repomix.config.json`) 초기화: + +```bash +repomix --init +``` + +생성된 파일은 Claude, ChatGPT, Gemini와 같은 생성형 AI 도구와 함께 사용할 수 있습니다. + +#### Docker 사용법 + +Docker를 사용하여 Repomix를 실행할 수도 있습니다 🐳 +격리된 환경에서 Repomix를 실행하거나 컨테이너를 선호하는 경우에 유용합니다. + +기본 사용법(현재 디렉토리): + +```bash +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix +``` + +특정 디렉토리를 처리: +```bash +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix path/to/directory +``` + +원격 저장소를 처리하고 `output` 디렉토리에 출력: + +```bash +docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix --remote https://github.com/yamadashy/repomix +``` + +### 출력 형식 + +선호하는 출력 형식을 선택하세요: + +```bash +# XML 형식(기본값) +repomix --style xml + +# Markdown 형식 +repomix --style markdown + +# 일반 텍스트 형식 +repomix --style plain +``` + +### 사용자 정의 + +`repomix.config.json`을 생성하여 지속적인 설정을 관리할 수 있습니다: + +```json +{ + "output": { + "style": "markdown", + "filePath": "custom-output.md", + "removeComments": true, + "showLineNumbers": true, + "topFilesLength": 10 + }, + "ignore": { + "customPatterns": ["*.test.ts", "docs/**"] + } +} +``` + +### 더 많은 예제 +::: tip +💡 전체 문서와 더 많은 예제는 [GitHub 저장소](https://github.com/yamadashy/repomix)를 참조하세요! +::: + +
diff --git a/website/client/src/pt-br/guide/command-line-options.md b/website/client/src/pt-br/guide/command-line-options.md new file mode 100644 index 000000000..4f988eb5b --- /dev/null +++ b/website/client/src/pt-br/guide/command-line-options.md @@ -0,0 +1,71 @@ +# Opções de Linha de Comando + +## Opções Básicas + +```bash +repomix [diretório] # Processar diretório específico (padrão: ".") +``` + +## Opções de Saída + +| Opção | Descrição | Padrão | +|--------|-------------|---------| +| `-o, --output ` | Nome do arquivo de saída | `repomix-output.txt` | +| `--style ` | Estilo de saída (`plain`, `xml`, `markdown`) | `plain` | +| `--output-show-line-numbers` | Adicionar números de linha | `false` | +| `--copy` | Copiar para a área de transferência | `false` | +| `--no-file-summary` | Desabilitar resumo de arquivos | `true` | +| `--no-directory-structure` | Desabilitar estrutura de diretórios | `true` | +| `--remove-comments` | Remover comentários | `false` | +| `--remove-empty-lines` | Remover linhas vazias | `false` | + +## Opções de Filtro + +| Opção | Descrição | +|--------|-------------| +| `--include ` | Padrões de inclusão (separados por vírgula) | +| `-i, --ignore ` | Padrões de exclusão (separados por vírgula) | + +## Repositório Remoto + +| Opção | Descrição | +|--------|-------------| +| `--remote ` | Processar repositório remoto | +| `--remote-branch ` | Especificar branch/tag/commit | + +## Configuração + +| Opção | Descrição | +|--------|-------------| +| `-c, --config ` | Caminho do arquivo de configuração personalizado | +| `--init` | Criar arquivo de configuração | +| `--global` | Usar configuração global | + +## Segurança + +| Opção | Descrição | Padrão | +|--------|-------------|---------| +| `--no-security-check` | Desabilitar verificação de segurança | `true` | + +## Outras Opções + +| Opção | Descrição | +|--------|-------------| +| `-v, --version` | Mostrar versão | +| `--verbose` | Habilitar logging detalhado | +| `--top-files-len ` | Número de arquivos principais para mostrar | `5` | + +## Exemplos + +```bash +# Uso básico +repomix + +# Saída personalizada +repomix -o output.xml --style xml + +# Processar arquivos específicos +repomix --include "src/**/*.ts" --ignore "**/*.test.ts" + +# Repositório remoto +repomix --remote user/repo --remote-branch main diff --git a/website/client/src/pt-br/guide/comment-removal.md b/website/client/src/pt-br/guide/comment-removal.md new file mode 100644 index 000000000..0038ce01b --- /dev/null +++ b/website/client/src/pt-br/guide/comment-removal.md @@ -0,0 +1,53 @@ +# Remoção de Comentários + +O Repomix pode remover automaticamente os comentários do seu código ao gerar o arquivo de saída. Isso pode ajudar a reduzir o ruído e focar no código real. + +## Uso + +Para habilitar a remoção de comentários, defina a opção `removeComments` como `true` no seu `repomix.config.json`: + +```json +{ + "output": { + "removeComments": true + } +} +``` + +## Linguagens Suportadas + +O Repomix suporta a remoção de comentários para uma ampla gama de linguagens de programação, incluindo: + +- JavaScript/TypeScript (`//`, `/* */`) +- Python (`#`, `"""`, `'''`) +- Java (`//`, `/* */`) +- C/C++ (`//`, `/* */`) +- HTML (``) +- CSS (`/* */`) +- E muitas outras... + +## Exemplo + +Dado o seguinte código JavaScript: + +```javascript +// Este é um comentário de linha única +function test() { + /* Este é um + comentário de várias linhas */ + return true; +} +``` + +Com a remoção de comentários habilitada, a saída será: + +```javascript +function test() { + return true; +} +``` + +## Notas + +- A remoção de comentários é realizada antes de outras etapas de processamento, como a adição de números de linha. +- Alguns comentários, como os comentários JSDoc, podem ser preservados dependendo da linguagem e do contexto. diff --git a/website/client/src/pt-br/guide/configuration.md b/website/client/src/pt-br/guide/configuration.md new file mode 100644 index 000000000..dd2f13901 --- /dev/null +++ b/website/client/src/pt-br/guide/configuration.md @@ -0,0 +1,84 @@ +# Configuração + +## Início Rápido + +Criar arquivo de configuração: +```bash +repomix --init +``` + +## Arquivo de Configuração + +`repomix.config.json`: +```json +{ + "output": { + "filePath": "repomix-output.xml", + "style": "xml", + "headerText": "Texto de cabeçalho personalizado", + "instructionFilePath": "repomix-instruction.md", + "fileSummary": true, + "directoryStructure": true, + "removeComments": false, + "removeEmptyLines": false, + "topFilesLength": 5, + "showLineNumbers": false, + "copyToClipboard": false, + "includeEmptyDirectories": false + }, + "include": ["**/*"], + "ignore": { + "useGitignore": true, + "useDefaultPatterns": true, + "customPatterns": ["tmp/", "*.log"] + }, + "security": { + "enableSecurityCheck": true + } +} +``` + +## Configuração Global + +Criar configuração global: +```bash +repomix --init --global +``` + +Localização: +- Windows: `%LOCALAPPDATA%\Repomix\repomix.config.json` +- macOS/Linux: `~/.config/repomix/repomix.config.json` + +## Padrões de Exclusão + +Ordem de prioridade: +1. Opções de CLI (`--ignore`) +2. .repomixignore +3. .gitignore +4. Padrões padrão + +Exemplo de `.repomixignore`: +```text +# Diretórios de cache +.cache/ +tmp/ + +# Saídas de build +dist/ +build/ + +# Logs +*.log +``` + +## Padrões de Exclusão Padrão + +Padrões comuns incluídos por padrão: +```text +node_modules/** +.git/** +coverage/** +dist/** +``` + +Lista completa: [defaultIgnore.ts](https://github.com/yamadashy/repomix/blob/main/src/config/defaultIgnore.ts) diff --git a/website/client/src/pt-br/guide/custom-instructions.md b/website/client/src/pt-br/guide/custom-instructions.md new file mode 100644 index 000000000..ece8d4327 --- /dev/null +++ b/website/client/src/pt-br/guide/custom-instructions.md @@ -0,0 +1,42 @@ +# Instruções Personalizadas + +O Repomix permite fornecer instruções personalizadas que serão incluídas no arquivo de saída. Isso pode ser útil para adicionar contexto ou diretrizes específicas para sistemas de IA que processam o repositório. + +## Uso + +Para incluir uma instrução personalizada, crie um arquivo markdown (por exemplo, `repomix-instruction.md`) na raiz do seu repositório. Em seguida, especifique o caminho para este arquivo no seu `repomix.config.json`: + +```json +{ + "output": { + "instructionFilePath": "repomix-instruction.md" + } +} +``` + +O conteúdo deste arquivo será incluído na saída sob a seção "Instruction". + +## Exemplo + +```markdown +# Instruções do Repositório + +Este repositório contém o código-fonte da ferramenta Repomix. Por favor, siga estas diretrizes ao analisar o código: + +1. Concentre-se na funcionalidade principal no diretório `src/core`. +2. Preste atenção especial às verificações de segurança em `src/core/security`. +3. Ignore quaisquer arquivos no diretório `tests`. +``` + +Isso resultará na seguinte seção na saída: + +```xml + +# Instruções do Repositório + +Este repositório contém o código-fonte da ferramenta Repomix. Por favor, siga estas diretrizes ao analisar o código: + +1. Concentre-se na funcionalidade principal no diretório `src/core`. +2. Preste atenção especial às verificações de segurança em `src/core/security`. +3. Ignore quaisquer arquivos no diretório `tests`. + diff --git a/website/client/src/pt-br/guide/development/index.md b/website/client/src/pt-br/guide/development/index.md new file mode 100644 index 000000000..db8582fcb --- /dev/null +++ b/website/client/src/pt-br/guide/development/index.md @@ -0,0 +1,42 @@ +# Contribuindo para o Repomix + +## Início Rápido + +```bash +git clone https://github.com/yamadashy/repomix.git +cd repomix +npm install +``` + +## Comandos de Desenvolvimento + +```bash +# Executar CLI +npm run cli-run + +# Executar testes +npm run test +npm run test-coverage + +# Lintar código +npm run lint +``` + +## Estilo de Código + +- Use [Biome](https://biomejs.dev/) para lintar e formatar +- Injeção de dependência para testabilidade +- Mantenha os arquivos com menos de 250 linhas +- Adicione testes para novos recursos + +## Diretrizes para Pull Requests + +1. Execute todos os testes +2. Passe nas verificações de lint +3. Atualize a documentação +4. Siga o estilo de código existente + +## Precisa de Ajuda? + +- [Abra uma issue](https://github.com/yamadashy/repomix/issues) +- [Junte-se ao Discord](https://discord.gg/wNYzTwZFku) diff --git a/website/client/src/pt-br/guide/development/setup.md b/website/client/src/pt-br/guide/development/setup.md new file mode 100644 index 000000000..bc55c05d7 --- /dev/null +++ b/website/client/src/pt-br/guide/development/setup.md @@ -0,0 +1,73 @@ +# Configuração de Desenvolvimento + +## Pré-requisitos + +- Node.js ≥ 18.0.0 +- Git +- npm + +## Desenvolvimento Local + +```bash +# Clonar repositório +git clone https://github.com/yamadashy/repomix.git +cd repomix + +# Instalar dependências +npm install + +# Executar CLI +npm run cli-run +``` + +## Desenvolvimento com Docker + +```bash +# Construir imagem +docker build -t repomix . + +# Executar container +docker run -v ./:/app -it --rm repomix +``` + +## Estrutura do Projeto + +``` +src/ +├── cli/ # Implementação da CLI +├── config/ # Manipulação de configuração +├── core/ # Funcionalidade principal +└── shared/ # Utilitários compartilhados +``` + +## Testando + +```bash +# Executar testes +npm run test + +# Cobertura de teste +npm run test-coverage + +# Linting +npm run lint-biome +npm run lint-ts +npm run lint-secretlint +``` + +## Processo de Release + +1. Atualizar versão +```bash +npm version patch # ou minor/major +``` + +2. Executar testes e construir +```bash +npm run test-coverage +npm run build +``` + +3. Publicar +```bash +npm publish diff --git a/website/client/src/pt-br/guide/index.md b/website/client/src/pt-br/guide/index.md new file mode 100644 index 000000000..cd491d19c --- /dev/null +++ b/website/client/src/pt-br/guide/index.md @@ -0,0 +1,60 @@ +# Introdução ao Repomix + +O Repomix é uma ferramenta que compacta todo o seu repositório em um único arquivo amigável para IA. Ele foi projetado para ajudá-lo a alimentar seu código-fonte para Modelos de Linguagem Grandes (LLMs) como Claude, ChatGPT e Gemini. + +## Início Rápido + +Execute este comando no diretório do seu projeto: + +```bash +npx repomix +``` + +É isso! Você encontrará um arquivo `repomix-output.txt` contendo todo o seu repositório em um formato amigável para IA. + +Você pode então enviar este arquivo para um assistente de IA com um prompt como: + +``` +Este arquivo contém todos os arquivos do repositório combinados em um só. +Eu quero refatorar o código, então, por favor, revise-o primeiro. +``` + +A IA analisará todo o seu código-fonte e fornecerá insights abrangentes: + +![Uso do Arquivo Repomix 1](/images/docs/repomix-file-usage-1.png) + +Ao discutir mudanças específicas, a IA pode ajudar a gerar código. Com recursos como o Artifacts do Claude, você pode até receber vários arquivos interdependentes: + +![Uso do Arquivo Repomix 2](/images/docs/repomix-file-usage-2.png) + +Feliz codificação! 🚀 + +## Principais Recursos + +- **Saída Otimizada para IA**: Formata seu código-fonte para fácil processamento por IA +- **Contagem de Tokens**: Rastreia o uso de tokens para limites de contexto de LLM +- **Consciente do Git**: Respeita seus arquivos .gitignore +- **Focado em Segurança**: Detecta informações sensíveis +- **Múltiplos Formatos de Saída**: Escolha entre texto simples, XML ou Markdown + +## O que vem a seguir? + +- [Guia de Instalação](installation.md): Diferentes maneiras de instalar o Repomix +- [Guia de Uso](usage.md): Aprenda sobre recursos básicos e avançados +- [Configuração](configuration.md): Personalize o Repomix para suas necessidades +- [Recursos de Segurança](security.md): Aprenda sobre verificações de segurança + +## Comunidade + +Junte-se à nossa [comunidade Discord](https://discord.gg/wNYzTwZFku) para: +- Obter ajuda com o Repomix +- Compartilhar suas experiências +- Sugerir novos recursos +- Conectar-se com outros usuários + +## Suporte + +Encontrou um bug ou precisa de ajuda? +- [Abra um problema no GitHub](https://github.com/yamadashy/repomix/issues) +- Junte-se ao nosso servidor Discord +- Verifique a [documentação](https://repomix.com) diff --git a/website/client/src/pt-br/guide/installation.md b/website/client/src/pt-br/guide/installation.md new file mode 100644 index 000000000..2742fe79f --- /dev/null +++ b/website/client/src/pt-br/guide/installation.md @@ -0,0 +1,53 @@ +# Instalação + +## Usando npx (Nenhuma Instalação Necessária) + +```bash +npx repomix +``` + +## Instalação Global + +### npm +```bash +npm install -g repomix +``` + +### Yarn +```bash +yarn global add repomix +``` + +### Homebrew (macOS) +```bash +brew install repomix +``` + +## Instalação via Docker + +Baixe e execute a imagem Docker: + +```bash +# Diretório atual +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix + +# Diretório específico +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix path/to/directory + +# Repositório remoto +docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix --remote yamadashy/repomix +``` + +## Requisitos de Sistema + +- Node.js: ≥ 18.0.0 +- Git: Necessário para processamento de repositório remoto + +## Verificação + +Após a instalação, verifique se o Repomix está funcionando: + +```bash +repomix --version +repomix --help +``` diff --git a/website/client/src/pt-br/guide/output.md b/website/client/src/pt-br/guide/output.md new file mode 100644 index 000000000..58ae0096d --- /dev/null +++ b/website/client/src/pt-br/guide/output.md @@ -0,0 +1,121 @@ +# Output Formats + +Repomix supports three output formats: +- Plain Text (default) +- XML +- Markdown + +## Plain Text Format + +```bash +repomix --style plain +``` + +Output structure: +```text +This file is a merged representation of the entire codebase... + +================ +File Summary +================ +(Metadata and AI instructions) + +================ +Directory Structure +================ +src/ + index.ts + utils/ + helper.ts + +================ +Files +================ + +================ +File: src/index.ts +================ +// File contents here +``` + +## XML Format + +```bash +repomix --style xml +``` + +XML format is optimized for AI processing: + +```xml +This file is a merged representation of the entire codebase... + + +(Metadata and AI instructions) + + + +src/ + index.ts + utils/ + helper.ts + + + + +// File contents here + + +``` + +::: tip Why XML? +XML tags help AI models like Claude parse content more accurately. [Claude Documentation](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/use-xml-tags) recommends using XML tags for structured prompts. +::: + +## Markdown Format + +```bash +repomix --style markdown +``` + +Markdown provides readable formatting: + +```markdown +This file is a merged representation of the entire codebase... + +# File Summary +(Metadata and AI instructions) + +# Directory Structure +``` +src/ +index.ts +utils/ +helper.ts +``` + +# Files + +## File: src/index.ts +```typescript +// File contents here +``` +``` + +## Usage with AI Models + +Each format works well with AI models, but consider: +- Use XML for Claude (best parsing accuracy) +- Use Markdown for general readability +- Use Plain Text for simplicity and universal compatibility + +## Customization + +Set default format in `repomix.config.json`: +```json +{ + "output": { + "style": "xml", + "filePath": "output.xml" + } +} +``` diff --git a/website/client/src/pt-br/guide/prompt-examples.md b/website/client/src/pt-br/guide/prompt-examples.md new file mode 100644 index 000000000..4d4ef5581 --- /dev/null +++ b/website/client/src/pt-br/guide/prompt-examples.md @@ -0,0 +1,124 @@ +# Exemplos de Prompts + +## Revisão de Código + +### Revisão de Arquitetura +``` +Analise a arquitetura desta base de código: +1. Avalie a estrutura geral e os padrões +2. Identifique possíveis problemas de arquitetura +3. Sugira melhorias para escalabilidade +4. Observe áreas que seguem as melhores práticas + +Concentre-se na manutenibilidade e modularidade. +``` + +### Revisão de Segurança +``` +Realize uma revisão de segurança desta base de código: +1. Identifique possíveis vulnerabilidades de segurança +2. Verifique se há antipadrões de segurança comuns +3. Revise o tratamento de erros e a validação de entrada +4. Avalie a segurança das dependências + +Forneça exemplos específicos e etapas de correção. +``` + +### Revisão de Desempenho +``` +Revise a base de código para desempenho: +1. Identifique gargalos de desempenho +2. Verifique a utilização de recursos +3. Revise a eficiência algorítmica +4. Avalie as estratégias de cache + +Inclua recomendações específicas de otimização. +``` + +## Geração de Documentação + +### Documentação de API +``` +Gere documentação abrangente da API: +1. Liste e descreva todos os endpoints públicos +2. Documente os formatos de solicitação/resposta +3. Inclua exemplos de uso +4. Observe quaisquer limitações ou restrições +``` + +### Guia do Desenvolvedor +``` +Crie um guia do desenvolvedor cobrindo: +1. Instruções de configuração +2. Visão geral da estrutura do projeto +3. Fluxo de trabalho de desenvolvimento +4. Abordagem de teste +5. Etapas comuns de solução de problemas +``` + +### Documentação de Arquitetura +``` +Documente a arquitetura do sistema: +1. Visão geral de alto nível +2. Interações de componentes +3. Diagramas de fluxo de dados +4. Decisões de design e justificativa +5. Restrições e limitações do sistema +``` + +## Análise e Melhoria + +### Análise de Dependências +``` +Analise as dependências do projeto: +1. Identifique pacotes desatualizados +2. Verifique se há vulnerabilidades de segurança +3. Sugira pacotes alternativos +4. Revise os padrões de uso de dependências + +Inclua recomendações específicas de atualização. +``` + +### Cobertura de Testes +``` +Revise a cobertura de testes: +1. Identifique componentes não testados +2. Sugira casos de teste adicionais +3. Revise a qualidade do teste +4. Recomende estratégias de teste +``` + +### Qualidade do Código +``` +Avalie a qualidade do código e sugira melhorias: +1. Revise as convenções de nomenclatura +2. Verifique a organização do código +3. Avalie o tratamento de erros +4. Revise as práticas de comentários + +Forneça exemplos específicos de padrões bons e problemáticos. +``` + +## Dicas para Obter Melhores Resultados + +1. **Seja Específico**: Inclua objetivos claros e critérios de avaliação +2. **Defina o Contexto**: Especifique sua função e o nível de especialização necessário +3. **Formato da Solicitação**: Defina como você deseja que a resposta seja estruturada +4. **Priorize**: Indique quais aspectos são mais importantes + +## Notas Específicas do Modelo + +### Claude +- Use o formato de saída XML +- Coloque instruções importantes no final +- Especifique a estrutura da resposta + +### ChatGPT +- Use o formato Markdown +- Divida grandes bases de código em seções +- Inclua prompts de função do sistema + +### Gemini +- Funciona com todos os formatos +- Concentre-se em áreas específicas por solicitação +- Use análise passo a passo diff --git a/website/client/src/pt-br/guide/remote-repository-processing.md b/website/client/src/pt-br/guide/remote-repository-processing.md new file mode 100644 index 000000000..c0c8b12b3 --- /dev/null +++ b/website/client/src/pt-br/guide/remote-repository-processing.md @@ -0,0 +1,68 @@ +# Processamento de Repositório Remoto + +## Uso Básico + +Processar repositórios públicos: +```bash +# Usando URL completo +repomix --remote https://github.com/user/repo + +# Usando atalho do GitHub +repomix --remote user/repo +``` + +## Seleção de Branch e Commit + +```bash +# Branch específico +repomix --remote user/repo --remote-branch main + +# Tag +repomix --remote user/repo --remote-branch v1.0.0 + +# Hash do commit +repomix --remote user/repo --remote-branch 935b695 +``` + +## Requisitos + +- Git deve estar instalado +- Conexão com a internet +- Acesso de leitura ao repositório + +## Controle de Saída + +```bash +# Local de saída personalizado +repomix --remote user/repo -o custom-output.xml + +# Com formato XML +repomix --remote user/repo --style xml + +# Remover comentários +repomix --remote user/repo --remove-comments +``` + +## Uso com Docker + +```bash +# Processar e enviar para o diretório atual +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix \ + --remote user/repo + +# Enviar para um diretório específico +docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix \ + --remote user/repo +``` + +## Problemas Comuns + +### Problemas de Acesso +- Certifique-se de que o repositório é público +- Verifique a instalação do Git +- Verifique a conexão com a internet + +### Repositórios Grandes +- Use `--include` para selecionar caminhos específicos +- Habilite `--remove-comments` +- Processe branches separadamente diff --git a/website/client/src/pt-br/guide/security.md b/website/client/src/pt-br/guide/security.md new file mode 100644 index 000000000..1f8c573dd --- /dev/null +++ b/website/client/src/pt-br/guide/security.md @@ -0,0 +1,65 @@ +# Segurança + +## Recurso de Verificação de Segurança + +O Repomix usa o [Secretlint](https://github.com/secretlint/secretlint) para detectar informações confidenciais em seus arquivos: +- Chaves de API +- Tokens de acesso +- Credenciais +- Chaves privadas +- Variáveis de ambiente + +## Configuração + +As verificações de segurança são habilitadas por padrão. + +Desativar via CLI: +```bash +repomix --no-security-check +``` + +Ou em `repomix.config.json`: +```json +{ + "security": { + "enableSecurityCheck": false + } +} +``` + +## Medidas de Segurança + +1. **Exclusão de Arquivos Binários**: Arquivos binários não são incluídos na saída +2. **Compatível com Git**: Respeita os padrões do `.gitignore` +3. **Detecção Automatizada**: Verifica problemas de segurança comuns: + - Credenciais da AWS + - Strings de conexão de banco de dados + - Tokens de autenticação + - Chaves privadas + +## Quando a Verificação de Segurança Encontra Problemas + +Exemplo de saída: +```bash +🔍 Verificação de Segurança: +────────────────── +2 arquivo(s) suspeito(s) detectados e excluídos: +1. config/credentials.json + - Chave de acesso da AWS encontrada +2. .env.local + - Senha do banco de dados encontrada +``` + +## Melhores Práticas + +1. Sempre revise a saída antes de compartilhar +2. Use `.repomixignore` para caminhos confidenciais +3. Mantenha as verificações de segurança habilitadas +4. Remova arquivos confidenciais do repositório + +## Reportando Problemas de Segurança + +Encontrou uma vulnerabilidade de segurança? Por favor: +1. Não abra uma issue pública +2. Envie um e-mail para: koukun0120@gmail.com +3. Ou use [Avisos de Segurança do GitHub](https://github.com/yamadashy/repomix/security/advisories/new) diff --git a/website/client/src/pt-br/guide/tips/best-practices.md b/website/client/src/pt-br/guide/tips/best-practices.md new file mode 100644 index 000000000..a18b35e0d --- /dev/null +++ b/website/client/src/pt-br/guide/tips/best-practices.md @@ -0,0 +1,35 @@ +# AI-Assisted Development Best Practices: From My Experience + +While I haven't successfully completed a large-scale project using AI yet, I'd like to share what I've learned so far from my experience working with AI in development. + +## Basic Development Approach + +When working with AI, attempting to implement all features at once can lead to unexpected issues and project stagnation. That's why it's more effective to start with core functionality and build each feature one at a time, ensuring solid implementation before moving forward. + +### The Power of Existing Code + +This approach is effective because implementing core functionality allows you to materialize your ideal design and coding style through actual code. The most effective way to communicate your project vision is through code that reflects your standards and preferences. + +By starting with core features and ensuring each component works properly before moving on, the entire project maintains consistency, making it easier for AI to generate more appropriate code. + +## The Modular Approach + +Breaking code into smaller modules is crucial. In my experience, keeping files around 250 lines of code makes it easier to give clear instructions to AI and makes the trial-and-error process more efficient. While token count would be a more accurate metric, line count is more practical for human developers to work with, so we use that as a guideline. + +This modularization isn't just about separating frontend, backend, and database components - it's about breaking down functionality at a much finer level. For example, within a single feature, you might separate validation, error handling, and other specific functionalities into distinct modules. Of course, high-level separation is also important, and implementing this modular approach gradually helps maintain clear instructions and enables AI to generate more appropriate code. This approach is effective not just for AI but for human developers as well. + +## Ensuring Quality Through Testing + +I consider testing to be crucial in AI-assisted development. Tests serve not only as quality assurance measures but also as documentation that clearly demonstrates code intentions. When asking AI to implement new features, existing test code effectively acts as a specification document. + +Tests are also an excellent tool for validating the correctness of AI-generated code. For instance, when having AI implement new functionality for a module, writing test cases beforehand allows you to objectively evaluate whether the generated code behaves as expected. This aligns well with Test-Driven Development (TDD) principles and is particularly effective when collaborating with AI. + +## Balancing Planning and Implementation + +Before implementing large-scale features, I recommend first discussing the plan with AI. Organizing requirements and considering architecture leads to smoother implementation. A good practice is to compile requirements first, then move to a separate chat session for implementation work. + +It's essential to have human review of AI output and make adjustments as needed. While the quality of AI-generated code is generally moderate, it still accelerates development compared to writing everything from scratch. + +## Conclusion + +By following these practices, you can leverage AI's strengths while building a consistent, high-quality codebase. Even as your project grows in size, each component remains well-defined and manageable. diff --git a/website/client/src/pt-br/guide/usage.md b/website/client/src/pt-br/guide/usage.md new file mode 100644 index 000000000..6240dffd5 --- /dev/null +++ b/website/client/src/pt-br/guide/usage.md @@ -0,0 +1,87 @@ +# Uso Básico + +## Início Rápido + +Compacte todo o seu repositório: +```bash +repomix +``` + +## Casos de Uso Comuns + +### Compactar Diretórios Específicos +```bash +repomix path/to/directory +``` + +### Incluir Arquivos Específicos +Use [glob patterns](https://github.com/mrmlnc/fast-glob?tab=readme-ov-file#pattern-syntax): +```bash +repomix --include "src/**/*.ts,**/*.md" +``` + +### Excluir Arquivos +```bash +repomix --ignore "**/*.log,tmp/" +``` + +### Repositórios Remotos +```bash +# Usando URL do GitHub +repomix --remote https://github.com/user/repo + +# Usando abreviação +repomix --remote user/repo + +# Branch/tag/commit específico +repomix --remote user/repo --remote-branch main +repomix --remote user/repo --remote-branch 935b695 +``` + +## Formatos de Saída + +### Texto Simples (Padrão) +```bash +repomix --style plain +``` + +### XML +```bash +repomix --style xml +``` + +### Markdown +```bash +repomix --style markdown +``` + +## Opções Adicionais + +### Remover Comentários +```bash +repomix --remove-comments +``` + +### Mostrar Números de Linha +```bash +repomix --output-show-line-numbers +``` + +### Copiar para a Área de Transferência +```bash +repomix --copy +``` + +### Desativar Verificação de Segurança +```bash +repomix --no-security-check +``` + +## Configuração + +Inicializar arquivo de configuração: +```bash +repomix --init +``` + +Veja o [Guia de Configuração](/pt-br/guide/configuration) para opções detalhadas. diff --git a/website/client/src/pt-br/index.md b/website/client/src/pt-br/index.md new file mode 100644 index 000000000..d5e233dde --- /dev/null +++ b/website/client/src/pt-br/index.md @@ -0,0 +1,187 @@ +--- +layout: home +title: Repomix +titleTemplate: Compacte seu código-fonte em formatos amigáveis para IA +aside: false +editLink: false + +features: + - icon: 🤖 + title: Otimizado para IA + details: Formata seu código-fonte de uma maneira fácil para a IA entender e processar. + + - icon: ⚙️ + title: Consciente do Git + details: Respeita automaticamente seus arquivos .gitignore. + + - icon: 🛡️ + title: Focado na Segurança + details: Incorpora o Secretlint para verificações de segurança robustas para detectar e prevenir a inclusão de informações confidenciais. + + - icon: 📊 + title: Contagem de Tokens + details: Fornece contagens de tokens para cada arquivo e para todo o repositório, útil para limites de contexto de LLM. + +--- + +
+ +## Início Rápido + +Depois de gerar um arquivo compactado (`repomix-output.txt`) usando o Repomix, você pode enviá-lo para um assistente de IA com um prompt como: + +``` +Este arquivo contém todos os arquivos do repositório combinados em um. +Eu quero refatorar o código, então, por favor, revise-o primeiro. +``` + +A IA analisará todo o seu código-fonte e fornecerá insights abrangentes: + +![Repomix File Usage 1](/images/docs/repomix-file-usage-1.png) + +Ao discutir mudanças específicas, a IA pode ajudar a gerar código. Com recursos como o Artifacts do Claude, você pode até receber vários arquivos interdependentes: + +![Repomix File Usage 2](/images/docs/repomix-file-usage-2.png) + +Feliz codificação! 🚀 + +## Guia do Usuário Avançado + +Para usuários avançados que precisam de mais controle, o Repomix oferece extensas opções de personalização através de sua interface CLI. + +### Início Rápido + +Você pode experimentar o Repomix instantaneamente no diretório do seu projeto sem instalação: + +```bash +npx repomix +``` + +Ou instale globalmente para uso repetido: + +```bash +# Instalar usando npm +npm install -g repomix + +# Alternativamente usando yarn +yarn global add repomix + +# Alternativamente usando Homebrew (macOS) +brew install repomix + +# Então execute em qualquer diretório de projeto +repomix +``` + +É isso! O Repomix irá gerar um arquivo `repomix-output.txt` no seu diretório atual, contendo todo o seu repositório em um formato amigável para IA. + +### Uso + +Para compactar todo o seu repositório: + +```bash +repomix +``` + +Para compactar um diretório específico: + +```bash +repomix path/to/directory +``` + +Para compactar arquivos ou diretórios específicos usando [glob patterns](https://github.com/mrmlnc/fast-glob?tab=readme-ov-file#pattern-syntax): + +```bash +repomix --include "src/**/*.ts,**/*.md" +``` + +Para excluir arquivos ou diretórios específicos: + +```bash +repomix --ignore "**/*.log,tmp/" +``` + +Para compactar um repositório remoto: +```bash +repomix --remote https://github.com/yamadashy/repomix + +# Você também pode usar o atalho do GitHub: +repomix --remote yamadashy/repomix + +# Você pode especificar o nome do branch, tag ou hash do commit: +repomix --remote https://github.com/yamadashy/repomix --remote-branch main + +# Ou usar um hash de commit específico: +repomix --remote https://github.com/yamadashy/repomix --remote-branch 935b695 +``` + +Para inicializar um novo arquivo de configuração (`repomix.config.json`): + +```bash +repomix --init +``` + +Depois de gerar o arquivo compactado, você pode usá-lo com ferramentas de IA Generativa como Claude, ChatGPT e Gemini. + +#### Uso do Docker + +Você também pode executar o Repomix usando o Docker 🐳 +Isso é útil se você quiser executar o Repomix em um ambiente isolado ou preferir usar contêineres. + +Uso básico (diretório atual): + +```bash +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix +``` + +Para compactar um diretório específico: +```bash +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix path/to/directory +``` + +Processar um repositório remoto e enviar para um diretório `output`: + +```bash +docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix --remote https://github.com/yamadashy/repomix +``` + +### Formatos de Saída + +Escolha seu formato de saída preferido: + +```bash +# Formato XML (padrão) +repomix --style xml + +# Formato Markdown +repomix --style markdown + +# Formato de texto simples +repomix --style plain +``` + +### Customização + +Crie um `repomix.config.json` para configurações persistentes: + +```json +{ + "output": { + "style": "markdown", + "filePath": "custom-output.md", + "removeComments": true, + "showLineNumbers": true, + "topFilesLength": 10 + }, + "ignore": { + "customPatterns": ["*.test.ts", "docs/**"] + } +} +``` + +### Mais Exemplos +::: tip +💡 Confira nosso [repositório GitHub](https://github.com/yamadashy/repomix) para documentação completa e mais exemplos! +::: + +
diff --git a/website/client/src/zh-cn/guide/command-line-options.md b/website/client/src/zh-cn/guide/command-line-options.md new file mode 100644 index 000000000..9b1e69ab9 --- /dev/null +++ b/website/client/src/zh-cn/guide/command-line-options.md @@ -0,0 +1,72 @@ +# 命令行选项 + +## 基本选项 + +```bash +repomix [directory] # 处理指定目录(默认为当前目录 ".") +``` + +## 输出选项 + +| 选项 | 说明 | 默认值 | +|--------|-------------|---------| +| `-o, --output ` | 输出文件名 | `repomix-output.txt` | +| `--style ` | 输出格式(`plain`, `xml`, `markdown`) | `plain` | +| `--output-show-line-numbers` | 添加行号 | `false` | +| `--copy` | 复制到剪贴板 | `false` | +| `--no-file-summary` | 禁用文件概要 | `true` | +| `--no-directory-structure` | 禁用目录结构 | `true` | +| `--remove-comments` | 移除注释 | `false` | +| `--remove-empty-lines` | 移除空行 | `false` | + +## 过滤选项 + +| 选项 | 说明 | +|--------|-------------| +| `--include ` | 包含模式(逗号分隔) | +| `-i, --ignore ` | 忽略模式(逗号分隔) | + +## 远程仓库 + +| 选项 | 说明 | +|--------|-------------| +| `--remote ` | 处理远程仓库 | +| `--remote-branch ` | 指定分支/标签/提交 | + +## 配置 + +| 选项 | 说明 | +|--------|-------------| +| `-c, --config ` | 自定义配置文件路径 | +| `--init` | 创建配置文件 | +| `--global` | 使用全局配置 | + +## 安全 + +| 选项 | 说明 | 默认值 | +|--------|-------------|---------| +| `--no-security-check` | 禁用安全检查 | `true` | + +## 其他选项 + +| 选项 | 说明 | +|--------|-------------| +| `-v, --version` | 显示版本 | +| `--verbose` | 启用详细日志 | +| `--top-files-len ` | 显示的顶部文件数量 | `5` | + +## 使用示例 + +```bash +# 基本用法 +repomix + +# 自定义输出 +repomix -o output.xml --style xml + +# 处理特定文件 +repomix --include "src/**/*.ts" --ignore "**/*.test.ts" + +# 远程仓库 +repomix --remote user/repo --remote-branch main +``` diff --git a/website/client/src/zh-cn/guide/comment-removal.md b/website/client/src/zh-cn/guide/comment-removal.md new file mode 100644 index 000000000..165ffe02f --- /dev/null +++ b/website/client/src/zh-cn/guide/comment-removal.md @@ -0,0 +1,68 @@ +# 注释移除 + +Repomix 可以在生成输出文件时自动移除代码中的注释。这有助于减少干扰,让代码更加简洁。 + +## 使用方法 + +要启用注释移除,在 `repomix.config.json` 中将 `removeComments` 选项设置为 `true`: + +```json +{ + "output": { + "removeComments": true + } +} +``` + +## 支持的语言 + +Repomix 支持移除多种编程语言的注释,包括: + +- JavaScript/TypeScript (`//`, `/* */`) +- Python (`#`, `"""`, `'''`) +- Java (`//`, `/* */`) +- C/C++ (`//`, `/* */`) +- HTML (``) +- CSS (`/* */`) +- 以及更多语言... + +## 示例 + +以下是 JavaScript 代码示例: + +```javascript +// 这是单行注释 +function test() { + /* 这是 + 多行注释 */ + return true; +} +``` + +启用注释移除后,输出将变为: + +```javascript +function test() { + return true; +} +``` + +## 注意事项 + +- 注释移除在其他处理步骤(如行号添加)之前执行 +- 某些注释,例如 JSDoc 注释,可能会根据语言和上下文保留 +- 如果你需要保留某些重要注释,请考虑使用其他方式记录这些信息,例如使用自定义指令 + +## 建议用法 + +1. **选择性使用**: + - 对于需要向 AI 展示实现细节的代码,保留注释 + - 对于主要关注代码结构的分析,移除注释 + +2. **配合其他功能**: + - 与 `--remove-empty-lines` 选项组合使用,获得更简洁的输出 + - 使用自定义指令提供额外的上下文信息 + +3. **性能考虑**: + - 移除注释可以减少输出文件大小 + - 对于大型代码库特别有用 diff --git a/website/client/src/zh-cn/guide/configuration.md b/website/client/src/zh-cn/guide/configuration.md new file mode 100644 index 000000000..e176832b5 --- /dev/null +++ b/website/client/src/zh-cn/guide/configuration.md @@ -0,0 +1,84 @@ +# 配置 + +## 快速开始 + +创建配置文件: +```bash +repomix --init +``` + +## 配置文件 + +`repomix.config.json`: +```json +{ + "output": { + "filePath": "repomix-output.xml", + "style": "xml", + "headerText": "自定义头部文本", + "instructionFilePath": "repomix-instruction.md", + "fileSummary": true, + "directoryStructure": true, + "removeComments": false, + "removeEmptyLines": false, + "topFilesLength": 5, + "showLineNumbers": false, + "copyToClipboard": false, + "includeEmptyDirectories": false + }, + "include": ["**/*"], + "ignore": { + "useGitignore": true, + "useDefaultPatterns": true, + "customPatterns": ["tmp/", "*.log"] + }, + "security": { + "enableSecurityCheck": true + } +} +``` + +## 全局配置 + +创建全局配置: +```bash +repomix --init --global +``` + +配置文件位置: +- Windows: `%LOCALAPPDATA%\\Repomix\\repomix.config.json` +- macOS/Linux: `~/.config/repomix/repomix.config.json` + +## 忽略模式 + +优先级顺序: +1. 命令行选项(`--ignore`) +2. .repomixignore 文件 +3. .gitignore 文件 +4. 默认模式 + +`.repomixignore` 示例: +```text +# 缓存目录 +.cache/ +tmp/ + +# 构建输出 +dist/ +build/ + +# 日志文件 +*.log +``` + +## 默认忽略模式 + +内置的常用模式: +```text +node_modules/** +.git/** +coverage/** +dist/** +``` + +完整列表:[defaultIgnore.ts](https://github.com/yamadashy/repomix/blob/main/src/config/defaultIgnore.ts) diff --git a/website/client/src/zh-cn/guide/custom-instructions.md b/website/client/src/zh-cn/guide/custom-instructions.md new file mode 100644 index 000000000..70b0b86c8 --- /dev/null +++ b/website/client/src/zh-cn/guide/custom-instructions.md @@ -0,0 +1,78 @@ +# 自定义指令 + +Repomix 允许你提供自定义指令,这些指令将被包含在输出文件中。这对于为处理代码库的 AI 系统提供上下文或特定指导非常有用。 + +## 使用方法 + +要包含自定义指令,请在仓库根目录创建一个 markdown 文件(例如 `repomix-instruction.md`)。然后,在 `repomix.config.json` 中指定该文件的路径: + +```json +{ + "output": { + "instructionFilePath": "repomix-instruction.md" + } +} +``` + +该文件的内容将在输出中的"Instruction"部分中显示。 + +## 示例 + +```markdown +# 仓库指令 + +这个仓库包含了 Repomix 工具的源代码。在分析代码时请遵循以下指导原则: + +1. 重点关注 `src/core` 目录中的核心功能 +2. 特别注意 `src/core/security` 中的安全检查 +3. 忽略 `tests` 目录中的文件 + +## 代码规范 +- 遵循 TypeScript 最佳实践 +- 确保所有公共 API 都有适当的文档 +- 使用依赖注入模式以便于测试 + +## 安全考虑 +- 确保所有用户输入都经过适当验证 +- 避免在日志中记录敏感信息 +- 使用安全的依赖版本 +``` + +这将在输出中生成以下部分: + +```xml + +# 仓库指令 + +这个仓库包含了 Repomix 工具的源代码。在分析代码时请遵循以下指导原则: + +1. 重点关注 `src/core` 目录中的核心功能 +2. 特别注意 `src/core/security` 中的安全检查 +3. 忽略 `tests` 目录中的文件 + +## 代码规范 +- 遵循 TypeScript 最佳实践 +- 确保所有公共 API 都有适当的文档 +- 使用依赖注入模式以便于测试 + +## 安全考虑 +- 确保所有用户输入都经过适当验证 +- 避免在日志中记录敏感信息 +- 使用安全的依赖版本 + +``` + +## 最佳实践 + +1. **保持简洁明确**:指令应该简短但详细 +2. **提供具体示例**:在适当的情况下添加代码示例 +3. **设置优先级**:将最重要的指令放在前面 +4. **包含上下文**:提供项目背景和重要考虑因素 +5. **结构化内容**:使用标题和列表使指令易于阅读 + +## 注意事项 + +- 避免在指令中包含敏感信息 +- 定期更新指令以反映项目的变化 +- 确保指令与项目的其他文档保持一致 +- 使用清晰的层次结构组织内容 diff --git a/website/client/src/zh-cn/guide/development/index.md b/website/client/src/zh-cn/guide/development/index.md new file mode 100644 index 000000000..189f793a7 --- /dev/null +++ b/website/client/src/zh-cn/guide/development/index.md @@ -0,0 +1,42 @@ +# 参与 Repomix 开发 + +## 快速开始 + +```bash +git clone https://github.com/yamadashy/repomix.git +cd repomix +npm install +``` + +## 开发命令 + +```bash +# 运行 CLI +npm run cli-run + +# 运行测试 +npm run test +npm run test-coverage + +# 代码检查 +npm run lint +``` + +## 代码风格 + +- 使用 [Biome](https://biomejs.dev/) 进行代码检查和格式化 +- 使用依赖注入以提高可测试性 +- 保持文件不超过 250 行 +- 为新功能添加测试用例 + +## Pull Request 提交指南 + +1. 运行所有测试 +2. 通过代码检查 +3. 更新文档 +4. 遵循现有代码风格 + +## 需要帮助? + +- [提交 Issue](https://github.com/yamadashy/repomix/issues) +- [加入 Discord](https://discord.gg/wNYzTwZFku) diff --git a/website/client/src/zh-cn/guide/development/setup.md b/website/client/src/zh-cn/guide/development/setup.md new file mode 100644 index 000000000..5a19ce927 --- /dev/null +++ b/website/client/src/zh-cn/guide/development/setup.md @@ -0,0 +1,74 @@ +# 开发环境搭建 + +## 前提条件 + +- Node.js ≥ 18.0.0 +- Git +- npm + +## 本地开发 + +```bash +# 克隆仓库 +git clone https://github.com/yamadashy/repomix.git +cd repomix + +# 安装依赖 +npm install + +# 运行 CLI +npm run cli-run +``` + +## Docker 开发环境 + +```bash +# 构建镜像 +docker build -t repomix . + +# 运行容器 +docker run -v ./:/app -it --rm repomix +``` + +## 项目结构 + +``` +src/ +├── cli/ # CLI 实现 +├── config/ # 配置处理 +├── core/ # 核心功能 +└── shared/ # 共享工具 +``` + +## 测试 + +```bash +# 运行测试 +npm run test + +# 测试覆盖率 +npm run test-coverage + +# 代码检查 +npm run lint-biome +npm run lint-ts +npm run lint-secretlint +``` + +## 发布流程 + +1. 更新版本 +```bash +npm version patch # 或 minor/major +``` + +2. 运行测试和构建 +```bash +npm run test-coverage +npm run build +``` + +3. 发布 +```bash +npm publish +``` diff --git a/website/client/src/zh-cn/guide/index.md b/website/client/src/zh-cn/guide/index.md new file mode 100644 index 000000000..fdbe49dbf --- /dev/null +++ b/website/client/src/zh-cn/guide/index.md @@ -0,0 +1,60 @@ +# Repomix 入门指南 + +Repomix 是一个将代码库打包成单个 AI 友好文件的工具。它专为帮助你将代码提供给大型语言模型(如 Claude、ChatGPT 和 Gemini)而设计。 + +## 快速开始 + +在你的项目目录中运行以下命令: + +```bash +npx repomix +``` + +就这么简单!你会在当前目录中找到一个 `repomix-output.txt` 文件,其中包含了以 AI 友好格式整理的整个代码库。 + +然后,你可以将此文件发送给 AI 助手,并附上类似这样的提示: + +``` +这个文件包含了仓库中所有文件的合并内容。 +我想重构代码,请先帮我审查一下。 +``` + +AI 将分析你的整个代码库并提供全面的见解: + +![Repomix 使用示例1](/images/docs/repomix-file-usage-1.png) + +在讨论具体修改时,AI 可以帮助生成代码。通过像 Claude 的 Artifacts 这样的功能,你甚至可以一次性接收多个相互依赖的文件: + +![Repomix 使用示例2](/images/docs/repomix-file-usage-2.png) + +祝你编码愉快!🚀 + +## 核心功能 + +- **AI 优化**:以 AI 易于理解的格式整理代码库 +- **令牌计数**:为 LLM 上下文限制提供令牌使用统计 +- **Git 感知**:自动识别并遵循 .gitignore 文件 +- **注重安全**:使用 Secretlint 进行敏感信息检测 +- **多种输出格式**:可选纯文本、XML 或 Markdown 格式 + +## 下一步 + +- [安装指南](installation.md):了解安装 Repomix 的不同方式 +- [使用指南](usage.md):学习基本和高级功能 +- [配置](configuration.md):根据需求自定义 Repomix +- [安全功能](security.md):了解安全检查详情 + +## 社区 + +加入我们的 [Discord 社区](https://discord.gg/wNYzTwZFku): +- 获取 Repomix 使用帮助 +- 分享你的使用经验 +- 提出新功能建议 +- 与其他用户交流 + +## 支持 + +发现问题或需要帮助? +- [在 GitHub 上提交问题](https://github.com/yamadashy/repomix/issues) +- 加入 Discord 服务器 +- 查看[文档](https://repomix.com) diff --git a/website/client/src/zh-cn/guide/installation.md b/website/client/src/zh-cn/guide/installation.md new file mode 100644 index 000000000..c45d31840 --- /dev/null +++ b/website/client/src/zh-cn/guide/installation.md @@ -0,0 +1,53 @@ +# 安装 + +## 使用 npx(无需安装) + +```bash +npx repomix +``` + +## 全局安装 + +### npm 安装 +```bash +npm install -g repomix +``` + +### Yarn 安装 +```bash +yarn global add repomix +``` + +### Homebrew 安装(macOS) +```bash +brew install repomix +``` + +## Docker 安装 + +使用 Docker 是最便捷的方式之一,可以避免环境配置问题。以下是具体步骤: + +```bash +# 处理当前目录 +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix + +# 处理指定目录 +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix path/to/directory + +# 处理远程仓库 +docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix --remote yamadashy/repomix +``` + +## 系统要求 + +- Node.js: ≥ 18.0.0 +- Git: 处理远程仓库时需要 + +## 验证安装 + +安装完成后,可以通过以下命令验证 Repomix 是否正常工作: + +```bash +repomix --version +repomix --help +``` diff --git a/website/client/src/zh-cn/guide/output.md b/website/client/src/zh-cn/guide/output.md new file mode 100644 index 000000000..53042e387 --- /dev/null +++ b/website/client/src/zh-cn/guide/output.md @@ -0,0 +1,121 @@ +# 输出格式 + +Repomix 支持三种输出格式: +- 纯文本(默认) +- XML +- Markdown + +## 纯文本格式 + +```bash +repomix --style plain +``` + +输出结构: +```text +本文件是整个代码库的合并表示形式... + +================ +文件概要 +================ +(元数据和 AI 指令) + +================ +目录结构 +================ +src/ + index.ts + utils/ + helper.ts + +================ +文件 +================ + +================ +File: src/index.ts +================ +// 文件内容 +``` + +## XML 格式 + +```bash +repomix --style xml +``` + +XML 格式针对 AI 处理进行了优化: + +```xml +本文件是整个代码库的合并表示形式... + + +(元数据和 AI 指令) + + + +src/ + index.ts + utils/ + helper.ts + + + + +// 文件内容 + + +``` + +::: tip 为什么选择 XML? +XML 标签有助于像 Claude 这样的 AI 模型更准确地解析内容。[Claude 官方文档](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/use-xml-tags)推荐使用 XML 标签来构建结构化提示。 +::: + +## Markdown 格式 + +```bash +repomix --style markdown +``` + +Markdown 提供了易读的格式: + +```markdown +本文件是整个代码库的合并表示形式... + +# 文件概要 +(元数据和 AI 指令) + +# 目录结构 +``` +src/ +index.ts +utils/ +helper.ts +``` + +# 文件 + +## File: src/index.ts +```typescript +// 文件内容 +``` +``` + +## 在 AI 模型中的使用 + +每种格式都能在 AI 模型中正常工作,但需要考虑以下几点: +- 对 Claude 使用 XML(解析最准确) +- 对一般可读性使用 Markdown +- 对简单性和通用兼容性使用纯文本 + +## 自定义设置 + +在 `repomix.config.json` 中设置默认格式: +```json +{ + "output": { + "style": "xml", + "filePath": "output.xml" + } +} +``` diff --git a/website/client/src/zh-cn/guide/prompt-examples.md b/website/client/src/zh-cn/guide/prompt-examples.md new file mode 100644 index 000000000..3243540ec --- /dev/null +++ b/website/client/src/zh-cn/guide/prompt-examples.md @@ -0,0 +1,124 @@ +# 提示示例 + +## 代码评审 + +### 架构评审 +``` +分析此代码库的架构: +1. 评估整体结构和模式 +2. 识别潜在的架构问题 +3. 提出改进可扩展性的建议 +4. 标注遵循最佳实践的部分 + +重点关注可维护性和模块化。 +``` + +### 安全性评审 +``` +对此代码库进行安全性评审: +1. 识别潜在的安全漏洞 +2. 检查常见的安全反模式 +3. 评审错误处理和输入验证 +4. 评估依赖项的安全性 + +请提供具体示例和修复步骤。 +``` + +### 性能评审 +``` +从性能角度评审代码库: +1. 识别性能瓶颈 +2. 检查资源使用情况 +3. 评审算法效率 +4. 评估缓存策略 + +包含具体的优化建议。 +``` + +## 文档生成 + +### API 文档 +``` +生成全面的 API 文档: +1. 列出并描述所有公共端点 +2. 记录请求/响应格式 +3. 包含使用示例 +4. 说明限制和约束 +``` + +### 开发者指南 +``` +创建包含以下内容的开发者指南: +1. 环境搭建说明 +2. 项目结构概览 +3. 开发工作流程 +4. 测试方法 +5. 常见问题排查步骤 +``` + +### 架构文档 +``` +记录系统架构: +1. 高层概述 +2. 组件交互 +3. 数据流程图 +4. 设计决策及理由 +5. 系统限制和约束 +``` + +## 分析与改进 + +### 依赖项分析 +``` +分析项目依赖: +1. 识别过时的包 +2. 检查安全漏洞 +3. 建议替代包 +4. 评审依赖使用模式 + +包含具体的升级建议。 +``` + +### 测试覆盖率 +``` +评审测试覆盖率: +1. 识别未测试的组件 +2. 建议额外的测试用例 +3. 评审测试质量 +4. 推荐测试策略 +``` + +### 代码质量 +``` +评估代码质量并提出改进建议: +1. 评审命名规范 +2. 检查代码组织 +3. 评估错误处理 +4. 评审注释实践 + +提供具体的良好和问题模式示例。 +``` + +## 获得更好结果的技巧 + +1. **明确具体**:包含清晰的目标和评估标准 +2. **设置上下文**:说明你的角色和所需的专业水平 +3. **请求格式**:定义期望的响应结构 +4. **设置优先级**:指出哪些方面最重要 + +## 模型特定说明 + +### Claude +- 使用 XML 输出格式 +- 将重要指令放在最后 +- 指定响应结构 + +### ChatGPT +- 使用 Markdown 格式 +- 将大型代码库分成小节 +- 包含系统角色提示 + +### Gemini +- 适用于所有格式 +- 每次请求专注于特定领域 +- 使用逐步分析 diff --git a/website/client/src/zh-cn/guide/remote-repository-processing.md b/website/client/src/zh-cn/guide/remote-repository-processing.md new file mode 100644 index 000000000..1849513ba --- /dev/null +++ b/website/client/src/zh-cn/guide/remote-repository-processing.md @@ -0,0 +1,68 @@ +# 远程仓库处理 + +## 基本用法 + +处理公共仓库: +```bash +# 使用完整 URL +repomix --remote https://github.com/user/repo + +# 使用 GitHub 简写 +repomix --remote user/repo +``` + +## 分支和提交选择 + +```bash +# 指定分支 +repomix --remote user/repo --remote-branch main + +# 指定标签 +repomix --remote user/repo --remote-branch v1.0.0 + +# 指定提交哈希 +repomix --remote user/repo --remote-branch 935b695 +``` + +## 系统要求 + +- 必须安装 Git +- 需要网络连接 +- 需要仓库的读取权限 + +## 输出控制 + +```bash +# 自定义输出位置 +repomix --remote user/repo -o custom-output.xml + +# 使用 XML 格式 +repomix --remote user/repo --style xml + +# 移除注释 +repomix --remote user/repo --remove-comments +``` + +## Docker 使用方法 + +```bash +# 在当前目录处理并输出 +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix \ + --remote user/repo + +# 输出到指定目录 +docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix \ + --remote user/repo +``` + +## 常见问题 + +### 访问问题 +- 确保仓库是公开的 +- 检查 Git 是否已安装 +- 验证网络连接 + +### 大型仓库处理 +- 使用 `--include` 选择特定路径 +- 启用 `--remove-comments` +- 分开处理不同分支 diff --git a/website/client/src/zh-cn/guide/security.md b/website/client/src/zh-cn/guide/security.md new file mode 100644 index 000000000..16c461b2f --- /dev/null +++ b/website/client/src/zh-cn/guide/security.md @@ -0,0 +1,65 @@ +# 安全性 + +## 安全检查功能 + +Repomix 使用 [Secretlint](https://github.com/secretlint/secretlint) 检测文件中的敏感信息: +- API 密钥 +- 访问令牌 +- 认证凭证 +- 私钥 +- 环境变量 + +## 配置 + +安全检查默认启用。 + +通过命令行禁用: +```bash +repomix --no-security-check +``` + +或在 `repomix.config.json` 中配置: +```json +{ + "security": { + "enableSecurityCheck": false + } +} +``` + +## 安全措施 + +1. **二进制文件排除**:输出中不包含二进制文件 +2. **Git 感知**:遵循 `.gitignore` 模式 +3. **自动检测**:扫描常见安全问题: + - AWS 凭证 + - 数据库连接字符串 + - 认证令牌 + - 私钥 + +## 安全检查发现问题时 + +输出示例: +```bash +🔍 Security Check: +────────────────── +2 suspicious file(s) detected and excluded: +1. config/credentials.json + - Found AWS access key +2. .env.local + - Found database password +``` + +## 最佳实践 + +1. 分享前务必检查输出内容 +2. 使用 `.repomixignore` 排除敏感路径 +3. 保持安全检查功能启用 +4. 从仓库中移除敏感文件 + +## 报告安全问题 + +如果发现安全漏洞,请: +1. 不要创建公开的 Issue +2. 发送邮件至:koukun0120@gmail.com +3. 或使用 [GitHub 安全公告](https://github.com/yamadashy/repomix/security/advisories/new) diff --git a/website/client/src/zh-cn/guide/tips/best-practices.md b/website/client/src/zh-cn/guide/tips/best-practices.md new file mode 100644 index 000000000..fedf45ca5 --- /dev/null +++ b/website/client/src/zh-cn/guide/tips/best-practices.md @@ -0,0 +1,37 @@ +# AI 辅助开发最佳实践:从实践经验谈起 + +虽然我还没有完成一个大型的 AI 辅助开发项目,但我想分享一下到目前为止从与 AI 合作开发中学到的经验。 + +## 基本开发方法 + +在与 AI 合作时,试图一次性实现所有功能可能会导致意外问题和项目停滞。因此,从核心功能开始,一步一步稳扎稳打地构建每个功能是更有效的方法。 + +### 现有代码的重要性 + +这种方法之所以有效,是因为通过核心功能的实现,你可以将你理想中的设计和编码风格具体化为实际代码。向 AI 传达项目愿景的最有效方式就是通过反映你的标准和偏好的代码本身。 + +从核心功能开始,确保每个功能在进入下一个功能之前都能正常工作,这样整个项目就能保持一致性,使 AI 更容易生成更合适的代码。 + +## 模块化方法 + +将代码分解成更小的模块至关重要。根据经验,将文件限制在 250 行左右的代码使得向 AI 提供清晰的指示更容易,并使试错过程更有效。虽然令牌计数会是更准确的指标,但对人类开发者来说,行数更容易判断,所以我们使用行数作为参考。 + +这不仅仅是关于前端、后端和数据库等大单元的分离,而是关于更精细层面的功能划分。例如,在一个功能内部,也要将验证、错误处理等具体功能分离成独立模块。 + +当然,大单元的分离也很重要,逐步实施模块化方法不仅让指令更清晰,也让 AI 能生成更合适的代码。这种方法不仅对 AI,对人类开发者来说也是有效的。 + +## 通过测试确保质量 + +我认为测试在 AI 辅助开发中尤为重要。测试不仅作为质量保证手段,还作为清晰展示代码意图的文档。当要求 AI 实现新功能时,现有的测试代码有效地充当了规范文档。 + +测试也是验证 AI 生成代码正确性的绝佳工具。例如,当让 AI 为某个模块实现新功能时,预先编写测试用例可以客观评估生成的代码是否符合预期。这与测试驱动开发(TDD)的理念高度契合,在与 AI 协作时特别有效。 + +## 规划与实现的平衡 + +在实现大规模功能之前,建议先与 AI 讨论计划。整理需求并考虑架构可以使后续实现更顺畅。先整理需求,然后在新的对话中进行实现是个好方法。 + +此外,AI 的输出必须经过人工审查,并在必要时进行调整。虽然 AI 输出的质量通常处于中等水平,但与从头开始编写代码相比,仍然可以提高开发速度。 + +## 结语 + +通过实践这些方法,你可以充分发挥 AI 的优势,同时构建一个连贯的、高质量的代码库。即使项目规模增长,每个部分都能保持清晰定义和易于管理的状态。 diff --git a/website/client/src/zh-cn/guide/usage.md b/website/client/src/zh-cn/guide/usage.md new file mode 100644 index 000000000..13dba1063 --- /dev/null +++ b/website/client/src/zh-cn/guide/usage.md @@ -0,0 +1,87 @@ +# 基本用法 + +## 快速开始 + +打包整个仓库: +```bash +repomix +``` + +## 常见使用场景 + +### 打包指定目录 +```bash +repomix path/to/directory +``` + +### 包含特定文件 +使用 [glob 模式](https://github.com/mrmlnc/fast-glob?tab=readme-ov-file#pattern-syntax): +```bash +repomix --include "src/**/*.ts,**/*.md" +``` + +### 排除文件 +```bash +repomix --ignore "**/*.log,tmp/" +``` + +### 处理远程仓库 +```bash +# 使用 GitHub URL +repomix --remote https://github.com/user/repo + +# 使用简写形式 +repomix --remote user/repo + +# 指定分支/标签/提交 +repomix --remote user/repo --remote-branch main +repomix --remote user/repo --remote-branch 935b695 +``` + +## 输出格式 + +### 纯文本(默认) +```bash +repomix --style plain +``` + +### XML +```bash +repomix --style xml +``` + +### Markdown +```bash +repomix --style markdown +``` + +## 其他选项 + +### 移除注释 +```bash +repomix --remove-comments +``` + +### 显示行号 +```bash +repomix --output-show-line-numbers +``` + +### 复制到剪贴板 +```bash +repomix --copy +``` + +### 禁用安全检查 +```bash +repomix --no-security-check +``` + +## 配置 + +初始化配置文件: +```bash +repomix --init +``` + +更多详细配置选项请参阅[配置指南](/zh-cn/guide/configuration)。 diff --git a/website/client/src/zh-cn/index.md b/website/client/src/zh-cn/index.md new file mode 100644 index 000000000..9bdb56572 --- /dev/null +++ b/website/client/src/zh-cn/index.md @@ -0,0 +1,191 @@ +--- +layout: home +title: Repomix +titleTemplate: 将代码库打包成AI友好的格式 +aside: false +editLink: false + +features: + - icon: 🤖 + title: AI 优化 + details: 以 AI 易于理解和处理的方式格式化代码库。 + + - icon: ⚙️ + title: Git 感知 + details: 自动识别并尊重您的 .gitignore 文件。 + + - icon: 🛡️ + title: 注重安全 + details: 集成 Secretlint 进行强大的安全检查,检测并防止敏感信息的泄露。 + + - icon: 📊 + title: 令牌计数 + details: 提供每个文件和整个代码库的令牌计数,便于控制 LLM 上下文限制。 + +--- + +
+ +## 快速开始 + +使用 Repomix 生成打包文件(`repomix-output.txt`)后,您可以将其发送给 AI 助手,并附上这样的提示: + +``` +此文件包含了仓库中所有文件的合并内容。 +我想重构代码,请先帮我审查一下。 +``` + +AI 将分析您的整个代码库并提供全面的见解: + +![Repomix 使用示例1](/images/docs/repomix-file-usage-1.png) + +在讨论具体修改时,AI 可以帮助生成代码。通过像 Claude 的 Artifacts 这样的功能,您甚至可以一次性接收多个相互依赖的文件: + +![Repomix 使用示例2](/images/docs/repomix-file-usage-2.png) + +祝您编码愉快!🚀 + + + +## 进阶使用指南 + +对于需要更多控制的高级用户,Repomix 通过其 CLI 界面提供了广泛的自定义选项。 + +### 快速上手 + +您可以在项目目录中无需安装即可立即尝试 Repomix: + +```bash +npx repomix +``` + +或者全局安装以便重复使用: + +```bash +# 使用 npm 安装 +npm install -g repomix + +# 或使用 yarn 安装 +yarn global add repomix + +# 或使用 Homebrew 安装(macOS) +brew install repomix + +# 然后在任意项目目录中运行 +repomix +``` + +就是这么简单!Repomix 将在您的当前目录中生成一个 `repomix-output.txt` 文件,其中包含了以 AI 友好格式整理的整个代码库。 + + + +### 基本用法 + +打包整个代码库: + +```bash +repomix +``` + +打包特定目录: + +```bash +repomix path/to/directory +``` + +使用 [glob 模式](https://github.com/mrmlnc/fast-glob?tab=readme-ov-file#pattern-syntax)打包特定文件: + +```bash +repomix --include "src/**/*.ts,**/*.md" +``` + +排除特定文件: + +```bash +repomix --ignore "**/*.log,tmp/" +``` + +处理远程仓库: +```bash +repomix --remote https://github.com/yamadashy/repomix + +# 也可以使用 GitHub 简写形式: +repomix --remote yamadashy/repomix + +# 可以指定分支名称、标签或提交哈希: +repomix --remote https://github.com/yamadashy/repomix --remote-branch main + +# 或使用特定的提交哈希: +repomix --remote https://github.com/yamadashy/repomix --remote-branch 935b695 +``` + +初始化配置文件(`repomix.config.json`): + +```bash +repomix --init +``` + +生成打包文件后,您可以将其用于 Claude、ChatGPT、Gemini 等生成式 AI 工具。 + +#### Docker 使用方法 + +您也可以使用 Docker 运行 Repomix 🐳 +如果您想在隔离环境中运行 Repomix 或更偏好使用容器,这是一个很好的选择。 + +基本用法(当前目录): + +```bash +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix +``` + +打包特定目录: +```bash +docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix path/to/directory +``` + +处理远程仓库并输出到 `output` 目录: + +```bash +docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix --remote https://github.com/yamadashy/repomix +``` + +### 输出格式 + +选择您偏好的输出格式: + +```bash +# XML 格式(默认) +repomix --style xml + +# Markdown 格式 +repomix --style markdown + +# 纯文本格式 +repomix --style plain +``` + +### 自定义设置 + +创建 `repomix.config.json` 进行持久化设置: + +```json +{ + "output": { + "style": "markdown", + "filePath": "custom-output.md", + "removeComments": true, + "showLineNumbers": true, + "topFilesLength": 10 + }, + "ignore": { + "customPatterns": ["*.test.ts", "docs/**"] + } +} +``` + +### 更多示例 +::: tip +💡 查看我们的 [GitHub 仓库](https://github.com/yamadashy/repomix)获取完整文档和更多示例! +::: + +
diff --git a/website/client/tsconfig.json b/website/client/tsconfig.json index 581f49f63..fc72973a9 100644 --- a/website/client/tsconfig.json +++ b/website/client/tsconfig.json @@ -17,10 +17,5 @@ "types": ["vite/client", "vitepress/client"] }, "include": [".vitepress/**/*.ts", ".vitepress/**/*.d.ts", ".vitepress/**/*.tsx", ".vitepress/**/*.vue"], - "exclude": ["node_modules", "dist"], - "references": [ - { - "path": "./tsconfig.node.json" - } - ] + "exclude": ["node_modules", "dist"] } diff --git a/website/client/tsconfig.node.json b/website/client/tsconfig.node.json index 6e3a2242f..42d7357e8 100644 --- a/website/client/tsconfig.node.json +++ b/website/client/tsconfig.node.json @@ -6,5 +6,5 @@ "moduleResolution": "bundler", "allowSyntheticDefaultImports": true }, - "include": [".vitepress/config.ts"] + "include": [".vitepress/config.ts", ".vitepress/config/**/*", ".vitepress/theme/**/*"] }