@intlayer/cli 8.4.4 → 8.4.5

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 (301) hide show
  1. package/dist/cjs/IntlayerEventListener.cjs +186 -1
  2. package/dist/cjs/IntlayerEventListener.cjs.map +1 -1
  3. package/dist/cjs/_virtual/_rolldown/runtime.cjs +29 -0
  4. package/dist/cjs/_virtual/_utils_asset.cjs +98 -0
  5. package/dist/cjs/auth/login.cjs +90 -2
  6. package/dist/cjs/auth/login.cjs.map +1 -1
  7. package/dist/cjs/build.cjs +30 -1
  8. package/dist/cjs/build.cjs.map +1 -1
  9. package/dist/cjs/ci.cjs +76 -1
  10. package/dist/cjs/ci.cjs.map +1 -1
  11. package/dist/cjs/cli.cjs +485 -1
  12. package/dist/cjs/cli.cjs.map +1 -1
  13. package/dist/cjs/config.cjs +15 -1
  14. package/dist/cjs/config.cjs.map +1 -1
  15. package/dist/cjs/editor.cjs +50 -1
  16. package/dist/cjs/editor.cjs.map +1 -1
  17. package/dist/cjs/extract.cjs +108 -1
  18. package/dist/cjs/extract.cjs.map +1 -1
  19. package/dist/cjs/fill/deepMergeContent.cjs +27 -1
  20. package/dist/cjs/fill/deepMergeContent.cjs.map +1 -1
  21. package/dist/cjs/fill/fill.cjs +84 -1
  22. package/dist/cjs/fill/fill.cjs.map +1 -1
  23. package/dist/cjs/fill/formatAutoFilledFilePath.cjs +32 -1
  24. package/dist/cjs/fill/formatAutoFilledFilePath.cjs.map +1 -1
  25. package/dist/cjs/fill/formatFillData.cjs +87 -1
  26. package/dist/cjs/fill/formatFillData.cjs.map +1 -1
  27. package/dist/cjs/fill/getAvailableLocalesInDictionary.cjs +26 -1
  28. package/dist/cjs/fill/getAvailableLocalesInDictionary.cjs.map +1 -1
  29. package/dist/cjs/fill/getFilterMissingContentPerLocale.cjs +51 -1
  30. package/dist/cjs/fill/getFilterMissingContentPerLocale.cjs.map +1 -1
  31. package/dist/cjs/fill/index.cjs +6 -1
  32. package/dist/cjs/fill/listTranslationsTasks.cjs +72 -1
  33. package/dist/cjs/fill/listTranslationsTasks.cjs.map +1 -1
  34. package/dist/cjs/fill/translateDictionary.cjs +240 -1
  35. package/dist/cjs/fill/translateDictionary.cjs.map +1 -1
  36. package/dist/cjs/fill/writeFill.cjs +55 -1
  37. package/dist/cjs/fill/writeFill.cjs.map +1 -1
  38. package/dist/cjs/getTargetDictionary.cjs +36 -1
  39. package/dist/cjs/getTargetDictionary.cjs.map +1 -1
  40. package/dist/cjs/index.cjs +44 -1
  41. package/dist/cjs/init.cjs +22 -1
  42. package/dist/cjs/init.cjs.map +1 -1
  43. package/dist/cjs/initMCP.cjs +69 -1
  44. package/dist/cjs/initMCP.cjs.map +1 -1
  45. package/dist/cjs/initSkills.cjs +93 -1
  46. package/dist/cjs/initSkills.cjs.map +1 -1
  47. package/dist/cjs/listContentDeclaration.cjs +42 -1
  48. package/dist/cjs/listContentDeclaration.cjs.map +1 -1
  49. package/dist/cjs/listProjects.cjs +28 -1
  50. package/dist/cjs/listProjects.cjs.map +1 -1
  51. package/dist/cjs/liveSync.cjs +153 -8
  52. package/dist/cjs/liveSync.cjs.map +1 -1
  53. package/dist/cjs/pull.cjs +153 -1
  54. package/dist/cjs/pull.cjs.map +1 -1
  55. package/dist/cjs/push/pullLog.cjs +105 -3
  56. package/dist/cjs/push/pullLog.cjs.map +1 -1
  57. package/dist/cjs/push/push.cjs +212 -1
  58. package/dist/cjs/push/push.cjs.map +1 -1
  59. package/dist/cjs/pushConfig.cjs +22 -1
  60. package/dist/cjs/pushConfig.cjs.map +1 -1
  61. package/dist/cjs/pushLog.cjs +86 -3
  62. package/dist/cjs/pushLog.cjs.map +1 -1
  63. package/dist/cjs/reviewDoc/reviewDoc.cjs +73 -1
  64. package/dist/cjs/reviewDoc/reviewDoc.cjs.map +1 -1
  65. package/dist/cjs/reviewDoc/reviewDocBlockAware.cjs +98 -1
  66. package/dist/cjs/reviewDoc/reviewDocBlockAware.cjs.map +1 -1
  67. package/dist/cjs/searchDoc.cjs +41 -1
  68. package/dist/cjs/searchDoc.cjs.map +1 -1
  69. package/dist/cjs/test/index.cjs +7 -1
  70. package/dist/cjs/test/listMissingTranslations.cjs +52 -1
  71. package/dist/cjs/test/listMissingTranslations.cjs.map +1 -1
  72. package/dist/cjs/test/test.cjs +56 -1
  73. package/dist/cjs/test/test.cjs.map +1 -1
  74. package/dist/cjs/translateDoc/index.cjs +9 -1
  75. package/dist/cjs/translateDoc/translateDoc.cjs +79 -1
  76. package/dist/cjs/translateDoc/translateDoc.cjs.map +1 -1
  77. package/dist/cjs/translateDoc/translateFile.cjs +106 -2
  78. package/dist/cjs/translateDoc/translateFile.cjs.map +1 -1
  79. package/dist/cjs/translateDoc/validation.cjs +49 -5
  80. package/dist/cjs/translateDoc/validation.cjs.map +1 -1
  81. package/dist/cjs/translation-alignment/alignBlocks.cjs +67 -1
  82. package/dist/cjs/translation-alignment/alignBlocks.cjs.map +1 -1
  83. package/dist/cjs/translation-alignment/computeSimilarity.cjs +25 -1
  84. package/dist/cjs/translation-alignment/computeSimilarity.cjs.map +1 -1
  85. package/dist/cjs/translation-alignment/fingerprintBlock.cjs +23 -1
  86. package/dist/cjs/translation-alignment/fingerprintBlock.cjs.map +1 -1
  87. package/dist/cjs/translation-alignment/index.cjs +22 -1
  88. package/dist/cjs/translation-alignment/mapChangedLinesToBlocks.cjs +18 -1
  89. package/dist/cjs/translation-alignment/mapChangedLinesToBlocks.cjs.map +1 -1
  90. package/dist/cjs/translation-alignment/normalizeBlock.cjs +22 -1
  91. package/dist/cjs/translation-alignment/normalizeBlock.cjs.map +1 -1
  92. package/dist/cjs/translation-alignment/pipeline.cjs +37 -1
  93. package/dist/cjs/translation-alignment/pipeline.cjs.map +1 -1
  94. package/dist/cjs/translation-alignment/planActions.cjs +46 -1
  95. package/dist/cjs/translation-alignment/planActions.cjs.map +1 -1
  96. package/dist/cjs/translation-alignment/rebuildDocument.cjs +49 -2
  97. package/dist/cjs/translation-alignment/rebuildDocument.cjs.map +1 -1
  98. package/dist/cjs/translation-alignment/segmentDocument.cjs +66 -5
  99. package/dist/cjs/translation-alignment/segmentDocument.cjs.map +1 -1
  100. package/dist/cjs/utils/calculateChunks.cjs +89 -2
  101. package/dist/cjs/utils/calculateChunks.cjs.map +1 -1
  102. package/dist/cjs/utils/checkAccess.cjs +83 -1
  103. package/dist/cjs/utils/checkAccess.cjs.map +1 -1
  104. package/dist/cjs/utils/checkConfigConsistency.cjs +16 -1
  105. package/dist/cjs/utils/checkConfigConsistency.cjs.map +1 -1
  106. package/dist/cjs/utils/checkFileModifiedRange.cjs +81 -1
  107. package/dist/cjs/utils/checkFileModifiedRange.cjs.map +1 -1
  108. package/dist/cjs/utils/checkLastUpdateTime.cjs +19 -1
  109. package/dist/cjs/utils/checkLastUpdateTime.cjs.map +1 -1
  110. package/dist/cjs/utils/chunkInference.cjs +45 -1
  111. package/dist/cjs/utils/chunkInference.cjs.map +1 -1
  112. package/dist/cjs/utils/fixChunkStartEndChars.cjs +27 -3
  113. package/dist/cjs/utils/fixChunkStartEndChars.cjs.map +1 -1
  114. package/dist/cjs/utils/formatTimeDiff.cjs +20 -1
  115. package/dist/cjs/utils/formatTimeDiff.cjs.map +1 -1
  116. package/dist/cjs/utils/getIsFileUpdatedRecently.cjs +16 -1
  117. package/dist/cjs/utils/getIsFileUpdatedRecently.cjs.map +1 -1
  118. package/dist/cjs/utils/getOutputFilePath.cjs +74 -1
  119. package/dist/cjs/utils/getOutputFilePath.cjs.map +1 -1
  120. package/dist/cjs/utils/getParentPackageJSON.cjs +20 -1
  121. package/dist/cjs/utils/getParentPackageJSON.cjs.map +1 -1
  122. package/dist/cjs/utils/listSpecialChars.cjs +54 -2
  123. package/dist/cjs/utils/listSpecialChars.cjs.map +1 -1
  124. package/dist/cjs/utils/mapChunksBetweenFiles.cjs +102 -1
  125. package/dist/cjs/utils/mapChunksBetweenFiles.cjs.map +1 -1
  126. package/dist/cjs/utils/openBrowser.cjs +19 -1
  127. package/dist/cjs/utils/openBrowser.cjs.map +1 -1
  128. package/dist/cjs/utils/reorderParagraphs.cjs +91 -3
  129. package/dist/cjs/utils/reorderParagraphs.cjs.map +1 -1
  130. package/dist/cjs/utils/setupAI.cjs +66 -1
  131. package/dist/cjs/utils/setupAI.cjs.map +1 -1
  132. package/dist/cjs/watch.cjs +47 -1
  133. package/dist/cjs/watch.cjs.map +1 -1
  134. package/dist/esm/IntlayerEventListener.mjs +183 -1
  135. package/dist/esm/IntlayerEventListener.mjs.map +1 -1
  136. package/dist/esm/_virtual/_rolldown/runtime.mjs +8 -0
  137. package/dist/esm/_virtual/_utils_asset.mjs +97 -0
  138. package/dist/esm/auth/login.mjs +86 -2
  139. package/dist/esm/auth/login.mjs.map +1 -1
  140. package/dist/esm/build.mjs +28 -1
  141. package/dist/esm/build.mjs.map +1 -1
  142. package/dist/esm/ci.mjs +74 -1
  143. package/dist/esm/ci.mjs.map +1 -1
  144. package/dist/esm/cli.mjs +482 -1
  145. package/dist/esm/cli.mjs.map +1 -1
  146. package/dist/esm/config.mjs +13 -1
  147. package/dist/esm/config.mjs.map +1 -1
  148. package/dist/esm/editor.mjs +50 -1
  149. package/dist/esm/editor.mjs.map +1 -0
  150. package/dist/esm/extract.mjs +104 -1
  151. package/dist/esm/extract.mjs.map +1 -1
  152. package/dist/esm/fill/deepMergeContent.mjs +25 -1
  153. package/dist/esm/fill/deepMergeContent.mjs.map +1 -1
  154. package/dist/esm/fill/fill.mjs +81 -1
  155. package/dist/esm/fill/fill.mjs.map +1 -1
  156. package/dist/esm/fill/formatAutoFilledFilePath.mjs +30 -1
  157. package/dist/esm/fill/formatAutoFilledFilePath.mjs.map +1 -1
  158. package/dist/esm/fill/formatFillData.mjs +85 -1
  159. package/dist/esm/fill/formatFillData.mjs.map +1 -1
  160. package/dist/esm/fill/getAvailableLocalesInDictionary.mjs +24 -1
  161. package/dist/esm/fill/getAvailableLocalesInDictionary.mjs.map +1 -1
  162. package/dist/esm/fill/getFilterMissingContentPerLocale.mjs +49 -1
  163. package/dist/esm/fill/getFilterMissingContentPerLocale.mjs.map +1 -1
  164. package/dist/esm/fill/index.mjs +4 -1
  165. package/dist/esm/fill/listTranslationsTasks.mjs +69 -1
  166. package/dist/esm/fill/listTranslationsTasks.mjs.map +1 -1
  167. package/dist/esm/fill/translateDictionary.mjs +237 -1
  168. package/dist/esm/fill/translateDictionary.mjs.map +1 -1
  169. package/dist/esm/fill/writeFill.mjs +53 -1
  170. package/dist/esm/fill/writeFill.mjs.map +1 -1
  171. package/dist/esm/getTargetDictionary.mjs +33 -1
  172. package/dist/esm/getTargetDictionary.mjs.map +1 -1
  173. package/dist/esm/index.mjs +20 -1
  174. package/dist/esm/init.mjs +19 -1
  175. package/dist/esm/init.mjs.map +1 -1
  176. package/dist/esm/initMCP.mjs +65 -1
  177. package/dist/esm/initMCP.mjs.map +1 -1
  178. package/dist/esm/initSkills.mjs +87 -1
  179. package/dist/esm/initSkills.mjs.map +1 -1
  180. package/dist/esm/listContentDeclaration.mjs +39 -1
  181. package/dist/esm/listContentDeclaration.mjs.map +1 -1
  182. package/dist/esm/listProjects.mjs +26 -1
  183. package/dist/esm/listProjects.mjs.map +1 -1
  184. package/dist/esm/liveSync.mjs +150 -8
  185. package/dist/esm/liveSync.mjs.map +1 -1
  186. package/dist/esm/pull.mjs +150 -1
  187. package/dist/esm/pull.mjs.map +1 -1
  188. package/dist/esm/push/pullLog.mjs +102 -3
  189. package/dist/esm/push/pullLog.mjs.map +1 -1
  190. package/dist/esm/push/push.mjs +208 -1
  191. package/dist/esm/push/push.mjs.map +1 -1
  192. package/dist/esm/pushConfig.mjs +20 -1
  193. package/dist/esm/pushConfig.mjs.map +1 -1
  194. package/dist/esm/pushLog.mjs +83 -3
  195. package/dist/esm/pushLog.mjs.map +1 -1
  196. package/dist/esm/reviewDoc/reviewDoc.mjs +69 -1
  197. package/dist/esm/reviewDoc/reviewDoc.mjs.map +1 -1
  198. package/dist/esm/reviewDoc/reviewDocBlockAware.mjs +95 -1
  199. package/dist/esm/reviewDoc/reviewDocBlockAware.mjs.map +1 -1
  200. package/dist/esm/searchDoc.mjs +39 -1
  201. package/dist/esm/searchDoc.mjs.map +1 -1
  202. package/dist/esm/test/index.mjs +4 -1
  203. package/dist/esm/test/listMissingTranslations.mjs +49 -1
  204. package/dist/esm/test/listMissingTranslations.mjs.map +1 -1
  205. package/dist/esm/test/test.mjs +53 -1
  206. package/dist/esm/test/test.mjs.map +1 -1
  207. package/dist/esm/translateDoc/index.mjs +5 -1
  208. package/dist/esm/translateDoc/translateDoc.mjs +75 -1
  209. package/dist/esm/translateDoc/translateDoc.mjs.map +1 -1
  210. package/dist/esm/translateDoc/translateFile.mjs +103 -2
  211. package/dist/esm/translateDoc/translateFile.mjs.map +1 -1
  212. package/dist/esm/translateDoc/validation.mjs +46 -5
  213. package/dist/esm/translateDoc/validation.mjs.map +1 -1
  214. package/dist/esm/translation-alignment/alignBlocks.mjs +66 -1
  215. package/dist/esm/translation-alignment/alignBlocks.mjs.map +1 -1
  216. package/dist/esm/translation-alignment/computeSimilarity.mjs +22 -1
  217. package/dist/esm/translation-alignment/computeSimilarity.mjs.map +1 -1
  218. package/dist/esm/translation-alignment/fingerprintBlock.mjs +20 -1
  219. package/dist/esm/translation-alignment/fingerprintBlock.mjs.map +1 -1
  220. package/dist/esm/translation-alignment/index.mjs +11 -1
  221. package/dist/esm/translation-alignment/mapChangedLinesToBlocks.mjs +16 -1
  222. package/dist/esm/translation-alignment/mapChangedLinesToBlocks.mjs.map +1 -1
  223. package/dist/esm/translation-alignment/normalizeBlock.mjs +20 -1
  224. package/dist/esm/translation-alignment/normalizeBlock.mjs.map +1 -1
  225. package/dist/esm/translation-alignment/pipeline.mjs +35 -1
  226. package/dist/esm/translation-alignment/pipeline.mjs.map +1 -1
  227. package/dist/esm/translation-alignment/planActions.mjs +44 -1
  228. package/dist/esm/translation-alignment/planActions.mjs.map +1 -1
  229. package/dist/esm/translation-alignment/rebuildDocument.mjs +46 -2
  230. package/dist/esm/translation-alignment/rebuildDocument.mjs.map +1 -1
  231. package/dist/esm/translation-alignment/segmentDocument.mjs +64 -5
  232. package/dist/esm/translation-alignment/segmentDocument.mjs.map +1 -1
  233. package/dist/esm/utils/calculateChunks.mjs +87 -2
  234. package/dist/esm/utils/calculateChunks.mjs.map +1 -1
  235. package/dist/esm/utils/checkAccess.mjs +79 -1
  236. package/dist/esm/utils/checkAccess.mjs.map +1 -1
  237. package/dist/esm/utils/checkConfigConsistency.mjs +14 -1
  238. package/dist/esm/utils/checkConfigConsistency.mjs.map +1 -1
  239. package/dist/esm/utils/checkFileModifiedRange.mjs +80 -1
  240. package/dist/esm/utils/checkFileModifiedRange.mjs.map +1 -1
  241. package/dist/esm/utils/checkLastUpdateTime.mjs +17 -1
  242. package/dist/esm/utils/checkLastUpdateTime.mjs.map +1 -1
  243. package/dist/esm/utils/chunkInference.mjs +43 -1
  244. package/dist/esm/utils/chunkInference.mjs.map +1 -1
  245. package/dist/esm/utils/fixChunkStartEndChars.mjs +25 -3
  246. package/dist/esm/utils/fixChunkStartEndChars.mjs.map +1 -1
  247. package/dist/esm/utils/formatTimeDiff.mjs +18 -1
  248. package/dist/esm/utils/formatTimeDiff.mjs.map +1 -1
  249. package/dist/esm/utils/getIsFileUpdatedRecently.mjs +14 -1
  250. package/dist/esm/utils/getIsFileUpdatedRecently.mjs.map +1 -1
  251. package/dist/esm/utils/getOutputFilePath.mjs +72 -1
  252. package/dist/esm/utils/getOutputFilePath.mjs.map +1 -1
  253. package/dist/esm/utils/getParentPackageJSON.mjs +18 -1
  254. package/dist/esm/utils/getParentPackageJSON.mjs.map +1 -1
  255. package/dist/esm/utils/listSpecialChars.mjs +52 -2
  256. package/dist/esm/utils/listSpecialChars.mjs.map +1 -1
  257. package/dist/esm/utils/mapChunksBetweenFiles.mjs +100 -1
  258. package/dist/esm/utils/mapChunksBetweenFiles.mjs.map +1 -1
  259. package/dist/esm/utils/openBrowser.mjs +17 -1
  260. package/dist/esm/utils/openBrowser.mjs.map +1 -1
  261. package/dist/esm/utils/reorderParagraphs.mjs +90 -3
  262. package/dist/esm/utils/reorderParagraphs.mjs.map +1 -1
  263. package/dist/esm/utils/setupAI.mjs +63 -1
  264. package/dist/esm/utils/setupAI.mjs.map +1 -1
  265. package/dist/esm/watch.mjs +45 -1
  266. package/dist/esm/watch.mjs.map +1 -1
  267. package/dist/types/fill/fill.d.ts +1 -1
  268. package/dist/types/fill/translateDictionary.d.ts +1 -1
  269. package/dist/types/getTargetDictionary.d.ts +19 -2
  270. package/dist/types/getTargetDictionary.d.ts.map +1 -0
  271. package/dist/types/index.d.ts +2 -2
  272. package/dist/types/reviewDoc/reviewDocBlockAware.d.ts +1 -1
  273. package/dist/types/test/index.d.ts +2 -2
  274. package/dist/types/test/listMissingTranslations.d.ts +28 -2
  275. package/dist/types/test/listMissingTranslations.d.ts.map +1 -0
  276. package/dist/types/test/test.d.ts +11 -2
  277. package/dist/types/test/test.d.ts.map +1 -0
  278. package/dist/types/translateDoc/index.d.ts +1 -1
  279. package/dist/types/translateDoc/translateDoc.d.ts +1 -1
  280. package/dist/types/translateDoc/translateFile.d.ts +1 -1
  281. package/dist/types/translateDoc/types.d.ts +48 -2
  282. package/dist/types/translateDoc/types.d.ts.map +1 -0
  283. package/dist/types/utils/chunkInference.d.ts +1 -1
  284. package/dist/types/utils/setupAI.d.ts +21 -2
  285. package/dist/types/utils/setupAI.d.ts.map +1 -0
  286. package/package.json +12 -12
  287. package/dist/cjs/_utils_asset-ghp_Cjwk.cjs +0 -2
  288. package/dist/cjs/chunk-Bmb41Sf3.cjs +0 -1
  289. package/dist/esm/_utils_asset-B187VPMw.mjs +0 -2
  290. package/dist/esm/editor-D8BGlLzF.mjs +0 -2
  291. package/dist/esm/editor-D8BGlLzF.mjs.map +0 -1
  292. package/dist/types/getTargetDictionary-RBSRtaQj.d.ts +0 -19
  293. package/dist/types/getTargetDictionary-RBSRtaQj.d.ts.map +0 -1
  294. package/dist/types/listMissingTranslations-DxKw7nqI.d.ts +0 -28
  295. package/dist/types/listMissingTranslations-DxKw7nqI.d.ts.map +0 -1
  296. package/dist/types/setupAI-Bosjx7ah.d.ts +0 -21
  297. package/dist/types/setupAI-Bosjx7ah.d.ts.map +0 -1
  298. package/dist/types/test-DUTiJR5_.d.ts +0 -11
  299. package/dist/types/test-DUTiJR5_.d.ts.map +0 -1
  300. package/dist/types/types-BKvc3FmV.d.ts +0 -48
  301. package/dist/types/types-BKvc3FmV.d.ts.map +0 -1
