configuration.mdโข20 kB
# ์ค์
Repomix๋ ์ค์ ํ์ผ ๋๋ ๋ช
๋ น์ค ์ต์
์ ์ฌ์ฉํ์ฌ ์ค์ ํ ์ ์์ต๋๋ค. ์ค์ ํ์ผ์ ์ฌ์ฉํ๋ฉด ์ฝ๋๋ฒ ์ด์ค์ ์ฒ๋ฆฌ ๋ฐ ์ถ๋ ฅ ๋ฐฉ์์ ์ฌ์ฉ์ ์ ์ํ ์ ์์ต๋๋ค.
## ์ค์ ํ์ผ ํ์
Repomix๋ ์ ์ฐ์ฑ๊ณผ ์ฌ์ฉ ํธ์์ฑ์ ์ํด ์ฌ๋ฌ ์ค์ ํ์ผ ํ์์ ์ง์ํฉ๋๋ค.
Repomix๋ ๋ค์ ์ฐ์ ์์ ์์๋ก ์ค์ ํ์ผ์ ์๋์ผ๋ก ๊ฒ์ํฉ๋๋ค:
1. **TypeScript** (`repomix.config.ts`, `repomix.config.mts`, `repomix.config.cts`)
2. **JavaScript/ES Module** (`repomix.config.js`, `repomix.config.mjs`, `repomix.config.cjs`)
3. **JSON** (`repomix.config.json5`, `repomix.config.jsonc`, `repomix.config.json`)
### JSON ์ค์
ํ๋ก์ ํธ ๋๋ ํ ๋ฆฌ์ ์ค์ ํ์ผ์ ์์ฑํฉ๋๋ค:
```bash
repomix --init
```
์ด๋ ๊ฒ ํ๋ฉด ๊ธฐ๋ณธ ์ค์ ์ด ํฌํจ๋ `repomix.config.json` ํ์ผ์ด ์์ฑ๋ฉ๋๋ค. ๋ก์ปฌ ์ค์ ์ด ์์ ๋ ๋์ฒด๋ก ์ฌ์ฉ๋ ์ ์ญ ์ค์ ํ์ผ์ ์์ฑํ ์๋ ์์ต๋๋ค:
```bash
repomix --init --global
```
### TypeScript ์ค์
TypeScript ์ค์ ํ์ผ์ ์์ ํ ํ์
๊ฒ์ฌ ๋ฐ IDE ์ง์์ผ๋ก ์ต๊ณ ์ ๊ฐ๋ฐ์ ๊ฒฝํ์ ์ ๊ณตํฉ๋๋ค.
**์ค์น:**
`defineConfig`์ ํจ๊ป TypeScript ๋๋ JavaScript ์ค์ ์ ์ฌ์ฉํ๋ ค๋ฉด Repomix๋ฅผ dev dependency๋ก ์ค์นํด์ผ ํฉ๋๋ค:
```bash
npm install -D repomix
```
**์์ :**
```typescript
// repomix.config.ts
import { defineConfig } from 'repomix';
export default defineConfig({
output: {
filePath: 'output.xml',
style: 'xml',
removeComments: true,
},
ignore: {
customPatterns: ['**/node_modules/**', '**/dist/**'],
},
});
```
**์ฅ์ :**
- โ
IDE์์ ์์ ํ TypeScript ํ์
๊ฒ์ฌ
- โ
ํ์ํ IDE ์๋ ์์ฑ ๋ฐ IntelliSense
- โ
๋์ ๊ฐ ์ฌ์ฉ ๊ฐ๋ฅ (ํ์์คํฌํ, ํ๊ฒฝ ๋ณ์ ๋ฑ)
**๋์ ๊ฐ ์์ :**
```typescript
// repomix.config.ts
import { defineConfig } from 'repomix';
// ํ์์คํฌํ ๊ธฐ๋ฐ ํ์ผ๋ช
์์ฑ
const timestamp = new Date().toISOString().slice(0, 19).replace(/[:.]/g, '-');
export default defineConfig({
output: {
filePath: `output-${timestamp}.xml`,
style: 'xml',
},
});
```
### JavaScript ์ค์
JavaScript ์ค์ ํ์ผ์ TypeScript์ ๋์ผํ๊ฒ ์๋ํ๋ฉฐ `defineConfig` ๋ฐ ๋์ ๊ฐ์ ์ง์ํฉ๋๋ค.
## ์ค์ ์ต์
| ์ต์
| ์ค๋ช
| ๊ธฐ๋ณธ๊ฐ |
|----------------------------------|------------------------------------------------------------------------------------------------------------------------------|------------------------|
| `input.maxFileSize` | ์ฒ๋ฆฌํ ์ต๋ ํ์ผ ํฌ๊ธฐ(๋ฐ์ดํธ). ์ด ํฌ๊ธฐ๋ฅผ ์ด๊ณผํ๋ ํ์ผ์ ๊ฑด๋๋๋๋ค. ํฐ ๋ฐ์ด๋๋ฆฌ ํ์ผ์ด๋ ๋ฐ์ดํฐ ํ์ผ์ ์ ์ธํ๋ ๋ฐ ์ ์ฉํฉ๋๋ค | `50000000` |
| `output.filePath` | ์ถ๋ ฅ ํ์ผ ์ด๋ฆ. XML, Markdown, ์ผ๋ฐ ํ
์คํธ ํ์์ ์ง์ํฉ๋๋ค | `"repomix-output.xml"` |
| `output.style` | ์ถ๋ ฅ ์คํ์ผ(`xml`, `markdown`, `json`, `plain`). ๊ฐ ํ์์ ๋ค๋ฅธ AI ๋๊ตฌ์ ๋ํด ์๋ก ๋ค๋ฅธ ์ฅ์ ์ด ์์ต๋๋ค | `"xml"` |
| `output.parsableStyle` | ์ ํํ ์คํ์ผ ์คํค๋ง์ ๋ฐ๋ผ ์ถ๋ ฅ์ ์ด์ค์ผ์ดํํ ์ง ์ฌ๋ถ. ๋ ๋์ ๊ตฌ๋ฌธ ๋ถ์์ด ๊ฐ๋ฅํ์ง๋ง ํ ํฐ ์๊ฐ ์ฆ๊ฐํ ์ ์์ต๋๋ค | `false` |
| `output.compress` | Tree-sitter๋ฅผ ์ฌ์ฉํ์ฌ ๊ตฌ์กฐ๋ฅผ ์ ์งํ๋ฉด์ ํ ํฐ ์๋ฅผ ์ค์ด๊ธฐ ์ํด ์ง๋ฅ์ ์ธ ์ฝ๋ ์ถ์ถ์ ์ํํ ์ง ์ฌ๋ถ | `false` |
| `output.headerText` | ํ์ผ ํค๋์ ํฌํจํ ์ฌ์ฉ์ ์ ์ ํ
์คํธ. AI ๋๊ตฌ์ ์ปจํ
์คํธ๋ ์ง์นจ์ ์ ๊ณตํ๋ ๋ฐ ์ ์ฉํฉ๋๋ค | `null` |
| `output.instructionFilePath` | AI ์ฒ๋ฆฌ๋ฅผ ์ํ ์์ธํ ์ฌ์ฉ์ ์ ์ ์ง์นจ์ด ํฌํจ๋ ํ์ผ ๊ฒฝ๋ก | `null` |
| `output.fileSummary` | ์ถ๋ ฅ ์์ ๋ถ๋ถ์ ํ์ผ ์, ํฌ๊ธฐ ๋ฐ ๊ธฐํ ๋ฉํธ๋ฆญ์ ๋ณด์ฌ์ฃผ๋ ์์ฝ ์น์
์ ํฌํจํ ์ง ์ฌ๋ถ | `true` |
| `output.directoryStructure` | ์ถ๋ ฅ์ ๋๋ ํ ๋ฆฌ ๊ตฌ์กฐ๋ฅผ ํฌํจํ ์ง ์ฌ๋ถ. AI๊ฐ ํ๋ก์ ํธ ๊ตฌ์ฑ์ ์ดํดํ๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค | `true` |
| `output.files` | ์ถ๋ ฅ์ ํ์ผ ๋ด์ฉ์ ํฌํจํ ์ง ์ฌ๋ถ. false๋ก ์ค์ ํ๋ฉด ๊ตฌ์กฐ์ ๋ฉํ๋ฐ์ดํฐ๋ง ํฌํจ๋ฉ๋๋ค | `true` |
| `output.removeComments` | ์ง์๋๋ ํ์ผ ์ ํ์์ ์ฃผ์์ ์ ๊ฑฐํ ์ง ์ฌ๋ถ. ๋
ธ์ด์ฆ์ ํ ํฐ ์๋ฅผ ์ค์ผ ์ ์์ต๋๋ค | `false` |
| `output.removeEmptyLines` | ์ถ๋ ฅ์์ ๋น ์ค์ ์ ๊ฑฐํ์ฌ ํ ํฐ ์๋ฅผ ์ค์ผ์ง ์ฌ๋ถ | `false` |
| `output.showLineNumbers` | ๊ฐ ์ค์ ์ค ๋ฒํธ๋ฅผ ์ถ๊ฐํ ์ง ์ฌ๋ถ. ์ฝ๋์ ํน์ ๋ถ๋ถ์ ์ฐธ์กฐํ๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค | `false` |
| `output.truncateBase64` | ํ ํฐ ์๋ฅผ ์ค์ด๊ธฐ ์ํด ๊ธด base64 ๋ฐ์ดํฐ ๋ฌธ์์ด(์: ์ด๋ฏธ์ง)์ ์๋ฅผ์ง ์ฌ๋ถ | `false` |
| `output.copyToClipboard` | ํ์ผ ์ ์ฅ ์ธ์๋ ์ถ๋ ฅ์ ์์คํ
ํด๋ฆฝ๋ณด๋์ ๋ณต์ฌํ ์ง ์ฌ๋ถ | `false` |
| `output.topFilesLength` | ์์ฝ์ ํ์ํ ์์ ํ์ผ ์. 0์ผ๋ก ์ค์ ํ๋ฉด ์์ฝ์ด ํ์๋์ง ์์ต๋๋ค | `5` |
| `output.includeEmptyDirectories` | ์ ์ฅ์ ๊ตฌ์กฐ์ ๋น ๋๋ ํ ๋ฆฌ๋ฅผ ํฌํจํ ์ง ์ฌ๋ถ | `false` |
| `output.includeFullDirectoryStructure` | `include` ํจํด ์ฌ์ฉ ์, ํฌํจ๋ ํ์ผ๋ง ์ฒ๋ฆฌํ๋ฉด์ ์์ ํ ๋๋ ํ ๋ฆฌ ํธ๋ฆฌ(๋ฌด์ ํจํด ์ค์)๋ฅผ ํ์ํ ์ง ์ฌ๋ถ. AI ๋ถ์์ ์ํ ์ ์ฒด ์ ์ฅ์ ์ปจํ
์คํธ ์ ๊ณต | `false` |
| `output.git.sortByChanges` | Git ๋ณ๊ฒฝ ํ์๋ก ํ์ผ์ ์ ๋ ฌํ ์ง ์ฌ๋ถ. ๋ณ๊ฒฝ์ด ๋ง์ ํ์ผ์ด ํ๋จ์ ํ์๋ฉ๋๋ค | `true` |
| `output.git.sortByChangesMaxCommits` | Git ๋ณ๊ฒฝ์ ๋ถ์ํ ๋ ๋ถ์ํ ์ต๋ ์ปค๋ฐ ์. ์ฑ๋ฅ์ ์ํด ์ด๋ ฅ ๊น์ด๋ฅผ ์ ํํฉ๋๋ค | `100` |
| `output.git.includeDiffs` | ์ถ๋ ฅ์ Git ์ฐจ์ด๋ฅผ ํฌํจํ ์ง ์ฌ๋ถ. ์์
ํธ๋ฆฌ์ ์คํ
์ด์ง๋ ๋ณ๊ฒฝ ์ฌํญ์ ๋ณ๋๋ก ํ์ํฉ๋๋ค | `false` |
| `output.git.includeLogs` | ์ถ๋ ฅ์ Git ๋ก๊ทธ๋ฅผ ํฌํจํ ์ง ์ฌ๋ถ. ์ปค๋ฐ ํ์คํ ๋ฆฌ์ ๋ ์ง, ๋ฉ์์ง, ํ์ผ ๊ฒฝ๋ก๋ฅผ ํ์ํฉ๋๋ค | `false` |
| `output.git.includeLogsCount` | ํฌํจํ Git ๋ก๊ทธ ์ปค๋ฐ ์. ๊ฐ๋ฐ ํจํด์ ์ดํดํ๊ธฐ ์ํ ํ์คํ ๋ฆฌ ๊น์ด๋ฅผ ์ ํํฉ๋๋ค | `50` |
| `include` | ํฌํจํ ํ์ผ ํจํด([glob ํจํด](https://github.com/mrmlnc/fast-glob?tab=readme-ov-file#pattern-syntax) ์ฌ์ฉ) | `[]` |
| `ignore.useGitignore` | ํ๋ก์ ํธ์ `.gitignore` ํ์ผ์ ํจํด์ ์ฌ์ฉํ ์ง ์ฌ๋ถ | `true` |
| `ignore.useDefaultPatterns` | ๊ธฐ๋ณธ ๋ฌด์ ํจํด(node_modules, .git ๋ฑ)์ ์ฌ์ฉํ ์ง ์ฌ๋ถ | `true` |
| `ignore.customPatterns` | ์ถ๊ฐ ๋ฌด์ ํจํด([glob ํจํด](https://github.com/mrmlnc/fast-glob?tab=readme-ov-file#pattern-syntax) ์ฌ์ฉ) | `[]` |
| `security.enableSecurityCheck` | Secretlint๋ฅผ ์ฌ์ฉํ์ฌ ๋ฏผ๊ฐํ ์ ๋ณด๋ฅผ ๊ฐ์งํ๋ ๋ณด์ ๊ฒ์ฌ๋ฅผ ์ํํ ์ง ์ฌ๋ถ | `true` |
| `tokenCount.encoding` | OpenAI์ [tiktoken](https://github.com/openai/tiktoken) ํ ํฌ๋์ด์ ๊ฐ ์ฌ์ฉํ๋ ํ ํฐ ์นด์ดํธ ์ธ์ฝ๋ฉ. GPT-4o๋ `o200k_base`, GPT-4/3.5๋ `cl100k_base`๋ฅผ ์ฌ์ฉ. ์์ธํ ๋ด์ฉ์ [tiktoken model.py](https://github.com/openai/tiktoken/blob/main/tiktoken/model.py#L24) ์ฐธ์กฐ | `"o200k_base"` |
์ค์ ํ์ผ์ [JSON5](https://json5.org/) ๊ตฌ๋ฌธ์ ์ง์ํ๋ฉฐ, ๋ค์์ ํ์ฉํฉ๋๋ค:
- ์ฃผ์(ํ ์ค ๋ฐ ์ฌ๋ฌ ์ค)
- ๊ฐ์ฒด์ ๋ฐฐ์ด์ ํํ ์ผํ
- ๋ฐ์ดํ ์๋ ์์ฑ ์ด๋ฆ
- ๋ ์ ์ฐํ ๋ฌธ์์ด ๊ตฌ๋ฌธ
## ์คํค๋ง ์ ํจ์ฑ ๊ฒ์ฌ
`$schema` ์์ฑ์ ์ถ๊ฐํ์ฌ ์ค์ ํ์ผ์ ๋ํ ์คํค๋ง ์ ํจ์ฑ ๊ฒ์ฌ๋ฅผ ํ์ฑํํ ์ ์์ต๋๋ค:
```json
{
"$schema": "https://repomix.com/schemas/latest/schema.json",
"output": {
"filePath": "repomix-output.md",
"style": "markdown"
}
}
```
์ด๋ ๊ฒ ํ๋ฉด JSON ์คํค๋ง๋ฅผ ์ง์ํ๋ ํธ์ง๊ธฐ์์ ์๋ ์์ฑ ๋ฐ ์ ํจ์ฑ ๊ฒ์ฌ ๊ธฐ๋ฅ์ ์ ๊ณตํฉ๋๋ค.
## ์ค์ ํ์ผ ์์
๋ค์์ ์ ์ฒด ์ค์ ํ์ผ(`repomix.config.json`)์ ์์์
๋๋ค:
```json
{
"$schema": "https://repomix.com/schemas/latest/schema.json",
"input": {
"maxFileSize": 50000000
},
"output": {
"filePath": "repomix-output.xml",
"style": "xml",
"parsableStyle": false,
"compress": false,
"headerText": "ํจํค์ง๋ ํ์ผ์ ์ฌ์ฉ์ ์ ์ ํค๋ ์ ๋ณด",
"fileSummary": true,
"directoryStructure": true,
"files": true,
"removeComments": false,
"removeEmptyLines": false,
"topFilesLength": 5,
"showLineNumbers": false,
"truncateBase64": false,
"copyToClipboard": false,
"includeEmptyDirectories": false,
"git": {
"sortByChanges": true,
"sortByChangesMaxCommits": 100,
"includeDiffs": false,
"includeLogs": false,
"includeLogsCount": 50
}
},
"include": ["**/*"],
"ignore": {
"useGitignore": true,
"useDefaultPatterns": true,
// ํจํด์ .repomixignore์์๋ ์ง์ ํ ์ ์์ต๋๋ค
"customPatterns": [
"additional-folder",
"**/*.log"
],
},
"security": {
"enableSecurityCheck": true
},
"tokenCount": {
"encoding": "o200k_base"
}
}
```
## ์ค์ ํ์ผ ์์น
Repomix๋ ๋ค์ ์์๋ก ์ค์ ํ์ผ์ ์ฐพ์ต๋๋ค:
1. ํ์ฌ ๋๋ ํ ๋ฆฌ์ ๋ก์ปฌ ์ค์ ํ์ผ (์ฐ์ ์์: TS > JS > JSON)
- TypeScript: `repomix.config.ts`, `repomix.config.mts`, `repomix.config.cts`
- JavaScript: `repomix.config.js`, `repomix.config.mjs`, `repomix.config.cjs`
- JSON: `repomix.config.json5`, `repomix.config.jsonc`, `repomix.config.json`
2. ์ ์ญ ์ค์ ํ์ผ (์ฐ์ ์์: TS > JS > JSON)
- Windows:
- TypeScript: `%LOCALAPPDATA%\Repomix\repomix.config.ts`, `.mts`, `.cts`
- JavaScript: `%LOCALAPPDATA%\Repomix\repomix.config.js`, `.mjs`, `.cjs`
- JSON: `%LOCALAPPDATA%\Repomix\repomix.config.json5`, `.jsonc`, `.json`
- macOS/Linux:
- TypeScript: `~/.config/repomix/repomix.config.ts`, `.mts`, `.cts`
- JavaScript: `~/.config/repomix/repomix.config.js`, `.mjs`, `.cjs`
- JSON: `~/.config/repomix/repomix.config.json5`, `.jsonc`, `.json`
๋ช
๋ น์ค ์ต์
์ ์ค์ ํ์ผ์ ์ค์ ๋ณด๋ค ์ฐ์ ํฉ๋๋ค.
## ํฌํจ ํจํด
Repomix๋ [glob ํจํด](https://github.com/mrmlnc/fast-glob?tab=readme-ov-file#pattern-syntax)์ ์ฌ์ฉํ์ฌ ํฌํจํ ํ์ผ์ ์ง์ ํ ์ ์์ต๋๋ค. ์ด๋ฅผ ํตํด ๋์ฑ ์ ์ฐํ๊ณ ๊ฐ๋ ฅํ ํ์ผ ์ ํ์ด ๊ฐ๋ฅํฉ๋๋ค:
- `**/*.js`๋ฅผ ์ฌ์ฉํ์ฌ ๋ชจ๋ ๋๋ ํ ๋ฆฌ์ ๋ชจ๋ JavaScript ํ์ผ ํฌํจ
- `src/**/*`๋ฅผ ์ฌ์ฉํ์ฌ `src` ๋๋ ํ ๋ฆฌ์ ํ์ ๋๋ ํ ๋ฆฌ ๋ด์ ๋ชจ๋ ํ์ผ ํฌํจ
- `["src/**/*.js", "**/*.md"]`์ ๊ฐ์ด ์ฌ๋ฌ ํจํด์ ๊ฒฐํฉํ์ฌ `src`์ JavaScript ํ์ผ๊ณผ ๋ชจ๋ Markdown ํ์ผ ํฌํจ
์ค์ ํ์ผ์์ ํฌํจ ํจํด์ ์ง์ ํ ์ ์์ต๋๋ค:
```json
{
"include": ["src/**/*", "tests/**/*.test.js"]
}
```
๋๋ ์ผํ์ฑ ํํฐ๋ง์ ์ํด `--include` ๋ช
๋ น์ค ์ต์
์ ์ฌ์ฉํฉ๋๋ค.
## ๋ฌด์ ํจํด
Repomix๋ ํจํค์ง ํ๋ก์ธ์ค ์ค์ ํน์ ํ์ผ์ด๋ ๋๋ ํ ๋ฆฌ๋ฅผ ์ ์ธํ๊ธฐ ์ํ ์ฌ๋ฌ ๋ฐฉ๋ฒ์ ์ ๊ณตํฉ๋๋ค:
- **.gitignore**: ๊ธฐ๋ณธ์ ์ผ๋ก ํ๋ก์ ํธ์ `.gitignore` ํ์ผ๊ณผ `.git/info/exclude`์ ๋์ด๋ ํจํด์ด ์ฌ์ฉ๋ฉ๋๋ค. ์ด ๋์์ `ignore.useGitignore` ์ค์ ๋๋ `--no-gitignore` CLI ์ต์
์ผ๋ก ์ ์ดํ ์ ์์ต๋๋ค.
- **๊ธฐ๋ณธ ํจํด**: Repomix์๋ ์ผ๋ฐ์ ์ผ๋ก ์ ์ธ๋๋ ํ์ผ ๋ฐ ๋๋ ํ ๋ฆฌ์ ๊ธฐ๋ณธ ๋ชฉ๋ก(์: node_modules, .git, ๋ฐ์ด๋๋ฆฌ ํ์ผ)์ด ํฌํจ๋์ด ์์ต๋๋ค. ์ด ๊ธฐ๋ฅ์ `ignore.useDefaultPatterns` ์ค์ ๋๋ `--no-default-patterns` CLI ์ต์
์ผ๋ก ์ ์ดํ ์ ์์ต๋๋ค. ์์ธํ ๋ด์ฉ์ [defaultIgnore.ts](https://github.com/yamadashy/repomix/blob/main/src/config/defaultIgnore.ts)๋ฅผ ์ฐธ์กฐํ์ธ์.
- **.repomixignore**: ํ๋ก์ ํธ ๋ฃจํธ์ `.repomixignore` ํ์ผ์ ์์ฑํ์ฌ Repomix ์ ์ฉ ๋ฌด์ ํจํด์ ์ ์ํ ์ ์์ต๋๋ค. ์ด ํ์ผ์ `.gitignore`์ ๋์ผํ ํ์์ ๋ฐ๋ฆ
๋๋ค.
- **์ฌ์ฉ์ ์ ์ ํจํด**: ์ค์ ํ์ผ์ `ignore.customPatterns` ์ต์
์ ์ฌ์ฉํ์ฌ ์ถ๊ฐ ๋ฌด์ ํจํด์ ์ง์ ํ ์ ์์ต๋๋ค. ์ด ์ค์ ์ `-i, --ignore` ๋ช
๋ น์ค ์ต์
์ผ๋ก ๋ฎ์ด์ธ ์ ์์ต๋๋ค.
**์ฐ์ ์์** (๋์ ์์์์ ๋ฎ์ ์์):
1. ์ฌ์ฉ์ ์ ์ ํจํด(`ignore.customPatterns`)
2. `.repomixignore`
3. `.gitignore` ๋ฐ `.git/info/exclude`(`ignore.useGitignore`๊ฐ true์ด๊ณ `--no-gitignore`๊ฐ ์ฌ์ฉ๋์ง ์์ ๊ฒฝ์ฐ)
4. ๊ธฐ๋ณธ ํจํด(`ignore.useDefaultPatterns`๊ฐ true์ด๊ณ `--no-default-patterns`๊ฐ ์ฌ์ฉ๋์ง ์์ ๊ฒฝ์ฐ)
์ด ์ ๊ทผ ๋ฐฉ์์ ํตํด ํ๋ก์ ํธ์ ํ์์ ๋ฐ๋ผ ์ ์ฐํ ํ์ผ ์ ์ธ ์ค์ ์ด ๊ฐ๋ฅํฉ๋๋ค. ๋ณด์์ ๋ฏผ๊ฐํ ํ์ผ๊ณผ ๋์ฉ๋ ๋ฐ์ด๋๋ฆฌ ํ์ผ์ ์ ์ธ๋ฅผ ๋ณด์ฅํ๋ฉด์ ๊ธฐ๋ฐ ์ ๋ณด ์ ์ถ์ ๋ฐฉ์งํ์ฌ ์์ฑ๋ ํฉ ํ์ผ์ ํฌ๊ธฐ๋ฅผ ์ต์ ํํ๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค.
**์ฐธ๊ณ :** ๋ฐ์ด๋๋ฆฌ ํ์ผ์ ๊ธฐ๋ณธ์ ์ผ๋ก ํจํน๋ ์ถ๋ ฅ์ ํฌํจ๋์ง ์์ง๋ง, ํด๋น ๊ฒฝ๋ก๋ ์ถ๋ ฅ ํ์ผ์ "์ ์ฅ์ ๊ตฌ์กฐ" ์น์
์ ๋์ด๋ฉ๋๋ค. ์ด๋ฅผ ํตํด ํฉ ํ์ผ์ ํจ์จ์ ์ด๊ณ ํ
์คํธ ๊ธฐ๋ฐ์ผ๋ก ์ ์งํ๋ฉด์ ์ ์ฅ์ ๊ตฌ์กฐ์ ์ ์ฒด ๊ฐ์๋ฅผ ์ ๊ณตํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ [๋ฐ์ด๋๋ฆฌ ํ์ผ ์ฒ๋ฆฌ](#๋ฐ์ด๋๋ฆฌ-ํ์ผ-์ฒ๋ฆฌ)๋ฅผ ์ฐธ์กฐํ์ธ์.
`.repomixignore` ์์:
```text
# ์บ์ ๋๋ ํ ๋ฆฌ
.cache/
tmp/
# ๋น๋ ์ถ๋ ฅ
dist/
build/
# ๋ก๊ทธ
*.log
```
## ๊ธฐ๋ณธ ๋ฌด์ ํจํด
`ignore.useDefaultPatterns`๊ฐ true์ผ ๋ Repomix๋ ๋ค์๊ณผ ๊ฐ์ ์ผ๋ฐ์ ์ธ ํจํด์ ์๋์ผ๋ก ๋ฌด์ํฉ๋๋ค:
```text
node_modules/**
.git/**
coverage/**
dist/**
```
์ ์ฒด ๋ชฉ๋ก์ [defaultIgnore.ts](https://github.com/yamadashy/repomix/blob/main/src/config/defaultIgnore.ts)๋ฅผ ์ฐธ์กฐํ์ธ์.
## ๋ฐ์ด๋๋ฆฌ ํ์ผ ์ฒ๋ฆฌ
๋ฐ์ด๋๋ฆฌ ํ์ผ(์ด๋ฏธ์ง, PDF, ์ปดํ์ผ๋ ๋ฐ์ด๋๋ฆฌ, ์์นด์ด๋ธ ๋ฑ)์ ํจ์จ์ ์ธ ํ
์คํธ ๊ธฐ๋ฐ ์ถ๋ ฅ์ ์ ์งํ๊ธฐ ์ํด ํน๋ณํ๊ฒ ์ฒ๋ฆฌ๋ฉ๋๋ค:
- **ํ์ผ ๋ด์ฉ**: ๋ฐ์ด๋๋ฆฌ ํ์ผ์ ํ์ผ์ ํ
์คํธ ๊ธฐ๋ฐ์ผ๋ก ์ ์งํ๊ณ AI ์ฒ๋ฆฌ์ ํจ์จ์ ์ผ๋ก ๋ง๋ค๊ธฐ ์ํด ํจํน๋ ์ถ๋ ฅ์ **ํฌํจ๋์ง ์์ต๋๋ค**
- **๋๋ ํ ๋ฆฌ ๊ตฌ์กฐ**: ๋ฐ์ด๋๋ฆฌ ํ์ผ **๊ฒฝ๋ก๋ ๋์ด๋๋ฉฐ** ๋๋ ํ ๋ฆฌ ๊ตฌ์กฐ ์น์
์ ํ์๋์ด ์ ์ฅ์์ ์์ ํ ๊ฐ์๋ฅผ ์ ๊ณตํฉ๋๋ค
์ด ์ ๊ทผ ๋ฐฉ์์ AI ์๋น์ ์ต์ ํ๋ ํจ์จ์ ์ธ ํ
์คํธ ๊ธฐ๋ฐ ์ถ๋ ฅ์ ์ ์งํ๋ฉด์ ์ ์ฅ์ ๊ตฌ์กฐ์ ์์ ํ ๋ณด๊ธฐ๋ฅผ ์ป์ ์ ์๋๋ก ๋ณด์ฅํฉ๋๋ค.
**์์:**
์ ์ฅ์์ `logo.png`์ `app.jar`๊ฐ ํฌํจ๋ ๊ฒฝ์ฐ:
- ๋๋ ํ ๋ฆฌ ๊ตฌ์กฐ ์น์
์ ํ์๋ฉ๋๋ค
- ํด๋น ๋ด์ฉ์ ํ์ผ ์น์
์ ํฌํจ๋์ง ์์ต๋๋ค
**๋๋ ํ ๋ฆฌ ๊ตฌ์กฐ ์ถ๋ ฅ:**
```
src/
index.ts
utils.ts
assets/
logo.png
build/
app.jar
```
์ด๋ ๊ฒ ํ๋ฉด AI ๋๊ตฌ๊ฐ ๋ฐ์ด๋๋ฆฌ ๋ด์ฉ์ ์ฒ๋ฆฌํ์ง ์๊ณ ๋ ํ๋ก์ ํธ ๊ตฌ์กฐ์ ์ด๋ฌํ ๋ฐ์ด๋๋ฆฌ ํ์ผ์ด ์กด์ฌํจ์ ์ดํดํ ์ ์์ต๋๋ค.
**์ฐธ๊ณ :** `input.maxFileSize` ์ค์ ์ต์
(๊ธฐ๋ณธ๊ฐ: 50MB)์ ์ฌ์ฉํ์ฌ ์ต๋ ํ์ผ ํฌ๊ธฐ ์๊ณ๊ฐ์ ์ ์ดํ ์ ์์ต๋๋ค. ์ด ์ ํ๋ณด๋ค ํฐ ํ์ผ์ ์์ ํ ๊ฑด๋๋๋๋ค.
## ๊ณ ๊ธ ๊ธฐ๋ฅ
### ์ฝ๋ ์์ถ
์ฝ๋ ์์ถ ๊ธฐ๋ฅ(`output.compress: true`๋ก ํ์ฑํ)์ [Tree-sitter](https://github.com/tree-sitter/tree-sitter)๋ฅผ ์ฌ์ฉํ์ฌ ๊ตฌํ ์ธ๋ถ ์ฌํญ์ ์ ๊ฑฐํ๋ฉด์ ํ์ ์ฝ๋ ๊ตฌ์กฐ๋ฅผ ์ง๋ฅ์ ์ผ๋ก ์ถ์ถํฉ๋๋ค. ์ด๋ ์ค์ํ ๊ตฌ์กฐ ์ ๋ณด๋ฅผ ์ ์งํ๋ฉด์ ํ ํฐ ์๋ฅผ ์ค์ด๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค.
์ฃผ์ ์ด์ :
- ํ ํฐ ์๋ฅผ ํฌ๊ฒ ์ค์
- ํด๋์ค์ ํจ์ ์๊ทธ๋์ฒ ์ ์ง
- ์ํฌํธ์ ์ต์คํฌํธ ์ ์ง
- ํ์
์ ์์ ์ธํฐํ์ด์ค ์ ์ง
- ํจ์ ๋ณธ๋ฌธ๊ณผ ๊ตฌํ ์ธ๋ถ ์ฌํญ ์ ๊ฑฐ
์์ธํ ์ ๋ณด์ ์์๋ [์ฝ๋ ์์ถ ๊ฐ์ด๋](code-compress)๋ฅผ ์ฐธ์กฐํ์ธ์.
### Git ํตํฉ
`output.git` ์ค์ ์ ๊ฐ๋ ฅํ Git ์ธ์ ๊ธฐ๋ฅ์ ์ ๊ณตํฉ๋๋ค:
- `sortByChanges`: true๋ก ์ค์ ํ๋ฉด ํ์ผ์ด Git ๋ณ๊ฒฝ ํ์(ํด๋น ํ์ผ์ ์์ ํ ์ปค๋ฐ ์)๋ก ์ ๋ ฌ๋ฉ๋๋ค. ๋ณ๊ฒฝ์ด ๋ง์ ํ์ผ์ด ์ถ๋ ฅ ํ๋จ์ ๋ํ๋ฉ๋๋ค. ์ด๋ ๋ ํ๋ฐํ๊ฒ ๊ฐ๋ฐ๋๋ ํ์ผ์ ์ฐ์ ์ํ๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ: `true`
- `sortByChangesMaxCommits`: ํ์ผ ๋ณ๊ฒฝ ํ์๋ฅผ ๊ณ์ฐํ ๋ ๋ถ์ํ ์ต๋ ์ปค๋ฐ ์. ๊ธฐ๋ณธ๊ฐ: `100`
- `includeDiffs`: true๋ก ์ค์ ํ๋ฉด Git ์ฐจ์ด๋ฅผ ์ถ๋ ฅ์ ํฌํจํฉ๋๋ค(์์
ํธ๋ฆฌ์ ์คํ
์ด์ง๋ ๋ณ๊ฒฝ ์ฌํญ์ ๋ณ๋๋ก ํฌํจ). ์ด๋ฅผ ํตํด ๋
์๋ ์ ์ฅ์์ ๋๊ธฐ ์ค์ธ ๋ณ๊ฒฝ ์ฌํญ์ ๋ณผ ์ ์์ต๋๋ค. ๊ธฐ๋ณธ๊ฐ: `false`
- `includeLogs`: true๋ก ์ค์ ํ๋ฉด Git ๋ก๊ทธ๋ฅผ ์ถ๋ ฅ์ ํฌํจํฉ๋๋ค. ์ปค๋ฐ ํ์คํ ๋ฆฌ์ ๋ ์ง, ๋ฉ์์ง, ํ์ผ ๊ฒฝ๋ก๊ฐ ํ์๋์ด AI๊ฐ ์ด๋ค ํ์ผ๋ค์ด ์ผ๋ฐ์ ์ผ๋ก ํจ๊ป ๋ณ๊ฒฝ๋๋์ง ์ดํดํ ์ ์์ต๋๋ค. ๊ธฐ๋ณธ๊ฐ: `false`
- `includeLogsCount`: ํฌํจํ Git ๋ก๊ทธ ์ปค๋ฐ ์์
๋๋ค. ๊ฐ๋ฐ ํจํด ๋ถ์์ ์ฌ์ฉ๋๋ ํ์คํ ๋ฆฌ ๊น์ด๋ฅผ ์ ์ดํฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ: `50`
์ค์ ์์:
```json
{
"output": {
"git": {
"sortByChanges": true,
"sortByChangesMaxCommits": 100,
"includeDiffs": true,
"includeLogs": true,
"includeLogsCount": 30
}
}
}
```
### ๋ณด์ ๊ฒ์ฌ
`security.enableSecurityCheck`๊ฐ ํ์ฑํ๋๋ฉด Repomix๋ [Secretlint](https://github.com/secretlint/secretlint)๋ฅผ ์ฌ์ฉํ์ฌ ์ฝ๋๋ฒ ์ด์ค๋ฅผ ์ถ๋ ฅ์ ํฌํจํ๊ธฐ ์ ์ ๋ฏผ๊ฐํ ์ ๋ณด๋ฅผ ๊ฐ์งํฉ๋๋ค. ์ด๋ ๋ค์๊ณผ ๊ฐ์ ์ ๋ณด์ ์ฐ๋ฐ์ ๋
ธ์ถ์ ๋ฐฉ์งํ๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค:
- API ํค
- ์ก์ธ์ค ํ ํฐ
- ๊ฐ์ธ ํค
- ๋น๋ฐ๋ฒํธ
- ๊ธฐํ ๋ฏผ๊ฐํ ์๊ฒฉ ์ฆ๋ช
### ์ฃผ์ ์ ๊ฑฐ
`output.removeComments`๋ฅผ `true`๋ก ์ค์ ํ๋ฉด ์ง์๋๋ ํ์ผ ์ ํ์์ ์ฃผ์์ด ์ ๊ฑฐ๋์ด ์ถ๋ ฅ ํฌ๊ธฐ๋ฅผ ์ค์ด๊ณ ํต์ฌ ์ฝ๋ ๋ด์ฉ์ ์ง์คํ ์ ์์ต๋๋ค. ์ด๋ ๋ค์๊ณผ ๊ฐ์ ๊ฒฝ์ฐ์ ํนํ ์ ์ฉํฉ๋๋ค:
- ๋ง์ ๋ฌธ์ํ๊ฐ ๋ ์ฝ๋ ์ฒ๋ฆฌ
- ํ ํฐ ์ ์ค์ด๊ธฐ ์๋
- ์ฝ๋ ๊ตฌ์กฐ์ ๋ก์ง์ ์ง์ค
์ง์๋๋ ์ธ์ด์ ์์ธํ ์์๋ [์ฃผ์ ์ ๊ฑฐ ๊ฐ์ด๋](comment-removal)๋ฅผ ์ฐธ์กฐํ์ธ์.