Repomix는 전체 저장소를 AI 친화적 인 단일 파일로 포장하는 강력한 도구입니다.
코드베이스를 대형 언어 모델 (LLM) 또는 Claude, Chatgpt 및 Gemini와 같은 다른 AI 도구에 공급해야 할 때에 적합합니다.
메모
법적 고려 사항으로 인해이 프로젝트는 "Repopack"에서 "Repomix"로 이름이 바뀌 었습니다. 이름 만 바뀌고 있습니다. Repomix 모든 기능 및 관리자 (@yamadashy)는 동일하게 유지됩니다. 우리는 모든 사용자에게 원활한 전환을 보장하기 위해 노력하고 있습니다.
도구를 계속 사용하려면 새 패키지를 설치하기 만하면됩니다.
# Install new package
npm install -g repomix
# Or use directly with npx
npx repomix선택적으로 이전 패키지를 제거 할 수도 있습니다.
npm uninstall -g repopack 기존 구성 파일 ( repopack.config.json 및 .repopackignore )은 전환 기간 동안 계속 작동합니다.
repomix 이러한 파일을 자동으로 감지하여 새로운 형식 ( repomix.config.json 및 .repomixignore )으로 마이그레이션합니다.
이 전환 중에 귀하의 이해와 협력에 감사드립니다.
설치없이 프로젝트 디렉토리에서 Repomix를 즉시 시도 할 수 있습니다.
npx repomix또는 반복적 인 사용을 위해 전 세계적으로 설치하십시오.
# Install using npm
npm install -g repomix
# Alternatively using yarn
yarn global add repomix
# Alternatively using Homebrew (macOS)
brew install repomix
# Then run in any project directory
repomix 그게 다야! Repomix는 전체 저장소를 AI 친화적 인 형식으로 포함하는 현재 디렉토리에서 repomix-output.txt 파일을 생성합니다.
전체 저장소를 포장하려면 :
repomix특정 디렉토리를 포장하려면 :
repomix path/to/directory글로벌 패턴을 사용하여 특정 파일 또는 디렉토리를 포장하려면 :
repomix --include " src/**/*.ts,**/*.md "특정 파일 또는 디렉토리를 제외하려면 :
repomix --ignore " **/*.log,tmp/ "원격 저장소를 포장하려면 :
repomix --remote https://github.com/yamadashy/repomix
# You can also use GitHub shorthand:
repomix --remote yamadashy/repomix 새 구성 파일을 초기화하려면 ( repomix.config.json ) :
repomix --init포장 된 파일을 생성 한 후에는 Claude, Chatgpt 및 Gemini와 같은 생성 AI 도구와 함께 사용할 수 있습니다.
Repomix로 포장 된 파일을 생성 한 후 Claude, Chatgpt 및 Gemini와 같은 AI 도구와 함께 사용할 수 있습니다. 다음은 시작하라는 프롬프트가 있습니다.
포괄적 인 코드 검토 및 리팩토링 제안 :
This file contains my entire codebase. Please review the overall structure and suggest any improvements or refactoring opportunities, focusing on maintainability and scalability.
프로젝트 문서를 생성하려면 :
Based on the codebase in this file, please generate a detailed README.md that includes an overview of the project, its main features, setup instructions, and usage examples.
테스트 사례 생성 :
Analyze the code in this file and suggest a comprehensive set of unit tests for the main functions and classes. Include edge cases and potential error scenarios.
코드 품질 평가 및 모범 사례 준수 :
Review the codebase for adherence to coding best practices and industry standards. Identify areas where the code could be improved in terms of readability, maintainability, and efficiency. Suggest specific changes to align the code with best practices.
도서관에 대한 높은 수준의 이해를 얻으십시오
This file contains the entire codebase of library. Please provide a comprehensive overview of the library, including its main purpose, key features, and overall architecture.
특정 요구 사항과 사용중인 AI 도구의 기능에 따라 이러한 프롬프트를 자유롭게 수정하십시오.
사용자가 공유하는 커뮤니티 토론을 확인하십시오.
토론에 참여하고 자신의 경험을 공유하십시오! 당신의 통찰력은 다른 사람들이 Repomix를 더 잘 활용하는 데 도움이 될 수 있습니다.
Repomix는 코드베이스의 다른 부분 사이에 명확한 분리기가있는 단일 파일을 생성합니다.
AI 이해력을 향상시키기 위해 출력 파일은 AI 중심 설명으로 시작하여 AI 모델이 포장 된 저장소의 컨텍스트와 구조를 더 쉽게 이해할 수 있도록합니다.
This file is a merged representation of the entire codebase, combining all repository files into a single document.
================================================================
File Summary
================================================================
(Metadata and usage AI instructions)
================================================================
Repository Structure
================================================================
src/
cli/
cliOutput.ts
index.ts
config/
configLoader.ts
(...remaining directories)
================================================================
Repository Files
================================================================
================
File: src/index.js
================
// File contents here
================
File: src/utils.js
================
// File contents here
(...remaining files)
================================================================
Instruction
================================================================
(Custom instructions from `output.instructionFilePath`)
XML 형식의 출력을 생성하려면 --style xml 옵션을 사용하십시오.
repomix --style xmlXML 형식은 컨텐츠를 계층 적 방식으로 구조화합니다.
This file is a merged representation of the entire codebase, combining all repository files into a single document.
< file_summary >
(Metadata and usage AI instructions)
</ file_summary >
< repository_structure >
src/
cli/
cliOutput.ts
index.ts
(...remaining directories)
</ repository_structure >
< repository_files >
< file path = " src/index.js " >
// File contents here
</ file >
(...remaining files)
</ repository_files >
< instruction >
(Custom instructions from `output.instructionFilePath`)
</ instruction > AI 컨텍스트에서 XML 태그의 잠재력에 관심이있는 사람들을 위해 :
https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/use-xml-tags
프롬프트에 컨텍스트, 지침 및 예제와 같은 여러 구성 요소가 포함되면 XML 태그는 게임 체인저가 될 수 있습니다. 그들은 Claude가 당신의 프롬프트를보다 정확하게 구문 분석하여 더 높은 품질의 출력으로 이어집니다.
즉, Repomix의 XML 출력은 다른 형식 일뿐 만 아니라 분석, 코드 검토 또는 기타 작업을 위해 코드베이스를 AI 시스템에 공급하는보다 효과적인 방법입니다.
Markdown 형식의 출력을 생성하려면 --style markdown 옵션을 사용하십시오.
repomix --style markdownMarkdown 형식은 내용을 계층 적 방식으로 구조화합니다.
This file is a merged representation of the entire codebase, combining all repository files into a single document.
# File Summary
(Metadata and usage AI instructions)
# Repository Structure
```
src/
cli/
cliOutput.ts
index.ts
```
(...remaining directories)
# Repository Files
## File: src/index.js
```
// File contents here
```
(...remaining files)
# Instruction
(Custom instructions from ` output.instructionFilePath ` )이 형식은 AI 시스템에서 인간 친화적이고 쉽게 변형 가능한 깨끗하고 읽기 쉬운 구조를 제공합니다.
-v, --version : 도구 버전 표시-o, --output <file> : 출력 파일 이름을 지정합니다--include <patterns> : 포함 패턴 목록 (comma-separated)-i, --ignore <patterns> : 추가 무시 패턴 (comma-separated)-c, --config <path> : 사용자 정의 구성 파일의 경로--style <style> : 출력 스타일 지정 ( plain , xml , markdown )--top-files-len <number> : 요약에 표시 할 상단 파일 수--output-show-line-numbers : 출력에 라인 번호 표시--copy : 추가로 생성 된 출력을 시스템 클립 보드에 복사합니다--remote <url> : 원격 git 저장소를 처리하십시오--verbose : 장황한 벌목을 활성화합니다예 :
repomix -o custom-output.txt
repomix -i " *.log,tmp " -v
repomix -c ./custom-config.json
repomix --style xml
repomix --remote https://github.com/user/repo.git
npx repomix src전 세계적으로 설치된 Repomix를 업데이트하려면 :
# Using npm
npm update -g repomix
# Using yarn
yarn global upgrade repomix npx repomix 사용하는 것은 항상 최신 버전을 사용하기 때문에 더 편리합니다.
Repomix는 수동 클로닝없이 원격 git 저장소 처리를 지원합니다. 이 기능을 사용하면 단일 명령으로 공개 git 저장소를 빠르게 분석 할 수 있습니다.
원격 저장소를 처리하려면 --remote 옵션을 사용한 다음 저장소 URL을 사용하십시오.
repomix --remote https://github.com/user/repo.gitGithub의 속기 형식을 사용할 수도 있습니다.
repomix --remote user/repo 사용자 정의 구성을 위해 프로젝트 루트에서 repomix.config.json 파일을 만듭니다.
repomix --init다음은 구성 옵션에 대한 설명입니다.
| 옵션 | 설명 | 기본 |
|---|---|---|
output.filePath | 출력 파일의 이름 | "repomix-output.txt" |
output.style | 출력 스타일 ( plain , xml , markdown ) | "plain" |
output.headerText | 파일 헤더에 포함 할 사용자 정의 텍스트 | null |
output.instructionFilePath | 자세한 사용자 정의 지침이 포함 된 파일로가는 경로 | null |
output.removeComments | 지원되는 파일 유형에서 댓글을 제거할지 여부 | false |
output.removeEmptyLines | 출력에서 빈 줄을 제거할지 여부 | false |
output.showLineNumbers | 출력의 각 줄에 줄 번호를 추가할지 여부 | false |
output.copyToClipboard | 파일 저장 외에 출력을 시스템 클립 보드에 복사할지 여부 | false |
output.topFilesLength | 요약에 표시 할 상단 파일 수. 0으로 설정하면 요약이 표시되지 않습니다 | 5 |
output.includeEmptyDirectories | 저장소 구조에 빈 디렉토리를 포함 시킬지 여부 | false |
include | 포함 할 파일 패턴 (글로벌 패턴 사용) | [] |
ignore.useGitignore | 프로젝트의 .gitignore 파일에서 패턴 사용 여부 | true |
ignore.useDefaultPatterns | 기본값을 사용할지 무시하는지 여부는 패턴을 무시합니다 | true |
ignore.customPatterns | 무시할 추가 패턴 (글로벌 패턴 사용) | [] |
security.enableSecurityCheck | 파일에서 보안 검사를 수행할지 여부 | true |
예제 구성 :
{
"output" : {
"filePath" : " repomix-output.xml " ,
"style" : " xml " ,
"headerText" : " Custom header information for the packed file. " ,
"removeComments" : false ,
"removeEmptyLines" : false ,
"showLineNumbers" : false ,
"copyToClipboard" : true ,
"topFilesLength" : 5 ,
"includeEmptyDirectories" : false
},
"include" : [ " **/* " ],
"ignore" : {
"useGitignore" : true ,
"useDefaultPatterns" : true ,
"customPatterns" : [ " additional-folder " , " **/*.log " ]
},
"security" : {
"enableSecurityCheck" : true
}
}전역 구성 파일을 만들려면 :
repomix --init --global글로벌 구성 파일은 다음과 같습니다.
%LOCALAPPDATA%Repomixrepomix.config.json$XDG_CONFIG_HOME/repomix/repomix.config.json 또는 ~/.config/repomix/repomix.config.json참고 : 로컬 구성 (현재 경우)은 글로벌 구성보다 우선합니다.
Repomix는 이제 글로벌 패턴 사용을 포함하도록 파일 지정을 지원합니다. 이를 통해보다 유연하고 강력한 파일 선택이 가능합니다.
**/*.js 사용src/**/* 사용하여 src 디렉토리 및 해당 하위 디렉토리 내에 모든 파일을 포함시키기 위해src 및 모든 Markdown 파일에 JavaScript 파일을 포함하려면 ["src/**/*.js", "**/*.md"] 와 같은 여러 패턴을 결합하십시오. Repomix는 포장 과정에서 특정 파일 또는 디렉토리를 제외하기위한 무시 패턴을 설정하는 여러 가지 방법을 제공합니다.
.gitignore 파일에 나열된 패턴이 사용됩니다. 이 동작은 ignore.useGitignore 으로 제어 할 수 있습니다.ignore.useDefaultPatterns 설정으로 제어 할 수 있습니다. 자세한 내용은 defaultignore.ts를 참조하십시오..repomixignore 파일을 만들어 Repomix 별 무시 패턴을 정의 할 수 있습니다. 이 파일은 .gitignore 와 동일한 형식을 따릅니다.ignore.customPatterns 옵션을 사용하여 지정할 수 있습니다. 이 설정을 -i, --ignore 명령 줄 옵션으로 덮어 쓸 수 있습니다.우선 순위 주문 (가장 높은 것부터 최저) :
ignore.customPatterns.repomixignore.gitignore ( ignore.useGitignore 경우, usegitignore가 참)ignore.useDefaultPatterns 경우 .useedefaultpatterns가 사실입니다)이 접근법을 사용하면 프로젝트의 요구에 따라 유연한 파일 제외 구성을 허용합니다. 보안에 민감한 파일과 대형 이진 파일을 제외하고 기밀 정보의 유출을 방지하여 생성 된 팩 파일의 크기를 최적화하는 데 도움이됩니다.
참고 : 이진 파일은 기본적으로 포장 된 출력에 포함되지 않지만 경로는 출력 파일의 "저장소 구조"섹션에 나열되어 있습니다. 이는 포장 된 파일을 효율적이고 텍스트 기반으로 유지하면서 저장소 구조에 대한 완전한 개요를 제공합니다.
output.instructionFilePath 옵션을 사용하면 프로젝트에 대한 자세한 지침 또는 컨텍스트가 포함 된 별도의 파일을 지정할 수 있습니다. 이를 통해 AI 시스템은 프로젝트의 특정 컨텍스트 및 요구 사항을 이해할 수 있으므로 더 관련성이 높고 맞춤형 분석 또는 제안으로 이어질 수 있습니다.
이 기능을 사용하는 방법의 예는 다음과 같습니다.
repomix-instruction.md 라는 파일을 만듭니다. # Coding Guidelines
- Follow the Airbnb JavaScript Style Guide
- Suggest splitting files into smaller, focused units when appropriate
- Add comments for non-obvious logic. Keep all text in English
- All new features should have corresponding unit tests
# Generate Comprehensive Output
- Include all content without abbreviation, unless specified otherwise
- Optimize for handling large codebases while maintaining output qualityrepomix.config.json 에서 instructionFilePath 옵션을 추가하십시오. {
"output" : {
"instructionFilePath" : "repomix-instruction.md" ,
// other options...
}
} Repomix가 출력을 생성하면 전용 섹션에 repomix-instruction.md 의 내용이 포함됩니다.
참고 : 명령 내용은 출력 파일 끝에 추가됩니다. 이 배치는 AI 시스템에 특히 효과적 일 수 있습니다. 이것이 왜 유익한 지 이해하는 데 관심이있는 사람들을 위해, Anthropic은 문서에 몇 가지 통찰력을 제공합니다.
https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/long-context-tips
긴 형태의 데이터를 맨 위에 놓으십시오. 긴 문서와 입력 (~ 20k+ 토큰)을 프롬프트 상단, 쿼리, 지침 및 예제 위에 놓습니다. 이것은 모든 모델에서 Claude의 성능을 크게 향상시킬 수 있습니다. 결국 쿼리는 테스트에서 최대 30%까지 응답 품질을 향상시킬 수 있습니다.
output.removeComments 가 true 로 설정되면 Repomix는 지원되는 파일 유형에서 주석을 제거하려고 시도합니다. 이 기능은 출력 파일의 크기를 줄이고 필수 코드 컨텐츠에 중점을 둘 수 있습니다.
지원되는 언어에는 다음이 포함됩니다.
HTML, CSS, JavaScript, TypeScript, Vue, Svelte, Python, PHP, Ruby, C, C#, Java, Go, Rust, Swift, Kotlin, Dart, Shell 및 Yaml.
참고 : 주석 제거 프로세스는 실수로 코드를 제거하지 않도록 보수적입니다. 복잡한 경우 일부 의견이 유지 될 수 있습니다.
Repomix에는 SecretLint를 사용하여 파일에서 잠재적으로 민감한 정보를 감지하는 보안 검사 기능이 포함되어 있습니다. 이 기능을 사용하면 포장 된 저장소를 공유하기 전에 가능한 보안 위험을 식별하는 데 도움이됩니다.
포장 프로세스가 완료된 후 CLI 출력에 보안 검사 결과가 표시됩니다. 의심스러운 파일이 감지되면 경고 메시지와 함께 이러한 파일 목록이 표시됩니다.
예제 출력 :
? Security Check:
──────────────────
2 suspicious file(s) detected:
1. src/utils/test.txt
2. tests/utils/secretLintUtils.test.ts
Please review these files for potentially sensitive information.
기본적으로 Repomix의 보안 검사 기능이 활성화됩니다. 구성 파일에서 security.enableSecurityCheck false 로 설정하여 비활성화 할 수 있습니다.
{
"security" : {
"enableSecurityCheck" : false
}
}우리는 지역 사회의 기여를 환영합니다! 시작하려면 기고 가이드를 참조하십시오.
이 프로젝트는 MIT 라이센스에 따라 라이센스가 부여됩니다.
위로 돌아갑니다