Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: Support multiple configurations within a single repomix.config.json #325

Open
edgariscoding opened this issue Jan 28, 2025 · 1 comment
Labels
enhancement New feature or request needs discussion Issues needing discussion and a decision to be made before action can be taken

Comments

@edgariscoding
Copy link

There are times when I'm workin non a large project which has multiple subdirectories within it.

If I'm only working inside of one of the subdirectories and I use repomix on the entire project it will be a massive file and a waste of tokens.

I would like to be able to place a repomix.config.json file at the root of the project and define a default config which packs the entire project by running

npx repomix

But then I would like to be able to pack a specific subdirectory by specifying a configuration such as

npx repomix my-ui-config

or

npx repomix my-api-config

The config file could look something like this:

{
  "default": {
    "output": {
      "filePath": "my-whole-project.xml",
      "style": "xml"
    },
    "include": [],
    "ignore": {
      "useGitignore": true,
      "useDefaultPatterns": true,
      "customPatterns": []
    }
  },
  "my-ui-project":{
    "output": {
      "filePath": "my-ui-project.xml",
      "style": "xml"
    },
    "include": [],
    "ignore": {
      "useGitignore": true,
      "useDefaultPatterns": true,
      "customPatterns": [
        "API-Project/"<======= Ignoring non UI related directories
      ]
    }
  },
  "my-api-project":{
    "output": {
      "filePath": "my-ui-project.xml",
      "style": "xml"
    },
    "include": [],
    "ignore": {
      "useGitignore": true,
      "useDefaultPatterns": true,
      "customPatterns": [
        "UI-Project/" <======= Ignoring non API related directories
      ]
    }
  }
}

Where if the default config is applied if npx repomix is called without any arguments.

Many other projects support similar configs, for example when building an angular project you can specify the build configuration like this:

ng build --configuration production

Where the production configuration is defined inside the angular.json file.

@yamadashy yamadashy added enhancement New feature or request needs discussion Issues needing discussion and a decision to be made before action can be taken labels Jan 31, 2025
@yamadashy
Copy link
Owner

Hi, @edgariscoding !
Thanks for the suggestion!

I've been wanting a similar feature myself. Some users are already specifying separate config files using the -c option.

When we implement this, it would be good to have a folder like configs to store named configs, similar to how Angular handles build configurations in angular.json. This would prevent naming conflicts with the main configuration file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs discussion Issues needing discussion and a decision to be made before action can be taken
Projects
None yet
Development

No branches or pull requests

2 participants