binary-collections 2.0.11 → 2.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/binaries/binary-executor.cjs +89 -13
  2. package/binaries/clean-nodemodule.cjs +89 -13
  3. package/binaries/clean-nodemodules.cjs +89 -13
  4. package/binaries/dev.cjs +89 -13
  5. package/binaries/empty.cjs +89 -13
  6. package/binaries/git-reduce-size.cjs +89 -13
  7. package/binaries/javakill.cjs +89 -13
  8. package/binaries/kill-process.cjs +89 -13
  9. package/binaries/nodekill.cjs +89 -13
  10. package/binaries/prod.cjs +89 -13
  11. package/binaries/py.cjs +89 -13
  12. package/binaries/rmfind.cjs +89 -13
  13. package/binaries/rmx +15 -1
  14. package/binaries/rmx.cjs +89 -13
  15. package/binaries/rmx.cmd +12 -0
  16. package/binaries/submodule-token.cjs +89 -13
  17. package/binaries/test-cjs +9 -1
  18. package/binaries/test-cjs.cjs +89 -13
  19. package/binaries/test-cjs.cmd +16 -1
  20. package/binaries/test-esm +16 -0
  21. package/binaries/test-esm.cjs +254 -0
  22. package/binaries/test-esm.cmd +23 -0
  23. package/binaries/yarn-clean +1 -1
  24. package/binaries/yarn-clean.cjs +89 -13
  25. package/binaries/yarn-clean.cmd +1 -1
  26. package/binaries/yarn-clean.py +33 -15
  27. package/binaries/yc +131 -0
  28. package/binaries/yc.cjs +254 -0
  29. package/binaries/ycw +256 -0
  30. package/binaries/ycw.cjs +254 -0
  31. package/docs-src/binary-collections.md +34 -0
  32. package/docs-src/changelog.md +26 -0
  33. package/docs-src/clean-github-actions-caches.md +91 -2
  34. package/docs-src/copy-move-file.md +59 -0
  35. package/docs-src/del-gradle.md +17 -0
  36. package/docs-src/del-ps.md +28 -0
  37. package/docs-src/downloader.md +62 -0
  38. package/docs-src/env-helpers.md +29 -0
  39. package/docs-src/find-node-modules.md +17 -0
  40. package/docs-src/git-diff.md +33 -0
  41. package/docs-src/git-fix.md +34 -0
  42. package/docs-src/git-purge.md +17 -0
  43. package/docs-src/git-reduce-size.md +17 -0
  44. package/docs-src/git-undo.md +21 -0
  45. package/docs-src/kill-night-crows.md +26 -0
  46. package/docs-src/node-cache-cleaner.md +182 -0
  47. package/docs-src/node-executor.md +50 -0
  48. package/docs-src/node-package-packer.md +48 -0
  49. package/docs-src/npm-run-series.md +43 -0
  50. package/docs-src/package-resolutions-updater.md +22 -0
  51. package/docs-src/php-cs-fixer-staged.md +19 -0
  52. package/docs-src/print-directory-tree.md +35 -0
  53. package/docs-src/print-tarball-tree.md +55 -0
  54. package/docs-src/py.md +19 -0
  55. package/docs-src/remove-module.md +32 -0
  56. package/docs-src/rmfind-rmx.md +21 -0
  57. package/docs-src/rmpath.md +38 -0
  58. package/docs-src/run-by-checksum.md +87 -0
  59. package/docs-src/submodule-install.md +31 -0
  60. package/docs-src/submodule-remove.md +22 -0
  61. package/docs-src/submodule-token.md +17 -0
  62. package/docs-src/test-runners.md +21 -0
  63. package/docs-src/yarn-install.md +31 -0
  64. package/docs-src/yarn-reinstall.md +27 -0
  65. package/lib/binary-collections/config.cjs +126 -0
  66. package/lib/binary-collections/config.mjs +7 -0
  67. package/lib/binary-collections/executeScript.cjs +19 -0
  68. package/lib/binary-collections/executeScript.d.cts +12 -0
  69. package/lib/binary-collections/executeScript.mjs +6 -0
  70. package/lib/binary-collections/findScript.cjs +309 -0
  71. package/lib/binary-collections/findScript.d.cts +12 -0
  72. package/lib/binary-collections/findScript.mjs +7 -0
  73. package/lib/binary-collections/listScript.cjs +291 -0
  74. package/lib/binary-collections/listScript.d.cts +19 -0
  75. package/lib/binary-collections/listScript.mjs +7 -0
  76. package/lib/binary-collections.cjs +264 -157
  77. package/lib/binary-collections.mjs +26 -286
  78. package/lib/changelog.cjs +9 -14
  79. package/lib/changelog.mjs +2 -2
  80. package/lib/chunk-2MN4VPV2.mjs +246 -0
  81. package/lib/chunk-6C7KTYGZ.mjs +41 -0
  82. package/lib/{chunk-Z6JLYU2J.mjs → chunk-6RK5UCTP.mjs} +7 -12
  83. package/lib/chunk-CD3HF3LK.mjs +190 -0
  84. package/lib/chunk-FLYSZFLW.mjs +61 -0
  85. package/lib/{chunk-N436BNBK.mjs → chunk-GAGABICI.mjs} +19 -13
  86. package/lib/chunk-H44UWUFY.mjs +105 -0
  87. package/lib/chunk-KLKAIFKI.mjs +40 -0
  88. package/lib/chunk-LVSPEFU2.mjs +86 -0
  89. package/lib/{chunk-RWLXRTYP.mjs → chunk-MGPYPKIE.mjs} +2 -2
  90. package/lib/chunk-NGFK3EYW.mjs +28 -0
  91. package/lib/chunk-NQXUYO67.mjs +253 -0
  92. package/lib/chunk-NVEG3LEZ.mjs +143 -0
  93. package/lib/chunk-OBXLTXFJ.mjs +34 -0
  94. package/lib/chunk-OGXVGBRI.mjs +29 -0
  95. package/lib/chunk-OXV52GD5.mjs +62 -0
  96. package/lib/chunk-PXBMHE7O.mjs +35 -0
  97. package/lib/chunk-QD4T255Z.mjs +40 -0
  98. package/lib/chunk-QII2EKCS.mjs +26 -0
  99. package/lib/chunk-R5FJOR63.mjs +47 -0
  100. package/lib/chunk-RDGDLSPD.mjs +76 -0
  101. package/lib/chunk-RDN6HF5Z.mjs +79 -0
  102. package/lib/chunk-RJKTSUAX.mjs +123 -0
  103. package/lib/{chunk-XA3SNBPA.mjs → chunk-TBWXE7ST.mjs} +97 -38
  104. package/lib/chunk-UXCFNAR6.mjs +55 -0
  105. package/lib/{chunk-M3YIYRHT.mjs → chunk-UY5VUEA3.mjs} +1 -1
  106. package/lib/chunk-WSHVPGNM.mjs +44 -0
  107. package/lib/{chunk-66PAU5PS.mjs → chunk-X2B3X7D4.mjs} +10 -6
  108. package/lib/clean-github-actions-caches-cli.cjs +507 -0
  109. package/lib/clean-github-actions-caches-cli.mjs +74 -0
  110. package/lib/clean-github-actions-caches.cjs +246 -106
  111. package/lib/clean-github-actions-caches.d.cts +53 -1
  112. package/lib/clean-github-actions-caches.mjs +5 -130
  113. package/lib/cross-env/command.cjs +63 -0
  114. package/lib/cross-env/command.d.ts +8 -0
  115. package/lib/cross-env/command.js +45 -0
  116. package/lib/{ps/isWin.mjs → cross-env/command.mjs} +4 -5
  117. package/lib/cross-env/index.cjs +178 -0
  118. package/lib/cross-env/index.d.ts +8 -0
  119. package/lib/cross-env/index.js +102 -0
  120. package/lib/cross-env/index.mjs +101 -0
  121. package/lib/cross-env/variable.cjs +60 -0
  122. package/lib/cross-env/variable.d.ts +7 -0
  123. package/lib/cross-env/variable.js +59 -0
  124. package/lib/cross-env/variable.mjs +9 -0
  125. package/lib/del-gradle.cjs +8 -13
  126. package/lib/del-gradle.js +8 -8
  127. package/lib/del-gradle.mjs +1 -1
  128. package/lib/del-node-modules.cjs +185 -3
  129. package/lib/del-node-modules.js +25 -25
  130. package/lib/del-node-modules.mjs +6 -3
  131. package/lib/{del-ps.cjs → del-ps-cli.cjs} +38 -43
  132. package/lib/del-ps-cli.d.mts +1 -0
  133. package/lib/del-ps-cli.mjs +44 -0
  134. package/lib/del-yarn-caches.cjs +8 -13
  135. package/lib/del-yarn-caches.js +2 -2
  136. package/lib/del-yarn-caches.mjs +1 -1
  137. package/lib/downloader-cli.cjs +256 -0
  138. package/lib/downloader-cli.d.cts +2 -0
  139. package/lib/downloader-cli.mjs +90 -0
  140. package/lib/file/copy-cli.cjs +273 -0
  141. package/lib/file/copy-cli.d.mts +1 -0
  142. package/lib/file/copy-cli.mjs +59 -0
  143. package/lib/file/copy.cjs +56 -0
  144. package/lib/file/copy.d.mts +1 -0
  145. package/lib/file/copy.mjs +8 -0
  146. package/lib/file/move-cli.cjs +272 -0
  147. package/lib/file/move-cli.d.mts +1 -0
  148. package/lib/file/move-cli.mjs +59 -0
  149. package/lib/file/move.cjs +55 -0
  150. package/lib/file/move.d.mts +1 -0
  151. package/lib/file/move.mjs +8 -0
  152. package/lib/find-node-modules-cli.cjs +1 -1
  153. package/lib/find-node-modules-cli.js +1 -1
  154. package/lib/find-node-modules-cli.mjs +1 -1
  155. package/lib/find-node-modules.cjs +1 -1
  156. package/lib/find-node-modules.mjs +1 -1
  157. package/lib/free-chatgpt.cjs +27 -26
  158. package/lib/free-chatgpt.js +10 -10
  159. package/lib/free-chatgpt.mjs +2 -2
  160. package/lib/git/user-config.cjs +9 -14
  161. package/lib/git/user-config.mjs +2 -2
  162. package/lib/git-diff-cli.cjs +273 -66
  163. package/lib/git-diff-cli.mjs +5 -4
  164. package/lib/git-diff.cjs +273 -66
  165. package/lib/git-diff.d.ts +2 -1
  166. package/lib/git-diff.js +153 -39
  167. package/lib/git-diff.mjs +5 -4
  168. package/lib/git-fix.cjs +9 -14
  169. package/lib/git-fix.mjs +2 -2
  170. package/lib/git-purge.cjs +9 -14
  171. package/lib/git-purge.mjs +2 -2
  172. package/lib/index.cjs +1 -1
  173. package/lib/index.d.ts +1 -1
  174. package/lib/index.mjs +1 -1
  175. package/lib/kill-night-crows.cjs +7 -7
  176. package/lib/kill-night-crows.mjs +7 -7
  177. package/lib/node-cache-cleaner/npm.cjs +65 -0
  178. package/lib/node-cache-cleaner/npm.d.ts +2 -0
  179. package/lib/node-cache-cleaner/npm.js +41 -0
  180. package/lib/node-cache-cleaner/npm.mjs +10 -0
  181. package/lib/node-cache-cleaner/npx.cjs +89 -0
  182. package/lib/node-cache-cleaner/npx.d.ts +4 -0
  183. package/lib/node-cache-cleaner/npx.js +82 -0
  184. package/lib/{ps/index.d.mjs → node-cache-cleaner/npx.mjs} +6 -5
  185. package/lib/node-cache-cleaner/yarn.cjs +73 -0
  186. package/lib/node-cache-cleaner/yarn.d.ts +2 -0
  187. package/lib/node-cache-cleaner/yarn.js +62 -0
  188. package/lib/node-cache-cleaner/yarn.mjs +10 -0
  189. package/lib/node-cache-cleaner-cli.cjs +365 -0
  190. package/lib/node-cache-cleaner-cli.d.ts +2 -0
  191. package/lib/node-cache-cleaner-cli.js +57 -0
  192. package/lib/node-cache-cleaner-cli.mjs +60 -0
  193. package/lib/node-executor.cjs +272 -0
  194. package/lib/node-executor.d.cts +2 -0
  195. package/lib/node-executor.mjs +106 -0
  196. package/lib/node-package-packer/build-readme.cjs +150 -0
  197. package/lib/node-package-packer/build-readme.d.mts +10 -0
  198. package/lib/node-package-packer/build-readme.mjs +10 -0
  199. package/lib/node-package-packer/build-tarball.cjs +495 -0
  200. package/lib/node-package-packer/build-tarball.d.mts +33 -0
  201. package/lib/node-package-packer/build-tarball.mjs +175 -0
  202. package/lib/node-package-packer-cli.cjs +525 -0
  203. package/lib/node-package-packer-cli.d.mts +1 -0
  204. package/lib/node-package-packer-cli.mjs +34 -0
  205. package/lib/npm-run-series.cjs +28 -40
  206. package/lib/npm-run-series.mjs +21 -7
  207. package/lib/package-resolutions-updater-cli.cjs +255 -173
  208. package/lib/package-resolutions-updater-cli.mjs +19 -40
  209. package/lib/package-resolutions-updater.cjs +244 -141
  210. package/lib/package-resolutions-updater.d.mts +54 -1
  211. package/lib/package-resolutions-updater.mjs +8 -5
  212. package/lib/php-cs-fixer-staged.cjs +1 -1
  213. package/lib/php-cs-fixer-staged.mjs +1 -1
  214. package/lib/print-directory-tree.cjs +18 -20
  215. package/lib/print-directory-tree.mjs +11 -8
  216. package/lib/print-tarball-tree.cjs +262 -0
  217. package/lib/print-tarball-tree.d.mts +1 -0
  218. package/lib/print-tarball-tree.mjs +68 -0
  219. package/lib/ps/connected-domain.js +10 -10
  220. package/lib/ps/index.cjs +11 -11
  221. package/lib/ps/index.mjs +180 -174
  222. package/lib/ps/table-parser.d.ts +3 -4
  223. package/lib/ps/table-parser.js +15 -22
  224. package/lib/remove-module.cjs +19 -24
  225. package/lib/remove-module.mjs +2 -2
  226. package/lib/rm-node-module-cli.cjs +389 -0
  227. package/lib/rm-node-module-cli.d.cts +1 -0
  228. package/lib/rm-node-module-cli.mjs +92 -0
  229. package/lib/rm-node-modules.cjs +127 -0
  230. package/lib/rm-node-modules.d.cts +35 -0
  231. package/lib/{binary-collections-config.mjs → rm-node-modules.mjs} +3 -3
  232. package/lib/rmpath-cli.cjs +285 -0
  233. package/lib/rmpath-cli.d.mts +1 -0
  234. package/lib/rmpath-cli.mjs +23 -0
  235. package/lib/rmpath.cjs +6 -217
  236. package/lib/rmpath.mjs +5 -101
  237. package/lib/run-by-checksum/cache.cjs +69 -0
  238. package/lib/run-by-checksum/cache.d.ts +19 -0
  239. package/lib/run-by-checksum/cache.js +50 -0
  240. package/lib/run-by-checksum/cache.mjs +12 -0
  241. package/lib/run-by-checksum/hash.cjs +72 -0
  242. package/lib/run-by-checksum/hash.d.ts +14 -0
  243. package/lib/run-by-checksum/hash.js +85 -0
  244. package/lib/run-by-checksum/hash.mjs +10 -0
  245. package/lib/run-by-checksum/run.cjs +169 -0
  246. package/lib/run-by-checksum/run.d.ts +22 -0
  247. package/lib/run-by-checksum/run.js +93 -0
  248. package/lib/run-by-checksum/run.mjs +10 -0
  249. package/lib/run-by-checksum-cli.cjs +382 -0
  250. package/lib/run-by-checksum-cli.d.ts +2 -0
  251. package/lib/run-by-checksum-cli.js +43 -0
  252. package/lib/run-by-checksum-cli.mjs +56 -0
  253. package/lib/submodule-install.cjs +55 -47
  254. package/lib/submodule-install.mjs +48 -35
  255. package/lib/submodule-remove-cli.cjs +170 -4
  256. package/lib/submodule-remove-cli.js +5 -5
  257. package/lib/submodule-remove-cli.mjs +6 -4
  258. package/lib/utils/chatgpt.cjs +19 -13
  259. package/lib/utils/chatgpt.js +94 -94
  260. package/lib/utils/chatgpt.mjs +1 -1
  261. package/lib/utils/fetchResponse.cjs +24 -0
  262. package/lib/utils/fetchResponse.d.cts +25 -0
  263. package/lib/utils/fetchResponse.mjs +6 -0
  264. package/lib/utils/findEnvFiles.cjs +28 -46
  265. package/lib/utils/findEnvFiles.d.cts +19 -0
  266. package/lib/utils/findEnvFiles.mjs +3 -5
  267. package/lib/utils/findWorkspaceRoot.js +4 -4
  268. package/lib/utils/index.cjs +7 -12
  269. package/lib/utils/index.d.cts +2 -9
  270. package/lib/utils/index.mjs +1 -1
  271. package/lib/utils/isGithubTokenValid.js +7 -7
  272. package/lib/{ps/isWin.cjs → utils/isWindows.cjs} +12 -7
  273. package/lib/utils/isWindows.d.ts +5 -0
  274. package/lib/utils/isWindows.js +10 -0
  275. package/lib/utils/isWindows.mjs +10 -0
  276. package/lib/utils/runBash.cjs +53 -0
  277. package/lib/utils/runBash.d.cts +12 -0
  278. package/lib/utils/runBash.mjs +66 -0
  279. package/lib/yarn-per-branch-lock-installer.cjs +288 -0
  280. package/lib/yarn-per-branch-lock-installer.d.cts +2 -0
  281. package/lib/yarn-per-branch-lock-installer.mjs +122 -0
  282. package/lib/yarn-reinstall.cjs +8 -13
  283. package/lib/yarn-reinstall.mjs +1 -1
  284. package/package.json +91 -57
  285. package/readme.html +784 -0
  286. package/readme.md +107 -219
  287. package/releases/readme.md +6 -3
  288. package/test/README.md +2 -2
  289. package/test-project/workspaces/workspace-a/readme.md +20 -0
  290. package/test-project/workspaces/workspace-a/release/readme.md +42 -0
  291. package/test-project/workspaces/workspace-a/test/readme.md +12 -0
  292. package/test-project/workspaces/workspace-b/readme.md +94 -0
  293. package/test-project/workspaces/workspace-b/requirements.txt +1 -0
  294. package/test-project/workspaces/workspace-b/themes/hexo-theme-flowbite/readme.md +156 -0
  295. package/tmp/test-repo/README.md +2 -35
  296. package/tmp/test-repo-runChecksum/test-complex-glob/README.md +1 -0
  297. package/tmp/test-repo-runChecksum/test-mixed-args/README.md +1 -0
  298. package/lib/binary-collections-config.cjs +0 -15
  299. package/lib/chunk-2CBJCW7E.mjs +0 -81
  300. package/lib/chunk-4UHL4WVN.mjs +0 -136
  301. package/lib/chunk-6HHJRKFB.mjs +0 -59
  302. package/lib/chunk-6S4NXESK.mjs +0 -26
  303. package/lib/chunk-7XTEJHOE.mjs +0 -193
  304. package/lib/chunk-AJDD5DZM.mjs +0 -109
  305. package/lib/chunk-FCDQGYBF.mjs +0 -136
  306. package/lib/chunk-GEYA2USY.mjs +0 -207
  307. package/lib/chunk-GJTGHXRA.mjs +0 -356
  308. package/lib/chunk-ID2WBTE2.mjs +0 -80
  309. package/lib/chunk-JXFOHKDM.mjs +0 -239
  310. package/lib/chunk-NCXAP7AA.mjs +0 -31
  311. package/lib/chunk-PDSXF5HY.mjs +0 -187
  312. package/lib/chunk-TOIVAQF7.mjs +0 -136
  313. package/lib/chunk-V5SKYJUB.mjs +0 -136
  314. package/lib/chunk-WSRETQCA.mjs +0 -59
  315. package/lib/chunk-YYLIQQKF.mjs +0 -31
  316. package/lib/del-ps.js +0 -32
  317. package/lib/del-ps.mjs +0 -43
  318. package/lib/ps/index.d.cjs +0 -17
  319. package/lib/ps/index.d.ts +0 -2
  320. package/lib/ps/index.js +0 -254
  321. package/lib/ps/isWin.d.ts +0 -2
  322. package/lib/ps/isWin.js +0 -4
  323. package/lib/utils/findEnvFiles.d.ts +0 -8
  324. package/lib/utils/findEnvFiles.js +0 -121
  325. package/test/package.json +0 -20
  326. package/test-project/package.json +0 -16
  327. package/tmp/test-repo/package.json +0 -7
  328. package/tmp/typedoc/readme.md +0 -320
  329. /package/lib/{binary-collections-config.d.cts → binary-collections/config.d.cts} +0 -0
  330. /package/lib/{del-ps.d.ts → clean-github-actions-caches-cli.d.cts} +0 -0
