Skip to content

Support .config/ directory convention and additional config formats (YAML, TOML) #1365

Description

@okikio

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:

  1. Explicit --config <path> (if provided)
  2. Project root: repomix.config.{ext}
  3. .config/ directory: .config/repomix.{ext} or .config/repomix.config.{ext}
  4. 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 (extends field)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions