Konfiguration
Schnellstart
Konfigurationsdatei erstellen:
repomix --initKonfigurationsdatei
repomix.config.json:
{
"output": {
"filePath": "repomix-output.xml",
"style": "xml",
"parsableStyle": true,
"compress": false,
"headerText": "Benutzerdefinierter Kopftext",
"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
}
}Globale Konfiguration
Globale Konfiguration erstellen:
repomix --init --globalSpeicherort:
- Windows:
%LOCALAPPDATA%\Repomix\repomix.config.json - macOS/Linux:
~/.config/repomix/repomix.config.json
Ignore-Muster
Prioritätsreihenfolge:
- CLI-Optionen (
--ignore) .repomixignore.gitignoreund.git/info/exclude- Standard-Muster
Beispiel für .repomixignore:
# Cache-Verzeichnisse
.cache/
tmp/
# Build-Ausgaben
dist/
build/
# Logs
*.logStandard-Ignore-Muster
Standardmäßig enthaltene häufige Muster:
node_modules/**
.git/**
coverage/**
dist/**Vollständige Liste: defaultIgnore.ts
Beispiele
Code-Komprimierung
Wenn output.compress auf true gesetzt ist, extrahiert Repomix intelligenterweise wesentliche Code-Strukturen und entfernt dabei Implementierungsdetails. Dies ist besonders nützlich, um die Token-Anzahl zu reduzieren und gleichzeitig wichtige strukturelle Informationen beizubehalten.
Zum Beispiel wird dieser Code:
const calculateTotal = (items: ShoppingItem[]) => {
let total = 0;
for (const item of items) {
total += item.price * item.quantity;
}
return total;
}
interface Item {
name: string;
price: number;
quantity: number;
}komprimiert zu:
const calculateTotal = (items: ShoppingItem[]) => {
interface Item {Kommentarentfernung
Wenn output.removeComments auf true gesetzt ist, werden alle Code-Kommentare entfernt. Dies ist nützlich, wenn Sie sich auf die Code-Implementierung konzentrieren möchten oder die Token-Anzahl weiter reduzieren möchten.