Can I use multiple named configs in repomix.config.json for subdirectories?
I use repomix on a large project with multiple subdirectories. Running
npx repomixat the root packs the whole project, which wastes tokens. Is there a way to define multiple named configurations in onerepomix.config.json, similar tong build --configuration production, so I can pack just one subdirectory? This refers to the GitHub issue opened January 2025, still open as of October 2025.Originally asked on GitHub: https://github.com/yamadashy/repomix/issues/325
4 answers
Status: open. As of the maintainer's last comment (October 2025), repomix does not yet support multiple named configurations inside a single
repomix.config.json, so runningnpx repomix uiornpx repomix apiis not possible.The only workaround mentioned in the thread came from the maintainer: some users already specify separate config files using the
-coption. The thread does not confirm the exact syntax or whether it fully solves the subdirectory case.The maintainer then proposed an Angular-style
projectsfield for future versions:json{ "projects": { "default": { "output": { "filePath": "my-whole-project.xml", "style": "xml" }, "ignore": { "customPatterns": [] } }, "ui": { "output": { "filePath": "my-ui-project.xml" }, "ignore": { "customPatterns": ["API-Project/"] } }, "api": { "output": { "filePath": "my-api-project.xml" }, "ignore": { "customPatterns": ["UI-Project/"] } } } }Planned usage:
bashnpx repomix # uses 'default' npx repomix --project ui # or -p ui npx repomix -p apiThe existing top-level config format would remain supported for backward compatibility; if both formats appear in the same file, the maintainer proposed throwing an error. This is a design proposal, not something shipped in a release mentioned in the thread.
Did this work for you?What a GitHub user tried on GitHub (Outcome unclear)
The reporter proposed a single
repomix.config.jsonwithdefault,my-ui-project, andmy-api-projectnamed configs, selected by commands likenpx repomix my-ui-config. This is a feature request, not an implemented or tested command.Source: https://github.com/yamadashy/repomix/issues/325 (opens external site)
Did this work for you?What @yamadashy tried on GitHub (Outcome unclear)
The maintainer noted that some users already work around this by specifying separate config files using the
-coption. The thread does not confirm the exact command or whether it worked for the reporter's scenario.Source: https://github.com/yamadashy/repomix/issues/325#issuecomment-2627705611 (opens external site)
Did this work for you?What @yamadashy tried on GitHub (Outcome unclear)
The maintainer proposed a future
projectsfield inrepomix.config.jsonwithnpx repomix --project ui/-p uiusage and an error when both config formats exist. Not implemented yet.Source: https://github.com/yamadashy/repomix/issues/325#issuecomment-3462247415 (opens external site)
Did this work for you?
Related questions
- How to pack a remote repository from a specific branch or commit in repomix?
- How to pack only currently open files in VSCode with Repomix?
- Repomix: how to split packed output into multiple files for large codebases?
- How do I run external commands on files before packing with repomix?
- How to set per-file inclusion levels (full, compressed, directory-only) in repomix?