package/dist/esm/cli.mjs CHANGED
@@ -1,2 +1,483 @@
1
- import{t as e}from"./editor-D8BGlLzF.mjs";import{extract as t}from"./extract.mjs";import{listProjectsCommand as n}from"./listProjects.mjs";import{liveSync as r}from"./liveSync.mjs";import{listContentDeclaration as i}from"./listContentDeclaration.mjs";import{init as a}from"./init.mjs";import{watchContentDeclaration as o}from"./watch.mjs";import{login as s}from"./auth/login.mjs";import{build as c}from"./build.mjs";import{runCI as l}from"./ci.mjs";import{getConfig as ee}from"./config.mjs";import{testMissingTranslations as u}from"./test/test.mjs";import{fill as te}from"./fill/fill.mjs";import{initSkills as d}from"./initSkills.mjs";import{initMCP as ne}from"./initMCP.mjs";import{pull as f}from"./pull.mjs";import{push as p}from"./push/push.mjs";import{pushConfig as re}from"./pushConfig.mjs";import"./_utils_asset-B187VPMw.mjs";import{reviewDoc as ie}from"./reviewDoc/reviewDoc.mjs";import{searchDoc as ae}from"./searchDoc.mjs";import{translateDoc as oe}from"./translateDoc/translateDoc.mjs";import{getParentPackageJSON as m}from"./utils/getParentPackageJSON.mjs";import{dirname as h}from"node:path";import{setPrefix as se}from"@intlayer/config/logger";import{getConfiguration as g}from"@intlayer/config/node";import{fileURLToPath as _}from"node:url";import{Command as v}from"commander";const y=typeof import.meta.url==`string`?h(_(import.meta.url)):__dirname,b=m(y),x=[[`--env-file [envFile]`,`Environment file`],[`-e, --env [env]`,`Environment`],[`--base-dir [baseDir]`,`Base directory`],[`--no-cache [noCache]`,`No cache`],...[[`--verbose`,`Verbose (default to true using CLI)`],[`--prefix [prefix]`,`Prefix`]]],S=[[`--provider [provider]`,`Provider`],[`--temperature [temperature]`,`Temperature`],[`--model [model]`,`Model`],[`--api-key [apiKey]`,`Provider API key`],[`--custom-prompt [prompt]`,`Custom prompt`],[`--application-context [applicationContext]`,`Application context`],[`--data-serialization [dataSerialization]`,`Data serialization`]],C=[[`--git-diff [gitDiff]`,`Git diff mode - Check git diff between two refs`],[`--git-diff-base [gitDiffBase]`,`Git diff base ref`],[`--git-diff-current [gitDiffCurrent]`,`Git diff current ref`],[`--uncommitted [uncommitted]`,`Uncommitted`],[`--unpushed [unpushed]`,`Unpushed`],[`--untracked [untracked]`,`Untracked`]],w=(e,t)=>t.filter(t=>e[t]!==void 0),T=(e,t)=>(t.forEach(([t,n])=>{e.option(t,n)}),e),E=e=>Object.fromEntries(Object.entries(e).filter(([e,t])=>t!==void 0)),D=e=>T(e,x),O=e=>T(e,S),k=e=>T(e,C),A=e=>{let{apiKey:t,provider:n,model:r,temperature:i,applicationContext:a,customPrompt:o,dataSerialization:s}=e,c=g(),{ai:l}=c;return E({...l,apiKey:t??c.ai?.apiKey,provider:n??c.ai?.provider,model:r??c.ai?.model,temperature:i??c.ai?.temperature,applicationContext:a??c.ai?.applicationContext,customPrompt:o??c.ai?.customPrompt,dataSerialization:s??c.ai?.dataSerialization})},j=[`gitDiff`,`gitDiffBase`,`gitDiffCurrent`,`uncommitted`,`unpushed`,`untracked`],M=e=>{if(w(e,j).length===0)return;let{gitDiff:t,gitDiffBase:n,gitDiffCurrent:r,uncommitted:i,unpushed:a,untracked:o}=e;return E({mode:[t&&`gitDiff`,i&&`uncommitted`,a&&`unpushed`,o&&`untracked`].filter(Boolean),baseRef:n,currentRef:r,absolute:!0})},N=[`baseDir`,`env`,`envFile`,`verbose`,`prefix`,`checkTypes`],P=e=>{if(w(e,N).length===0)return;let{baseDir:t,env:n,envFile:r,verbose:i,noCache:a,checkTypes:o}=e,s=E({mode:i===void 0?void 0:i?`verbose`:`default`}),c=E({checkTypes:o}),l=E({log:Object.keys(s).length>0?s:void 0,build:Object.keys(c).length>0?c:void 0});return E({baseDir:t,env:n,envFile:r,override:Object.keys(l).length>0?l:void 0,cache:a===void 0?void 0:!a})},F=()=>{process.argv.includes(`--with`)||se(``);let m=new v;m.version(b.version).description(`Intlayer CLI`),m.command(`version`).description(`Print the Intlayer CLI version`).action(()=>{console.log(b.version??`unknown`)});let h=m.command(`login`).description(`Login to Intlayer`).option(`--cms-url [cmsUrl]`,`CMS URL`);D(h),h.action(e=>{let t=P(e)??{override:{log:{prefix:``,mode:`verbose`}}};return s({cmsUrl:e.cmsUrl,configOptions:t})});let g=m.command(`init`).description(`Initialize Intlayer in the project`).option(`--project-root [projectRoot]`,`Project root directory`).action(e=>a(e.projectRoot));g.command(`skills`).description(`Initialize Intlayer skills in the project`).option(`--project-root [projectRoot]`,`Project root directory`).action(e=>d(e.projectRoot)),g.command(`mcp`).description(`Initialize Intlayer MCP server in the project`).option(`--project-root [projectRoot]`,`Project root directory`).action(e=>ne(e.projectRoot));let _=m.command(`dictionary`).alias(`dictionaries`).alias(`dic`).description(`Dictionaries operations`),y={description:`Build the dictionaries`,options:[[`-w, --watch`,`Watch for changes`],[`--skip-prepare`,`Skip the prepare step`],[`--with [with...]`,`Start command in parallel with the build`],[`--check-types`,`Check TypeScript type and log errors`]]},x=_.command(`build`).description(y.description);T(x,y.options),D(x),x.action(e=>{c({...e,configOptions:P(e)})});let S=m.command(`build`).description(y.description);T(S,y.options),D(S),S.action(e=>{c({...e,configOptions:P(e)})});let C={description:`Watch the dictionaries changes`,options:[[`--with [with...]`,`Start command in parallel with the build`]]},w=_.command(`watch`).description(y.description);T(w,C.options),D(w),w.action(e=>{o({...e,configOptions:P(e)})});let E=m.command(`watch`).description(y.description);T(E,C.options),D(E),E.action(e=>{o({...e,configOptions:P(e)})});let j={description:`Pull dictionaries from the server`,options:[[`-d, --dictionaries [ids...]`,`List of dictionary IDs to pull`],[`--dictionary [ids...]`,`List of dictionary IDs to pull (alias for --dictionaries)`],[`--new-dictionaries-path [path]`,`Path to save the new dictionaries`],[`--newDictionariesPath [path]`,`[alias] Path to save the new dictionaries`]]},N=_.command(`pull`).description(j.description);T(N,j.options),D(N),N.action(e=>{let t=[...e.dictionaries??[],...e.dictionary??[]];f({...e,dictionaries:t.length>0?t:void 0,configOptions:{...e.configOptions,baseDir:e.baseDir}})});let F=m.command(`pull`).description(j.description);T(F,j.options),D(F),F.action(e=>{let t=[...e.dictionaries??[],...e.dictionary??[]];f({...e,dictionaries:t.length>0?t:void 0,configOptions:P(e)})});let I={description:`Push all dictionaries. Create or update the pushed dictionaries`,options:[[`-d, --dictionaries [ids...]`,`List of dictionary IDs to push`],[`--dictionary [ids...]`,`List of dictionary IDs to push (alias for --dictionaries)`],[`-r, --delete-locale-dictionary`,`Delete the local dictionaries after pushing`],[`-k, --keep-locale-dictionary`,`Keep the local dictionaries after pushing`],[`--deleteLocaleDictionary`,`[alias] Delete the local dictionaries after pushing`],[`--keepLocaleDictionary`,`[alias] Keep the local dictionaries after pushing`],[`--build [build]`,`Build the dictionaries before pushing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build`]]},L=_.command(`push`).description(I.description);T(L,I.options),D(L),k(L),L.action(e=>{let t=[...e.dictionaries||[],...e.dictionary||[]];return p({...e,dictionaries:t.length>0?t:void 0,gitOptions:M(e),configOptions:P(e)})});let R=m.command(`push`).description(I.description);T(R,I.options),D(R),k(R),R.action(e=>{let t=[...e.dictionaries||[],...e.dictionary||[]];return p({...e,dictionaries:t.length>0?t:void 0,gitOptions:M(e),configOptions:P(e)})});let z=m.command(`configuration`).alias(`config`).alias(`conf`).description(`Configuration operations`),B=z.command(`get`).description(`Get the configuration`);D(B),B.action(e=>{ee({...e,configOptions:P(e)})});let V=z.command(`push`).description(`Push the configuration`);D(V),V.action(e=>{re({...e,configOptions:P(e)})}),m.command(`projects`).alias(`project`).description(`List Intlayer projects`).command(`list`).description(`List all Intlayer projects in the directory`).option(`--base-dir [baseDir]`,`Base directory to search from`).option(`--git-root`,`Search from the git root directory instead of the base directory`).option(`--json`,`Output the results as JSON`).action(e=>{n({baseDir:e.baseDir,gitRoot:e.gitRoot,json:e.json})}),m.command(`projects-list`).alias(`pl`).description(`List all Intlayer projects in the directory`).option(`--base-dir [baseDir]`,`Base directory to search from`).option(`--git-root`,`Search from the git root directory instead of the base directory`).option(`--absolute`,`Output the results as absolute paths`).option(`--json`,`Output the results as JSON`).action(e=>{n({baseDir:e.baseDir,gitRoot:e.gitRoot,json:e.json,absolute:e.absolute})});let H=m.command(`content`).description(`Content declaration operations`);H.command(`list`).description(`List the content declaration files`).option(`--json`,`Output the results as JSON`).option(`--absolute`,`Output the results as absolute paths`).action(e=>{i({json:e.json,absolute:e.absolute})}),m.command(`list`).description(`List the content declaration files`).option(`--json`,`Output the results as JSON`).option(`--absolute`,`Output the results as absolute paths`).action(e=>{i({json:e.json,absolute:e.absolute})});let U=H.command(`test`).description(`Test if there are missing translations`).option(`--build [build]`,`Build the dictionaries before testing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build`);D(U),U.action(e=>{u({...e,configOptions:P(e)})});let W=m.command(`test`).description(`Test if there are missing translations`).option(`--build [build]`,`Build the dictionaries before testing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build`);D(W),W.action(e=>{u({...e,configOptions:P(e)})});let G=m.command(`fill`).description(`Fill the dictionaries`).option(`-f, --file [files...]`,`List of Dictionary files to fill`).option(`--source-locale [sourceLocale]`,`Source locale to translate from`).option(`--output-locales [outputLocales...]`,`Target locales to translate to`).option(`--mode [mode]`,`Fill mode: complete, review. Complete will fill all missing content, review will fill missing content and review existing keys`,`complete`).option(`-k, --keys [keys...]`,`Filter dictionaries based on keys`).option(`--key [keys...]`,`Filter dictionaries based on keys (alias for --keys)`).option(`--excluded-keys [excludedKeys...]`,`Filter out dictionaries based on keys`).option(`--excluded-key [excludedKeys...]`,`Filter out dictionaries based on keys (alias for --excluded-keys)`).option(`--path-filter [pathFilters...]`,`Filter dictionaries based on glob pattern`).option(`--build [build]`,`Build the dictionaries before filling to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build`).option(`--skip-metadata`,`Skip filling missing metadata (description, title, tags) for dictionaries`);D(G),O(G),k(G),G.action(e=>{let t=[...e.keys??[],...e.key??[]],n=[...e.excludedKeys??[],...e.excludedKey??[]],r=[...e.dictionaries??[],...e.dictionary??[]];return te({...e,keys:t.length>0?t:void 0,excludedKeys:n.length>0?n:void 0,dictionaries:r.length>0?r:void 0,aiOptions:A(e),gitOptions:M(e),configOptions:P(e)})});let K=[[`--doc-pattern [docPattern...]`,`Documentation pattern`],[`--excluded-glob-pattern [excludedGlobPattern...]`,`Excluded glob pattern`],[`--nb-simultaneous-file-processed [nbSimultaneousFileProcessed]`,`Number of simultaneous file processed`],[`--locales [locales...]`,`Locales`],[`--base-locale [baseLocale]`,`Base locale`],[`--custom-instructions [customInstructions]`,`Custom instructions added to the prompt. Usefull to apply specific rules regarding formatting, urls translation, etc.`],[`--skip-if-modified-before [skipIfModifiedBefore]`,'Skip the file if it has been modified before the given time. Can be an absolute time as "2025-12-05" (string or Date) or a relative time in ms `1 * 60 * 60 * 1000` (1 hour). This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file.'],[`--skip-if-modified-after [skipIfModifiedAfter]`,'Skip the file if it has been modified within the given time. Can be an absolute time as "2025-12-05" (string or Date) or a relative time in ms `1 * 60 * 60 * 1000` (1 hour). This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file.'],[`--skip-if-exists`,`Skip the file if it already exists`]],q=m.command(`doc`).description(`Documentation operations`),J=q.command(`translate`).description(`Translate the documentation`);D(J),O(J),k(J),T(J,K),J.action(e=>oe({docPattern:e.docPattern,excludedGlobPattern:e.excludedGlobPattern,locales:e.locales,baseLocale:e.baseLocale,aiOptions:A(e),gitOptions:M(e),nbSimultaneousFileProcessed:e.nbSimultaneousFileProcessed,configOptions:P(e),customInstructions:e.customInstructions,skipIfModifiedBefore:e.skipIfModifiedBefore,skipIfModifiedAfter:e.skipIfModifiedAfter,skipIfExists:e.skipIfExists}));let Y=q.command(`review`).description(`Review the documentation`);D(Y),O(Y),k(Y),T(Y,K),Y.action(e=>ie({docPattern:e.docPattern,excludedGlobPattern:e.excludedGlobPattern,locales:e.locales,baseLocale:e.baseLocale,aiOptions:A(e),gitOptions:M(e),nbSimultaneousFileProcessed:e.nbSimultaneousFileProcessed,configOptions:P(e),customInstructions:e.customInstructions,skipIfModifiedBefore:e.skipIfModifiedBefore,skipIfModifiedAfter:e.skipIfModifiedAfter,skipIfExists:e.skipIfExists}));let X=q.command(`search`).description(`Search the documentation`).argument(`<query>`,`Search query`).option(`--limit [limit]`,`Limit the number of results`,`10`);D(X),X.action((e,t)=>ae({query:e,limit:t.limit?parseInt(t.limit,10):10,configOptions:P(t)}));let ce=[[`--with [with...]`,`Start command in parallel with the live sync`]],Z=m.command(`live`).description(`Live sync - Watch for changes made on the CMS and update the application content accordingly`);T(Z,ce),D(Z),Z.action(e=>r(e));let Q=m.command(`editor`).description(`Visual editor operations`).command(`start`).description(`Start the Intlayer visual editor`);D(Q),Q.action(t=>{e({env:t.env,envFile:t.envFile})});let $=m.command(`extract`).alias(`ext`).description(`Extract strings from components to be placed in a .content file close to the component`);return $.option(`-f, --file [files...]`,`List of files to extract`).option(`--code-only`,`Only extract the component code`,!1).option(`--declaration-only`,`Only generate content declaration`,!1).action(e=>{t({files:e.file,configOptions:P(e),codeOnly:e.codeOnly,declarationOnly:e.declarationOnly})}),D($),m.parse(process.argv),m.command(`ci`).description(`Run Intlayer commands with auto-injected credentials from INTLAYER_PROJECT_CREDENTIALS. Detects current project or iterates over all projects.`).argument(`<command...>`,`The intlayer command to execute (e.g., "fill", "push")`).allowUnknownOption().action(e=>{l(e)}),m};export{y as dirname,F as setAPI};
1
+ import { extract } from "./extract.mjs";
2
+ import { listProjectsCommand } from "./listProjects.mjs";
3
+ import { liveSync } from "./liveSync.mjs";
4
+ import { listContentDeclaration } from "./listContentDeclaration.mjs";
5
+ import { init } from "./init.mjs";
6
+ import { startEditor } from "./editor.mjs";
7
+ import { watchContentDeclaration } from "./watch.mjs";
8
+ import { login } from "./auth/login.mjs";
9
+ import { build } from "./build.mjs";
10
+ import { runCI } from "./ci.mjs";
11
+ import { getConfig } from "./config.mjs";
12
+ import { testMissingTranslations } from "./test/test.mjs";
13
+ import { fill } from "./fill/fill.mjs";
14
+ import { initSkills } from "./initSkills.mjs";
15
+ import { initMCP } from "./initMCP.mjs";
16
+ import { pull } from "./pull.mjs";
17
+ import { push } from "./push/push.mjs";
18
+ import { pushConfig } from "./pushConfig.mjs";
19
+ import { reviewDoc } from "./reviewDoc/reviewDoc.mjs";
20
+ import { searchDoc } from "./searchDoc.mjs";
21
+ import { translateDoc } from "./translateDoc/translateDoc.mjs";
22
+ import { getParentPackageJSON } from "./utils/getParentPackageJSON.mjs";
23
+ import { dirname as dirname$1 } from "node:path";
24
+ import { setPrefix } from "@intlayer/config/logger";
25
+ import { getConfiguration } from "@intlayer/config/node";
26
+ import { fileURLToPath } from "node:url";
27
+ import { Command } from "commander";
28
+
29
+ //#region src/cli.ts
30
+ const isESModule = typeof import.meta.url === "string";
31
+ const dirname = isESModule ? dirname$1(fileURLToPath(import.meta.url)) : __dirname;
32
+ const packageJson = getParentPackageJSON(dirname);
33
+ const configurationOptions = [
34
+ ["--env-file [envFile]", "Environment file"],
35
+ ["-e, --env [env]", "Environment"],
36
+ ["--base-dir [baseDir]", "Base directory"],
37
+ ["--no-cache [noCache]", "No cache"],
38
+ ...[["--verbose", "Verbose (default to true using CLI)"], ["--prefix [prefix]", "Prefix"]]
39
+ ];
40
+ const aiOptions = [
41
+ ["--provider [provider]", "Provider"],
42
+ ["--temperature [temperature]", "Temperature"],
43
+ ["--model [model]", "Model"],
44
+ ["--api-key [apiKey]", "Provider API key"],
45
+ ["--custom-prompt [prompt]", "Custom prompt"],
46
+ ["--application-context [applicationContext]", "Application context"],
47
+ ["--data-serialization [dataSerialization]", "Data serialization"]
48
+ ];
49
+ const gitOptions = [
50
+ ["--git-diff [gitDiff]", "Git diff mode - Check git diff between two refs"],
51
+ ["--git-diff-base [gitDiffBase]", "Git diff base ref"],
52
+ ["--git-diff-current [gitDiffCurrent]", "Git diff current ref"],
53
+ ["--uncommitted [uncommitted]", "Uncommitted"],
54
+ ["--unpushed [unpushed]", "Unpushed"],
55
+ ["--untracked [untracked]", "Untracked"]
56
+ ];
57
+ const extractKeysFromOptions = (options, keys) => keys.filter((key) => options[key] !== void 0);
58
+ /**
59
+ * Helper functions to apply common options to commands
60
+ */
61
+ const applyOptions = (command, options) => {
62
+ options.forEach(([flag, description]) => {
63
+ command.option(flag, description);
64
+ });
65
+ return command;
66
+ };
67
+ const removeUndefined = (obj) => Object.fromEntries(Object.entries(obj).filter(([_, value]) => value !== void 0));
68
+ const applyConfigOptions = (command) => applyOptions(command, configurationOptions);
69
+ const applyAIOptions = (command) => applyOptions(command, aiOptions);
70
+ const applyGitOptions = (command) => applyOptions(command, gitOptions);
71
+ const extractAiOptions = (options) => {
72
+ const { apiKey, provider, model, temperature, applicationContext, customPrompt, dataSerialization } = options;
73
+ const configuration = getConfiguration();
74
+ const { ai } = configuration;
75
+ return removeUndefined({
76
+ ...ai,
77
+ apiKey: apiKey ?? configuration.ai?.apiKey,
78
+ provider: provider ?? configuration.ai?.provider,
79
+ model: model ?? configuration.ai?.model,
80
+ temperature: temperature ?? configuration.ai?.temperature,
81
+ applicationContext: applicationContext ?? configuration.ai?.applicationContext,
82
+ customPrompt: customPrompt ?? configuration.ai?.customPrompt,
83
+ dataSerialization: dataSerialization ?? configuration.ai?.dataSerialization
84
+ });
85
+ };
86
+ const gitOptionKeys = [
87
+ "gitDiff",
88
+ "gitDiffBase",
89
+ "gitDiffCurrent",
90
+ "uncommitted",
91
+ "unpushed",
92
+ "untracked"
93
+ ];
94
+ const extractGitOptions = (options) => {
95
+ if (extractKeysFromOptions(options, gitOptionKeys).length === 0) return void 0;
96
+ const { gitDiff, gitDiffBase, gitDiffCurrent, uncommitted, unpushed, untracked } = options;
97
+ return removeUndefined({
98
+ mode: [
99
+ gitDiff && "gitDiff",
100
+ uncommitted && "uncommitted",
101
+ unpushed && "unpushed",
102
+ untracked && "untracked"
103
+ ].filter(Boolean),
104
+ baseRef: gitDiffBase,
105
+ currentRef: gitDiffCurrent,
106
+ absolute: true
107
+ });
108
+ };
109
+ const configurationOptionKeys = [
110
+ "baseDir",
111
+ "env",
112
+ "envFile",
113
+ "verbose",
114
+ "prefix",
115
+ "checkTypes"
116
+ ];
117
+ const extractConfigOptions = (options) => {
118
+ if (extractKeysFromOptions(options, configurationOptionKeys).length === 0) return;
119
+ const { baseDir, env, envFile, verbose, noCache, checkTypes } = options;
120
+ const log = removeUndefined({ mode: typeof verbose !== "undefined" ? verbose ? "verbose" : "default" : void 0 });
121
+ const build = removeUndefined({ checkTypes });
122
+ const override = removeUndefined({
123
+ log: Object.keys(log).length > 0 ? log : void 0,
124
+ build: Object.keys(build).length > 0 ? build : void 0
125
+ });
126
+ return removeUndefined({
127
+ baseDir,
128
+ env,
129
+ envFile,
130
+ override: Object.keys(override).length > 0 ? override : void 0,
131
+ cache: typeof noCache !== "undefined" ? !noCache : void 0
132
+ });
133
+ };
134
+ /**
135
+ * Set the API for the CLI
136
+ *
137
+ * Example of commands:
138
+ *
139
+ * npm run intlayer build --watch
140
+ * npm run intlayer push --dictionaries id1 id2 id3 --deleteLocaleDir
141
+ */
142
+ const setAPI = () => {
143
+ if (!process.argv.includes("--with")) setPrefix("");
144
+ const program = new Command();
145
+ program.version(packageJson.version).description("Intlayer CLI");
146
+ program.command("version").description("Print the Intlayer CLI version").action(() => {
147
+ console.log(packageJson.version ?? "unknown");
148
+ });
149
+ /**
150
+ * AUTH
151
+ */
152
+ const loginCmd = program.command("login").description("Login to Intlayer").option("--cms-url [cmsUrl]", "CMS URL");
153
+ applyConfigOptions(loginCmd);
154
+ loginCmd.action((options) => {
155
+ const configOptions = extractConfigOptions(options) ?? { override: { log: {
156
+ prefix: "",
157
+ mode: "verbose"
158
+ } } };
159
+ return login({
160
+ cmsUrl: options.cmsUrl,
161
+ configOptions
162
+ });
163
+ });
164
+ /**
165
+ * INIT
166
+ */
167
+ const initCmd = program.command("init").description("Initialize Intlayer in the project").option("--project-root [projectRoot]", "Project root directory").action((options) => init(options.projectRoot));
168
+ initCmd.command("skills").description("Initialize Intlayer skills in the project").option("--project-root [projectRoot]", "Project root directory").action((options) => initSkills(options.projectRoot));
169
+ initCmd.command("mcp").description("Initialize Intlayer MCP server in the project").option("--project-root [projectRoot]", "Project root directory").action((options) => initMCP(options.projectRoot));
170
+ /**
171
+ * DICTIONARIES
172
+ */
173
+ const dictionariesProgram = program.command("dictionary").alias("dictionaries").alias("dic").description("Dictionaries operations");
174
+ const buildOptions = {
175
+ description: "Build the dictionaries",
176
+ options: [
177
+ ["-w, --watch", "Watch for changes"],
178
+ ["--skip-prepare", "Skip the prepare step"],
179
+ ["--with [with...]", "Start command in parallel with the build"],
180
+ ["--check-types", "Check TypeScript type and log errors"]
181
+ ]
182
+ };
183
+ const dictionariesBuildCmd = dictionariesProgram.command("build").description(buildOptions.description);
184
+ applyOptions(dictionariesBuildCmd, buildOptions.options);
185
+ applyConfigOptions(dictionariesBuildCmd);
186
+ dictionariesBuildCmd.action((options) => {
187
+ build({
188
+ ...options,
189
+ configOptions: extractConfigOptions(options)
190
+ });
191
+ });
192
+ const rootBuildCmd = program.command("build").description(buildOptions.description);
193
+ applyOptions(rootBuildCmd, buildOptions.options);
194
+ applyConfigOptions(rootBuildCmd);
195
+ rootBuildCmd.action((options) => {
196
+ build({
197
+ ...options,
198
+ configOptions: extractConfigOptions(options)
199
+ });
200
+ });
201
+ const watchOptions = {
202
+ description: "Watch the dictionaries changes",
203
+ options: [["--with [with...]", "Start command in parallel with the build"]]
204
+ };
205
+ const dictionariesWatchCmd = dictionariesProgram.command("watch").description(buildOptions.description);
206
+ applyOptions(dictionariesWatchCmd, watchOptions.options);
207
+ applyConfigOptions(dictionariesWatchCmd);
208
+ dictionariesWatchCmd.action((options) => {
209
+ watchContentDeclaration({
210
+ ...options,
211
+ configOptions: extractConfigOptions(options)
212
+ });
213
+ });
214
+ const rootWatchCmd = program.command("watch").description(buildOptions.description);
215
+ applyOptions(rootWatchCmd, watchOptions.options);
216
+ applyConfigOptions(rootWatchCmd);
217
+ rootWatchCmd.action((options) => {
218
+ watchContentDeclaration({
219
+ ...options,
220
+ configOptions: extractConfigOptions(options)
221
+ });
222
+ });
223
+ const pullOptions = {
224
+ description: "Pull dictionaries from the server",
225
+ options: [
226
+ ["-d, --dictionaries [ids...]", "List of dictionary IDs to pull"],
227
+ ["--dictionary [ids...]", "List of dictionary IDs to pull (alias for --dictionaries)"],
228
+ ["--new-dictionaries-path [path]", "Path to save the new dictionaries"],
229
+ ["--newDictionariesPath [path]", "[alias] Path to save the new dictionaries"]
230
+ ]
231
+ };
232
+ const dictionariesPullCmd = dictionariesProgram.command("pull").description(pullOptions.description);
233
+ applyOptions(dictionariesPullCmd, pullOptions.options);
234
+ applyConfigOptions(dictionariesPullCmd);
235
+ dictionariesPullCmd.action((options) => {
236
+ const dictionaries = [...options.dictionaries ?? [], ...options.dictionary ?? []];
237
+ pull({
238
+ ...options,
239
+ dictionaries: dictionaries.length > 0 ? dictionaries : void 0,
240
+ configOptions: {
241
+ ...options.configOptions,
242
+ baseDir: options.baseDir
243
+ }
244
+ });
245
+ });
246
+ const rootPullCmd = program.command("pull").description(pullOptions.description);
247
+ applyOptions(rootPullCmd, pullOptions.options);
248
+ applyConfigOptions(rootPullCmd);
249
+ rootPullCmd.action((options) => {
250
+ const dictionaries = [...options.dictionaries ?? [], ...options.dictionary ?? []];
251
+ pull({
252
+ ...options,
253
+ dictionaries: dictionaries.length > 0 ? dictionaries : void 0,
254
+ configOptions: extractConfigOptions(options)
255
+ });
256
+ });
257
+ const pushOptions = {
258
+ description: "Push all dictionaries. Create or update the pushed dictionaries",
259
+ options: [
260
+ ["-d, --dictionaries [ids...]", "List of dictionary IDs to push"],
261
+ ["--dictionary [ids...]", "List of dictionary IDs to push (alias for --dictionaries)"],
262
+ ["-r, --delete-locale-dictionary", "Delete the local dictionaries after pushing"],
263
+ ["-k, --keep-locale-dictionary", "Keep the local dictionaries after pushing"],
264
+ ["--deleteLocaleDictionary", "[alias] Delete the local dictionaries after pushing"],
265
+ ["--keepLocaleDictionary", "[alias] Keep the local dictionaries after pushing"],
266
+ ["--build [build]", "Build the dictionaries before pushing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build"]
267
+ ]
268
+ };
269
+ const dictionariesPushCmd = dictionariesProgram.command("push").description(pushOptions.description);
270
+ applyOptions(dictionariesPushCmd, pushOptions.options);
271
+ applyConfigOptions(dictionariesPushCmd);
272
+ applyGitOptions(dictionariesPushCmd);
273
+ dictionariesPushCmd.action((options) => {
274
+ const dictionaries = [...options.dictionaries || [], ...options.dictionary || []];
275
+ return push({
276
+ ...options,
277
+ dictionaries: dictionaries.length > 0 ? dictionaries : void 0,
278
+ gitOptions: extractGitOptions(options),
279
+ configOptions: extractConfigOptions(options)
280
+ });
281
+ });
282
+ const rootPushCmd = program.command("push").description(pushOptions.description);
283
+ applyOptions(rootPushCmd, pushOptions.options);
284
+ applyConfigOptions(rootPushCmd);
285
+ applyGitOptions(rootPushCmd);
286
+ rootPushCmd.action((options) => {
287
+ const dictionaries = [...options.dictionaries || [], ...options.dictionary || []];
288
+ return push({
289
+ ...options,
290
+ dictionaries: dictionaries.length > 0 ? dictionaries : void 0,
291
+ gitOptions: extractGitOptions(options),
292
+ configOptions: extractConfigOptions(options)
293
+ });
294
+ });
295
+ /**
296
+ * CONFIGURATION
297
+ */
298
+ const configurationProgram = program.command("configuration").alias("config").alias("conf").description("Configuration operations");
299
+ const configGetCmd = configurationProgram.command("get").description("Get the configuration");
300
+ applyConfigOptions(configGetCmd);
301
+ configGetCmd.action((options) => {
302
+ getConfig({
303
+ ...options,
304
+ configOptions: extractConfigOptions(options)
305
+ });
306
+ });
307
+ const configPushCmd = configurationProgram.command("push").description("Push the configuration");
308
+ applyConfigOptions(configPushCmd);
309
+ configPushCmd.action((options) => {
310
+ pushConfig({
311
+ ...options,
312
+ configOptions: extractConfigOptions(options)
313
+ });
314
+ });
315
+ program.command("projects").alias("project").description("List Intlayer projects").command("list").description("List all Intlayer projects in the directory").option("--base-dir [baseDir]", "Base directory to search from").option("--git-root", "Search from the git root directory instead of the base directory").option("--json", "Output the results as JSON").action((options) => {
316
+ listProjectsCommand({
317
+ baseDir: options.baseDir,
318
+ gitRoot: options.gitRoot,
319
+ json: options.json
320
+ });
321
+ });
322
+ program.command("projects-list").alias("pl").description("List all Intlayer projects in the directory").option("--base-dir [baseDir]", "Base directory to search from").option("--git-root", "Search from the git root directory instead of the base directory").option("--absolute", "Output the results as absolute paths").option("--json", "Output the results as JSON").action((options) => {
323
+ listProjectsCommand({
324
+ baseDir: options.baseDir,
325
+ gitRoot: options.gitRoot,
326
+ json: options.json,
327
+ absolute: options.absolute
328
+ });
329
+ });
330
+ /**
331
+ * CONTENT DECLARATION
332
+ */
333
+ const contentProgram = program.command("content").description("Content declaration operations");
334
+ contentProgram.command("list").description("List the content declaration files").option("--json", "Output the results as JSON").option("--absolute", "Output the results as absolute paths").action((options) => {
335
+ listContentDeclaration({
336
+ json: options.json,
337
+ absolute: options.absolute
338
+ });
339
+ });
340
+ program.command("list").description("List the content declaration files").option("--json", "Output the results as JSON").option("--absolute", "Output the results as absolute paths").action((options) => {
341
+ listContentDeclaration({
342
+ json: options.json,
343
+ absolute: options.absolute
344
+ });
345
+ });
346
+ const testProgram = contentProgram.command("test").description("Test if there are missing translations").option("--build [build]", "Build the dictionaries before testing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build");
347
+ applyConfigOptions(testProgram);
348
+ testProgram.action((options) => {
349
+ testMissingTranslations({
350
+ ...options,
351
+ configOptions: extractConfigOptions(options)
352
+ });
353
+ });
354
+ const rootTestCmd = program.command("test").description("Test if there are missing translations").option("--build [build]", "Build the dictionaries before testing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build");
355
+ applyConfigOptions(rootTestCmd);
356
+ rootTestCmd.action((options) => {
357
+ testMissingTranslations({
358
+ ...options,
359
+ configOptions: extractConfigOptions(options)
360
+ });
361
+ });
362
+ const fillProgram = program.command("fill").description("Fill the dictionaries").option("-f, --file [files...]", "List of Dictionary files to fill").option("--source-locale [sourceLocale]", "Source locale to translate from").option("--output-locales [outputLocales...]", "Target locales to translate to").option("--mode [mode]", "Fill mode: complete, review. Complete will fill all missing content, review will fill missing content and review existing keys", "complete").option("-k, --keys [keys...]", "Filter dictionaries based on keys").option("--key [keys...]", "Filter dictionaries based on keys (alias for --keys)").option("--excluded-keys [excludedKeys...]", "Filter out dictionaries based on keys").option("--excluded-key [excludedKeys...]", "Filter out dictionaries based on keys (alias for --excluded-keys)").option("--path-filter [pathFilters...]", "Filter dictionaries based on glob pattern").option("--build [build]", "Build the dictionaries before filling to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build").option("--skip-metadata", "Skip filling missing metadata (description, title, tags) for dictionaries");
363
+ applyConfigOptions(fillProgram);
364
+ applyAIOptions(fillProgram);
365
+ applyGitOptions(fillProgram);
366
+ fillProgram.action((options) => {
367
+ const keys = [...options.keys ?? [], ...options.key ?? []];
368
+ const excludedKeys = [...options.excludedKeys ?? [], ...options.excludedKey ?? []];
369
+ const dictionaries = [...options.dictionaries ?? [], ...options.dictionary ?? []];
370
+ return fill({
371
+ ...options,
372
+ keys: keys.length > 0 ? keys : void 0,
373
+ excludedKeys: excludedKeys.length > 0 ? excludedKeys : void 0,
374
+ dictionaries: dictionaries.length > 0 ? dictionaries : void 0,
375
+ aiOptions: extractAiOptions(options),
376
+ gitOptions: extractGitOptions(options),
377
+ configOptions: extractConfigOptions(options)
378
+ });
379
+ });
380
+ /**
381
+ * DOCS
382
+ */
383
+ const docParams = [
384
+ ["--doc-pattern [docPattern...]", "Documentation pattern"],
385
+ ["--excluded-glob-pattern [excludedGlobPattern...]", "Excluded glob pattern"],
386
+ ["--nb-simultaneous-file-processed [nbSimultaneousFileProcessed]", "Number of simultaneous file processed"],
387
+ ["--locales [locales...]", "Locales"],
388
+ ["--base-locale [baseLocale]", "Base locale"],
389
+ ["--custom-instructions [customInstructions]", "Custom instructions added to the prompt. Usefull to apply specific rules regarding formatting, urls translation, etc."],
390
+ ["--skip-if-modified-before [skipIfModifiedBefore]", "Skip the file if it has been modified before the given time. Can be an absolute time as \"2025-12-05\" (string or Date) or a relative time in ms `1 * 60 * 60 * 1000` (1 hour). This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file."],
391
+ ["--skip-if-modified-after [skipIfModifiedAfter]", "Skip the file if it has been modified within the given time. Can be an absolute time as \"2025-12-05\" (string or Date) or a relative time in ms `1 * 60 * 60 * 1000` (1 hour). This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file."],
392
+ ["--skip-if-exists", "Skip the file if it already exists"]
393
+ ];
394
+ const docProgram = program.command("doc").description("Documentation operations");
395
+ const translateProgram = docProgram.command("translate").description("Translate the documentation");
396
+ applyConfigOptions(translateProgram);
397
+ applyAIOptions(translateProgram);
398
+ applyGitOptions(translateProgram);
399
+ applyOptions(translateProgram, docParams);
400
+ translateProgram.action((options) => translateDoc({
401
+ docPattern: options.docPattern,
402
+ excludedGlobPattern: options.excludedGlobPattern,
403
+ locales: options.locales,
404
+ baseLocale: options.baseLocale,
405
+ aiOptions: extractAiOptions(options),
406
+ gitOptions: extractGitOptions(options),
407
+ nbSimultaneousFileProcessed: options.nbSimultaneousFileProcessed,
408
+ configOptions: extractConfigOptions(options),
409
+ customInstructions: options.customInstructions,
410
+ skipIfModifiedBefore: options.skipIfModifiedBefore,
411
+ skipIfModifiedAfter: options.skipIfModifiedAfter,
412
+ skipIfExists: options.skipIfExists
413
+ }));
414
+ const reviewProgram = docProgram.command("review").description("Review the documentation");
415
+ applyConfigOptions(reviewProgram);
416
+ applyAIOptions(reviewProgram);
417
+ applyGitOptions(reviewProgram);
418
+ applyOptions(reviewProgram, docParams);
419
+ reviewProgram.action((options) => reviewDoc({
420
+ docPattern: options.docPattern,
421
+ excludedGlobPattern: options.excludedGlobPattern,
422
+ locales: options.locales,
423
+ baseLocale: options.baseLocale,
424
+ aiOptions: extractAiOptions(options),
425
+ gitOptions: extractGitOptions(options),
426
+ nbSimultaneousFileProcessed: options.nbSimultaneousFileProcessed,
427
+ configOptions: extractConfigOptions(options),
428
+ customInstructions: options.customInstructions,
429
+ skipIfModifiedBefore: options.skipIfModifiedBefore,
430
+ skipIfModifiedAfter: options.skipIfModifiedAfter,
431
+ skipIfExists: options.skipIfExists
432
+ }));
433
+ const searchProgram = docProgram.command("search").description("Search the documentation").argument("<query>", "Search query").option("--limit [limit]", "Limit the number of results", "10");
434
+ applyConfigOptions(searchProgram);
435
+ searchProgram.action((query, options) => searchDoc({
436
+ query,
437
+ limit: options.limit ? parseInt(options.limit, 10) : 10,
438
+ configOptions: extractConfigOptions(options)
439
+ }));
440
+ /**
441
+ * LIVE SYNC
442
+ */
443
+ const liveOptions = [["--with [with...]", "Start command in parallel with the live sync"]];
444
+ const liveCmd = program.command("live").description("Live sync - Watch for changes made on the CMS and update the application content accordingly");
445
+ applyOptions(liveCmd, liveOptions);
446
+ applyConfigOptions(liveCmd);
447
+ liveCmd.action((options) => liveSync(options));
448
+ const editorStartCmd = program.command("editor").description("Visual editor operations").command("start").description("Start the Intlayer visual editor");
449
+ applyConfigOptions(editorStartCmd);
450
+ editorStartCmd.action((options) => {
451
+ startEditor({
452
+ env: options.env,
453
+ envFile: options.envFile
454
+ });
455
+ });
456
+ /**
457
+ * EXTRACT
458
+ */
459
+ const extractProgram = program.command("extract").alias("ext").description("Extract strings from components to be placed in a .content file close to the component");
460
+ extractProgram.option("-f, --file [files...]", "List of files to extract").option("--code-only", "Only extract the component code", false).option("--declaration-only", "Only generate content declaration", false).action((options) => {
461
+ extract({
462
+ files: options.file,
463
+ configOptions: extractConfigOptions(options),
464
+ codeOnly: options.codeOnly,
465
+ declarationOnly: options.declarationOnly
466
+ });
467
+ });
468
+ applyConfigOptions(extractProgram);
469
+ program.parse(process.argv);
470
+ /**
471
+ * CI / AUTOMATION
472
+ *
473
+ * Used to iterate over all projects in a monorepo, and help to parse secrets
474
+ */
475
+ program.command("ci").description("Run Intlayer commands with auto-injected credentials from INTLAYER_PROJECT_CREDENTIALS. Detects current project or iterates over all projects.").argument("<command...>", "The intlayer command to execute (e.g., \"fill\", \"push\")").allowUnknownOption().action((args) => {
476
+ runCI(args);
477
+ });
478
+ return program;
479
+ };
480
+
481
+ //#endregion
482
+ export { dirname, setAPI };
2
483
  //# sourceMappingURL=cli.mjs.map