@@ -14,18 +14,18 @@ const index_cjs_1 = require("./utils/index.cjs");
14
14
  const argv = (0, index_cjs_1.getArgs)();
15
15
  if (argv.help || argv.h) {
16
16
  console.log();
17
- console.log("Usage: free-chatgpt.js [--question <text> | -q <text>] [--qfile <file> | -qf <file>] [--help | -h]");
17
+ console.log('Usage: free-chatgpt.js [--question <text> | -q <text>] [--qfile <file> | -qf <file>] [--help | -h]');
18
18
  console.log();
19
- console.log("Options:");
19
+ console.log('Options:');
20
20
  console.log(' --question, -q The question to ask ChatGPT (default: "Hello, ChatGPT!")');
21
- console.log(" --qfile, -qf Path to a file containing the question text");
22
- console.log(" --help, -h Show this help message");
21
+ console.log(' --qfile, -qf Path to a file containing the question text');
22
+ console.log(' --help, -h Show this help message');
23
23
  console.log();
24
- console.log("Description:");
25
- console.log(" Automates browser interaction with ChatGPT, including login, question submission, and response retrieval.");
26
- console.log(" - Questions can be provided directly or loaded from a file.");
27
- console.log(" - Cookies are saved to ./tmp/cookies for session persistence.");
28
- console.log(" - Requires browser access to chat.openai.com and chatgpt.com (firewall must allow connection).");
24
+ console.log('Description:');
25
+ console.log(' Automates browser interaction with ChatGPT, including login, question submission, and response retrieval.');
26
+ console.log(' - Questions can be provided directly or loaded from a file.');
27
+ console.log(' - Cookies are saved to ./tmp/cookies for session persistence.');
28
+ console.log(' - Requires browser access to chat.openai.com and chatgpt.com (firewall must allow connection).');
29
29
  console.log();
30
30
  process.exit(0);
31
31
  }
