From 777785be1b5163c176388ca74d6d0e7151dd87ea Mon Sep 17 00:00:00 2001 From: Jason Son Date: Sun, 3 Nov 2024 16:00:13 -0800 Subject: [PATCH 01/12] feat: Add clipboard output functionality flag --- package-lock.json | 229 +++++++++++++++++- package.json | 1 + src/cli/cliRun.ts | 1 + src/config/configTypes.ts | 1 + src/core/packager.ts | 8 + .../outputStyles/clipboardStyle.test.ts | 0 6 files changed, 233 insertions(+), 7 deletions(-) create mode 100644 tests/core/output/outputStyles/clipboardStyle.test.ts diff --git a/package-lock.json b/package-lock.json index 6c75230..03522ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "@secretlint/core": "^9.0.0", "@secretlint/secretlint-rule-preset-recommend": "^9.0.0", "cli-spinners": "^2.9.2", + "clipboardy": "^4.0.0", "commander": "^12.1.0", "globby": "^14.0.2", "handlebars": "^4.7.8", @@ -1874,6 +1875,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/clipboardy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-4.0.0.tgz", + "integrity": "sha512-5mOlNS0mhX0707P2I0aZ2V/cmHUEO/fL7VFLqszkhUsxt7RwnmrInf/eEQKlf5GzvYeHIjT+Ov1HRfNmymlG0w==", + "license": "MIT", + "dependencies": { + "execa": "^8.0.1", + "is-wsl": "^3.1.0", + "is64bit": "^2.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1905,7 +1923,6 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -2050,6 +2067,29 @@ "@types/estree": "^1.0.0" } }, + "node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, "node_modules/expect-type": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.1.0.tgz", @@ -2160,6 +2200,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/glob": { "version": "10.4.5", "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", @@ -2247,6 +2299,15 @@ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, + "node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=16.17.0" + } + }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -2282,6 +2343,21 @@ "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, + "node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -2310,6 +2386,24 @@ "node": ">=0.10.0" } }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "license": "MIT", + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -2318,11 +2412,52 @@ "node": ">=0.12.0" } }, + "node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-wsl": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", + "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", + "license": "MIT", + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is64bit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is64bit/-/is64bit-2.0.0.tgz", + "integrity": "sha512-jv+8jaWCl0g2lSBkNSVXdzfBA0npK1HGC2KtWM9FumFRoGS94g3NbCCLVnCYHLjp4GrW2KZeeSTMo5ddtznmGw==", + "license": "MIT", + "dependencies": { + "system-architecture": "^0.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", @@ -2597,6 +2732,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "license": "MIT" + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -2618,6 +2759,18 @@ "node": ">=8.6" } }, + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/mimic-function": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", @@ -2706,6 +2859,48 @@ "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "license": "MIT", + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "license": "MIT", + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-map": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.2.tgz", @@ -2759,7 +2954,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, "engines": { "node": ">=8" } @@ -3192,7 +3386,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -3204,7 +3397,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "engines": { "node": ">=8" } @@ -3444,6 +3636,18 @@ "node": ">=10" } }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/structured-source": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/structured-source/-/structured-source-4.0.0.tgz", @@ -3477,6 +3681,18 @@ "node": ">=8" } }, + "node_modules/system-architecture": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/system-architecture/-/system-architecture-0.1.0.tgz", + "integrity": "sha512-ulAk51I9UVUyJgxlv9M6lFot2WP3e7t8Kz9+IS6D4rVba1tR9kON+Ey69f+1R4Q8cd45Lod6a4IcJIxnzGc/zA==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/table": { "version": "6.8.2", "resolved": "https://registry.npmjs.org/table/-/table-6.8.2.tgz", @@ -3935,7 +4151,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "dependencies": { "isexe": "^2.0.0" }, diff --git a/package.json b/package.json index e3d7646..33d8bc5 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "@secretlint/core": "^9.0.0", "@secretlint/secretlint-rule-preset-recommend": "^9.0.0", "cli-spinners": "^2.9.2", + "clipboardy": "^4.0.0", "commander": "^12.1.0", "globby": "^14.0.2", "handlebars": "^4.7.8", diff --git a/src/cli/cliRun.ts b/src/cli/cliRun.ts index 85898a7..dee3f43 100644 --- a/src/cli/cliRun.ts +++ b/src/cli/cliRun.ts @@ -37,6 +37,7 @@ export async function run() { .option('--include ', 'list of include patterns (comma-separated)') .option('-i, --ignore ', 'additional ignore patterns (comma-separated)') .option('-c, --config ', 'path to a custom config file') + .option('-cb, --copy', 'copy output to clipboard after execution') .option('--top-files-len ', 'specify the number of top files to display', Number.parseInt) .option('--output-show-line-numbers', 'add line numbers to each line in the output') .option('--style ', 'specify the output style (plain, xml, markdown)') diff --git a/src/config/configTypes.ts b/src/config/configTypes.ts index 7289163..5128dd7 100644 --- a/src/config/configTypes.ts +++ b/src/config/configTypes.ts @@ -10,6 +10,7 @@ interface RepomixConfigBase { removeEmptyLines?: boolean; topFilesLength?: number; showLineNumbers?: boolean; + copyToClipboard?: boolean; }; include?: string[]; ignore?: { diff --git a/src/core/packager.ts b/src/core/packager.ts index 7fe070a..58dee5b 100644 --- a/src/core/packager.ts +++ b/src/core/packager.ts @@ -13,6 +13,7 @@ import { searchFiles as defaultSearchFiles } from './file/fileSearch.js'; import { generateOutput as defaultGenerateOutput } from './output/outputGenerate.js'; import { type SuspiciousFileResult, runSecurityCheck as defaultRunSecurityCheck } from './security/securityCheck.js'; import { TokenCounter } from './tokenCount/tokenCount.js'; +import clipboard from 'clipboardy'; export interface PackDependencies { searchFiles: typeof defaultSearchFiles; @@ -80,6 +81,13 @@ export const pack = async ( logger.trace(`Writing output to: ${outputPath}`); await fs.writeFile(outputPath, output); + if (config.output.copyToClipboard) { + // Additionally copy to clipboard if flag is raised + progressCallback('Copying to clipboard...'); + logger.trace(`Copying output to clipboard`); + await clipboard.write(output); + } + // Setup token counter const tokenCounter = new TokenCounter(); diff --git a/tests/core/output/outputStyles/clipboardStyle.test.ts b/tests/core/output/outputStyles/clipboardStyle.test.ts new file mode 100644 index 0000000..e69de29 From f5ca623783e376008120d21d54dc78353689c626 Mon Sep 17 00:00:00 2001 From: Jason Son Date: Sun, 3 Nov 2024 16:26:31 -0800 Subject: [PATCH 02/12] clean: linted + tested --- src/core/packager.ts | 4 ++-- .../output/outputStyles/clipboardStyle.test.ts | 0 tests/core/packager.test.ts | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) delete mode 100644 tests/core/output/outputStyles/clipboardStyle.test.ts diff --git a/src/core/packager.ts b/src/core/packager.ts index 58dee5b..eecc236 100644 --- a/src/core/packager.ts +++ b/src/core/packager.ts @@ -1,6 +1,7 @@ import fs from 'node:fs/promises'; import path from 'node:path'; import { setTimeout } from 'node:timers/promises'; +import clipboard from 'clipboardy'; import pMap from 'p-map'; import pc from 'picocolors'; import type { RepomixConfigMerged } from '../config/configTypes.js'; @@ -13,7 +14,6 @@ import { searchFiles as defaultSearchFiles } from './file/fileSearch.js'; import { generateOutput as defaultGenerateOutput } from './output/outputGenerate.js'; import { type SuspiciousFileResult, runSecurityCheck as defaultRunSecurityCheck } from './security/securityCheck.js'; import { TokenCounter } from './tokenCount/tokenCount.js'; -import clipboard from 'clipboardy'; export interface PackDependencies { searchFiles: typeof defaultSearchFiles; @@ -84,7 +84,7 @@ export const pack = async ( if (config.output.copyToClipboard) { // Additionally copy to clipboard if flag is raised progressCallback('Copying to clipboard...'); - logger.trace(`Copying output to clipboard`); + logger.trace('Copying output to clipboard'); await clipboard.write(output); } diff --git a/tests/core/output/outputStyles/clipboardStyle.test.ts b/tests/core/output/outputStyles/clipboardStyle.test.ts deleted file mode 100644 index e69de29..0000000 diff --git a/tests/core/packager.test.ts b/tests/core/packager.test.ts index 702e7f7..3c06cea 100644 --- a/tests/core/packager.test.ts +++ b/tests/core/packager.test.ts @@ -4,11 +4,17 @@ import { beforeEach, describe, expect, test, vi } from 'vitest'; import { type PackDependencies, pack } from '../../src/core/packager.js'; import { TokenCounter } from '../../src/core/tokenCount/tokenCount.js'; import { createMockConfig } from '../testing/testUtils.js'; +import clipboardy from 'clipboardy'; vi.mock('node:fs/promises'); vi.mock('fs/promises'); vi.mock('../../src/core/security/securityCheck'); vi.mock('../../src/core/tokenCount/tokenCount'); +vi.mock('clipboardy', () => ({ + default: { + write: vi.fn(), + }, +})); describe('packager', () => { let mockDeps: PackDependencies; @@ -165,4 +171,15 @@ describe('packager', () => { expect(result.suspiciousFilesResults).toEqual([suspiciousFile]); expect(result.totalFiles).toBe(2); // All files should still be included in the result }); + + test('pack should copy to clipboard when enabled', async () => { + const mockConfig = createMockConfig({ + output: { + copyToClipboard: true, + }, + }); + + await pack('root', mockConfig, () => { }, mockDeps); + expect(clipboardy.write).toHaveBeenCalled(); + }) }); From 7fbedcaea6a37599d766b8bb32480a03ad5eec07 Mon Sep 17 00:00:00 2001 From: Jason Son Date: Sun, 3 Nov 2024 16:40:01 -0800 Subject: [PATCH 03/12] feat(config): add copyToClipboard to RepoMixConfigDefault interface --- src/config/configTypes.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/config/configTypes.ts b/src/config/configTypes.ts index 5128dd7..8995147 100644 --- a/src/config/configTypes.ts +++ b/src/config/configTypes.ts @@ -33,6 +33,7 @@ export type RepomixConfigDefault = RepomixConfigBase & { removeEmptyLines: boolean; topFilesLength: number; showLineNumbers: boolean; + copyToClipboard?: boolean; }; include: string[]; ignore: { From 64a1871024b65c3de52682dc9c55c644b429a238 Mon Sep 17 00:00:00 2001 From: Jason Son Date: Sun, 3 Nov 2024 16:40:39 -0800 Subject: [PATCH 04/12] refactor(cli): improve clipboard option naming and description --- src/cli/cliRun.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/cliRun.ts b/src/cli/cliRun.ts index dee3f43..f85de9e 100644 --- a/src/cli/cliRun.ts +++ b/src/cli/cliRun.ts @@ -37,7 +37,7 @@ export async function run() { .option('--include ', 'list of include patterns (comma-separated)') .option('-i, --ignore ', 'additional ignore patterns (comma-separated)') .option('-c, --config ', 'path to a custom config file') - .option('-cb, --copy', 'copy output to clipboard after execution') + .option('--clipboard', 'copy generated output to system clipboard') .option('--top-files-len ', 'specify the number of top files to display', Number.parseInt) .option('--output-show-line-numbers', 'add line numbers to each line in the output') .option('--style ', 'specify the output style (plain, xml, markdown)') From 3fed50c52a3ff8fe0e1fd66a0e4ca1a897e81268 Mon Sep 17 00:00:00 2001 From: Jason Son Date: Mon, 4 Nov 2024 11:56:58 -0800 Subject: [PATCH 05/12] docs: add copyToClipboard option to README configuration section --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 25f7ec8..6cbdec0 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![npm](https://img.shields.io/npm/l/repomix.svg?maxAge=1000)](https://github.com/yamadashy/repomix/blob/main/LICENSE) [![node](https://img.shields.io/node/v/repomix.svg?maxAge=1000)](https://www.npmjs.com/package/repomix) -Repomix is a powerful tool that packs your entire repository into a single, AI-friendly file. +Repomix is a powerful tool that packs your entire repository into a single, AI-friendly file. It is perfect for when you need to feed your codebase to Large Language Models (LLMs) or other AI tools like Claude, ChatGPT, and Gemini. ## 📢 Important Notice: Project Renamed to Repomix @@ -32,7 +32,7 @@ npm uninstall -g repopack ``` #### Configuration Files -Your existing configuration files (`repopack.config.json` and `.repopackignore`) will continue to work during the transition period. +Your existing configuration files (`repopack.config.json` and `.repopackignore`) will continue to work during the transition period. `repomix` will automatically detect these files and offer to migrate them to the new format (`repomix.config.json` and `.repomixignore`). #### Timeline @@ -173,7 +173,7 @@ Feel free to join the discussion and share your own experiences! Your insights c ### Output File Format -Repomix generates a single file with clear separators between different parts of your codebase. +Repomix generates a single file with clear separators between different parts of your codebase. To enhance AI comprehension, the output file begins with an AI-oriented explanation, making it easier for AI models to understand the context and structure of the packed repository. #### Plain Text Format (default) @@ -258,7 +258,7 @@ src/ ``` -For those interested in the potential of XML tags in AI contexts: +For those interested in the potential of XML tags in AI contexts: https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/use-xml-tags > When your prompts involve multiple components like context, instructions, and examples, XML tags can be a game-changer. They help Claude parse your prompts more accurately, leading to higher-quality outputs. @@ -314,6 +314,7 @@ This format provides a clean, readable structure that is both human-friendly and - `--style