Support `.config/` directory convention and additional config formats (YAML, TOML)
Description
Repomix should support the increasingly common .config/ directory convention for configuration files, and expand format support beyond TypeScript, JavaScript, and JSON.
Summary
Many tools in the JavaScript ecosystem now support placing config files in a .config/ directory to reduce root-level clutter (e.g., Nuxt, ESLint flat config, Vitest). Repomix currently only searches the project root for repomix.config.{ts,js,json}.
Additionally, YAML and TOML are popular config formats that Repomix doesn't currently support. Projects that prefer these formats have to use JSON or JS instead.
Proposed behavior
Config discovery order:
- Explicit
--config <path>(if provided) - Project root:
repomix.config.{ext} .config/directory:.config/repomix.{ext}or.config/repomix.config.{ext}- Global config directory (fallback)
New supported formats:
- YAML (
.yaml,.yml) - TOML (
.toml) - JSONC (
.jsonc) and JSON5 (.json5) — already partially supported, now first-class
repomix --init improvements:
- Interactive prompt to choose config file location (project root vs
.config/directory)
Potential Approach
Replace the manual config file discovery and loading logic with unjs/c12, the config loader used by Nuxt and the unjs ecosystem. c12 handles file discovery across directories, dynamic TS/JS loading, and multi-format parsing out of the box.
Future possibilities
c12 also supports features that could be enabled later:
- RC files (
.repomixrc) - Config in package.json (
"repomix"key) - Config inheritance/extending (
extendsfield)
Source: yamadashy/repomix