Add comprehensive JSON output format support#837
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds JSON as a first-class output style across core generation, CLI, config schema, and docs. Implements a parsable JSON generator and routes style=json to it. Updates tests and integration to cover JSON. Expands website docs (multi-language) and schemas to include json. Adds repomix-output.json to .gitignore. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User/CLI
participant C as ConfigLoader
participant G as OutputGenerator
participant J as JSON Generator
participant W as FileWriter
U->>C: Load config (style, flags)
C->>G: RenderContext (style=json, parsableStyle, sections)
alt style == json
G->>J: generateParsableJsonOutput(ctx)
J-->>G: JSON string
else style == xml/markdown/plain
G-->>G: Route to existing generators
end
G->>W: Write to defaultFilePathMap['json'] (if configured)
W-->>U: Done / path
opt unsupported style
G-->>U: Throw RepomixError
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive JSON output format support to Repomix, enabling users to generate structured, programmatically accessible output alongside existing XML, Markdown, and Plain text formats.
- Introduces
repomix --style jsoncommand with camelCase property structure - Adds comprehensive documentation across all 12 language versions with 15+ practical jq examples
- Implements complete test coverage and maintains backward compatibility
Reviewed Changes
Copilot reviewed 82 out of 83 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/config/configSchema.ts | Adds 'json' to output style enum and default file path mapping |
| src/core/output/outputGenerate.ts | Implements JSON output generation with camelCase properties |
| src/cli/cliRun.ts | Updates CLI to include JSON format option |
| src/cli/actions/initAction.ts | Adds JSON option to interactive initialization |
| tests/core/output/jsonStyle.test.ts | Comprehensive test coverage for JSON output functionality |
| tests/integration-tests/packager.test.ts | Integration test validation for JSON format |
| website/client/src/*/index.md | Adds JSON format examples to all 12 language homepages |
| website/client/src//guide/.md | Updates documentation with JSON format usage and jq examples |
Deploying repomix with
|
| Latest commit: |
2ed7798
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://55c01e7b.repomix.pages.dev |
| Branch Preview URL: | https://feat-style-json.repomix.pages.dev |
There was a problem hiding this comment.
Summary of Changes
Hello @yamadashy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request significantly enhances Repomix by introducing a new, fully supported JSON output format. This addition provides users with a highly structured and machine-readable output, ideal for programmatic processing, API integrations, and compatibility with AI systems. The changes span core implementation, CLI options, configuration schema, and extensive multilingual documentation, ensuring a seamless and well-supported experience for this new feature.
Highlights
- New JSON Output Format: Repomix now supports a new JSON output format, accessible via
repomix --style json, providing a structured and programmatically friendly option. - Comprehensive Documentation: The
README.mdand all 12 language versions of the website have been updated with detailed documentation for the new JSON format, including its structure, benefits, and usage examples. - jq Integration Examples: Over 15 practical
jqcommand examples have been added to the documentation, demonstrating how to effectively manipulate and extract data from the JSON output. - Unified Format Order: The output format order has been standardized across all documentation to
xml, markdown, json, plainfor consistency. - Core Implementation & Testing: The core logic for JSON output generation has been implemented in
src/core/output/outputGenerate.ts, along with comprehensive test coverage intests/core/output/outputStyles/jsonStyle.test.tsand updated integration tests.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This is an excellent pull request that introduces comprehensive support for JSON output. The implementation is well-structured, includes thorough test coverage, and the documentation has been updated across all supported languages, which is a significant effort. I've identified a few minor areas for improvement related to consistency and maintainability, but overall, this is a high-quality contribution that greatly enhances the tool's capabilities.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
website/client/src/vi/guide/usage.md (3)
121-126: Wrong flag: use --output (or -o), not --output-file.Current command won’t work as documented.
Apply:
- repomix --output-file my-codebase.xml + repomix --output my-codebase.xml + # or: repomix -o my-codebase.xml
137-141: Wrong flag: use --output-show-line-numbers.Keeps CLI naming consistent with EN docs.
Apply:
- repomix --show-line-numbers + repomix --output-show-line-numbers
147-151: Wrong flag: use --no-gitignore.Matches actual CLI option.
Apply:
- repomix --no-respect-gitignore + repomix --no-gitignore
♻️ Duplicate comments (5)
src/cli/actions/initAction.ts (1)
84-88: Reorder options to match standardized format order (xml, markdown, json, plain).Keeps CLI consistent with docs and PR objective.
Apply:
options: [ { value: 'xml', label: 'XML', hint: 'Structured XML format' }, { value: 'markdown', label: 'Markdown', hint: 'Markdown format' }, - { value: 'plain', label: 'Plain', hint: 'Simple text format' }, - { value: 'json', label: 'JSON', hint: 'Machine-readable JSON format' }, + { value: 'json', label: 'JSON', hint: 'Machine-readable JSON format' }, + { value: 'plain', label: 'Plain', hint: 'Simple text format' }, ],README.md (1)
617-619: Don’t list JSON under --parsable-style (no effect for JSON)JSON output is always valid and not affected by this flag. This mirrors prior feedback.
Apply:
-- `--parsable-style`: Escape special characters to ensure valid XML/Markdown/JSON (needed when output contains code that breaks formatting) +- `--parsable-style`: Escape special characters to ensure valid XML/Markdown (needed when output contains code that breaks formatting) + - Note: No effect for `json` (output is always properly escaped JSON).src/cli/cliRun.ts (1)
104-105: Remove “JSON” from --parsable-style help; JSON path ignores this flag.JSON output is inherently parsable and the flag has no effect. Keep the guidance specific to XML/Markdown to avoid confusion.
- 'Escape special characters to ensure valid XML/Markdown/JSON (needed when output contains code that breaks formatting)', + 'Escape special characters to ensure valid XML/Markdown (needed when output contains code that breaks formatting)',src/core/output/outputGenerate.ts (2)
68-74: Avoid hardcoded “5.” item; make the list data-driven.Hardcoding numbering is brittle if the base list changes.
- file_format: `${renderContext.summaryFileFormat} -5. Repository files, each consisting of: - - File path as an attribute - - Full contents of the file`, + file_format: [ + ...renderContext.summaryFileFormat.split('\n'), + 'Repository files, each consisting of:', + ' - File path as an attribute', + ' - Full contents of the file', + ] + .map((line, i) => `${i + 1}. ${line}`) // or use a helper that formats per-style + .join('\n'),
121-125: Same brittle numbering in JSON fileSummary.fileFormat.Mirror the data-driven approach to keep XML/JSON in sync.
- fileFormat: `${renderContext.summaryFileFormat} -5. Repository files, each consisting of: - - File path as a key - - Full contents of the file as the value`, + fileFormat: [ + ...renderContext.summaryFileFormat.split('\n'), + 'Repository files, each consisting of:', + ' - File path as a key', + ' - Full contents of the file as the value', + ] + .map((line, i) => `${i + 1}. ${line}`) + .join('\n'),
🧹 Nitpick comments (80)
website/client/src/ja/guide/usage.md (1)
166-170: LGTM; add a one‑liner explaining JSON structure and a save example.The order matches the project‑wide standard (xml, markdown, json, plain). Consider adding a brief description (camelCase, key sections) and an example of redirecting to repomix-output.json for parity with other docs.
-### JSON -```bash -repomix --style json -``` +### JSON +Repomixの出力を機械可読なJSONで取得します(プロパティはcamelCase、fileSummary / userProvidedHeader / directoryStructure / files / instructionを含む階層構造)。 +```bash +repomix --style json +# 例: ファイルに保存 +repomix --style json > repomix-output.json +```website/client/src/ko/guide/usage.md (1)
166-170: JSON 섹션에 한 줄 설명 추가 제안(가독성/검색성 향상).독자가 JSON의 특징(카멜케이스/계층 구조)을 바로 파악할 수 있도록 간단한 문장 추가를 권장합니다.
적용 diff:
-### JSON -```bash -repomix --style json -``` +### JSON +카멜케이스 속성의 계층 구조 JSON을 생성합니다. 도구/스크립트에서 파싱하기 쉽습니다. +```bash +repomix --style json +```website/client/src/fr/guide/github-actions.md (2)
28-34: Good addition: JSON workflow example.Example correctly uses
output: repomix-output.jsonwithstyle: json. Minor localization nit: change “JSON format” → “format JSON” for FR consistency.Apply this diff:
- - name: Pack repository with Repomix (JSON format) + - name: Pack repository with Repomix (format JSON)
78-78: Style list updated correctly; tighten formatting.Include backticks around literal values for consistency with other inline literals in the doc.
Apply this diff:
-| `style` | Style de sortie (xml, markdown, json, plain) | `xml` | +| `style` | Style de sortie (`xml`, `markdown`, `json`, `plain`) | `xml` |website/client/src/hi/guide/github-actions.md (2)
125-143: Map style → file extension to avoid odd filenames (.markdown, .plain).In this matrix example,
repomix-output.${{ matrix.output-style }}yields.markdownand.plain. Prefer.mdand.txtto align with earlier examples and common tooling.Apply this patch to compute an appropriate extension and reuse it:
- name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - - name: Run Repomix - run: npx repomix --style ${{ matrix.output-style }} --output-file repomix-output.${{ matrix.output-style }} + + - name: Set output extension + id: set_ext + shell: bash + run: | + case "${{ matrix.output-style }}" in + markdown) echo "ext=md" >> "$GITHUB_OUTPUT" ;; + plain) echo "ext=txt" >> "$GITHUB_OUTPUT" ;; + *) echo "ext=${{ matrix.output-style }}" >> "$GITHUB_OUTPUT" ;; + esac + + - name: Run Repomix + run: npx repomix --style ${{ matrix.output-style }} --output-file repomix-output.${{ steps.set_ext.outputs.ext }} - name: Upload Repomix Output uses: actions/upload-artifact@v3 with: name: repomix-output-${{ matrix.output-style }}-node${{ matrix.node-version }} - path: repomix-output.${{ matrix.output-style }} + path: repomix-output.${{ steps.set_ext.outputs.ext }}
22-29: Optional: Bump Actions to v4 for newer runners and perf.
actions/checkout@v4,actions/setup-node@v4, andactions/upload-artifact@v4are the current majors and recommended in GitHub docs.Minimal replacements:
Also applies to: 81-86, 139-143
website/client/src/pt-br/guide/github-actions.md (1)
28-34: JSON snippet looks correct; consider localizing the step name.The YAML is valid and aligns with the new JSON style. Nit: switch "(JSON format)" to "(formato JSON)" to match the page language.
Apply this diff if you agree:
- - name: Pack repository with Repomix (JSON format) + - name: Pack repository with Repomix (formato JSON)website/client/src/hi/guide/command-line-options.md (1)
17-19: Add JSON: looks good; clarify default output filename.
- The JSON style addition is correct.
- Minor: Line 16 still says the default output is repomix-output.xml. With style-aware defaults (including json: repomix-output.json), clarify it to be style-dependent.
Apply:
- - `-o, --output <file>`: आउटपुट फ़ाइल पथ (डिफ़ॉल्ट: repomix-output.xml, stdout के लिए "-" का उपयोग करें) + - `-o, --output <file>`: आउटपुट फ़ाइल पथ (डिफ़ॉल्ट: चुनी गई स्टाइल के अनुसार; xml: repomix-output.xml, markdown: repomix-output.md, json: repomix-output.json, plain: repomix-output.txt; stdout के लिए "-" का उपयोग करें)website/client/src/hi/guide/configuration.md (1)
24-25: JSON value added: update adjacent description to include JSON.Line 23 still claims filePath supports only XML/Markdown/plain. Include JSON for consistency.
Apply:
-| `output.filePath` | आउटपुट फ़ाइल का नाम। XML, Markdown, और सादे टेक्स्ट फ़ॉर्मेट का समर्थन करता है | `"repomix-output.xml"` | +| `output.filePath` | आउटपुट फ़ाइल का नाम। XML, Markdown, JSON और सादे टेक्स्ट फ़ॉर्मेट का समर्थन करता है | `"repomix-output.xml"` |website/client/src/id/guide/command-line-options.md (1)
17-18: JSON style addition: OK; note style-dependent default filename.The JSON entry is correct. Please clarify the default output filename on Line 16 as style-dependent.
Apply:
- - `-o, --output <file>`: Jalur file output (default: repomix-output.xml, gunakan "-" untuk stdout) + - `-o, --output <file>`: Jalur file output (default bergantung pada style; xml: repomix-output.xml, markdown: repomix-output.md, json: repomix-output.json, plain: repomix-output.txt; gunakan "-" untuk stdout)website/client/src/es/guide/command-line-options.md (1)
17-18: JSON added: good; align default filename text with style-aware defaults.Please adjust Line 16 so the default output path reflects the selected style.
Apply:
- - `-o, --output <file>`: Ruta del archivo de salida (por defecto: repomix-output.xml, usar "-" para stdout) + - `-o, --output <file>`: Ruta del archivo de salida (por defecto según el estilo; xml: repomix-output.xml, markdown: repomix-output.md, json: repomix-output.json, plain: repomix-output.txt; usa "-" para stdout)website/client/src/pt-br/guide/configuration.md (1)
24-25: Style enum updated: also update filePath description to list JSON.Line 23 mentions only XML/Markdown/texto simples. Add JSON for consistency.
Apply:
-| `output.filePath` | Nome do arquivo de saída. Suporta formatos XML, Markdown e texto simples | `"repomix-output.xml"` | +| `output.filePath` | Nome do arquivo de saída. Suporta formatos XML, Markdown, JSON e texto simples | `"repomix-output.xml"` |website/client/src/de/guide/usage.md (1)
166-170: JSON usage section: LGTM; add a one-line default-file hint.Small doc nicety: note the default JSON filename.
Apply:
### JSON ```bash repomix --style json+Hinweis: Der Standard-Dateiname für JSON ist
repomix-output.json.</blockquote></details> <details> <summary>website/client/src/fr/guide/configuration.md (1)</summary><blockquote> `24-25`: **Enum lists JSON; fix neighboring filePath description to include JSON.** Line 23 still excludes JSON; align with the new style. Apply: ```diff -| `output.filePath` | Nom du fichier de sortie. Prend en charge les formats XML, Markdown et texte brut | `"repomix-output.xml"` | +| `output.filePath` | Nom du fichier de sortie. Prend en charge les formats XML, Markdown, JSON et texte brut | `"repomix-output.xml"` |website/client/src/ja/guide/command-line-options.md (1)
17-18: JSON added: OK; broaden parsable-style text and default filename note.
- Line 18 says “有効なXML/Markdownを保証”. With JSON supported, generalize wording.
- Also consider clarifying Line 16’s default filename as style-dependent.
Apply:
- - `--parsable-style`: 特殊文字をエスケープして有効なXML/Markdownを保証(出力に形式を破損するコードが含まれる場合に必要) + - `--parsable-style`: 選択したスタイルのスキーマに従ってエスケープし、有効な出力を保証(必要に応じて使用。トークン数が増える場合があります)And:
- - `-o, --output <file>`: 出力ファイルパス(デフォルト:repomix-output.xml、標準出力には「-」を使用) + - `-o, --output <file>`: 出力ファイルパス(デフォルトはスタイルに依存:xml→repomix-output.xml、markdown→repomix-output.md、json→repomix-output.json、plain→repomix-output.txt。標準出力には「-」を使用)website/client/src/ko/guide/configuration.md (1)
23-25: Doc consistency: mention JSON inoutput.filePathrow too
output.styleincludesjson, but theoutput.filePathrow still lists only XML/Markdown/plain. Update to include JSON and keep the standardized order (xml, markdown, json, plain).-| `output.filePath` | 출력 파일 이름. XML, Markdown, 일반 텍스트 형식을 지원합니다 | `"repomix-output.xml"` | +| `output.filePath` | 출력 파일 이름. XML, Markdown, JSON, 일반 텍스트 형식을 지원합니다 | `"repomix-output.xml"` |website/client/src/zh-cn/guide/configuration.md (1)
23-25: 文档一致性:在output.filePath行中也加入 JSON
output.style已包含json,但output.filePath行仍只写了 XML/Markdown/纯文本。请补充 JSON,并保持顺序统一(xml、markdown、json、plain)。-| `output.filePath` | 输出文件名。支持XML、Markdown和纯文本格式 | `"repomix-output.xml"` | +| `output.filePath` | 输出文件名。支持 XML、Markdown、JSON 和纯文本格式 | `"repomix-output.xml"` |website/client/src/id/guide/configuration.md (1)
23-25: Konsistensi dok: sebutkan JSON juga di barisoutput.filePath
output.stylesudah memuatjson, tapi deskripsioutput.filePathbelum. Tambahkan JSON dan pertahankan urutan standar (xml, markdown, json, plain).-| `output.filePath` | Nama file output. Mendukung format XML, Markdown, dan teks biasa | `"repomix-output.xml"` | +| `output.filePath` | Nama file output. Mendukung format XML, Markdown, JSON, dan teks biasa | `"repomix-output.xml"` |website/client/src/vi/guide/configuration.md (1)
23-25: Đồng bộ tài liệu: thêm JSON ở dòngoutput.filePath
output.styleđã liệt kêjson, nhưng mô tảoutput.filePathchưa có. Bổ sung JSON và giữ thứ tự chuẩn (xml, markdown, json, plain).-| `output.filePath` | Tên file đầu ra. Hỗ trợ định dạng XML, Markdown và văn bản thuần túy | `"repomix-output.xml"` | +| `output.filePath` | Tên file đầu ra. Hỗ trợ định dạng XML, Markdown, JSON và văn bản thuần túy | `"repomix-output.xml"` |website/client/src/de/guide/github-actions.md (2)
28-34: JSON example looks good. Consider clarifying default output path.Add a short note that when style: json is used without an explicit output, the default file name is repomix-output.json.
77-79: Clarify style-dependent default for output file.Current default shows only XML. Suggest reflecting JSON’s default too.
-| `output` | Pfad der Ausgabedatei | `repomix-output.xml` | +| `output` | Pfad der Ausgabedatei | Stilabhängig; z. B. JSON → `repomix-output.json` (ohne Style-Angabe: `repomix-output.xml`) |website/client/src/pt-br/guide/command-line-options.md (1)
17-17: Add note about style-dependent default file name.Make it explicit that the default output file name changes with --style (e.g., json → repomix-output.json).
-- `--style <type>`: Formato de saída: xml, markdown, json ou plain (padrão: xml) +- `--style <type>`: Formato de saída: xml, markdown, json ou plain (padrão: xml; o arquivo padrão acompanha o estilo, ex.: json → `repomix-output.json`)website/client/src/zh-cn/index.md (1)
191-193: JSON section LGTM. Optional: mention default file name for JSON.Suggest adding: “提示:使用 style 为 json 且未指定 --output 时,默认文件名为 repomix-output.json。”
website/client/src/en/guide/usage.md (1)
166-169: Add schema link and default-path note for JSON.Consider adding a line after the code block:
- Default file when using --style json: repomix-output.json.
- JSON schema: /schemas/latest/schema.json
website/client/src/de/index.md (1)
189-191: JSON format entry is good. Optional: note default file.Add a brief note that JSON defaults to repomix-output.json when no --output is provided.
website/client/src/pt-br/index.md (1)
189-191: JSON section LGTM. Optional: clarify default output filename.Add a short note: “Padrão com --style json (sem --output): repomix-output.json.”
website/client/src/de/guide/configuration.md (1)
23-25: Doc inconsistency: filePath support text omits JSON.Row for output.filePath still lists only XML/Markdown/Text. Include JSON.
-| `output.filePath` | Name der Ausgabedatei. Unterstützt XML-, Markdown- und Textformate | `"repomix-output.xml"` | +| `output.filePath` | Name der Ausgabedatei. Unterstützt XML-, Markdown-, JSON- und Textformate | `"repomix-output.xml"` |website/client/src/zh-cn/guide/usage.md (1)
166-169: JSON section LGTM. Optional: add default and schema pointers.
- 默认文件名(未指定 --output 且使用 --style json):repomix-output.json
- JSON 模式(Schema):/schemas/latest/schema.json
website/client/src/es/guide/configuration.md (1)
23-23: Actualiza la descripción de output.filePath para incluir JSON.Ahora soporta XML, Markdown, JSON y texto plano.
-| `output.filePath` | Nombre del archivo de salida. Admite formatos XML, Markdown y texto plano | `"repomix-output.xml"` | +| `output.filePath` | Nombre del archivo de salida. Admite formatos XML, Markdown, JSON y texto plano | `"repomix-output.xml"` |website/client/src/ja/guide/configuration.md (1)
23-23: output.filePath の説明にも JSON を追加してください。現在は XML/Markdown/プレーンのみの記載です。
-| `output.filePath` | 出力ファイル名。XML、Markdown、プレーンテキスト形式をサポートしています | `"repomix-output.xml"` | +| `output.filePath` | 出力ファイル名。XML、Markdown、JSON、プレーンテキスト形式をサポートしています | `"repomix-output.xml"` |website/client/src/zh-tw/guide/configuration.md (1)
23-23: 同步更新 output.filePath 說明以包含 JSON。目前僅提到 XML、Markdown 與純文字。
-| `output.filePath` | 輸出檔案名。支援XML、Markdown和純文字格式 | `"repomix-output.xml"` | +| `output.filePath` | 輸出檔案名。支援 XML、Markdown、JSON 和純文字格式 | `"repomix-output.xml"` |website/client/src/en/guide/command-line-options.md (1)
17-19: Include JSON in parsable-style description.Docs still say XML/Markdown only; JSON is now supported.
Apply:
- - `--parsable-style`: Escape special characters to ensure valid XML/Markdown (needed when output contains code that breaks formatting) + - `--parsable-style`: Escape/encode to ensure valid XML/Markdown/JSON (use when output contains content that can break rendering/parsing)website/client/src/en/guide/configuration.md (2)
23-25: Mention JSON in filePath description for completeness.Apply:
-| `output.filePath` | The name of the output file. Supports XML, Markdown, and plain text formats | `"repomix-output.xml"` | +| `output.filePath` | The name of the output file. Supports XML, Markdown, JSON, and plain text formats | `"repomix-output.xml"` |
65-67: Schema snippet updated to XML default—ok. Consider adding a JSON variant example.Add a short JSON example below to guide users:
{ "$schema": "https://repomix.com/schemas/latest/schema.json", "output": { "filePath": "repomix-output.json", "style": "json" } }website/client/src/en/guide/github-actions.md (1)
28-34: Nice addition of the JSON workflow example.Consider adding a brief note reminding users to also switch the artifact upload path/name to .json when using style: json, to avoid copy-paste mismatches from the XML example later on this page.
website/client/src/zh-cn/guide/github-actions.md (1)
28-35: Add matching artifact upload for the JSON example.Readers may forget to switch the artifact path to the .json file. Add an upload step (or a note) mirroring the JSON example.
- name: Upload Repomix JSON output uses: actions/upload-artifact@v4 with: name: repomix-output-json path: repomix-output.jsonwebsite/client/src/ja/index.md (1)
191-193: LGTM: JSON フォーマットの使用例を追加。Optionally link to a “jq” snippet page later.
src/config/configSchema.ts (1)
14-14: Nit: Redundant typing withas const.
defaultFilePathMapis already typed asRecord<RepomixOutputStyle, string>.as constadds no value here.-export const defaultFilePathMap: Record<RepomixOutputStyle, string> = { +export const defaultFilePathMap: Record<RepomixOutputStyle, string> = { xml: 'repomix-output.xml', markdown: 'repomix-output.md', plain: 'repomix-output.txt', json: 'repomix-output.json', -} as const; +};website/client/src/ja/guide/github-actions.md (1)
28-35: Add JSON artifact upload snippet.Mirror the JSON pack step with an artifact upload using the .json file to avoid copy/paste mistakes.
- name: Upload Repomix JSON output uses: actions/upload-artifact@v4 with: name: repomix-output-json path: repomix-output.jsonwebsite/client/src/vi/guide/github-actions.md (1)
43-47: Clarify Action variant and add JSON artifact upload.This page uses
yamadashy/repomix-action@v1and inputs likeoutput-file, while other locales use.github/actions/repomix@mainwithoutput. Consider adding a short note calling out the two variants or unifying across docs. Also upload the JSON artifact to match the new step.- name: Upload packed JSON output uses: actions/upload-artifact@v3 with: name: repomix-output-json path: repomix-output.jsonwebsite/client/src/es/guide/github-actions.md (1)
28-35: Add JSON artifact upload for completeness.Include an upload step for
repomix-output.jsonto mirror the new JSON example.- name: Upload Repomix JSON output uses: actions/upload-artifact@v4 with: name: repomix-output-json path: repomix-output.jsonwebsite/client/src/id/guide/github-actions.md (1)
84-90: Surface JSON artifact upload and consider Action consistency note.Add an artifact upload for the JSON file and, optionally, a note explaining this page uses
repomix-action@v1whereas other locales reference.github/actions/repomix@main.- name: Upload Repomix JSON File uses: actions/upload-artifact@v3 with: name: repomix-output-json path: ./docs/repomix-output.jsonwebsite/client/src/ko/guide/output.md (2)
87-93: Fix invalid JSON: escape newlines in directoryStructure.Raw newlines inside JSON strings are invalid. Use explicit "\n" escapes.
Apply this diff:
- "directoryStructure": "src/ - cli/ - cliOutput.ts - index.ts - config/ - configLoader.ts", + "directoryStructure": "src/\n cli/\n cliOutput.ts\n index.ts\n config/\n configLoader.ts",
109-165: Nit: drop useless cat in jq examples.Prefer
jq -r '...' repomix-output.jsonovercat ... | jq ....website/client/src/de/guide/output.md (2)
77-83: Fix invalid JSON: escape newlines in directoryStructure.Raw newlines are not valid in JSON strings.
- "directoryStructure": "src/ - cli/ - cliOutput.ts - index.ts - config/ - configLoader.ts", + "directoryStructure": "src/\n cli/\n cliOutput.ts\n index.ts\n config/\n configLoader.ts",
245-263: Optional: mention default JSON output path.Consider adding that the default file for
style: "json"isrepomix-output.json.website/client/src/fr/guide/output.md (2)
74-80: Corriger le JSON: échapper les retours à la ligne dans directoryStructure.Les retours à la ligne non échappés invalident le JSON.
- "directoryStructure": "src/ - cli/ - cliOutput.ts - index.ts - config/ - configLoader.ts", + "directoryStructure": "src/\n cli/\n cliOutput.ts\n index.ts\n config/\n configLoader.ts",
96-152: Nit: éviter l’usage inutile de cat dans les exemples jq.Utiliser
jq -r '...' repomix-output.json.website/client/src/vi/guide/output.md (2)
107-113: Sửa JSON không hợp lệ: escape newline trong directoryStructure.JSON không cho phép xuống dòng thô trong chuỗi.
- "directoryStructure": "src/ - cli/ - cliOutput.ts - index.ts - config/ - configLoader.ts", + "directoryStructure": "src/\n cli/\n cliOutput.ts\n index.ts\n config/\n configLoader.ts",
333-337: Cập nhật danh sách tên tệp mặc định để bao gồm JSON.Thêm mục
repomix-output.jsonđể phản ánh định dạng mới.Mặc định, Repomix sẽ tạo: - - `repomix-output.xml` cho định dạng XML - - `repomix-output.md` cho định dạng Markdown - - `repomix-output.txt` cho định dạng văn bản thuần túy + - `repomix-output.json` cho định dạng JSONwebsite/client/src/en/guide/output.md (3)
76-82: Fix invalid JSON: escape newlines in directoryStructure.Unescaped newlines are not valid JSON.
- "directoryStructure": "src/ - cli/ - cliOutput.ts - index.ts - config/ - configLoader.ts", + "directoryStructure": "src/\n cli/\n cliOutput.ts\n index.ts\n config/\n configLoader.ts",
102-126: Nit: avoid UUOC in jq snippets.Use
jq -r '...' repomix-output.jsoninstead ofcat ... | jq.
213-215: Confirm config schema and defaults for JSON.Verify
style: "json"is accepted by schema and mention default pathrepomix-output.jsonif helpful.website/client/src/id/guide/output.md (4)
87-93: Perbaiki JSON tidak valid: escape newline di directoryStructure.Newline mentah membuat JSON tidak valid.
- "directoryStructure": "src/ - cli/ - cliOutput.ts - index.ts - config/ - configLoader.ts", + "directoryStructure": "src/\n cli/\n cliOutput.ts\n index.ts\n config/\n configLoader.ts",
81-85: Perbaikan terjemahan kecil.
- “terpacked” → “terpaket”.
- "purpose": "File ini berisi representasi terpacked dari keseluruhan konten repositori...", + "purpose": "File ini berisi representasi terpaket dari keseluruhan konten repositori...",
126-127: Konsistensi istilah: ganti “Filtering” dengan “Penyaringan”.Bahasa campur Inggris/Indonesia.
-#### Filtering dan Analisis File +#### Penyaringan dan Analisis File
151-153: Perbaiki tata bahasa Indonesia.Tambahkan “yang”.
-cat repomix-output.json | jq -r '.instruction // "Tidak ada instruksi disediakan"' +cat repomix-output.json | jq -r '.instruction // "Tidak ada instruksi yang disediakan"'website/client/src/zh-tw/guide/output.md (2)
86-92: 修正無效 JSON:在 directoryStructure 中跳脫換行。JSON 字串不得包含未跳脫的換行。
- "directoryStructure": "src/ - cli/ - cliOutput.ts - index.ts - config/ - configLoader.ts", + "directoryStructure": "src/\n cli/\n cliOutput.ts\n index.ts\n config/\n configLoader.ts",
108-164: Nit:在 jq 範例中避免多餘的 cat。改為
jq -r '...' repomix-output.json。website/client/src/pt-br/guide/output.md (2)
87-93: Corrigir JSON inválido: escape quebras de linha em directoryStructure.Quebras de linha não escapadas invalidam o JSON.
- "directoryStructure": "src/ - cli/ - cliOutput.ts - index.ts - config/ - configLoader.ts", + "directoryStructure": "src/\n cli/\n cliOutput.ts\n index.ts\n config/\n configLoader.ts",
109-165: Nit: evitar uso desnecessário de cat nos exemplos com jq.Use
jq -r '...' repomix-output.json.website/client/src/ja/guide/output.md (3)
81-103: Invalid JSON sample: directoryStructure string spans multiple lines without escapesJSON strings cannot contain literal newlines. Escape them with \n so examples are copy-pastable.
Apply this diff inside the JSON block:
- "directoryStructure": "src/ - cli/ - cliOutput.ts - index.ts - config/ - configLoader.ts", + "directoryStructure": "src/\n cli/\n cliOutput.ts\n index.ts\n config/\n configLoader.ts",
115-129: Prefer direct jq invocation over UUOCUse jq with the file argument instead of piping through cat.
Example replacements:
- cat repomix-output.json | jq -r '.files | keys[]' + jq -r '.files | keys[]' repomix-output.json - cat repomix-output.json | jq '.files | keys | length' + jq '.files | keys | length' repomix-output.json - cat repomix-output.json | jq -r '.files["README.md"]' + jq -r '.files["README.md"]' repomix-output.jsonAlso applies to: 130-141, 143-157, 159-169
75-77: Call out the default JSON output fileReaders benefit from knowing the default path when style=json.
Add a short note right below the code block:
repomix --style json+デフォルト出力ファイル: repomix-output.json
</blockquote></details> <details> <summary>README.md (3)</summary><blockquote> `516-549`: **Minor: avoid cat | jq in examples** Use jq with file args for consistency and best practices. Example replacements: ```diff - cat repomix-output.json | jq -r '.files | keys[]' + jq -r '.files | keys[]' repomix-output.json - cat repomix-output.json | jq '.files | keys | length' + jq '.files | keys | length' repomix-output.json
1276-1282: Add .json to the “extension determines format” note in Action inputsThe Actions snippet for JSON is great. Update the “Action Inputs” table row for output (currently lists .txt, .md, .xml) to include .json as well.
1010-1010: Note default file path varies by styleConsider adding a footnote that when style=json and -o is omitted, the default output is repomix-output.json (per config mapping), similar for markdown/plain.
website/client/src/zh-cn/guide/output.md (3)
77-99: 无效的 JSON 示例:directoryStructure 字符串未转义换行JSON 字符串不能直接包含换行。请用 \n 转义,保证示例可直接复制使用。
- "directoryStructure": "src/ - cli/ - cliOutput.ts - index.ts - config/ - configLoader.ts", + "directoryStructure": "src/\n cli/\n cliOutput.ts\n index.ts\n config/\n configLoader.ts",
111-125: 使用 jq 时避免“cat | jq”的反模式直接将文件作为 jq 的参数。
- cat repomix-output.json | jq -r '.files | keys[]' + jq -r '.files | keys[]' repomix-output.json - cat repomix-output.json | jq '.files | keys | length' + jq '.files | keys | length' repomix-output.jsonAlso applies to: 126-137, 139-153, 155-165
71-74: 补充默认 JSON 输出文件名建议在命令示例下方注明:默认输出文件为 repomix-output.json。
repomix --style json+默认输出文件:repomix-output.json
</blockquote></details> <details> <summary>website/client/src/es/guide/output.md (3)</summary><blockquote> `77-99`: **JSON inválido en el ejemplo: cadena directoryStructure con saltos de línea sin escapar** Las cadenas JSON no pueden contener nuevas líneas literales. Escápalas con \n. ```diff - "directoryStructure": "src/ - cli/ - cliOutput.ts - index.ts - config/ - configLoader.ts", + "directoryStructure": "src/\n cli/\n cliOutput.ts\n index.ts\n config/\n configLoader.ts",
111-125: Pequeño: evita “cat | jq”Usa jq con el archivo como argumento.
- cat repomix-output.json | jq -r '.files | keys[]' + jq -r '.files | keys[]' repomix-output.json - cat repomix-output.json | jq '.files | keys | length' + jq '.files | keys | length' repomix-output.jsonAlso applies to: 126-137, 139-153, 155-165
71-74: Indicar el archivo de salida predeterminado para JSONAñade una nota bajo el bloque de comandos: salida por defecto repomix-output.json.
repomix --style json+Archivo de salida predeterminado: repomix-output.json
</blockquote></details> <details> <summary>tests/core/output/outputGenerate.test.ts (1)</summary><blockquote> `13-15`: **Add a JSON-path unit test to assert dispatcher behavior** Verify that style=json routes to generateParsableJsonOutput (independent of parsableStyle) and that headerText/fileSummary toggles mirror other styles. You can append a test like: ```ts test('generateOutput should use generateParsableJsonOutput for json style', async () => { const mockConfig = createMockConfig({ output: { filePath: 'repomix-output.json', style: 'json', fileSummary: false, headerText: 'JSON HEADER' }, }); const mockFiles: ProcessedFile[] = [{ path: 'a.txt', content: 'x' }]; mockDeps.generateParsableJsonOutput.mockResolvedValue(JSON.stringify({ fileSummary: undefined, userProvidedHeader: 'JSON HEADER', directoryStructure: '', files: { 'a.txt': 'x' }, })); const out = await generateOutput([process.cwd()], mockConfig, mockFiles, [], undefined, undefined, mockDeps); expect(mockDeps.generateParsableJsonOutput).toHaveBeenCalledTimes(1); expect(out).toContain('"userProvidedHeader":"JSON HEADER"'); expect(out).toContain('"files":{"a.txt":"x"}'); });website/client/src/de/guide/command-line-options.md (1)
17-18: JSON aufgenommen – add example and clarify parsable-style effect
- Add a short example showing JSON usage in the Examples section for symmetry: repomix -o my-output.json --style json.
- Optionally note that --parsable-style has no effect for json (output is always valid JSON), to align with README.
website/client/src/hi/guide/usage.md (1)
50-52: Mention default JSON output filenameAdd a brief note so users know the default file when style=json.
# JSON फॉर्मेट repomix --style json + +# डिफ़ॉल्ट आउटपुट फ़ाइल: repomix-output.jsonsrc/cli/cliRun.ts (1)
100-101: Clarify default output path depends on --style.The message still hardcodes repomix-output.xml. Suggest documenting style-based defaults.
- .option('-o, --output <file>', 'Output file path (default: repomix-output.xml, use "-" for stdout)') + .option( + '-o, --output <file>', + 'Output file path (default depends on --style: xml→repomix-output.xml, markdown→repomix-output.md, json→repomix-output.json, plain→repomix-output.txt; use "-" for stdout)', + )tests/integration-tests/packager.test.ts (1)
220-231: Make userProvidedHeader assertion optional.userProvidedHeader emits only when headerText is set. Current test assumes it always exists and may become flaky.
- expect(jsonOutput.userProvidedHeader).toBeDefined(); + // userProvidedHeader is optional; assert type only if present + if ('userProvidedHeader' in jsonOutput) { + expect(typeof jsonOutput.userProvidedHeader).toBe('string'); + }tests/core/output/outputStyles/jsonStyle.test.ts (1)
127-145: Add coverage for gitDiffs/gitLogs/instruction (optional).Consider a test enabling includeDiffs/includeLogs and setting instructionFilePath to verify those JSON fields.
src/core/output/outputGenerate.ts (1)
46-57: Coalesce possibly-undefined flags to booleans in RenderContext.git/file flags may be undefined; RenderContext types are boolean. Coalesce to avoid type drift and subtle truthiness bugs.
- fileSummaryEnabled: outputGeneratorContext.config.output.fileSummary, - directoryStructureEnabled: outputGeneratorContext.config.output.directoryStructure, - filesEnabled: outputGeneratorContext.config.output.files, - escapeFileContent: outputGeneratorContext.config.output.parsableStyle, + fileSummaryEnabled: Boolean(outputGeneratorContext.config.output.fileSummary), + directoryStructureEnabled: Boolean(outputGeneratorContext.config.output.directoryStructure), + filesEnabled: Boolean(outputGeneratorContext.config.output.files), + escapeFileContent: Boolean(outputGeneratorContext.config.output.parsableStyle), markdownCodeBlockDelimiter: calculateMarkdownDelimiter(outputGeneratorContext.processedFiles), - gitDiffEnabled: outputGeneratorContext.config.output.git?.includeDiffs, + gitDiffEnabled: Boolean(outputGeneratorContext.config.output.git?.includeDiffs), gitDiffWorkTree: outputGeneratorContext.gitDiffResult?.workTreeDiffContent, gitDiffStaged: outputGeneratorContext.gitDiffResult?.stagedDiffContent, - gitLogEnabled: outputGeneratorContext.config.output.git?.includeLogs, + gitLogEnabled: Boolean(outputGeneratorContext.config.output.git?.includeLogs), gitLogContent: outputGeneratorContext.gitLogResult?.logContent, gitLogCommits: outputGeneratorContext.gitLogResult?.commits,
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (85)
-
.gitignore(1 hunks) -
README.md(5 hunks) -
src/cli/actions/initAction.ts(1 hunks) -
src/cli/cliRun.ts(1 hunks) -
src/config/configSchema.ts(1 hunks) -
src/core/output/outputGenerate.ts(4 hunks) -
tests/core/output/diffsInOutput.test.ts(2 hunks) -
tests/core/output/outputGenerate.test.ts(1 hunks) -
tests/core/output/outputGenerateDiffs.test.ts(1 hunks) -
tests/core/output/outputStyles/jsonStyle.test.ts(1 hunks) -
tests/integration-tests/packager.test.ts(2 hunks) -
website/client/src/de/guide/command-line-options.md(1 hunks) -
website/client/src/de/guide/configuration.md(1 hunks) -
website/client/src/de/guide/github-actions.md(2 hunks) -
website/client/src/de/guide/output.md(3 hunks) -
website/client/src/de/guide/usage.md(1 hunks) -
website/client/src/de/index.md(1 hunks) -
website/client/src/en/guide/command-line-options.md(2 hunks) -
website/client/src/en/guide/configuration.md(2 hunks) -
website/client/src/en/guide/github-actions.md(2 hunks) -
website/client/src/en/guide/output.md(4 hunks) -
website/client/src/en/guide/usage.md(1 hunks) -
website/client/src/en/index.md(1 hunks) -
website/client/src/es/guide/command-line-options.md(1 hunks) -
website/client/src/es/guide/configuration.md(1 hunks) -
website/client/src/es/guide/github-actions.md(2 hunks) -
website/client/src/es/guide/output.md(3 hunks) -
website/client/src/es/guide/usage.md(1 hunks) -
website/client/src/es/index.md(1 hunks) -
website/client/src/fr/guide/command-line-options.md(1 hunks) -
website/client/src/fr/guide/configuration.md(1 hunks) -
website/client/src/fr/guide/github-actions.md(2 hunks) -
website/client/src/fr/guide/output.md(3 hunks) -
website/client/src/fr/guide/usage.md(1 hunks) -
website/client/src/fr/index.md(1 hunks) -
website/client/src/hi/guide/command-line-options.md(1 hunks) -
website/client/src/hi/guide/configuration.md(1 hunks) -
website/client/src/hi/guide/github-actions.md(1 hunks) -
website/client/src/hi/guide/output.md(3 hunks) -
website/client/src/hi/guide/usage.md(1 hunks) -
website/client/src/hi/index.md(1 hunks) -
website/client/src/id/guide/command-line-options.md(1 hunks) -
website/client/src/id/guide/configuration.md(1 hunks) -
website/client/src/id/guide/github-actions.md(2 hunks) -
website/client/src/id/guide/output.md(3 hunks) -
website/client/src/id/guide/usage.md(1 hunks) -
website/client/src/id/index.md(1 hunks) -
website/client/src/ja/guide/command-line-options.md(1 hunks) -
website/client/src/ja/guide/configuration.md(1 hunks) -
website/client/src/ja/guide/github-actions.md(2 hunks) -
website/client/src/ja/guide/output.md(3 hunks) -
website/client/src/ja/guide/usage.md(1 hunks) -
website/client/src/ja/index.md(2 hunks) -
website/client/src/ko/guide/command-line-options.md(1 hunks) -
website/client/src/ko/guide/configuration.md(1 hunks) -
website/client/src/ko/guide/github-actions.md(2 hunks) -
website/client/src/ko/guide/output.md(3 hunks) -
website/client/src/ko/guide/usage.md(1 hunks) -
website/client/src/ko/index.md(1 hunks) -
website/client/src/pt-br/guide/command-line-options.md(1 hunks) -
website/client/src/pt-br/guide/configuration.md(1 hunks) -
website/client/src/pt-br/guide/github-actions.md(2 hunks) -
website/client/src/pt-br/guide/output.md(3 hunks) -
website/client/src/pt-br/guide/usage.md(1 hunks) -
website/client/src/pt-br/index.md(1 hunks) -
website/client/src/public/schemas/1.4.2/schema.json(1 hunks) -
website/client/src/public/schemas/latest/schema.json(1 hunks) -
website/client/src/vi/guide/command-line-options.md(1 hunks) -
website/client/src/vi/guide/configuration.md(1 hunks) -
website/client/src/vi/guide/github-actions.md(2 hunks) -
website/client/src/vi/guide/output.md(2 hunks) -
website/client/src/vi/guide/usage.md(1 hunks) -
website/client/src/vi/index.md(1 hunks) -
website/client/src/zh-cn/guide/command-line-options.md(1 hunks) -
website/client/src/zh-cn/guide/configuration.md(1 hunks) -
website/client/src/zh-cn/guide/github-actions.md(2 hunks) -
website/client/src/zh-cn/guide/output.md(3 hunks) -
website/client/src/zh-cn/guide/usage.md(1 hunks) -
website/client/src/zh-cn/index.md(1 hunks) -
website/client/src/zh-tw/guide/command-line-options.md(1 hunks) -
website/client/src/zh-tw/guide/configuration.md(1 hunks) -
website/client/src/zh-tw/guide/github-actions.md(2 hunks) -
website/client/src/zh-tw/guide/output.md(3 hunks) -
website/client/src/zh-tw/guide/usage.md(1 hunks) -
website/client/src/zh-tw/index.md(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
tests/core/output/outputStyles/jsonStyle.test.ts (4)
tests/testing/testUtils.ts (1)
createMockConfig(15-45)src/config/configSchema.ts (1)
RepomixConfigMerged(165-165)src/core/file/fileTypes.ts (1)
ProcessedFile(6-9)src/core/output/outputGenerate.ts (1)
generateOutput(223-264)
src/core/output/outputGenerate.ts (2)
src/core/output/outputGeneratorTypes.ts (1)
RenderContext(16-37)src/shared/errorHandle.ts (1)
RepomixError(5-10)
🪛 markdownlint-cli2 (0.17.2)
website/client/src/hi/guide/output.md
118-118: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Cloudflare Pages
🔇 Additional comments (54)
website/client/src/id/index.md (2)
191-193: JSON format usage added: LGTMCommand and ordering (xml, markdown, json, plain) look consistent with the repo-wide convention.
191-193: AI summary mismatchThe AI summary mentions a Hindi header “# JSON फॉर्मेट,” but this file correctly uses Indonesian within a bash code block comments. No action needed in code; just noting the inconsistency.
website/client/src/ko/guide/usage.md (1)
166-170: JSON 섹션 추가 LGTM; 형식 순서도 일관적입니다.XML → Markdown → JSON → 일반 텍스트 순서 유지되어 다른 언어 문서와도 정렬됩니다.
혹시 다른 언어 페이지에서도 동일한 순서와 제목 표기가 유지되는지 한번 더 확인 부탁드립니다.
website/client/src/pt-br/guide/github-actions.md (1)
78-78: ```shell
#!/bin/bash
set -euo pipefailcommand -v rg >/dev/null 2>&1 || { echo "rg (ripgrep) not found"; exit 0; }
echo "1) All occurrences of the token 'style' (with context):"
rg -n --hidden --no-ignore -S -C3 '\bstyle\b' || trueecho -e "\n2) Occurrences of CLI flag '--style' (with context):"
rg -n --hidden --no-ignore -S -C3 '--style\b' || trueecho -e "\n3) Enum-style lines that mention xml/markdown/json/plain:"
rg -n --hidden --no-ignore -S -C5 'enum\s*:\s*[.(xml|markdown|json|plain).' || trueecho -e "\n4) YAML files that define inputs and any that contain 'style':"
rg -n --hidden --no-ignore -S -C3 'inputs\s*:' -g '/*.yml' -g '/.yaml' || true
rg -n --hidden --no-ignore -S -C3 '\bstyle\b' -g '**/.yml' -g '**/*.yaml' || trueecho -e "\n5) List .github/actions directory (if present):"
ls -la .github/actions 2>/dev/null || echo ".github/actions not found or empty"echo -e "\n6) Show any action.yml/action.yaml files that contain 'style':"
for f in$(rg -n --hidden --no-ignore --files | rg -e 'action.ya?ml$ ' -e '.ya?ml$' || true); do
if rg -n --hidden --no-ignore -S '\bstyle\b' "$f" >/dev/null 2>&1; then
echo -e "\n--- $f (contains 'style') ---"
sed -n '1,240p' "$f" || true
fi
done</blockquote></details> <details> <summary>.gitignore (1)</summary><blockquote> `29-29`: **Add repomix-output.json to ignore — LGTM** Consistent with the new JSON output style and default file mapping. No further action. </blockquote></details> <details> <summary>website/client/src/fr/guide/usage.md (1)</summary><blockquote> `172-176`: **JSON section added — LGTM** The new JSON format block is clear and matches other format sections. </blockquote></details> <details> <summary>website/client/src/ko/guide/command-line-options.md (1)</summary><blockquote> `17-18`: **CLI `--style` includes json — LGTM** Matches the new output style support and keeps default as xml. </blockquote></details> <details> <summary>website/client/src/zh-tw/guide/command-line-options.md (1)</summary><blockquote> `17-18`: **CLI `--style` 支援 json — LGTM** 與新樣式相符,預設仍為 xml。 </blockquote></details> <details> <summary>website/client/src/de/guide/configuration.md (1)</summary><blockquote> `24-24`: **Nice: output.style now lists json.** Change aligns with code and schema updates. </blockquote></details> <details> <summary>website/client/src/vi/index.md (1)</summary><blockquote> `191-193`: **LGTM: JSON format entry added in correct order.** Placement between markdown and plain matches the repo-wide order. </blockquote></details> <details> <summary>website/client/src/ko/index.md (1)</summary><blockquote> `191-193`: **LGTM: JSON 형식 사용 예 추가 OK.** 형식 순서도 일관적입니다. </blockquote></details> <details> <summary>website/client/src/id/guide/usage.md (1)</summary><blockquote> `181-185`: **LGTM: JSON style documented.** Order and example look good. </blockquote></details> <details> <summary>website/client/src/es/guide/configuration.md (1)</summary><blockquote> `24-24`: **LGTM: Añadir 'json' a output.style.** La fila refleja correctamente el nuevo valor permitido. </blockquote></details> <details> <summary>website/client/src/pt-br/guide/usage.md (1)</summary><blockquote> `166-170`: **LGTM: Bloco de uso para JSON adicionado.** Ordem consistente com o restante da documentação. </blockquote></details> <details> <summary>website/client/src/ja/guide/configuration.md (1)</summary><blockquote> `24-24`: **LGTM: output.style に json を追加。** 許可値の更新は適切です。 </blockquote></details> <details> <summary>website/client/src/zh-tw/guide/configuration.md (1)</summary><blockquote> `24-24`: **LGTM: output.style 行已加入 json。** 描述與功能一致。 </blockquote></details> <details> <summary>website/client/src/en/guide/command-line-options.md (1)</summary><blockquote> `66-66`: **JSON example looks good.** </blockquote></details> <details> <summary>website/client/src/en/index.md (1)</summary><blockquote> `191-193`: **Nice addition of JSON format example.** </blockquote></details> <details> <summary>website/client/src/es/guide/usage.md (1)</summary><blockquote> `166-170`: **JSON usage block reads clearly and matches other locales.** </blockquote></details> <details> <summary>website/client/src/vi/guide/usage.md (1)</summary><blockquote> `112-114`: **JSON example added correctly.** </blockquote></details> <details> <summary>website/client/src/fr/index.md (1)</summary><blockquote> `186-188`: **JSON format addition is correct and consistent.** </blockquote></details> <details> <summary>website/client/src/ko/guide/github-actions.md (2)</summary><blockquote> `28-35`: **Good JSON-format Action example.** --- `78-79`: **Table update to include json looks correct.** </blockquote></details> <details> <summary>website/client/src/en/guide/configuration.md (1)</summary><blockquote> `24-26`: **Style row update looks good; consider clarifying parsableStyle applies to JSON too.** Please confirm whether `output.parsableStyle` affects JSON output (escapes within string fields vs structural JSON). If yes, add a brief note here. </blockquote></details> <details> <summary>website/client/src/public/schemas/1.4.2/schema.json (1)</summary><blockquote> `28-29`: **Enum updated with "json"—looks correct.** </blockquote></details> <details> <summary>website/client/src/en/guide/github-actions.md (1)</summary><blockquote> `79-79`: **Docs correctly list json as a supported style.** Looks consistent with the new CLI and schema updates. </blockquote></details> <details> <summary>website/client/src/vi/guide/command-line-options.md (1)</summary><blockquote> `17-17`: **VI docs updated to include json — LGTM.** Terminology and default note are correct. </blockquote></details> <details> <summary>website/client/src/zh-tw/guide/github-actions.md (2)</summary><blockquote> `28-34`: **JSON example block reads well.** Matches the action’s inputs and the new default filename convention. --- `79-79`: **Style row includes json — good.** Aligned with other locales. </blockquote></details> <details> <summary>website/client/src/fr/guide/command-line-options.md (1)</summary><blockquote> `17-17`: **Ajout de “json” correct.** Formulation et valeur par défaut conformes. </blockquote></details> <details> <summary>website/client/src/zh-tw/guide/usage.md (1)</summary><blockquote> `166-170`: **JSON usage snippet added — LGTM.** Consistent with other format sections. </blockquote></details> <details> <summary>website/client/src/zh-cn/guide/command-line-options.md (1)</summary><blockquote> `17-17`: **样式选项新增 json — 正确。** 与 CLI 和配置模式一致。 </blockquote></details> <details> <summary>website/client/src/public/schemas/latest/schema.json (1)</summary><blockquote> `24-31`: **Schema enum updated to include "json" — looks good.** No additional schema changes needed for this addition. </blockquote></details> <details> <summary>website/client/src/zh-tw/index.md (1)</summary><blockquote> `191-193`: **Added JSON format snippet — LGTM.** Consistent with other localized index pages. </blockquote></details> <details> <summary>website/client/src/zh-cn/guide/github-actions.md (1)</summary><blockquote> `78-78`: **LGTM: style now lists json.** Consistent with CLI/config updates. </blockquote></details> <details> <summary>website/client/src/ja/index.md (1)</summary><blockquote> `181-181`: **LGTM: 出力フォーマットの一覧に json を追加。** </blockquote></details> <details> <summary>src/config/configSchema.ts (2)</summary><blockquote> `5-5`: **LGTM: Add 'json' to the output style enum.** --- `13-14`: **Ignore — output.filePath is already derived from style in configLoad.ts** - src/config/configLoad.ts (lines 113–118) sets baseConfig.output.filePath = defaultFilePathMap[style] when both CLI and file configs omit filePath, so `--style json` will default to repomix-output.json. - defaultFilePathMap is defined in src/config/configSchema.ts. Add a test to assert `--style json` yields 'repomix-output.json' when filePath is omitted. > Likely an incorrect or invalid review comment. </blockquote></details> <details> <summary>website/client/src/ja/guide/github-actions.md (1)</summary><blockquote> `79-79`: **LGTM: style includes json.** </blockquote></details> <details> <summary>website/client/src/vi/guide/github-actions.md (1)</summary><blockquote> `63-63`: **LGTM: style option now documents json.** </blockquote></details> <details> <summary>website/client/src/es/guide/github-actions.md (1)</summary><blockquote> `79-79`: **LGTM: style includes json.** </blockquote></details> <details> <summary>website/client/src/es/index.md (1)</summary><blockquote> `191-193`: **LGTM: Añadido ejemplo de uso para JSON.** </blockquote></details> <details> <summary>website/client/src/id/guide/github-actions.md (1)</summary><blockquote> `47-47`: **LGTM: Tambahkan json ke opsi style.** </blockquote></details> <details> <summary>README.md (1)</summary><blockquote> `481-509`: **JSON section looks good; clarify diffs/logs behavior in JSON** If --include-diffs/--include-logs produce JSON fields, document their shape (e.g., gitDiffWorkTree, gitDiffStaged, gitLogs). If they’re intentionally omitted in JSON, say so explicitly to avoid confusion. </blockquote></details> <details> <summary>tests/core/output/outputGenerateDiffs.test.ts (1)</summary><blockquote> `64-64`: **Consider a JSON diffs-path test or explicit omission** If JSON includes diffs/logs, add a test mirroring the XML/MD/plain cases to assert the JSON shape. If JSON intentionally omits them, document that and add a test asserting absence. Example (if included): ```ts test('JSON style includes diffs when enabled', async () => { mockConfig.output.style = 'json'; mockDeps.generateParsableJsonOutput.mockImplementation((ctx: RenderContext) => JSON.stringify({ gitDiffWorkTree: ctx.gitDiffWorkTree, files: {} }) ); const output = await generateOutput(rootDirs, mockConfig, mockProcessedFiles, allFilePaths, gitDiffResult, undefined, mockDeps); const parsed = JSON.parse(output); expect(parsed.gitDiffWorkTree).toContain('diff --git'); });src/cli/cliRun.ts (1)
101-101: Help text: include json — good.Listing json alongside xml/markdown/plain is correct.
website/client/src/hi/index.md (1)
191-193: JSON format doc addition looks good.Placement and example align with other locales and the standardized order.
tests/integration-tests/packager.test.ts (1)
71-78: Nice: added end-to-end JSON style case.Covers the new pathway without impacting existing styles.
website/client/src/hi/guide/output.md (2)
69-109: JSON section is clear and consistent.Examples and jq snippets are helpful and match the implemented schema.
215-216: Good guidance note.Calling out JSON for programmatic processing is accurate.
tests/core/output/diffsInOutput.test.ts (2)
126-132: Deps updated to include generateParsableJsonOutput — good.Keeps tests in sync with the new dependency surface.
190-196: Same here: JSON dep wired — good.No behavior change for markdown path.
tests/core/output/outputStyles/jsonStyle.test.ts (1)
1-75: Solid baseline coverage for JSON validity and presence.Good use of minimal config and simple processed files.
src/core/output/outputGenerate.ts (1)
251-259: JSON path ignores parsableStyle — that’s fine; keep switch explicit.Routing json → generateParsableJsonOutput is correct and clear.
Add comprehensive JSON output style with camelCase naming convention: - JSON output generates machine-readable format using JSON.stringify() - Always uses parsable style for valid JSON structure - Parameter names follow camelCase convention (fileSummary, userProvidedHeader, etc.) - Includes CLI option, config schema, and interactive prompt support - Comprehensive test coverage for unit and integration tests - Error handling with clear unsupported style messages This enables easier programmatic consumption of Repomix output for AI systems and automated tools.
- Reorder output formats from xml, markdown, plain, json to xml, markdown, json, plain throughout README.md, CLI help, and schema - Move JSON Format section before Plain Text Format in documentation - Enhance jq command examples with comprehensive JSON manipulation patterns - Change jq examples to use `cat | jq` pipeline format for consistency - Update all references to maintain xml, markdown, json, plain order in: - CLI options help text - Configuration schema enum - GitHub Actions examples - Documentation tables - Fix linting issue with switch case block scoping in integration tests This improves the logical flow by placing JSON (programmatic format) before Plain (simple format) and maintains consistent ordering across all documentation and code.
…l languages - Add JSON format documentation to all 12 languages (en, ja, ko, zh-cn, zh-tw, de, fr, es, pt-br, id, vi, hi) - Update output format order from xml, markdown, plain, json to xml, markdown, json, plain throughout all language versions - Add comprehensive jq command examples with cat | jq pipeline format in all languages - Update configuration documentation to include JSON format option across all languages - Add JSON examples to GitHub Actions workflow documentation in all languages - Update CLI options documentation to include JSON format in all languages - Add JSON usage examples to usage guides in all languages - Update index pages to reflect 4 output formats instead of 3 across all languages - Maintain technical accuracy while providing appropriate translations for each language - Keep code examples and JSON keys consistent across all language versions This provides comprehensive multilingual documentation for the new JSON output format, enabling users worldwide to access detailed information about JSON format benefits, structure, and practical usage examples with jq command-line tool.
fc44423 to
30ae12a
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #837 +/- ##
==========================================
- Coverage 87.29% 87.13% -0.17%
==========================================
Files 113 113
Lines 6660 6723 +63
Branches 1372 1384 +12
==========================================
+ Hits 5814 5858 +44
- Misses 846 865 +19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Fix format order in initAction.ts to match documentation (xml, markdown, json, plain) - Remove JSON from --parsable-style descriptions since parsableStyle doesn't affect JSON output - Refactor brittle fileFormat construction in generateParsableJsonOutput to use dedicated function - Improve maintainability by creating generateSummaryFileFormatJson() function Addresses feedback from automated code reviewers on consistency and code quality.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This is a comprehensive and well-executed pull request that introduces JSON output format support. The implementation is clean, particularly the refactoring in outputGenerate.ts, and it's great to see thorough test coverage and extensive documentation updates across all supported languages. I've identified a few minor inconsistencies in the documentation that could be improved for clarity and consistency. Overall, this is a high-quality contribution that significantly enhances the tool's capabilities.
…down rendering Fixed two major issues in the multilingual output format documentation: 1. Enhanced JSON format description in generateSummaryFileFormatJson() to include all possible JSON output fields (custom header, repository instruction, git diffs, and git logs) for comprehensive documentation coverage. 2. Reordered documentation sections across all 12 language versions to follow logical structure: - All format descriptions first (XML, Markdown, JSON, Plain Text) - Usage with AI Models after all formats - Customization as final section 3. Fixed Markdown code block rendering issues by properly escaping nested code blocks using quadruple backticks (````markdown) to prevent rendering conflicts. This improves user experience by providing logical information flow where readers learn about all output formats before understanding usage patterns and customization options. Addresses PR review feedback from automated code reviewers regarding incomplete JSON documentation and inconsistent section ordering.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This is a comprehensive and well-executed pull request that introduces JSON output format support. The implementation is solid, with good test coverage and extensive documentation updates across all supported languages. I've found a couple of minor inconsistencies in the documentation for the GitHub Action and a small suggestion for code readability in the JSON generation logic. Overall, great work on this feature!
This PR introduces comprehensive JSON output format support to Repomix, providing users with a structured, programmatically-friendly output option alongside the existing XML, Markdown, and Plain text formats.
Summary
repomix --style jsoncommand supportcat | jqpipeline formatKey Features
JSON Output Structure
The JSON format uses camelCase properties and provides a hierarchical structure:
{ "fileSummary": { /* metadata and usage guidelines */ }, "userProvidedHeader": "Custom header if specified", "directoryStructure": "src/\n cli/\n ...", "files": { "src/index.js": "// File contents here" }, "instruction": "Custom instructions if specified" }Benefits
jq Examples
Comprehensive command examples for practical JSON manipulation:
Technical Changes
Core Implementation
src/core/output/outputGenerate.tstests/core/output/outputStyles/jsonStyle.test.tsDocumentation Updates
Format Order Consistency
Standardized format order throughout all documentation:
Files Changed
Test Coverage
This comprehensive update provides users with a powerful new output format while maintaining backward compatibility and enhancing the overall documentation experience across all supported languages.
Checklist
npm run testnpm run lint