@@ -43,7 +43,7 @@ function main() {
43
43
  });
44
44
  }
45
45
  catch (error) {
46
- console.error("Error running ChatGPT:", error);
46
+ console.error('Error running ChatGPT:', error);
47
47
  process.exit(1);
48
48
  }
49
49
  });
@@ -1,10 +1,10 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
2
  import {
3
3
  runChatGpt
4
- } from "./chunk-N436BNBK.mjs";
4
+ } from "./chunk-GAGABICI.mjs";
5
5
  import {
6
6
  require_utils
7
- } from "./chunk-Z6JLYU2J.mjs";
7
+ } from "./chunk-6RK5UCTP.mjs";
8
8
  import {
9
9
  __toESM,
10
10
  init_esm_shims
@@ -74,9 +74,9 @@ var require_utils2 = __commonJS({
74
74
  init_cjs_shims();
75
75
  var fs = require("fs");
76
76
  var path = require("upath");
77
- var argv = require("minimist")(process.argv.slice(2));
77
+ var minimistLib = require("minimist");
78
+ var argv = minimistLib(process.argv.slice(2));
78
79
  var { exec } = require("child_process");
79
- var { URL: URL2 } = require("url");
80
80
  var { promisify } = require("util");
81
81
  var execAsync = promisify(exec);
82
82
  async function parseGitRemotes() {
@@ -89,7 +89,7 @@ var require_utils2 = __commonJS({
89
89
  if (name && url) {
90
90
  const [repoUrl] = url.split(" ");
91
91
  try {
92
- const parsedUrl = new URL2(repoUrl);
92
+ const parsedUrl = new URL(repoUrl);
93
93
  const pathParts = parsedUrl.pathname.split("/").filter(Boolean);
94
94
  if (parsedUrl.hostname === "github.com" && pathParts.length === 2) {
95
95
  let repoPath = pathParts.join("/");
@@ -110,15 +110,10 @@ var require_utils2 = __commonJS({
110
110
  }
111
111
  }
112
112
  module2.exports.parseGitRemotes = parseGitRemotes;
113
- function joinPathPreserveDriveLetter(...segments) {
114
- let fullPath = require("path").join(...segments);
115
- if (/^[a-z]:\\/.test(fullPath)) {
116
- fullPath = fullPath.charAt(0).toUpperCase() + fullPath.slice(1);
113
+ function getArgs2(opts) {
114
+ if (opts) {
115
+ return minimistLib(process.argv.slice(2), opts);
117
116
  }
118
- return fullPath;
119
- }
120
- module2.exports.joinPathPreserveDriveLetter = joinPathPreserveDriveLetter;
121
- function getArgs2() {
122
117
  return argv;
123
118
  }
124
119
  module2.exports.getArgs = getArgs2;
@@ -143,7 +138,7 @@ var require_utils2 = __commonJS({
143
138
  try {
144
139
  fs.rmdirSync(fullPath);
145
140
  console.log("deleted", fullPath);
146
- } catch (e) {
141
+ } catch (_e) {
147
142
  try {
148
143
  fs.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
149
144
  console.log("deleted", fullPath);
@@ -156,7 +151,7 @@ var require_utils2 = __commonJS({
156
151
  try {
157
152
  fs.unlinkSync(fullPath);
158
153
  console.log("deleted", fullPath);
159
- } catch (e) {
154
+ } catch (_e) {
160
155
  try {
161
156
  fs.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
162
157
  console.log("deleted", fullPath);
@@ -245,7 +240,7 @@ init_cjs_shims();
245
240
  var gch = require("git-command-helper");
246
241
  var { runGitCommand, runGitCommandOutput } = require_utils();
247
242
  var { getArgs } = require_utils2();
248
- require("dotenv").config({ path: require("path").join(process.cwd(), ".env"), quiet: true });
243
+ require("dotenv").config({ path: require("upath").join(process.cwd(), ".env"), quiet: true });
249
244
  function configureGitUser(cliUser = null, cliEmail = null, options = {}) {
250
245
  console.log("\n=== Configuring Git User ===");
251
246
  let username, email;
@@ -1,8 +1,8 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
2
  import {
3
3
  require_user_config
4
- } from "../chunk-AJDD5DZM.mjs";
4
+ } from "../chunk-MGPYPKIE.mjs";
5
5
  import "../chunk-A3VUZEJK.mjs";
6
- import "../chunk-Z6JLYU2J.mjs";
6
+ import "../chunk-6RK5UCTP.mjs";
7
7
  import "../chunk-QQ4A6DLD.mjs";
8
8
  export default require_user_config();
@@ -37,12 +37,108 @@ var init_cjs_shims = __esm({
37
37
  }
38
38
  });
39
39
 
40
- // src/binary-collections-config.cjs
41
- var require_binary_collections_config = __commonJS({
42
- "src/binary-collections-config.cjs"(exports2, module2) {
40
+ // src/utils/findEnvFiles.cjs
41
+ var require_findEnvFiles = __commonJS({
42
+ "src/utils/findEnvFiles.cjs"(exports2, module2) {
43
43
  init_cjs_shims();
44
+ var fs3 = require("fs");
44
45
  var path3 = require("path");
45
- require("dotenv").config({ path: path3.join(process.cwd(), ".env"), quiet: true, override: true });
46
+ var glob = require("glob");
47
+ var DEFAULT_IGNORES = [
48
+ "**/node_modules/**",
49
+ "**/.git/**",
50
+ "**/.yarn/**",
51
+ "**/.pnpm/**",
52
+ "**/dist/**",
53
+ "**/build/**",
54
+ "**/coverage/**",
55
+ "**/vendor/**",
56
+ "**/tmp/**",
57
+ "**/.cache/**",
58
+ "**/assets/**",
59
+ "**/logs/**",
60
+ "**/output/**",
61
+ "**/public/**",
62
+ "**/static/**",
63
+ "**/temp/**",
64
+ "**/backup/**",
65
+ "**/backups/**",
66
+ "**/examples/**",
67
+ "**/docs/**",
68
+ "**/tests/**",
69
+ "**/__tests__/**",
70
+ "**/spec/**",
71
+ "**/__specs__/**",
72
+ "**/scripts/**",
73
+ "**/bin/**",
74
+ "**/hooks/**",
75
+ "**/config/**",
76
+ "**/configs/**",
77
+ "**/settings/**",
78
+ "**/.vscode/**",
79
+ "**/.idea/**"
80
+ ];
81
+ function findEnvFiles(startDir = process.cwd(), filter) {
82
+ const found = /* @__PURE__ */ new Set();
83
+ function addFile(file) {
84
+ const normalized = path3.normalize(file);
85
+ if (typeof filter === "function" && !filter(normalized)) {
86
+ return;
87
+ }
88
+ found.add(normalized);
89
+ }
90
+ let current = path3.resolve(startDir);
91
+ while (true) {
92
+ const envPath = path3.join(current, ".env");
93
+ if (fs3.existsSync(envPath)) {
94
+ addFile(envPath);
95
+ }
96
+ const parent = path3.dirname(current);
97
+ if (parent === current) {
98
+ break;
99
+ }
100
+ current = parent;
101
+ }
102
+ const files = glob.globSync("**/.env*", {
103
+ cwd: startDir,
104
+ absolute: true,
105
+ nodir: true,
106
+ ignore: DEFAULT_IGNORES
107
+ });
108
+ for (const file of files) {
109
+ addFile(file);
110
+ }
111
+ return [...found];
112
+ }
113
+ function findEnvWithToken(startDir = process.cwd(), tokenName = "GITHUB_TOKEN") {
114
+ const envFiles = findEnvFiles(startDir);
115
+ return envFiles.find((file) => {
116
+ try {
117
+ const content = fs3.readFileSync(file, "utf-8");
118
+ const regex = new RegExp(`^\\s*${tokenName}\\s*=`, "m");
119
+ return regex.test(content);
120
+ } catch (err) {
121
+ console.warn(`Failed to read ${file}: ${err instanceof Error ? err.message : String(err)}`);
122
+ return false;
123
+ }
124
+ });
125
+ }
126
+ module2.exports = {
127
+ DEFAULT_IGNORES,
128
+ findEnvFiles,
129
+ findEnvWithToken,
130
+ default: findEnvFiles
131
+ };
132
+ }
133
+ });
134
+
135
+ // src/binary-collections/config.cjs
136
+ var require_config = __commonJS({
137
+ "src/binary-collections/config.cjs"(exports2, module2) {
138
+ init_cjs_shims();
139
+ var path3 = require("upath");
140
+ var { findEnvWithToken } = require_findEnvFiles();
141
+ require("dotenv").config({ path: findEnvWithToken(), quiet: true, overwrite: true });
46
142
  function getTempDir() {
47
143
  return process.env.TEMP_DIR || path3.join(process.cwd(), "tmp");
48
144
  }
@@ -64,9 +160,9 @@ var require_utils = __commonJS({
64
160
  init_cjs_shims();
65
161
  var fs3 = require("fs");
66
162
  var path3 = require("upath");
67
- var argv = require("minimist")(process.argv.slice(2));
163
+ var minimistLib = require("minimist");
164
+ var argv = minimistLib(process.argv.slice(2));
68
165
  var { exec } = require("child_process");
69
- var { URL: URL2 } = require("url");
70
166
  var { promisify } = require("util");
71
167
  var execAsync = promisify(exec);
72
168
  async function parseGitRemotes() {
@@ -79,7 +175,7 @@ var require_utils = __commonJS({
79
175
  if (name && url) {
80
176
  const [repoUrl] = url.split(" ");
81
177
  try {
82
- const parsedUrl = new URL2(repoUrl);
178
+ const parsedUrl = new URL(repoUrl);
83
179
  const pathParts = parsedUrl.pathname.split("/").filter(Boolean);
84
180
  if (parsedUrl.hostname === "github.com" && pathParts.length === 2) {
85
181
  let repoPath = pathParts.join("/");
@@ -100,15 +196,10 @@ var require_utils = __commonJS({
100
196
  }
101
197
  }
102
198
  module2.exports.parseGitRemotes = parseGitRemotes;
103
- function joinPathPreserveDriveLetter(...segments) {
104
- let fullPath = require("path").join(...segments);
105
- if (/^[a-z]:\\/.test(fullPath)) {
106
- fullPath = fullPath.charAt(0).toUpperCase() + fullPath.slice(1);
199
+ function getArgs2(opts) {
200
+ if (opts) {
201
+ return minimistLib(process.argv.slice(2), opts);
107
202
  }
108
- return fullPath;
109
- }
110
- module2.exports.joinPathPreserveDriveLetter = joinPathPreserveDriveLetter;
111
- function getArgs2() {
112
203
  return argv;
113
204
  }
114
205
  module2.exports.getArgs = getArgs2;
@@ -133,7 +224,7 @@ var require_utils = __commonJS({
133
224
  try {
134
225
  fs3.rmdirSync(fullPath);
135
226
  console.log("deleted", fullPath);
136
- } catch (e) {
227
+ } catch (_e) {
137
228
  try {
138
229
  fs3.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
139
230
  console.log("deleted", fullPath);
@@ -146,7 +237,7 @@ var require_utils = __commonJS({
146
237
  try {
147
238
  fs3.unlinkSync(fullPath);
148
239
  console.log("deleted", fullPath);
149
- } catch (e) {
240
+ } catch (_e) {
150
241
  try {
151
242
  fs3.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
152
243
  console.log("deleted", fullPath);
@@ -235,11 +326,13 @@ init_cjs_shims();
235
326
 
236
327
  // src/git-diff.js
237
328
  init_cjs_shims();
329
+ var import_ansi_colors = __toESM(require("ansi-colors"), 1);
238
330
  var import_child_process = require("child_process");
239
331
  var import_fs_extra2 = __toESM(require("fs-extra"), 1);
332
+ var import_sbg_utility = require("sbg-utility");
240
333
  var import_upath2 = __toESM(require("upath"), 1);
241
334
  var import_url = require("url");
242
- var import_binary_collections_config = __toESM(require_binary_collections_config(), 1);
335
+ var import_config = __toESM(require_config(), 1);
243
336
 
244
337
  // src/utils/chatgpt.js
245
338
  init_cjs_shims();
@@ -358,7 +451,10 @@ async function writeQuestion(page, question) {
358
451
  async function clickSubmitButton(page) {
359
452
  console.log("Attempting to click the submit button...");
360
453
  try {
361
- const userMessageCountBefore = await page.$$eval('[data-message-author-role="user"]', (elements) => elements.length);
454
+ const userMessageCountBefore = await page.$$eval(
455
+ '[data-message-author-role="user"]',
456
+ (elements) => elements.length
457
+ );
362
458
  const waitForSubmit = async (timeout = 5e3) => {
363
459
  try {
364
460
  await page.waitForFunction(
@@ -374,18 +470,21 @@ async function clickSubmitButton(page) {
374
470
  return false;
375
471
  }
376
472
  };
377
- await page.waitForFunction(() => {
378
- const candidates = [
379
- document.querySelector('[data-testid="fruitjuice-send-button"]'),
380
- document.querySelector("#composer-submit-button"),
381
- document.querySelector('[data-testid="send-button"]')
382
- ].filter(Boolean);
383
- return candidates.some((button) => {
384
- const isDisabled = button.disabled || button.getAttribute("aria-disabled") === "true";
385
- const isVisible = button.offsetParent !== null;
386
- return !isDisabled && isVisible;
387
- });
388
- }, { timeout: 5e3 }).catch(() => {
473
+ await page.waitForFunction(
474
+ () => {
475
+ const candidates = [
476
+ document.querySelector('[data-testid="fruitjuice-send-button"]'),
477
+ document.querySelector("#composer-submit-button"),
478
+ document.querySelector('[data-testid="send-button"]')
479
+ ].filter(Boolean);
480
+ return candidates.some((button) => {
481
+ const isDisabled = button.disabled || button.getAttribute("aria-disabled") === "true";
482
+ const isVisible = button.offsetParent !== null;
483
+ return !isDisabled && isVisible;
484
+ });
485
+ },
486
+ { timeout: 5e3 }
487
+ ).catch(() => {
389
488
  });
390
489
  const buttonDetails = await page.evaluate(() => {
391
490
  const selectors = [
@@ -751,22 +850,26 @@ async function runChatGpt(chatgptOptions = {}) {
751
850
  var import_utils = __toESM(require_utils(), 1);
752
851
  var __filename2 = (0, import_url.fileURLToPath)(importMetaUrl);
753
852
  var __dirname = import_upath2.default.dirname(__filename2);
754
- var DIFF_OUTPUT = (0, import_binary_collections_config.getTempPath)("git-diff.txt");
755
- var GPT_DIFF_OUTPUT = (0, import_binary_collections_config.getTempPath)("gpt-question.txt");
853
+ var args = (0, import_utils.getArgs)();
854
+ var positional = args._ || [];
855
+ var FILENAME = (0, import_sbg_utility.md5)((positional[0] || "default") + JSON.stringify(args));
856
+ var DIFF_OUTPUT = (0, import_config.getTempPath)(`git-diff/${FILENAME}.txt`);
857
+ var GPT_DIFF_OUTPUT = (0, import_config.getTempPath)(`git-diff/gpt-${FILENAME}.txt`);
756
858
  var CACHE_DIR = import_upath2.default.dirname(DIFF_OUTPUT);
757
859
  var DIFF_OUTPUT_RELATIVE = import_upath2.default.relative(process.cwd(), DIFF_OUTPUT);
758
860
  var GPT_DIFF_OUTPUT_RELATIVE = import_upath2.default.relative(process.cwd(), GPT_DIFF_OUTPUT);
759
- if (!import_fs_extra2.default.existsSync(CACHE_DIR)) {
760
- import_fs_extra2.default.mkdirSync(CACHE_DIR, { recursive: true });
761
- }
861
+ import_fs_extra2.default.ensureDirSync(CACHE_DIR, { mode: 493 });
762
862
  function showHelp() {
763
- console.log("\u{1F4DD} Git Diff Helper");
764
- console.log("\u{1F4C4} Usage:");
765
- console.log(" \u{1F4C2} git-diff FILE Show staged diff of specified file");
766
- console.log(" \u{1F4C2} git-diff --staged-only Show staged diff of all files");
767
- console.log(" \u{1F4C2} git-diff -s | -S Same as --staged-only");
768
- console.log(" \u{1F4C2} git-diff --ai Run ChatGPT automation for commit message");
769
- console.log(" \u{1F4C2} git-diff --help | -h Show this help message");
863
+ console.log("\u{1F4CB} Git Diff Helper");
864
+ console.log("Usage:");
865
+ console.log(" git-diff FILE Show staged diff of specified file");
866
+ console.log(" git-diff --staged-only Show staged diff of all files");
867
+ console.log(" git-diff -s | -S Same as --staged-only");
868
+ console.log(" git-diff --unstaged FILE Show unstaged diff of specified file");
869
+ console.log(" git-diff --unstaged Show unstaged diff of all files");
870
+ console.log(" git-diff -u Same as --unstaged");
871
+ console.log(" git-diff --ai Run ChatGPT automation for commit message");
872
+ console.log(" git-diff --help | -h Show this help message");
770
873
  console.log("");
771
874
  console.log(`\u{1F4BE} Output is saved to: ${DIFF_OUTPUT_RELATIVE}`);
772
875
  console.log(`\u{1F916} GPT prompt is saved to: ${GPT_DIFF_OUTPUT_RELATIVE}`);
@@ -774,22 +877,22 @@ function showHelp() {
774
877
  }
775
878
  function runGitDiff(command, successMessage, errorMessage) {
776
879
  try {
777
- console.log(`\u{1F50D} [i] Running command: ${command}`);
880
+ console.log(`\u2139\uFE0F Running command: ${command}`);
778
881
  const result = (0, import_child_process.execSync)(command, {
779
882
  encoding: "utf8",
780
883
  maxBuffer: 1024 * 1024 * 10
781
884
  // 10MB buffer to handle large diffs
782
885
  });
783
886
  if (!result || result.trim() === "") {
784
- console.log(`\u2139\uFE0F [i] No changes found for the specified criteria`);
785
- import_fs_extra2.default.writeFileSync(DIFF_OUTPUT, "# No changes found\n");
887
+ console.log(`\u2139\uFE0F No changes found for the specified criteria`);
888
+ (0, import_sbg_utility.writefile)(DIFF_OUTPUT, "# No changes found\n");
786
889
  console.log(`\u2705 Empty diff saved to "${DIFF_OUTPUT_RELATIVE}"`);
787
- return;
890
+ return false;
788
891
  }
789
- import_fs_extra2.default.writeFileSync(DIFF_OUTPUT, result);
790
- import_fs_extra2.default.writeFileSync(
892
+ (0, import_sbg_utility.writefile)(DIFF_OUTPUT, result);
893
+ (0, import_sbg_utility.writefile)(
791
894
  GPT_DIFF_OUTPUT,
792
- `Hello, ChatGPT!
895
+ `Hello!
793
896
  Can you create a conventional commit message by diff content below:
794
897
 
795
898
  \`\`\`${result}
@@ -800,45 +903,149 @@ Give me result as codeblock with language "text" only.
800
903
  Thank you!`
801
904
  );
802
905
  console.log(`\u2705 ${successMessage}`);
803
- console.log(`\u{1F4BE} GPT diff prompt saved to "${GPT_DIFF_OUTPUT_RELATIVE}"`);
906
+ console.log(`\u{1F4BE} GPT diff prompt saved to "${import_ansi_colors.default.green(GPT_DIFF_OUTPUT_RELATIVE)}"`);
907
+ return true;
804
908
  } catch (error) {
805
909
  console.error(`\u274C ${errorMessage}`);
806
- console.error(`\u{1F4DD} Command: ${command}`);
807
- console.error(`\u26A0\uFE0F Error: ${error.message}`);
910
+ console.error(`\u274C Command: ${command}`);
911
+ console.error(`\u274C Error: ${error.message}`);
808
912
  if (error.message.includes("not a git repository")) {
809
- console.error("\u{1F6A7} Make sure you are in a git repository");
913
+ console.error("\u274C Make sure you are in a git repository");
810
914
  }
811
915
  process.exit(1);
812
916
  }
813
917
  }
918
+ function getUntrackedDiff() {
919
+ try {
920
+ const untrackedStr = (0, import_child_process.execSync)("git ls-files --others --exclude-standard", {
921
+ encoding: "utf8",
922
+ maxBuffer: 1024 * 1024 * 10
923
+ }).trim();
924
+ if (!untrackedStr) return "";
925
+ const untrackedFiles = untrackedStr.split("\n").filter(function(f) {
926
+ return f;
927
+ });
928
+ if (untrackedFiles.length === 0) return "";
929
+ var result = "\n# Untracked files:\n";
930
+ for (var i = 0; i < untrackedFiles.length; i++) {
931
+ var file = untrackedFiles[i];
932
+ if (!import_fs_extra2.default.existsSync(file)) continue;
933
+ var stat = import_fs_extra2.default.statSync(file);
934
+ if (!stat.isFile()) continue;
935
+ var content;
936
+ try {
937
+ content = import_fs_extra2.default.readFileSync(file, "utf8");
938
+ } catch (_a) {
939
+ continue;
940
+ }
941
+ var lines = content.split("\n");
942
+ if (lines.length > 0 && lines[lines.length - 1] === "") {
943
+ lines.pop();
944
+ }
945
+ result += "diff --git a/" + file + " b/" + file + "\n";
946
+ result += "new file mode 100644\n";
947
+ result += "index 0000000..0000000\n";
948
+ result += "--- /dev/null\n";
949
+ result += "+++ b/" + file + "\n";
950
+ result += "@@ -0,0 +1," + (lines.length || 0) + " @@\n";
951
+ for (var j = 0; j < lines.length; j++) {
952
+ result += "+" + lines[j] + "\n";
953
+ }
954
+ }
955
+ return result;
956
+ } catch (_b) {
957
+ return "";
958
+ }
959
+ }
960
+ function fileHasChanges(file, mode) {
961
+ const command = mode === "staged" ? `git diff --cached --quiet -- "${file}"` : `git diff --quiet -- "${file}"`;
962
+ try {
963
+ (0, import_child_process.execSync)(command, { stdio: "ignore" });
964
+ return false;
965
+ } catch (error) {
966
+ if (error.status === 1) {
967
+ return true;
968
+ }
969
+ throw error;
970
+ }
971
+ }
814
972
  async function mainGitDiff() {
815
- const args = (0, import_utils.getArgs)();
816
- const positional = args._ || [];
817
973
  if (args.help || args.h) {
818
974
  showHelp();
819
975
  }
976
+ const useUnstaged = args.unstaged || args.u;
977
+ const fileFromFlag = typeof args.unstaged === "string" ? args.unstaged : typeof args.u === "string" ? args.u : null;
978
+ let hasDiff = false;
820
979
  if (args["staged-only"] || args.s || args.S) {
821
- runGitDiff(
980
+ hasDiff = runGitDiff(
822
981
  "git --no-pager diff --staged",
823
- `Full staged diff saved to "${DIFF_OUTPUT_RELATIVE}"`,
982
+ `Full staged diff saved to "${import_ansi_colors.default.green(DIFF_OUTPUT_RELATIVE)}"`,
824
983
  "Failed to save staged diff"
825
984
  );
826
985
  } else {
827
- const file = positional[0];
986
+ const file = positional[0] || fileFromFlag;
828
987
  if (!file) {
829
- runGitDiff(
988
+ const fullDiffModeLabel = useUnstaged ? "unstaged" : "unstaged";
989
+ hasDiff = runGitDiff(
830
990
  "git --no-pager diff",
831
- `Full staged diff saved to "${DIFF_OUTPUT_RELATIVE}"`,
991
+ `Full ${fullDiffModeLabel} diff saved to "${import_ansi_colors.default.green(DIFF_OUTPUT_RELATIVE)}"`,
832
992
  "Failed to save all diff's"
833
993
  );
994
+ const untrackedDiff = getUntrackedDiff();
995
+ if (untrackedDiff) {
996
+ const UNTRACKED_DIFF_OUTPUT = (0, import_config.getTempPath)(`git-diff/untracked-${FILENAME}.txt`);
997
+ const UNTRACKED_GPT_DIFF_OUTPUT = (0, import_config.getTempPath)(`git-diff/gpt-untracked-${FILENAME}.txt`);
998
+ const UNTRACKED_DIFF_OUTPUT_RELATIVE = import_upath2.default.relative(process.cwd(), UNTRACKED_DIFF_OUTPUT);
999
+ (0, import_sbg_utility.writefile)(UNTRACKED_DIFF_OUTPUT, untrackedDiff);
1000
+ (0, import_sbg_utility.writefile)(
1001
+ UNTRACKED_GPT_DIFF_OUTPUT,
1002
+ `Hello!
1003
+ Can you create a conventional commit message by diff content below:
1004
+
1005
+ \`\`\`${untrackedDiff}
1006
+ \`\`\`
1007
+
1008
+ Give me result as codeblock with language "text" only.
1009
+
1010
+ Thank you!`
1011
+ );
1012
+ console.log(`\u2705 Untracked file diff saved to "${import_ansi_colors.default.green(UNTRACKED_DIFF_OUTPUT_RELATIVE)}"`);
1013
+ console.log(
1014
+ `\u{1F4BE} AI diff prompt saved to "${import_ansi_colors.default.green(import_upath2.default.relative(process.cwd(), UNTRACKED_GPT_DIFF_OUTPUT))}"`
1015
+ );
1016
+ hasDiff = true;
1017
+ }
834
1018
  } else {
835
- runGitDiff(
836
- `git --no-pager diff --cached -- "${file}"`,
837
- `Staged diff of "${file}" saved to "${DIFF_OUTPUT_RELATIVE}"`,
838
- `Failed to generate diff for "${file}"`
1019
+ let fileDiffMode = useUnstaged ? "unstaged" : "staged";
1020
+ if (!useUnstaged && !fileHasChanges(file, "staged") && fileHasChanges(file, "unstaged")) {
1021
+ fileDiffMode = "unstaged";
1022
+ }
1023
+ hasDiff = runGitDiff(
1024
+ fileDiffMode === "unstaged" ? `git --no-pager diff -- "${file}"` : `git --no-pager diff --cached -- "${file}"`,
1025
+ `${fileDiffMode[0].toUpperCase() + fileDiffMode.slice(1)} diff of "${file}" saved to "${import_ansi_colors.default.green(
1026
+ DIFF_OUTPUT_RELATIVE
1027
+ )}"`,
1028
+ `Failed to generate ${fileDiffMode} diff for "${file}"`
839
1029
  );
840
1030
  }
841
1031
  }
1032
+ if (hasDiff) {
1033
+ const opencodePrompt = [
1034
+ "",
1035
+ "\u{1F916} OpenCode Prompt Helper",
1036
+ "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
1037
+ "",
1038
+ "\u{1F4C4} App Prompt:",
1039
+ ` Generate a conventional commit message from diff file: ${DIFF_OUTPUT}`,
1040
+ "",
1041
+ "\u{1F4BB} CLI Command:",
1042
+ ` opencode run "Generate a conventional commit message from diff file ${DIFF_OUTPUT}"`,
1043
+ ""
1044
+ ];
1045
+ const opencodePromptPath = (0, import_config.getTempPath)(`git-diff/opencode-${FILENAME}.txt`);
1046
+ (0, import_sbg_utility.writefile)(opencodePromptPath, opencodePrompt.join("\n"));
1047
+ console.log(`\u2705 OpenCode prompt saved to "${import_ansi_colors.default.green(import_upath2.default.relative(process.cwd(), opencodePromptPath))}"`);
1048
+ }
842
1049
  if (args.ai) {
843
1050
  try {
844
1051
  await runChatGpt({ headless: true, questionFile: GPT_DIFF_OUTPUT });
@@ -847,7 +1054,7 @@ async function mainGitDiff() {
847
1054
  console.error("\u{1F4A1} Try running with visible browser mode or check if Chrome is installed");
848
1055
  }
849
1056
  } else {
850
- console.log("\u{1F4A1} Tip: Use --ai flag to generate commit message with ChatGPT");
1057
+ console.log("\u{1F4A1} Use --ai flag to generate commit message with ChatGPT");
851
1058
  }
852
1059
  }
853
1060
 
@@ -2,10 +2,11 @@
2
2
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
3
3
  import {
4
4
  mainGitDiff
5
- } from "./chunk-FCDQGYBF.mjs";
6
- import "./chunk-N436BNBK.mjs";
7
- import "./chunk-YYLIQQKF.mjs";
8
- import "./chunk-Z6JLYU2J.mjs";
5
+ } from "./chunk-2MN4VPV2.mjs";
6
+ import "./chunk-X2B3X7D4.mjs";
7
+ import "./chunk-GAGABICI.mjs";
8
+ import "./chunk-H44UWUFY.mjs";
9
+ import "./chunk-6RK5UCTP.mjs";
9
10
  import {
10
11
  init_esm_shims
11
12
  } from "./chunk-QQ4A6DLD.mjs";