Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
18b7f85
feat: Add c12 dependency and remove json5 from package.json
okikio Mar 31, 2026
bad0368
feat: refactor config loading to utilize c12 to support loading confi…
okikio Mar 31, 2026
d0116cc
feat: enhance config file creation process to allow user-defined loca…
okikio Mar 31, 2026
14112a6
feat: enhance config option descriptions for clarity and interactivity
okikio Mar 31, 2026
be588f2
tests: enhance config file creation tests to include user selection p…
okikio Mar 31, 2026
8318c5c
tests: update config loading tests to utilize c12 for dynamic value h…
okikio Mar 31, 2026
5f97d14
docs: update README to clarify configuration file initialization and …
okikio Mar 31, 2026
e946cd6
docs(english): enhance command-line options and configuration documen…
okikio Mar 31, 2026
b80770b
test: improve dynamic value handling in TypeScript config tests
okikio Mar 31, 2026
34c02c1
fix(config): prevent c12 from executing untrusted code when skipLocal…
okikio Mar 31, 2026
134e3cf
feat(cli): add format selection to --init wizard
okikio Mar 31, 2026
7e98390
build(deps): add confbox and jiti as explicit dependencies
okikio Mar 31, 2026
498737a
test(config): verify c12 is not called for local cwd when skipLocalCo…
okikio Mar 31, 2026
4f9b42c
style(config): replace non-null assertions with nullish coalescing in…
okikio Mar 31, 2026
882a076
test(cli): update init tests for format selection and add format-spec…
okikio Mar 31, 2026
05e1b6b
fix(config): use c12's _configFile to detect when no config file was …
okikio Mar 31, 2026
9a6b834
fix(config): enforce exact-path provenance for explicit --config and …
okikio Mar 31, 2026
211167a
fix(init): harden init writes against symlinks and fix cancel handling
okikio Mar 31, 2026
b9205c9
test(config): cover exact-path enforcement, .config/full-filename dis…
okikio Mar 31, 2026
a6fa882
test(config): add real c12-backed integration tests for discovery and…
okikio Mar 31, 2026
da73440
test(init): cover symlink rejection, cancel-overwrite handling, and p…
okikio Mar 31, 2026
01cf2bf
docs(readme): update --init and global config sections for multi-form…
okikio Mar 31, 2026
66d626b
docs(website): update configuration guide for interactive multi-forma…
okikio Mar 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 30 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,14 @@ repomix --compress
repomix --remote yamadashy/repomix --compress
```

To initialize a new configuration file (`repomix.config.json`):
To initialize a new configuration file:

```bash
repomix --init
```

This will guide you through choosing a config location and format. It can create `repomix.config.{json,yaml,toml,ts,js}` in your project root, or `.config/repomix.{json,yaml,toml,ts,js}` and `.config/repomix.config.{json,yaml,toml,ts,js}` in the `.config/` directory.

Once you have generated the packed file, you can use it with Generative AI tools like ChatGPT, DeepSeek, Perplexity, Gemini, Gemma, Llama, Grok, and more.

### Docker Usage 🐳
Expand Down Expand Up @@ -647,8 +649,8 @@ Instruction
- `--remote-trust-config`: Trust and load config files from remote repositories (disabled by default for security)

#### Configuration Options
- `-c, --config <path>`: Use custom config file instead of repomix.config.json
- `--init`: Create a new repomix.config.json file with defaults
- `-c, --config <path>`: Use custom config file (supports .json, .ts, .js, .yaml, .toml, etc.)
- `--init`: Create a new Repomix config file (choose location and format interactively)
Comment thread
okikio marked this conversation as resolved.
Comment thread
okikio marked this conversation as resolved.
- `--global`: With --init, create config in home directory instead of current directory

#### Security Options
Expand Down Expand Up @@ -1254,21 +1256,28 @@ Repomix supports multiple configuration file formats for flexibility and ease of

### Configuration File Formats

Repomix will automatically search for configuration files in the following priority order:
Repomix will automatically search for configuration files in the following locations and formats:

**Locations** (searched in order):
1. Project root: `repomix.config.{ext}`
2. `.config/` directory: `.config/repomix.{ext}` or `.config/repomix.config.{ext}`

1. **TypeScript** (`repomix.config.ts`, `repomix.config.mts`, `repomix.config.cts`)
2. **JavaScript/ES Module** (`repomix.config.js`, `repomix.config.mjs`, `repomix.config.cjs`)
3. **JSON** (`repomix.config.json5`, `repomix.config.jsonc`, `repomix.config.json`)
**Supported formats**:
1. **TypeScript** (`.ts`, `.mts`, `.cts`)
2. **JavaScript/ES Module** (`.js`, `.mjs`, `.cjs`)
3. **JSON** (`.json`, `.jsonc`, `.json5`)
4. **YAML** (`.yaml`, `.yml`)
5. **TOML** (`.toml`)

#### JSON Configuration

Create a `repomix.config.json` file in your project root:
Create a configuration file interactively:

```bash
repomix --init
```

This will create a `repomix.config.json` file with default settings.
This will guide you through choosing a config location and format. It can create `repomix.config.{json,yaml,toml,ts,js}` in the project root, or `.config/repomix.{json,yaml,toml,ts,js}` and `.config/repomix.config.{json,yaml,toml,ts,js}` in the `.config/` directory.

#### TypeScript Configuration

Expand All @@ -1282,6 +1291,8 @@ To use TypeScript or JavaScript configuration with `defineConfig`, you need to i
npm install -D repomix
```

`repomix --init` generates plain `export default { ... }` files for TypeScript and JavaScript so the generated config works without requiring a local `repomix` dependency. If you want editor type checking and autocomplete, switch the generated file to `defineConfig(...)` after installing Repomix locally.

**Example:**

```typescript
Expand Down Expand Up @@ -1452,8 +1463,16 @@ repomix --init --global

The global configuration file will be created in:

- Windows: `%LOCALAPPDATA%\Repomix\repomix.config.json`
- macOS/Linux: `$XDG_CONFIG_HOME/repomix/repomix.config.json` or `~/.config/repomix/repomix.config.json`
- Windows: `%LOCALAPPDATA%\Repomix\repomix.config.{json,yaml,toml,ts,js}`
- macOS/Linux: `$XDG_CONFIG_HOME/repomix/repomix.config.{json,yaml,toml,ts,js}` or `~/.config/repomix/repomix.config.{json,yaml,toml,ts,js}`

Repomix searches for configuration files in this 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 configuration directory (as fallback)

Supported extensions: `.ts`, `.mts`, `.cts`, `.js`, `.mjs`, `.cjs`, `.json`, `.jsonc`, `.json5`, `.yaml`, `.yml`, `.toml`

Note: Local configuration (if present) takes precedence over global configuration.

Expand Down
100 changes: 92 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@
"is-binary-path": "^3.0.0",
"isbinaryfile": "^5.0.2",
"jiti": "^2.6.1",
"c12": "^4.0.0-beta.4",
Comment thread
okikio marked this conversation as resolved.
Comment thread
okikio marked this conversation as resolved.
"confbox": "^0.2.4",
"jschardet": "^3.1.4",
"json5": "^2.2.3",
"minimatch": "^10.2.4",
"picocolors": "^1.1.1",
"picospinner": "^3.0.0",
Expand Down
Loading