ccjk 14.2.2 → 15.0.0

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 (528) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +58 -341
  3. package/dist/cli.js +59 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/commands/detect.js +15 -0
  6. package/dist/commands/detect.js.map +1 -0
  7. package/dist/commands/doctor.js +68 -0
  8. package/dist/commands/doctor.js.map +1 -0
  9. package/dist/commands/git-install.js +50 -0
  10. package/dist/commands/git-install.js.map +1 -0
  11. package/dist/commands/init.js +102 -0
  12. package/dist/commands/init.js.map +1 -0
  13. package/dist/commands/mcp.js +66 -0
  14. package/dist/commands/mcp.js.map +1 -0
  15. package/dist/commands/menu.js +33 -0
  16. package/dist/commands/menu.js.map +1 -0
  17. package/dist/core/detect.js +24 -0
  18. package/dist/core/detect.js.map +1 -0
  19. package/dist/core/lint.js +49 -0
  20. package/dist/core/lint.js.map +1 -0
  21. package/dist/core/mcp.js +41 -0
  22. package/dist/core/mcp.js.map +1 -0
  23. package/dist/core/paths.js +9 -0
  24. package/dist/core/paths.js.map +1 -0
  25. package/dist/core/providers.js +53 -0
  26. package/dist/core/providers.js.map +1 -0
  27. package/dist/core/settings.js +31 -0
  28. package/dist/core/settings.js.map +1 -0
  29. package/dist/core/slash-templates.js +56 -0
  30. package/dist/core/slash-templates.js.map +1 -0
  31. package/dist/core/tools.js +27 -0
  32. package/dist/core/tools.js.map +1 -0
  33. package/package.json +43 -164
  34. package/README.HONEST.md +0 -176
  35. package/README.en.md +0 -67
  36. package/README.ja.md +0 -67
  37. package/README.ko.md +0 -67
  38. package/README.zh-CN.md +0 -86
  39. package/bin/ccjk.mjs +0 -5
  40. package/bin/ccjk.ts +0 -222
  41. package/dist/chunks/agent-teams.mjs +0 -145
  42. package/dist/chunks/agent.mjs +0 -1439
  43. package/dist/chunks/agents.mjs +0 -3783
  44. package/dist/chunks/api-cli.mjs +0 -135
  45. package/dist/chunks/api-config-selector.mjs +0 -159
  46. package/dist/chunks/api-providers.mjs +0 -144
  47. package/dist/chunks/api.mjs +0 -115
  48. package/dist/chunks/auto-bootstrap.mjs +0 -358
  49. package/dist/chunks/auto-fixer.mjs +0 -95
  50. package/dist/chunks/auto-updater.mjs +0 -507
  51. package/dist/chunks/banner.mjs +0 -173
  52. package/dist/chunks/bash.mjs +0 -187
  53. package/dist/chunks/boost.mjs +0 -474
  54. package/dist/chunks/brain-config.mjs +0 -75
  55. package/dist/chunks/brain-status.mjs +0 -89
  56. package/dist/chunks/ccjk-agents.mjs +0 -416
  57. package/dist/chunks/ccjk-all.mjs +0 -1046
  58. package/dist/chunks/ccjk-config.mjs +0 -445
  59. package/dist/chunks/ccjk-hooks.mjs +0 -1074
  60. package/dist/chunks/ccjk-mcp.mjs +0 -763
  61. package/dist/chunks/ccjk-setup.mjs +0 -765
  62. package/dist/chunks/ccjk-skills.mjs +0 -518
  63. package/dist/chunks/ccr.mjs +0 -109
  64. package/dist/chunks/ccu.mjs +0 -40
  65. package/dist/chunks/check-updates.mjs +0 -117
  66. package/dist/chunks/claude-code-incremental-manager.mjs +0 -761
  67. package/dist/chunks/claude-config.mjs +0 -606
  68. package/dist/chunks/claude-config2.mjs +0 -62
  69. package/dist/chunks/claude-wrapper.mjs +0 -85
  70. package/dist/chunks/clavue-config.mjs +0 -1454
  71. package/dist/chunks/cleanup-migration.mjs +0 -20
  72. package/dist/chunks/cli-hook.mjs +0 -4096
  73. package/dist/chunks/cloud-sync.mjs +0 -29
  74. package/dist/chunks/code-type-resolver.mjs +0 -880
  75. package/dist/chunks/codex-config-switch.mjs +0 -452
  76. package/dist/chunks/codex-provider-manager.mjs +0 -238
  77. package/dist/chunks/codex-uninstaller.mjs +0 -404
  78. package/dist/chunks/codex.mjs +0 -2141
  79. package/dist/chunks/commands.mjs +0 -108
  80. package/dist/chunks/commands2.mjs +0 -421
  81. package/dist/chunks/commit.mjs +0 -140
  82. package/dist/chunks/completion.mjs +0 -517
  83. package/dist/chunks/config-consolidator.mjs +0 -172
  84. package/dist/chunks/config-switch.mjs +0 -334
  85. package/dist/chunks/config.mjs +0 -558
  86. package/dist/chunks/config2.mjs +0 -484
  87. package/dist/chunks/config3.mjs +0 -486
  88. package/dist/chunks/constants.mjs +0 -323
  89. package/dist/chunks/context-opt.mjs +0 -444
  90. package/dist/chunks/context.mjs +0 -974
  91. package/dist/chunks/dashboard.mjs +0 -481
  92. package/dist/chunks/doctor.mjs +0 -1301
  93. package/dist/chunks/eval.mjs +0 -502
  94. package/dist/chunks/evolution.mjs +0 -322
  95. package/dist/chunks/features.mjs +0 -715
  96. package/dist/chunks/fish.mjs +0 -181
  97. package/dist/chunks/fs-operations.mjs +0 -180
  98. package/dist/chunks/health-alerts.mjs +0 -830
  99. package/dist/chunks/help.mjs +0 -341
  100. package/dist/chunks/hook-installer.mjs +0 -48
  101. package/dist/chunks/impact.mjs +0 -651
  102. package/dist/chunks/index.mjs +0 -23
  103. package/dist/chunks/index10.mjs +0 -19
  104. package/dist/chunks/index11.mjs +0 -1171
  105. package/dist/chunks/index12.mjs +0 -218
  106. package/dist/chunks/index13.mjs +0 -679
  107. package/dist/chunks/index14.mjs +0 -1009
  108. package/dist/chunks/index15.mjs +0 -194
  109. package/dist/chunks/index2.mjs +0 -7637
  110. package/dist/chunks/index3.mjs +0 -171
  111. package/dist/chunks/index4.mjs +0 -26
  112. package/dist/chunks/index5.mjs +0 -19
  113. package/dist/chunks/index6.mjs +0 -19092
  114. package/dist/chunks/index7.mjs +0 -616
  115. package/dist/chunks/index8.mjs +0 -1602
  116. package/dist/chunks/index9.mjs +0 -5384
  117. package/dist/chunks/init.mjs +0 -1911
  118. package/dist/chunks/installer.mjs +0 -757
  119. package/dist/chunks/installer2.mjs +0 -103
  120. package/dist/chunks/interview.mjs +0 -2927
  121. package/dist/chunks/json-config.mjs +0 -60
  122. package/dist/chunks/linux.mjs +0 -3863
  123. package/dist/chunks/macos.mjs +0 -69
  124. package/dist/chunks/main.mjs +0 -635
  125. package/dist/chunks/manager.mjs +0 -1048
  126. package/dist/chunks/marketplace.mjs +0 -265
  127. package/dist/chunks/mcp-cli.mjs +0 -205
  128. package/dist/chunks/mcp-performance.mjs +0 -187
  129. package/dist/chunks/mcp.mjs +0 -667
  130. package/dist/chunks/memory-check.mjs +0 -2973
  131. package/dist/chunks/memory-paths.mjs +0 -259
  132. package/dist/chunks/memory-sync.mjs +0 -209
  133. package/dist/chunks/memory.mjs +0 -354
  134. package/dist/chunks/metrics-display.mjs +0 -153
  135. package/dist/chunks/monitor.mjs +0 -1856
  136. package/dist/chunks/notification.mjs +0 -1864
  137. package/dist/chunks/onboarding.mjs +0 -386
  138. package/dist/chunks/package.mjs +0 -3
  139. package/dist/chunks/paradigm.mjs +0 -74
  140. package/dist/chunks/permission-manager.mjs +0 -250
  141. package/dist/chunks/permissions.mjs +0 -265
  142. package/dist/chunks/persistence-manager.mjs +0 -801
  143. package/dist/chunks/persistence.mjs +0 -707
  144. package/dist/chunks/platform.mjs +0 -395
  145. package/dist/chunks/plugin.mjs +0 -1936
  146. package/dist/chunks/powershell.mjs +0 -213
  147. package/dist/chunks/prompts.mjs +0 -244
  148. package/dist/chunks/providers.mjs +0 -263
  149. package/dist/chunks/quick-actions.mjs +0 -335
  150. package/dist/chunks/quick-provider.mjs +0 -755
  151. package/dist/chunks/quick-setup.mjs +0 -421
  152. package/dist/chunks/remote.mjs +0 -497
  153. package/dist/chunks/research.mjs +0 -1904
  154. package/dist/chunks/rollback.mjs +0 -38
  155. package/dist/chunks/session-manager.mjs +0 -1371
  156. package/dist/chunks/session.mjs +0 -878
  157. package/dist/chunks/sessions.mjs +0 -106
  158. package/dist/chunks/silent-updater.mjs +0 -396
  159. package/dist/chunks/simple-config.mjs +0 -122
  160. package/dist/chunks/skill.mjs +0 -117
  161. package/dist/chunks/skill2.mjs +0 -9052
  162. package/dist/chunks/skills-sync.mjs +0 -1343
  163. package/dist/chunks/skills.mjs +0 -577
  164. package/dist/chunks/slash-commands.mjs +0 -208
  165. package/dist/chunks/smart-guide.mjs +0 -247
  166. package/dist/chunks/snapshot.mjs +0 -58
  167. package/dist/chunks/startup.mjs +0 -487
  168. package/dist/chunks/stats.mjs +0 -191
  169. package/dist/chunks/status.mjs +0 -471
  170. package/dist/chunks/team.mjs +0 -63
  171. package/dist/chunks/thinking.mjs +0 -626
  172. package/dist/chunks/trace.mjs +0 -57
  173. package/dist/chunks/uninstall.mjs +0 -852
  174. package/dist/chunks/update.mjs +0 -174
  175. package/dist/chunks/upgrade-manager.mjs +0 -204
  176. package/dist/chunks/upgrade.mjs +0 -133
  177. package/dist/chunks/version-checker.mjs +0 -891
  178. package/dist/chunks/vim.mjs +0 -903
  179. package/dist/chunks/windows.mjs +0 -14
  180. package/dist/chunks/workflows.mjs +0 -633
  181. package/dist/chunks/wsl.mjs +0 -129
  182. package/dist/chunks/zero-config.mjs +0 -871
  183. package/dist/chunks/zsh.mjs +0 -182
  184. package/dist/cli.d.mts +0 -1
  185. package/dist/cli.d.ts +0 -1
  186. package/dist/cli.mjs +0 -2684
  187. package/dist/i18n/locales/en/agent-teams.json +0 -18
  188. package/dist/i18n/locales/en/agentBrowser.json +0 -80
  189. package/dist/i18n/locales/en/agents.json +0 -135
  190. package/dist/i18n/locales/en/api.json +0 -63
  191. package/dist/i18n/locales/en/ccjk-agents.json +0 -33
  192. package/dist/i18n/locales/en/ccjk-all.json +0 -23
  193. package/dist/i18n/locales/en/ccjk-skills.json +0 -22
  194. package/dist/i18n/locales/en/ccjk.json +0 -276
  195. package/dist/i18n/locales/en/ccr.json +0 -65
  196. package/dist/i18n/locales/en/claude-md.json +0 -73
  197. package/dist/i18n/locales/en/cli.json +0 -148
  198. package/dist/i18n/locales/en/cloud-setup.json +0 -31
  199. package/dist/i18n/locales/en/cloud-sync.json +0 -147
  200. package/dist/i18n/locales/en/cloud.json +0 -40
  201. package/dist/i18n/locales/en/cloudPlugins.json +0 -118
  202. package/dist/i18n/locales/en/codex.json +0 -184
  203. package/dist/i18n/locales/en/cometix.json +0 -29
  204. package/dist/i18n/locales/en/common.json +0 -68
  205. package/dist/i18n/locales/en/config.json +0 -108
  206. package/dist/i18n/locales/en/configuration.json +0 -236
  207. package/dist/i18n/locales/en/context.json +0 -85
  208. package/dist/i18n/locales/en/dashboard.json +0 -78
  209. package/dist/i18n/locales/en/errors.json +0 -26
  210. package/dist/i18n/locales/en/evolution.json +0 -54
  211. package/dist/i18n/locales/en/hooks.json +0 -74
  212. package/dist/i18n/locales/en/hooksSync.json +0 -133
  213. package/dist/i18n/locales/en/installation.json +0 -83
  214. package/dist/i18n/locales/en/interview.json +0 -104
  215. package/dist/i18n/locales/en/language.json +0 -19
  216. package/dist/i18n/locales/en/lsp.json +0 -78
  217. package/dist/i18n/locales/en/marketplace.json +0 -116
  218. package/dist/i18n/locales/en/mcp.json +0 -180
  219. package/dist/i18n/locales/en/memory.json +0 -23
  220. package/dist/i18n/locales/en/menu.json +0 -299
  221. package/dist/i18n/locales/en/multi-config.json +0 -79
  222. package/dist/i18n/locales/en/notification.json +0 -307
  223. package/dist/i18n/locales/en/permissions.json +0 -95
  224. package/dist/i18n/locales/en/persistence.json +0 -127
  225. package/dist/i18n/locales/en/plugins.json +0 -146
  226. package/dist/i18n/locales/en/quick-actions.json +0 -78
  227. package/dist/i18n/locales/en/registry.json +0 -54
  228. package/dist/i18n/locales/en/remote.json +0 -93
  229. package/dist/i18n/locales/en/sandbox.json +0 -44
  230. package/dist/i18n/locales/en/setup.json +0 -44
  231. package/dist/i18n/locales/en/shencha.json +0 -14
  232. package/dist/i18n/locales/en/skills.json +0 -100
  233. package/dist/i18n/locales/en/skillsSync.json +0 -74
  234. package/dist/i18n/locales/en/smartGuide.json +0 -49
  235. package/dist/i18n/locales/en/stats.json +0 -20
  236. package/dist/i18n/locales/en/subagent.json +0 -69
  237. package/dist/i18n/locales/en/superpowers.json +0 -117
  238. package/dist/i18n/locales/en/team.json +0 -7
  239. package/dist/i18n/locales/en/thinking.json +0 -65
  240. package/dist/i18n/locales/en/tools.json +0 -42
  241. package/dist/i18n/locales/en/uninstall.json +0 -56
  242. package/dist/i18n/locales/en/updater.json +0 -29
  243. package/dist/i18n/locales/en/vim.json +0 -169
  244. package/dist/i18n/locales/en/workflow.json +0 -55
  245. package/dist/i18n/locales/en/workspace.json +0 -108
  246. package/dist/i18n/locales/zh-CN/agent-teams.json +0 -18
  247. package/dist/i18n/locales/zh-CN/agentBrowser.json +0 -80
  248. package/dist/i18n/locales/zh-CN/agents.json +0 -135
  249. package/dist/i18n/locales/zh-CN/api.json +0 -63
  250. package/dist/i18n/locales/zh-CN/ccjk-agents.json +0 -33
  251. package/dist/i18n/locales/zh-CN/ccjk-all.json +0 -23
  252. package/dist/i18n/locales/zh-CN/ccjk-skills.json +0 -22
  253. package/dist/i18n/locales/zh-CN/ccjk.json +0 -276
  254. package/dist/i18n/locales/zh-CN/ccr.json +0 -65
  255. package/dist/i18n/locales/zh-CN/claude-md.json +0 -73
  256. package/dist/i18n/locales/zh-CN/cli.json +0 -148
  257. package/dist/i18n/locales/zh-CN/cloud-setup.json +0 -31
  258. package/dist/i18n/locales/zh-CN/cloud-sync.json +0 -147
  259. package/dist/i18n/locales/zh-CN/cloud.json +0 -40
  260. package/dist/i18n/locales/zh-CN/cloudPlugins.json +0 -118
  261. package/dist/i18n/locales/zh-CN/codex.json +0 -184
  262. package/dist/i18n/locales/zh-CN/cometix.json +0 -29
  263. package/dist/i18n/locales/zh-CN/common.json +0 -68
  264. package/dist/i18n/locales/zh-CN/config.json +0 -108
  265. package/dist/i18n/locales/zh-CN/configuration.json +0 -234
  266. package/dist/i18n/locales/zh-CN/context.json +0 -85
  267. package/dist/i18n/locales/zh-CN/dashboard.json +0 -78
  268. package/dist/i18n/locales/zh-CN/errors.json +0 -26
  269. package/dist/i18n/locales/zh-CN/evolution.json +0 -54
  270. package/dist/i18n/locales/zh-CN/hooks.json +0 -74
  271. package/dist/i18n/locales/zh-CN/hooksSync.json +0 -133
  272. package/dist/i18n/locales/zh-CN/installation.json +0 -83
  273. package/dist/i18n/locales/zh-CN/interview.json +0 -104
  274. package/dist/i18n/locales/zh-CN/language.json +0 -19
  275. package/dist/i18n/locales/zh-CN/lsp.json +0 -78
  276. package/dist/i18n/locales/zh-CN/marketplace.json +0 -116
  277. package/dist/i18n/locales/zh-CN/mcp.json +0 -180
  278. package/dist/i18n/locales/zh-CN/memory.json +0 -23
  279. package/dist/i18n/locales/zh-CN/menu.json +0 -299
  280. package/dist/i18n/locales/zh-CN/multi-config.json +0 -79
  281. package/dist/i18n/locales/zh-CN/notification.json +0 -307
  282. package/dist/i18n/locales/zh-CN/permissions.json +0 -95
  283. package/dist/i18n/locales/zh-CN/persistence.json +0 -127
  284. package/dist/i18n/locales/zh-CN/plugins.json +0 -146
  285. package/dist/i18n/locales/zh-CN/quick-actions.json +0 -78
  286. package/dist/i18n/locales/zh-CN/registry.json +0 -54
  287. package/dist/i18n/locales/zh-CN/remote.json +0 -93
  288. package/dist/i18n/locales/zh-CN/sandbox.json +0 -44
  289. package/dist/i18n/locales/zh-CN/setup.json +0 -44
  290. package/dist/i18n/locales/zh-CN/shencha.json +0 -14
  291. package/dist/i18n/locales/zh-CN/skills.json +0 -100
  292. package/dist/i18n/locales/zh-CN/skillsSync.json +0 -74
  293. package/dist/i18n/locales/zh-CN/smartGuide.json +0 -49
  294. package/dist/i18n/locales/zh-CN/stats.json +0 -20
  295. package/dist/i18n/locales/zh-CN/subagent.json +0 -69
  296. package/dist/i18n/locales/zh-CN/superpowers.json +0 -117
  297. package/dist/i18n/locales/zh-CN/team.json +0 -7
  298. package/dist/i18n/locales/zh-CN/thinking.json +0 -65
  299. package/dist/i18n/locales/zh-CN/tools.json +0 -42
  300. package/dist/i18n/locales/zh-CN/uninstall.json +0 -56
  301. package/dist/i18n/locales/zh-CN/updater.json +0 -29
  302. package/dist/i18n/locales/zh-CN/vim.json +0 -169
  303. package/dist/i18n/locales/zh-CN/workflow.json +0 -55
  304. package/dist/i18n/locales/zh-CN/workspace.json +0 -108
  305. package/dist/index.d.mts +0 -5658
  306. package/dist/index.d.ts +0 -5658
  307. package/dist/index.mjs +0 -3732
  308. package/dist/shared/ccjk.5bEolFrk.mjs +0 -254
  309. package/dist/shared/ccjk.8oaxX4iR.mjs +0 -90
  310. package/dist/shared/ccjk.B2U7DsPy.mjs +0 -31
  311. package/dist/shared/ccjk.B2f-cwUP.mjs +0 -468
  312. package/dist/shared/ccjk.BAGoDD49.mjs +0 -36
  313. package/dist/shared/ccjk.BBtCGd_g.mjs +0 -899
  314. package/dist/shared/ccjk.BFQ7yr5S.mjs +0 -16
  315. package/dist/shared/ccjk.BLsIiTqO.mjs +0 -449
  316. package/dist/shared/ccjk.BXv8aYs1.mjs +0 -170
  317. package/dist/shared/ccjk.BnsY5WxD.mjs +0 -171
  318. package/dist/shared/ccjk.BoApaI4j.mjs +0 -28
  319. package/dist/shared/ccjk.Bq8TqZG_.mjs +0 -189
  320. package/dist/shared/ccjk.BtrioX1Z.mjs +0 -25
  321. package/dist/shared/ccjk.Bx_rmYfN.mjs +0 -69
  322. package/dist/shared/ccjk.BzPbSEP2.mjs +0 -115
  323. package/dist/shared/ccjk.C0WLUnFV.mjs +0 -293
  324. package/dist/shared/ccjk.C1hANZTu.mjs +0 -19
  325. package/dist/shared/ccjk.C2jHOZVP.mjs +0 -52
  326. package/dist/shared/ccjk.CNhnT6uQ.mjs +0 -636
  327. package/dist/shared/ccjk.COweQ1RR.mjs +0 -5
  328. package/dist/shared/ccjk.CfKKcvWy.mjs +0 -126
  329. package/dist/shared/ccjk.Cjgrln_h.mjs +0 -297
  330. package/dist/shared/ccjk.CoCHVXl3.mjs +0 -3951
  331. package/dist/shared/ccjk.CwGZSTAK.mjs +0 -319
  332. package/dist/shared/ccjk.CxpGa6MC.mjs +0 -2724
  333. package/dist/shared/ccjk.D-magaEx.mjs +0 -763
  334. package/dist/shared/ccjk.D0g2ABGg.mjs +0 -171
  335. package/dist/shared/ccjk.D6ycHbak.mjs +0 -270
  336. package/dist/shared/ccjk.D75wivnp.mjs +0 -142
  337. package/dist/shared/ccjk.DDL-4C-k.mjs +0 -100
  338. package/dist/shared/ccjk.DFRPtmK_.mjs +0 -75
  339. package/dist/shared/ccjk.DMV3x5Sd.mjs +0 -299
  340. package/dist/shared/ccjk.DZ2LLOa-.mjs +0 -2195
  341. package/dist/shared/ccjk.DbigonEQ.mjs +0 -698
  342. package/dist/shared/ccjk.DcMvE7lf.mjs +0 -618
  343. package/dist/shared/ccjk.DeWpAShp.mjs +0 -1828
  344. package/dist/shared/ccjk.DhJ1kyDR.mjs +0 -30
  345. package/dist/shared/ccjk.DlTXS9rP.mjs +0 -224
  346. package/dist/shared/ccjk.DopKzo3z.mjs +0 -305
  347. package/dist/shared/ccjk.DsZsc4LR.mjs +0 -1280
  348. package/dist/shared/ccjk.DuzJZlgj.mjs +0 -418
  349. package/dist/shared/ccjk.Dxgd2vjc.mjs +0 -444
  350. package/dist/shared/ccjk.J8YiPsOw.mjs +0 -259
  351. package/dist/shared/ccjk.KfSWcGlE.mjs +0 -38
  352. package/dist/shared/ccjk.L7yC58_i.mjs +0 -225
  353. package/dist/shared/ccjk.MwtjAULc.mjs +0 -1447
  354. package/dist/shared/ccjk.OJKHVSOb.mjs +0 -2005
  355. package/dist/shared/ccjk.OTnevPNE.mjs +0 -225
  356. package/dist/shared/ccjk.RyizuzOI.mjs +0 -21
  357. package/dist/shared/ccjk.T_cX87dY.mjs +0 -15
  358. package/dist/shared/ccjk.bQ7Dh1g4.mjs +0 -249
  359. package/dist/shared/ccjk.gDEDGD_t.mjs +0 -38
  360. package/dist/shared/ccjk.hoqrwWdN.mjs +0 -333
  361. package/dist/shared/ccjk.i_vn-9C3.mjs +0 -317
  362. package/dist/shared/ccjk.lG3ccFjm.mjs +0 -885
  363. package/dist/shared/ccjk.wLJHO0Af.mjs +0 -244
  364. package/dist/shared/ccjk.y-a_1vK4.mjs +0 -5127
  365. package/dist/templates/agents/README.md +0 -78
  366. package/dist/templates/agents/fullstack-developer.json +0 -70
  367. package/dist/templates/agents/go-expert.json +0 -69
  368. package/dist/templates/agents/index.json +0 -64
  369. package/dist/templates/agents/python-expert.json +0 -69
  370. package/dist/templates/agents/react-specialist.json +0 -69
  371. package/dist/templates/agents/testing-automation-expert.json +0 -70
  372. package/dist/templates/agents/typescript-architect.json +0 -69
  373. package/dist/templates/claude-code/common/settings.json +0 -109
  374. package/dist/templates/common/error-prevention.md +0 -267
  375. package/dist/templates/common/karpathy-baseline.md +0 -83
  376. package/dist/templates/common/output-styles/zh-CN/carmack-mode.md +0 -381
  377. package/dist/templates/common/output-styles/zh-CN/codex-rigor-mode.md +0 -114
  378. package/dist/templates/common/output-styles/zh-CN/dhh-mode.md +0 -265
  379. package/dist/templates/common/output-styles/zh-CN/evan-you-mode.md +0 -539
  380. package/dist/templates/common/output-styles/zh-CN/jobs-mode.md +0 -369
  381. package/dist/templates/common/output-styles/zh-CN/linus-mode.md +0 -135
  382. package/dist/templates/common/output-styles/zh-CN/uncle-bob-mode.md +0 -221
  383. package/dist/templates/common/workflow/continuousDelivery/en/continuous-delivery.md +0 -628
  384. package/dist/templates/common/workflow/continuousDelivery/zh-CN/continuous-delivery.md +0 -628
  385. package/dist/templates/common/workflow/essential/en/agents/ccjk-config-agent.md +0 -187
  386. package/dist/templates/common/workflow/essential/en/agents/ccjk-mcp-agent.md +0 -191
  387. package/dist/templates/common/workflow/essential/en/agents/ccjk-skill-agent.md +0 -249
  388. package/dist/templates/common/workflow/essential/en/agents/ccjk-workflow-agent.md +0 -277
  389. package/dist/templates/common/workflow/essential/en/agents/get-current-datetime.md +0 -29
  390. package/dist/templates/common/workflow/essential/en/agents/init-architect.md +0 -115
  391. package/dist/templates/common/workflow/essential/en/agents/ui-ux-designer.md +0 -91
  392. package/dist/templates/common/workflow/essential/en/feat.md +0 -92
  393. package/dist/templates/common/workflow/essential/en/goal.md +0 -147
  394. package/dist/templates/common/workflow/essential/en/init-project.md +0 -53
  395. package/dist/templates/common/workflow/essential/zh-CN/agents/get-current-datetime.md +0 -29
  396. package/dist/templates/common/workflow/essential/zh-CN/agents/init-architect.md +0 -115
  397. package/dist/templates/common/workflow/essential/zh-CN/agents/ui-ux-designer.md +0 -91
  398. package/dist/templates/common/workflow/essential/zh-CN/feat.md +0 -315
  399. package/dist/templates/common/workflow/essential/zh-CN/goal.md +0 -146
  400. package/dist/templates/common/workflow/essential/zh-CN/init-project.md +0 -53
  401. package/dist/templates/common/workflow/git/en/git-cleanBranches.md +0 -102
  402. package/dist/templates/common/workflow/git/en/git-commit.md +0 -205
  403. package/dist/templates/common/workflow/git/en/git-rollback.md +0 -90
  404. package/dist/templates/common/workflow/git/en/git-worktree.md +0 -276
  405. package/dist/templates/common/workflow/git/zh-CN/git-cleanBranches.md +0 -102
  406. package/dist/templates/common/workflow/git/zh-CN/git-commit.md +0 -205
  407. package/dist/templates/common/workflow/git/zh-CN/git-rollback.md +0 -90
  408. package/dist/templates/common/workflow/git/zh-CN/git-worktree.md +0 -276
  409. package/dist/templates/common/workflow/interview/en/interview.md +0 -67
  410. package/dist/templates/common/workflow/interview/zh-CN/interview.md +0 -67
  411. package/dist/templates/common/workflow/linearMethod/en/linear-method.md +0 -651
  412. package/dist/templates/common/workflow/linearMethod/zh-CN/linear-method.md +0 -752
  413. package/dist/templates/common/workflow/refactoringMaster/en/refactoring-master.md +0 -516
  414. package/dist/templates/common/workflow/refactoringMaster/zh-CN/refactoring-master.md +0 -812
  415. package/dist/templates/common/workflow/sixStep/en/workflow.md +0 -83
  416. package/dist/templates/common/workflow/sixStep/zh-CN/workflow.md +0 -359
  417. package/dist/templates/common/workflow/specFirstTDD/en/spec-first-tdd.md +0 -364
  418. package/dist/templates/common/workflow/specFirstTDD/zh-CN/spec-first-tdd.md +0 -366
  419. package/dist/templates/hooks/README.md +0 -212
  420. package/dist/templates/hooks/git-workflow-hooks.md +0 -551
  421. package/dist/templates/hooks/post-test/coverage.json +0 -21
  422. package/dist/templates/hooks/post-test/summary.json +0 -21
  423. package/dist/templates/hooks/post-test-coverage.md +0 -434
  424. package/dist/templates/hooks/pre-commit/eslint.json +0 -22
  425. package/dist/templates/hooks/pre-commit/prettier.json +0 -22
  426. package/dist/templates/hooks/pre-commit-black.md +0 -274
  427. package/dist/templates/hooks/pre-commit-eslint.md +0 -153
  428. package/dist/templates/hooks/pre-commit-gofmt.md +0 -284
  429. package/dist/templates/hooks/pre-commit-prettier.md +0 -212
  430. package/dist/templates/hooks/pre-commit-type-check.md +0 -377
  431. package/dist/templates/skills/ccjk-init.md +0 -154
  432. package/dist/templates/skills/ccjk-mcp-setup.md +0 -205
  433. package/dist/templates/skills/ccjk-troubleshoot.md +0 -228
  434. package/dist/templates/skills/django-patterns.md +0 -1016
  435. package/dist/templates/skills/git-workflow.md +0 -748
  436. package/dist/templates/skills/go-idioms.md +0 -963
  437. package/dist/templates/skills/index.json +0 -132
  438. package/dist/templates/skills/nextjs-optimization.md +0 -694
  439. package/dist/templates/skills/python-pep8.md +0 -852
  440. package/dist/templates/skills/react-patterns.md +0 -686
  441. package/dist/templates/skills/rust-patterns.md +0 -1057
  442. package/dist/templates/skills/security-best-practices.md +0 -1413
  443. package/dist/templates/skills/testing-best-practices.md +0 -1315
  444. package/dist/templates/skills/ts-best-practices.md +0 -354
  445. package/templates/agents/README.md +0 -78
  446. package/templates/agents/fullstack-developer.json +0 -70
  447. package/templates/agents/go-expert.json +0 -69
  448. package/templates/agents/index.json +0 -64
  449. package/templates/agents/python-expert.json +0 -69
  450. package/templates/agents/react-specialist.json +0 -69
  451. package/templates/agents/testing-automation-expert.json +0 -70
  452. package/templates/agents/typescript-architect.json +0 -69
  453. package/templates/claude-code/common/settings.json +0 -109
  454. package/templates/common/error-prevention.md +0 -267
  455. package/templates/common/karpathy-baseline.md +0 -83
  456. package/templates/common/output-styles/zh-CN/carmack-mode.md +0 -381
  457. package/templates/common/output-styles/zh-CN/codex-rigor-mode.md +0 -114
  458. package/templates/common/output-styles/zh-CN/dhh-mode.md +0 -265
  459. package/templates/common/output-styles/zh-CN/evan-you-mode.md +0 -539
  460. package/templates/common/output-styles/zh-CN/jobs-mode.md +0 -369
  461. package/templates/common/output-styles/zh-CN/linus-mode.md +0 -135
  462. package/templates/common/output-styles/zh-CN/uncle-bob-mode.md +0 -221
  463. package/templates/common/workflow/continuousDelivery/en/continuous-delivery.md +0 -628
  464. package/templates/common/workflow/continuousDelivery/zh-CN/continuous-delivery.md +0 -628
  465. package/templates/common/workflow/essential/en/agents/ccjk-config-agent.md +0 -187
  466. package/templates/common/workflow/essential/en/agents/ccjk-mcp-agent.md +0 -191
  467. package/templates/common/workflow/essential/en/agents/ccjk-skill-agent.md +0 -249
  468. package/templates/common/workflow/essential/en/agents/ccjk-workflow-agent.md +0 -277
  469. package/templates/common/workflow/essential/en/agents/get-current-datetime.md +0 -29
  470. package/templates/common/workflow/essential/en/agents/init-architect.md +0 -115
  471. package/templates/common/workflow/essential/en/agents/ui-ux-designer.md +0 -91
  472. package/templates/common/workflow/essential/en/feat.md +0 -92
  473. package/templates/common/workflow/essential/en/goal.md +0 -147
  474. package/templates/common/workflow/essential/en/init-project.md +0 -53
  475. package/templates/common/workflow/essential/zh-CN/agents/get-current-datetime.md +0 -29
  476. package/templates/common/workflow/essential/zh-CN/agents/init-architect.md +0 -115
  477. package/templates/common/workflow/essential/zh-CN/agents/ui-ux-designer.md +0 -91
  478. package/templates/common/workflow/essential/zh-CN/feat.md +0 -315
  479. package/templates/common/workflow/essential/zh-CN/goal.md +0 -146
  480. package/templates/common/workflow/essential/zh-CN/init-project.md +0 -53
  481. package/templates/common/workflow/git/en/git-cleanBranches.md +0 -102
  482. package/templates/common/workflow/git/en/git-commit.md +0 -205
  483. package/templates/common/workflow/git/en/git-rollback.md +0 -90
  484. package/templates/common/workflow/git/en/git-worktree.md +0 -276
  485. package/templates/common/workflow/git/zh-CN/git-cleanBranches.md +0 -102
  486. package/templates/common/workflow/git/zh-CN/git-commit.md +0 -205
  487. package/templates/common/workflow/git/zh-CN/git-rollback.md +0 -90
  488. package/templates/common/workflow/git/zh-CN/git-worktree.md +0 -276
  489. package/templates/common/workflow/interview/en/interview.md +0 -67
  490. package/templates/common/workflow/interview/zh-CN/interview.md +0 -67
  491. package/templates/common/workflow/linearMethod/en/linear-method.md +0 -651
  492. package/templates/common/workflow/linearMethod/zh-CN/linear-method.md +0 -752
  493. package/templates/common/workflow/refactoringMaster/en/refactoring-master.md +0 -516
  494. package/templates/common/workflow/refactoringMaster/zh-CN/refactoring-master.md +0 -812
  495. package/templates/common/workflow/sixStep/en/workflow.md +0 -83
  496. package/templates/common/workflow/sixStep/zh-CN/workflow.md +0 -359
  497. package/templates/common/workflow/specFirstTDD/en/spec-first-tdd.md +0 -364
  498. package/templates/common/workflow/specFirstTDD/zh-CN/spec-first-tdd.md +0 -366
  499. package/templates/hooks/README.md +0 -212
  500. package/templates/hooks/git-workflow-hooks.md +0 -551
  501. package/templates/hooks/post-test/coverage.json +0 -21
  502. package/templates/hooks/post-test/summary.json +0 -21
  503. package/templates/hooks/post-test-coverage.md +0 -434
  504. package/templates/hooks/pre-commit/eslint.json +0 -22
  505. package/templates/hooks/pre-commit/prettier.json +0 -22
  506. package/templates/hooks/pre-commit-black.md +0 -274
  507. package/templates/hooks/pre-commit-eslint.md +0 -153
  508. package/templates/hooks/pre-commit-gofmt.md +0 -284
  509. package/templates/hooks/pre-commit-prettier.md +0 -212
  510. package/templates/hooks/pre-commit-type-check.md +0 -377
  511. package/templates/skills/basic.hbs +0 -72
  512. package/templates/skills/ccjk-init.md +0 -154
  513. package/templates/skills/ccjk-mcp-setup.md +0 -205
  514. package/templates/skills/ccjk-troubleshoot.md +0 -228
  515. package/templates/skills/code-refactor.hbs +0 -133
  516. package/templates/skills/code-review.hbs +0 -141
  517. package/templates/skills/django-patterns.md +0 -1016
  518. package/templates/skills/git-workflow.md +0 -748
  519. package/templates/skills/go-idioms.md +0 -963
  520. package/templates/skills/index.json +0 -132
  521. package/templates/skills/nextjs-optimization.md +0 -694
  522. package/templates/skills/python-pep8.md +0 -852
  523. package/templates/skills/react-patterns.md +0 -686
  524. package/templates/skills/rust-patterns.md +0 -1057
  525. package/templates/skills/security-best-practices.md +0 -1413
  526. package/templates/skills/testing-best-practices.md +0 -1315
  527. package/templates/skills/ts-best-practices.md +0 -354
  528. package/templates/skills/type-fix.hbs +0 -132
package/dist/cli.mjs DELETED
@@ -1,2684 +0,0 @@
1
- #!/usr/bin/env node
2
- import process__default from 'node:process';
3
- import { spawn } from 'node:child_process';
4
-
5
- function parseOptionalNumber(value, flag) {
6
- if (value === void 0) {
7
- return void 0;
8
- }
9
- const parsed = Number(value);
10
- if (!Number.isFinite(parsed)) {
11
- throw new TypeError(`${flag} must be a valid number`);
12
- }
13
- return parsed;
14
- }
15
- function parseOptionalPositiveNumber(value, flag) {
16
- const parsed = parseOptionalNumber(value, flag);
17
- if (parsed === void 0) {
18
- return void 0;
19
- }
20
- if (parsed <= 0) {
21
- throw new TypeError(`${flag} must be greater than 0`);
22
- }
23
- return parsed;
24
- }
25
- function parseOptionalPositiveInteger(value, flag) {
26
- const parsed = parseOptionalPositiveNumber(value, flag);
27
- if (parsed === void 0) {
28
- return void 0;
29
- }
30
- if (!Number.isInteger(parsed)) {
31
- throw new TypeError(`${flag} must be an integer`);
32
- }
33
- return parsed;
34
- }
35
- const COMMANDS = [
36
- // ==================== Core Commands ====================
37
- {
38
- name: "",
39
- description: "Show interactive menu (default)",
40
- tier: "core",
41
- options: [
42
- { flags: "--lang, -l <lang>", description: "Display language (zh-CN, en)" },
43
- { flags: "--code-type, -T <type>", description: "Code tool type" }
44
- ],
45
- loader: async () => {
46
- const { showMainMenu } = await import('./chunks/index9.mjs').then(function (n) { return n.i; });
47
- return async (options) => {
48
- await showMainMenu({ codeType: options.codeType });
49
- };
50
- }
51
- },
52
- {
53
- name: "init",
54
- description: "Initialize Claude Code configuration",
55
- aliases: ["i"],
56
- tier: "core",
57
- options: [
58
- { flags: "--lang, -l <lang>", description: "Display language" },
59
- { flags: "--config-lang, -c <lang>", description: "Configuration language" },
60
- { flags: "--force, -f", description: "Force overwrite" },
61
- { flags: "--skip-prompt, -s", description: "Skip prompts" },
62
- { flags: "--silent", description: "Silent mode - fully non-interactive with smart defaults" },
63
- { flags: "--api-type, -t <type>", description: "API type" },
64
- { flags: "--api-key, -k <key>", description: "API key" },
65
- { flags: "--code-type, -T <type>", description: "Code tool type" },
66
- { flags: "--orchestration <level>", description: "Workflow orchestration level (off|minimal|standard|max)" },
67
- { flags: "--install-agent-browser <boolean>", description: "Install Agent Browser during init (default: true)" },
68
- { flags: "--smart", description: "Smart generation mode - auto-detect project and generate agents/skills" },
69
- { flags: "--dry-run", description: "Preview changes without writing files" },
70
- { flags: "--yes, -y", description: "Skip confirmation prompts (auto-confirm)" }
71
- ],
72
- loader: async () => {
73
- const { init } = await import('./chunks/init.mjs').then(function (n) { return n.c; });
74
- return async (options) => {
75
- await init(options);
76
- };
77
- }
78
- },
79
- {
80
- name: "quick-setup",
81
- description: "One-click configuration for CCJK",
82
- aliases: ["quick", "qs"],
83
- tier: "core",
84
- options: [
85
- { flags: "--api-key <key>", description: "API key" },
86
- { flags: "--provider <provider>", description: "API provider" },
87
- { flags: "--skip-prompt, -s", description: "Skip all prompts" },
88
- { flags: "--lang, -l <lang>", description: "Display language" }
89
- ],
90
- loader: async () => {
91
- const { quickSetup } = await import('./chunks/quick-setup.mjs');
92
- return async (options) => {
93
- await quickSetup(options);
94
- };
95
- }
96
- },
97
- {
98
- name: "update",
99
- description: "Update Claude Code prompts",
100
- aliases: ["u"],
101
- tier: "core",
102
- options: [
103
- { flags: "--lang, -l <lang>", description: "Display language" },
104
- { flags: "--config-lang, -c <lang>", description: "Configuration language" }
105
- ],
106
- loader: async () => {
107
- const { update } = await import('./chunks/update.mjs');
108
- return async (options) => {
109
- await update({
110
- codeType: options.codeType,
111
- configLang: options.configLang,
112
- aiOutputLang: options.aiOutputLang
113
- });
114
- };
115
- }
116
- },
117
- {
118
- name: "upgrade",
119
- description: "Upgrade CCJK to the latest version",
120
- tier: "core",
121
- options: [],
122
- loader: async () => {
123
- const { upgrade } = await import('./chunks/upgrade.mjs');
124
- return async () => {
125
- await upgrade();
126
- };
127
- }
128
- },
129
- {
130
- name: "doctor",
131
- description: "Run environment health check",
132
- tier: "core",
133
- options: [
134
- { flags: "--check-providers", description: "Check API provider health" },
135
- { flags: "--code-type, -T <type>", description: "Code tool type" },
136
- { flags: "--fix-settings", description: "Fix settings.json validation issues" },
137
- { flags: "--json", description: "Output in JSON format" }
138
- ],
139
- loader: async () => {
140
- const { doctor } = await import('./chunks/doctor.mjs');
141
- return async (options) => {
142
- await doctor({
143
- checkProviders: options.checkProviders,
144
- codeType: options.codeType,
145
- fixSettings: options.fixSettings,
146
- json: options.json
147
- });
148
- };
149
- }
150
- },
151
- {
152
- name: "help [topic]",
153
- description: "Show help and quick reference",
154
- aliases: ["h", "?"],
155
- tier: "core",
156
- loader: async () => {
157
- const { help } = await import('./chunks/help.mjs');
158
- return async (_options, topic) => {
159
- await help(topic);
160
- };
161
- }
162
- },
163
- // ==================== Extended Commands ====================
164
- {
165
- name: "mcp <action> [...args]",
166
- description: "MCP Server management",
167
- tier: "extended",
168
- options: [
169
- { flags: "--tool, -T <type>", description: "Target tool (claude-code, codex)" },
170
- { flags: "--verbose, -v", description: "Verbose output" },
171
- { flags: "--dry-run, -d", description: "Preview changes" },
172
- { flags: "--yes, -y", description: "Skip confirmation prompts" },
173
- { flags: "--installed", description: "Show only installed services" },
174
- { flags: "--json", description: "Output in JSON format" }
175
- ],
176
- loader: async () => {
177
- return async (options, action, args) => {
178
- const actionStr = action;
179
- const argsArr = args;
180
- if (actionStr === "status" || !actionStr) {
181
- const { mcpStatus } = await import('./chunks/mcp.mjs');
182
- await mcpStatus(options);
183
- } else if (actionStr === "doctor") {
184
- const { mcpDoctor } = await import('./chunks/mcp.mjs');
185
- await mcpDoctor(options);
186
- } else if (actionStr === "profile") {
187
- const { listProfiles, showCurrentProfile, useProfile } = await import('./chunks/mcp.mjs');
188
- if (!argsArr[0] || argsArr[0] === "list" || argsArr[0] === "ls") {
189
- await listProfiles(options);
190
- } else if (argsArr[0] === "current" || argsArr[0] === "status") {
191
- await showCurrentProfile(options);
192
- } else if (argsArr[0] === "use" || argsArr[0] === "switch") {
193
- await useProfile(argsArr[1] || "", options);
194
- } else {
195
- await useProfile(argsArr[0], options);
196
- }
197
- } else if (actionStr === "release") {
198
- const { mcpRelease } = await import('./chunks/mcp.mjs');
199
- await mcpRelease(options);
200
- } else if (actionStr === "help") {
201
- const { mcpHelp } = await import('./chunks/mcp.mjs');
202
- mcpHelp(options);
203
- } else if (actionStr === "list") {
204
- if (options.json || options.installed) {
205
- const { mcpListCli } = await import('./chunks/mcp-cli.mjs');
206
- await mcpListCli({
207
- json: options.json,
208
- installed: options.installed,
209
- tool: options.tool,
210
- lang: options.lang
211
- });
212
- } else {
213
- const { mcpList } = await import('./chunks/mcp.mjs');
214
- await mcpList(options);
215
- }
216
- } else if (actionStr === "search") {
217
- const { mcpSearch } = await import('./chunks/mcp.mjs');
218
- await mcpSearch(argsArr[0] || "", options);
219
- } else if (actionStr === "install") {
220
- if (argsArr.length > 1 || options.yes) {
221
- const { mcpInstallCli } = await import('./chunks/mcp-cli.mjs');
222
- await mcpInstallCli({
223
- services: argsArr,
224
- yes: options.yes,
225
- tool: options.tool,
226
- lang: options.lang
227
- });
228
- } else {
229
- const { mcpInstall } = await import('./chunks/mcp.mjs');
230
- await mcpInstall(argsArr[0] || "", options);
231
- }
232
- } else if (actionStr === "uninstall") {
233
- if (argsArr.length > 1 || options.yes) {
234
- const { mcpUninstallCli } = await import('./chunks/mcp-cli.mjs');
235
- await mcpUninstallCli({
236
- services: argsArr,
237
- yes: options.yes,
238
- tool: options.tool,
239
- lang: options.lang
240
- });
241
- } else {
242
- const { mcpUninstall } = await import('./chunks/mcp.mjs');
243
- await mcpUninstall(argsArr[0] || "", options);
244
- }
245
- } else {
246
- const { mcpHelp } = await import('./chunks/mcp.mjs');
247
- mcpHelp(options);
248
- }
249
- };
250
- }
251
- },
252
- {
253
- name: "memory",
254
- description: "Manage Claude Code memory (view/edit/sync)",
255
- aliases: ["mem"],
256
- tier: "core",
257
- options: [
258
- { flags: "--status", description: "Show memory status without changing files" },
259
- { flags: "--doctor", description: "Run memory health diagnostics" },
260
- { flags: "-v, --view", description: "View memory content" },
261
- { flags: "-e, --edit", description: "Edit memory interactively" },
262
- { flags: "-s, --sync", description: "Sync memory using AutoMemoryBridge" },
263
- { flags: "-p, --project <path>", description: "Project-specific memory path" }
264
- ],
265
- loader: async () => {
266
- const { memoryCommand } = await import('./chunks/memory.mjs');
267
- return async (options) => {
268
- await memoryCommand(options);
269
- };
270
- }
271
- },
272
- {
273
- name: "agents <action> [...args]",
274
- description: "Agent Teams - Multi-agent orchestration",
275
- aliases: ["team", "teams"],
276
- tier: "extended",
277
- options: [
278
- { flags: "--task <task>", description: "Task description" },
279
- { flags: "--workflow <id>", description: "Workflow preset (analyze, fix, test, optimize)" },
280
- { flags: "--verbose, -v", description: "Verbose output" },
281
- { flags: "--json", description: "JSON output" }
282
- ],
283
- loader: async () => {
284
- return async (options, action, args) => {
285
- const actionStr = action;
286
- const argsArr = args;
287
- const { handleAgentsCommand } = await import('./chunks/agents.mjs');
288
- await handleAgentsCommand([actionStr, ...argsArr], {
289
- task: options.task,
290
- workflow: options.workflow,
291
- verbose: options.verbose,
292
- json: options.json
293
- });
294
- };
295
- }
296
- },
297
- {
298
- name: "browser <action> [...args]",
299
- description: "Agent Browser management",
300
- aliases: ["ab"],
301
- tier: "extended",
302
- options: [
303
- { flags: "--verbose, -v", description: "Verbose output" }
304
- ],
305
- loader: async () => {
306
- return async (options, action, args) => {
307
- const actionStr = action;
308
- const argsArr = args;
309
- if (actionStr === "install") {
310
- const { installAgentBrowser } = await import('./chunks/installer2.mjs');
311
- await installAgentBrowser();
312
- } else if (actionStr === "uninstall") {
313
- const { uninstallAgentBrowser } = await import('./chunks/installer2.mjs');
314
- await uninstallAgentBrowser();
315
- } else if (actionStr === "status") {
316
- const { agentBrowserStatus } = await import('./chunks/commands2.mjs');
317
- await agentBrowserStatus(options);
318
- } else if (actionStr === "start") {
319
- const { startBrowserSession } = await import('./chunks/commands2.mjs');
320
- await startBrowserSession(argsArr[0], options);
321
- } else if (actionStr === "stop") {
322
- const { stopBrowserSession } = await import('./chunks/commands2.mjs');
323
- await stopBrowserSession(options);
324
- } else if (actionStr === "config") {
325
- const { configureBrowser } = await import('./chunks/commands2.mjs');
326
- await configureBrowser(options);
327
- } else {
328
- const { agentBrowserHelp } = await import('./chunks/commands2.mjs');
329
- agentBrowserHelp(options);
330
- }
331
- };
332
- }
333
- },
334
- {
335
- name: "interview [specFile]",
336
- description: "Interview-Driven Development",
337
- aliases: ["iv"],
338
- tier: "extended",
339
- options: [
340
- { flags: "--template, -t <template>", description: "Interview template" },
341
- { flags: "--depth, -d <depth>", description: "Interview depth" },
342
- { flags: "--resume, -r", description: "Resume session" },
343
- { flags: "--list", description: "List sessions" }
344
- ],
345
- loader: async () => {
346
- const { interview, quickInterview, deepInterview, listInterviewSessions, resumeInterview } = await import('./chunks/interview.mjs');
347
- return async (options, specFile) => {
348
- if (options.list) {
349
- await listInterviewSessions();
350
- } else if (options.resume) {
351
- await resumeInterview();
352
- } else if (options.depth === "quick") {
353
- await quickInterview(specFile, {
354
- specFile,
355
- depth: "quick",
356
- resume: !!options.resume,
357
- lang: options.lang
358
- });
359
- } else if (options.depth === "deep") {
360
- await deepInterview(specFile, {
361
- specFile,
362
- depth: "deep",
363
- resume: !!options.resume,
364
- lang: options.lang
365
- });
366
- } else {
367
- await interview({
368
- specFile,
369
- depth: options.depth,
370
- template: options.template,
371
- resume: !!options.resume,
372
- lang: options.lang
373
- });
374
- }
375
- };
376
- }
377
- },
378
- {
379
- name: "commit",
380
- description: "Smart git commit",
381
- tier: "extended",
382
- options: [
383
- { flags: "--auto, -a", description: "Auto-generate message" },
384
- { flags: "--dry-run, -d", description: "Preview only" },
385
- { flags: "--message, -m <msg>", description: "Custom message" }
386
- ],
387
- loader: async () => {
388
- const { commit } = await import('./chunks/commit.mjs');
389
- return async (options) => {
390
- await commit({
391
- auto: options.auto,
392
- dryRun: options.dryRun,
393
- message: options.message
394
- });
395
- };
396
- }
397
- },
398
- {
399
- name: "memory",
400
- description: "Manage Claude auto-memory and CCJK Brain memory",
401
- aliases: ["mem"],
402
- tier: "extended",
403
- options: [
404
- { flags: "--status", description: "Show memory status without changing files" },
405
- { flags: "--doctor", description: "Run memory health diagnostics" },
406
- { flags: "-v, --view", description: "View memory content" },
407
- { flags: "-e, --edit", description: "Edit memory interactively" },
408
- { flags: "-s, --sync", description: "Sync memory using AutoMemoryBridge" },
409
- { flags: "-p, --project <path>", description: "Project-specific memory path" }
410
- ],
411
- loader: async () => {
412
- const { memoryCommand } = await import('./chunks/memory.mjs');
413
- return async (options) => {
414
- await memoryCommand(options);
415
- };
416
- }
417
- },
418
- {
419
- name: "generate [projectPath]",
420
- description: "Smart agent/skill generation \u2014 auto-detect project and generate configs",
421
- aliases: ["gen"],
422
- tier: "extended",
423
- options: [
424
- { flags: "--dry-run, -d", description: "Preview without writing files" },
425
- { flags: "--verbose, -v", description: "Verbose output" }
426
- ],
427
- loader: async () => {
428
- return async (_options, projectPath) => {
429
- const { smartGenerateAndInstall } = await import('./chunks/index13.mjs');
430
- await smartGenerateAndInstall(projectPath);
431
- };
432
- }
433
- },
434
- {
435
- name: "config [action] [...args]",
436
- description: "Manage CCJK configuration",
437
- tier: "extended",
438
- options: [
439
- { flags: "--format, -f <format>", description: "Output format (table|json|yaml)" },
440
- { flags: "--global, -g", description: "Use global config" },
441
- { flags: "--code-type, -T <type>", description: "Code tool type" }
442
- ],
443
- loader: async () => {
444
- return async (options, action, args) => {
445
- const actionStr = action;
446
- const argsArr = args;
447
- const configOptions = {
448
- global: !!options.global,
449
- json: options.format === "json",
450
- codeType: options.codeType
451
- };
452
- if (!actionStr || actionStr === "list") {
453
- const { listConfig } = await import('./chunks/config3.mjs');
454
- await listConfig(configOptions);
455
- } else if (actionStr === "get") {
456
- const { getConfig } = await import('./chunks/config3.mjs');
457
- await getConfig(argsArr[0] || "", configOptions);
458
- } else if (actionStr === "set") {
459
- const { setConfig } = await import('./chunks/config3.mjs');
460
- await setConfig(argsArr[0] || "", argsArr[1] || "", configOptions);
461
- } else if (actionStr === "unset") {
462
- const { unsetConfig } = await import('./chunks/config3.mjs');
463
- await unsetConfig(argsArr[0] || "", configOptions);
464
- } else if (actionStr === "reset") {
465
- const { resetConfig } = await import('./chunks/config3.mjs');
466
- await resetConfig(configOptions);
467
- } else if (actionStr === "edit") {
468
- const { editConfig } = await import('./chunks/config3.mjs');
469
- await editConfig(configOptions);
470
- } else if (actionStr === "validate") {
471
- const { validateConfig } = await import('./chunks/config3.mjs');
472
- await validateConfig(configOptions);
473
- } else {
474
- console.error(`Unknown config action: ${actionStr}`);
475
- console.log("Available actions: list, get, set, unset, reset, edit, validate");
476
- }
477
- };
478
- }
479
- },
480
- {
481
- name: "providers [action] [...args]",
482
- description: "Manage API providers",
483
- tier: "extended",
484
- options: [
485
- { flags: "--format, -f <format>", description: "Output format (table|json)" },
486
- { flags: "--code-type, -T <type>", description: "Code tool type" },
487
- { flags: "--verbose, -v", description: "Verbose output" }
488
- ],
489
- loader: async () => {
490
- return async (options, action) => {
491
- const actionStr = action;
492
- const { providersCommand } = await import('./chunks/providers.mjs');
493
- await providersCommand(actionStr || "list", {
494
- lang: options.lang,
495
- codeType: options.codeType,
496
- verbose: options.verbose
497
- });
498
- };
499
- }
500
- },
501
- {
502
- name: "research <action> [...args]",
503
- description: "Run persisted research experiments with explicit metric comparison",
504
- tier: "extended",
505
- options: [
506
- { flags: "--name <name>", description: "Experiment name" },
507
- { flags: "--cmd <command>", description: "Shell command to execute" },
508
- { flags: "--metric <name>", description: "Metric name to parse from output" },
509
- { flags: "--objective <mode>", description: "Metric objective (auto|maximize|minimize)" },
510
- { flags: "--baseline <sessionId>", description: "Baseline session id to compare against" },
511
- { flags: "--program <path>", description: "Research program file path" },
512
- { flags: "--db-path <path>", description: "Research database path" },
513
- { flags: "--budget-ms <ms>", description: "Execution budget in milliseconds" },
514
- { flags: "--cwd <path>", description: "Working directory for the command" },
515
- { flags: "--limit <n>", description: "Number of sessions to list" },
516
- { flags: "--max-rounds <n>", description: "Maximum loop rounds" },
517
- { flags: "--max-no-improve-rounds <n>", description: "Maximum no-improve rounds before stop" },
518
- { flags: "--target-metric <value>", description: "Stop the loop when target metric is reached" }
519
- ],
520
- loader: async () => {
521
- return async (options, action, args) => {
522
- const actionStr = action;
523
- const argsArr = args;
524
- const { researchCommand } = await import('./chunks/research.mjs');
525
- await researchCommand(actionStr || "help", argsArr, {
526
- name: options.name,
527
- cmd: options.cmd,
528
- metric: options.metric,
529
- objective: options.objective,
530
- baseline: options.baseline,
531
- program: options.program,
532
- dbPath: options.dbPath,
533
- budgetMs: parseOptionalPositiveNumber(options.budgetMs, "--budget-ms"),
534
- cwd: options.cwd,
535
- limit: parseOptionalPositiveInteger(options.limit, "--limit"),
536
- maxRounds: parseOptionalPositiveInteger(options.maxRounds, "--max-rounds"),
537
- maxNoImproveRounds: parseOptionalPositiveInteger(options.maxNoImproveRounds, "--max-no-improve-rounds"),
538
- targetMetric: parseOptionalNumber(options.targetMetric, "--target-metric")
539
- });
540
- };
541
- }
542
- },
543
- // ==================== New v8.0.0 Commands ====================
544
- // Note: task, keybinding, and history commands use Commander.js subcommand pattern
545
- // They are registered via registerSpecialCommands() instead of lazy loading
546
- // {
547
- // name: 'task [action]',
548
- // description: 'Task management (create, list, update, delete, graph, stats, schedule)',
549
- // aliases: ['tasks'],
550
- // tier: 'extended',
551
- // options: [
552
- // { flags: '--lang, -l <lang>', description: 'Display language' },
553
- // ],
554
- // loader: async () => {
555
- // // Task command handler - future enhancement
556
- // return async () => {
557
- // console.log('Task command not yet implemented for CAC')
558
- // }
559
- // },
560
- // },
561
- // ========================================================================
562
- {
563
- name: "ccr",
564
- description: "Configure Claude Code Router",
565
- tier: "extended",
566
- loader: async () => {
567
- const { ccr } = await import('./chunks/ccr.mjs');
568
- return async () => {
569
- await ccr();
570
- };
571
- }
572
- },
573
- {
574
- name: "zero-config [preset]",
575
- description: "Apply zero-config permission presets (max, dev, safe)",
576
- aliases: ["zc"],
577
- tier: "extended",
578
- options: [
579
- { flags: "--preset, -p <preset>", description: "Preset to apply (max, dev, safe)" },
580
- { flags: "--list, -l", description: "List available presets" },
581
- { flags: "--skip-backup", description: "Skip backup before applying" },
582
- { flags: "--dry-run", description: "Preview the full config plan without writing files" },
583
- { flags: "--code-type, -T <type>", description: "Code tool type" },
584
- { flags: "--skip-ccr", description: "Do not install CCR while applying core features" }
585
- ],
586
- loader: async () => {
587
- const { zeroConfig } = await import('./chunks/zero-config.mjs');
588
- return async (options, preset) => {
589
- await zeroConfig({
590
- preset: preset || options.preset,
591
- list: options.list,
592
- skipBackup: options.skipBackup,
593
- dryRun: options.dryRun,
594
- codeTool: options.codeType,
595
- installCcr: options.skipCcr ? false : void 0
596
- });
597
- };
598
- }
599
- },
600
- {
601
- name: "snapshot [action] [id]",
602
- description: "List or inspect config snapshots",
603
- tier: "extended",
604
- options: [
605
- { flags: "--json", description: "Output in JSON format" }
606
- ],
607
- loader: async () => {
608
- const { snapshotCommand } = await import('./chunks/snapshot.mjs');
609
- return async (options, action, id) => {
610
- await snapshotCommand(action, id, {
611
- json: options.json
612
- });
613
- };
614
- }
615
- },
616
- {
617
- name: "rollback <id>",
618
- description: "Rollback config files from a snapshot",
619
- tier: "extended",
620
- options: [
621
- { flags: "--json", description: "Output in JSON format" }
622
- ],
623
- loader: async () => {
624
- const { rollbackCommand } = await import('./chunks/rollback.mjs');
625
- return async (options, id) => {
626
- await rollbackCommand(id, {
627
- json: options.json
628
- });
629
- };
630
- }
631
- },
632
- {
633
- name: "context-opt [action] [...args]",
634
- description: "Context optimization tools (stats/search/decay/config)",
635
- tier: "extended",
636
- options: [
637
- { flags: "--top-k, -k <number>", description: "Number of search results" }
638
- ],
639
- loader: async () => {
640
- return async (options, action, args) => {
641
- const actionStr = action;
642
- const argsArr = args;
643
- if (actionStr === "stats") {
644
- const { contextOptStats } = await import('./chunks/context-opt.mjs');
645
- await contextOptStats();
646
- } else if (actionStr === "search") {
647
- const { contextOptSearch } = await import('./chunks/context-opt.mjs');
648
- await contextOptSearch(argsArr[0] || "", { topK: options.topK });
649
- } else if (actionStr === "decay") {
650
- const { contextOptDecay } = await import('./chunks/context-opt.mjs');
651
- await contextOptDecay();
652
- } else if (actionStr === "config") {
653
- const { contextOptConfig } = await import('./chunks/context-opt.mjs');
654
- await contextOptConfig();
655
- } else {
656
- console.log("\n\u{1F9E0} Context Optimization Commands:");
657
- console.log(" ccjk context-opt stats - Show memory tree statistics");
658
- console.log(" ccjk context-opt search - Search memory tree");
659
- console.log(" ccjk context-opt decay - Run confidence decay");
660
- console.log(" ccjk context-opt config - Show configuration\n");
661
- }
662
- };
663
- }
664
- },
665
- {
666
- name: "vim",
667
- description: "Vim mode configuration and keybindings",
668
- tier: "extended",
669
- options: [
670
- { flags: "--enable, -e", description: "Enable Vim mode" },
671
- { flags: "--disable, -d", description: "Disable Vim mode" },
672
- { flags: "--toggle, -t", description: "Toggle Vim mode" },
673
- { flags: "--status, -s", description: "Show status" },
674
- { flags: "--install", description: "Install keybindings" },
675
- { flags: "--uninstall", description: "Uninstall keybindings" },
676
- { flags: "--keys, -k", description: "Show keybinding reference" },
677
- { flags: "--test <cmd>", description: "Test command parsing" },
678
- { flags: "--lang, -l <lang>", description: "Language (en, zh-CN)" }
679
- ],
680
- loader: async () => {
681
- return async (options) => {
682
- const { vimCommand } = await import('./chunks/vim.mjs');
683
- await vimCommand({
684
- lang: options.lang,
685
- enable: options.enable,
686
- disable: options.disable,
687
- toggle: options.toggle,
688
- status: options.status,
689
- install: options.install,
690
- uninstall: options.uninstall,
691
- keys: options.keys,
692
- test: options.test
693
- });
694
- };
695
- }
696
- },
697
- {
698
- name: "permissions [action] [...args]",
699
- description: "Manage CCJK permissions",
700
- aliases: ["perm"],
701
- tier: "extended",
702
- options: [
703
- { flags: "--format, -f <format>", description: "Output format (table|json|list)" },
704
- { flags: "--verbose, -v", description: "Verbose output" }
705
- ],
706
- loader: async () => {
707
- return async (options, action, args) => {
708
- const actionStr = action;
709
- const argsArr = args;
710
- if (!actionStr || actionStr === "list") {
711
- const { listPermissions } = await import('./chunks/permissions.mjs');
712
- await listPermissions(options);
713
- } else if (actionStr === "check") {
714
- const { checkPermission } = await import('./chunks/permissions.mjs');
715
- await checkPermission(argsArr[0] || "", options);
716
- } else if (actionStr === "grant") {
717
- const { grantPermission } = await import('./chunks/permissions.mjs');
718
- await grantPermission(argsArr[0] || "", options);
719
- } else if (actionStr === "revoke") {
720
- const { revokePermission } = await import('./chunks/permissions.mjs');
721
- await revokePermission(argsArr[0] || "", options);
722
- } else if (actionStr === "reset") {
723
- const { resetPermissions } = await import('./chunks/permissions.mjs');
724
- await resetPermissions(options);
725
- } else if (actionStr === "export") {
726
- const { exportPermissions } = await import('./chunks/permissions.mjs');
727
- await exportPermissions(argsArr[0], options);
728
- } else if (actionStr === "import") {
729
- const { importPermissions } = await import('./chunks/permissions.mjs');
730
- await importPermissions(argsArr[0] || "", options);
731
- } else {
732
- const { permissionsHelp } = await import('./chunks/permissions.mjs');
733
- permissionsHelp(options);
734
- }
735
- };
736
- }
737
- },
738
- {
739
- name: "skills [action] [...args]",
740
- description: "Manage CCJK skills",
741
- aliases: ["sk"],
742
- tier: "extended",
743
- options: [
744
- { flags: "--category, -c <category>", description: "Filter by category" },
745
- { flags: "--show-disabled", description: "Show disabled skills" },
746
- { flags: "--format, -f <format>", description: "Output format (table|json|list)" },
747
- { flags: "--batch", description: "Batch create skills" }
748
- ],
749
- loader: async () => {
750
- return async (options, action, args) => {
751
- const { initI18n } = await import('./chunks/index2.mjs');
752
- await initI18n(options.lang || "zh-CN");
753
- const actionStr = action;
754
- const argsArr = args;
755
- if (!actionStr) {
756
- const { skillsMenu } = await import('./chunks/skills.mjs');
757
- await skillsMenu(options);
758
- } else if (actionStr === "list" || actionStr === "ls") {
759
- const { listSkills } = await import('./chunks/skills.mjs');
760
- await listSkills(options);
761
- } else if (actionStr === "run") {
762
- const { runSkill } = await import('./chunks/skills.mjs');
763
- await runSkill(argsArr[0] || "", options);
764
- } else if (actionStr === "info") {
765
- const { showSkillInfo } = await import('./chunks/skills.mjs');
766
- await showSkillInfo(argsArr[0] || "", options);
767
- } else if (actionStr === "create") {
768
- const { createSkill } = await import('./chunks/skills.mjs');
769
- await createSkill(argsArr[0] || "", options);
770
- } else if (actionStr === "enable") {
771
- const { enableSkill } = await import('./chunks/skills.mjs');
772
- await enableSkill(argsArr[0] || "", options);
773
- } else if (actionStr === "disable") {
774
- const { disableSkill } = await import('./chunks/skills.mjs');
775
- await disableSkill(argsArr[0] || "", options);
776
- } else if (actionStr === "delete" || actionStr === "remove" || actionStr === "rm") {
777
- const { deleteSkill } = await import('./chunks/skills.mjs');
778
- await deleteSkill(argsArr[0] || "", options);
779
- } else {
780
- const { runSkill } = await import('./chunks/skills.mjs');
781
- await runSkill(actionStr, options);
782
- }
783
- };
784
- }
785
- },
786
- // ==================== Plugins-v2 Commands ====================
787
- {
788
- name: "skill [action] [...args]",
789
- description: "Manage plugins-v2 skills (SKILL.md based)",
790
- tier: "extended",
791
- options: [
792
- { flags: "--force, -f", description: "Force reinstall" },
793
- { flags: "--json", description: "Output as JSON" }
794
- ],
795
- loader: async () => {
796
- const { handleSkillCommand } = await import('./chunks/skill2.mjs');
797
- return async (options, action, args) => {
798
- const actionStr = action;
799
- const argsArr = args;
800
- await handleSkillCommand([actionStr, ...argsArr], {
801
- force: options.force,
802
- json: options.json
803
- });
804
- };
805
- }
806
- },
807
- {
808
- name: "agent [action] [...args]",
809
- description: "Manage AI agents (Skills + MCP composition)",
810
- aliases: ["ag"],
811
- tier: "extended",
812
- options: [
813
- { flags: "--template, -t <template>", description: "Use agent template" },
814
- { flags: "--skills, -s <skills>", description: "Comma-separated skill IDs" },
815
- { flags: "--mcp, -m <servers>", description: "Comma-separated MCP servers" },
816
- { flags: "--persona, -p <persona>", description: "Custom persona" },
817
- { flags: "--json", description: "Output as JSON" }
818
- ],
819
- loader: async () => {
820
- const { handleAgentCommand } = await import('./chunks/agent.mjs');
821
- return async (options, action, args) => {
822
- const actionStr = action;
823
- const argsArr = args;
824
- await handleAgentCommand([actionStr, ...argsArr], {
825
- template: options.template,
826
- skills: options.skills ? options.skills.split(",") : void 0,
827
- mcp: options.mcp ? options.mcp.split(",") : void 0,
828
- persona: options.persona,
829
- json: options.json
830
- });
831
- };
832
- }
833
- },
834
- {
835
- name: "ccu [...args]",
836
- description: "Claude Code usage analysis",
837
- tier: "extended",
838
- loader: async () => {
839
- const { executeCcusage } = await import('./chunks/ccu.mjs');
840
- return async (_options, args) => {
841
- await executeCcusage(args);
842
- };
843
- }
844
- },
845
- {
846
- name: "impact",
847
- description: "Usage impact page with daily tokens, savings, and before/after trends",
848
- aliases: ["gain"],
849
- tier: "extended",
850
- options: [
851
- { flags: "--days <days>", description: "Number of days to include (7-90)" },
852
- { flags: "--json", description: "Output as JSON" },
853
- { flags: "--output <file>", description: "Custom HTML output path" }
854
- ],
855
- loader: async () => {
856
- const { impactCommand } = await import('./chunks/impact.mjs');
857
- return async (options) => {
858
- await impactCommand({
859
- json: options.json,
860
- days: options.days ? Number(options.days) : void 0,
861
- output: options.output
862
- });
863
- };
864
- }
865
- },
866
- {
867
- name: "stats [action]",
868
- description: "Usage statistics and analytics",
869
- tier: "extended",
870
- options: [
871
- { flags: "--period, -p <period>", description: "Time period (1d, 7d, 30d, 90d, all)" },
872
- { flags: "--format, -f <format>", description: "Output format (table, json, csv)" },
873
- { flags: "--export, -e <file>", description: "Export to file" },
874
- { flags: "--provider <provider>", description: "Filter by provider" },
875
- { flags: "--days <days>", description: "Days to keep for cleanup action" }
876
- ],
877
- loader: async () => {
878
- return async (options, action) => {
879
- const actionStr = action;
880
- if (actionStr === "dates") {
881
- const { listStatsDates } = await import('./chunks/stats.mjs');
882
- await listStatsDates();
883
- } else if (actionStr === "storage") {
884
- const { storageStats } = await import('./chunks/stats.mjs');
885
- await storageStats();
886
- } else if (actionStr === "cleanup") {
887
- const { cleanupStats } = await import('./chunks/stats.mjs');
888
- const days = options.days ? Number.parseInt(options.days, 10) : 90;
889
- await cleanupStats(days);
890
- } else {
891
- const { stats } = await import('./chunks/stats.mjs');
892
- await stats(options);
893
- }
894
- };
895
- }
896
- },
897
- {
898
- name: "uninstall",
899
- description: "Remove CCJK configurations",
900
- tier: "extended",
901
- options: [
902
- { flags: "--mode, -m <mode>", description: "Uninstall mode" },
903
- { flags: "--code-type, -T <type>", description: "Code tool type" }
904
- ],
905
- loader: async () => {
906
- const { uninstall } = await import('./chunks/uninstall.mjs');
907
- return async (options) => {
908
- await uninstall(options);
909
- };
910
- }
911
- },
912
- {
913
- name: "check-updates",
914
- description: "Check for updates",
915
- aliases: ["check"],
916
- tier: "extended",
917
- options: [
918
- { flags: "--code-type, -T <type>", description: "Code tool type" },
919
- { flags: "--skip-prompt, -s", description: "Skip prompts" }
920
- ],
921
- loader: async () => {
922
- const { checkUpdates } = await import('./chunks/check-updates.mjs');
923
- return async (options) => {
924
- await checkUpdates(options);
925
- };
926
- }
927
- },
928
- {
929
- name: "config-switch [target]",
930
- description: "Switch configuration",
931
- aliases: ["cs"],
932
- tier: "extended",
933
- options: [
934
- { flags: "--code-type, -T <type>", description: "Code tool type" },
935
- { flags: "--list, -l", description: "List configurations" }
936
- ],
937
- loader: async () => {
938
- const { configSwitchCommand } = await import('./chunks/config-switch.mjs');
939
- return async (options, target) => {
940
- await configSwitchCommand({
941
- target,
942
- codeType: options.codeType,
943
- list: options.list
944
- });
945
- };
946
- }
947
- },
948
- {
949
- name: "workflows",
950
- description: "Manage workflows",
951
- aliases: ["wf"],
952
- tier: "extended",
953
- loader: async () => {
954
- const { listWorkflowsQuick } = await import('./chunks/workflows.mjs');
955
- return async () => {
956
- await listWorkflowsQuick();
957
- };
958
- }
959
- },
960
- {
961
- name: "notification [action]",
962
- description: "Task notifications",
963
- aliases: ["notify"],
964
- tier: "extended",
965
- loader: async () => {
966
- const { notificationCommand } = await import('./chunks/notification.mjs');
967
- return async (_options, action) => {
968
- await notificationCommand(action);
969
- };
970
- }
971
- },
972
- {
973
- name: "session <action> [id]",
974
- description: "Session management (save, restore, list, delete)",
975
- tier: "extended",
976
- options: [
977
- { flags: "--name, -n <name>", description: "Session name" }
978
- ],
979
- loader: async () => {
980
- const { handleSessionCommand } = await import('./chunks/session.mjs');
981
- return async (_options, action, id) => {
982
- const args = [];
983
- if (action)
984
- args.push(action);
985
- if (id)
986
- args.push(id);
987
- await handleSessionCommand(args);
988
- };
989
- }
990
- },
991
- {
992
- name: "context <action> [id]",
993
- description: "Context management (analyze, compress, optimize, status)",
994
- aliases: ["ctx"],
995
- tier: "extended",
996
- options: [
997
- { flags: "--verbose, -v", description: "Verbose output" },
998
- { flags: "--show", description: "Show context layers" },
999
- { flags: "--layers <layers>", description: "Specific layers to show" },
1000
- { flags: "--task <task>", description: "Preview context for task" },
1001
- { flags: "--clear", description: "Clear context cache" },
1002
- { flags: "--health", description: "Run database health check" },
1003
- { flags: "--alerts", description: "Show current health alerts" },
1004
- { flags: "--alert-history", description: "Show alert history" },
1005
- { flags: "--checkpoint", description: "Checkpoint WAL file" },
1006
- { flags: "--vacuum", description: "Vacuum database" },
1007
- { flags: "--backup", description: "Create database backup" },
1008
- { flags: "--recover", description: "Attempt database recovery" }
1009
- ],
1010
- loader: async () => {
1011
- const { contextCommand } = await import('./chunks/context.mjs');
1012
- return async (options, action) => {
1013
- await contextCommand({
1014
- ...options,
1015
- action
1016
- });
1017
- };
1018
- }
1019
- },
1020
- {
1021
- name: "api [action] [...args]",
1022
- description: "Configure API providers",
1023
- tier: "extended",
1024
- options: [
1025
- { flags: "--provider, -p <provider>", description: "Provider ID" },
1026
- { flags: "--key, -k <key>", description: "API key" },
1027
- { flags: "--url <url>", description: "API URL" },
1028
- { flags: "--model <model>", description: "Default model" },
1029
- { flags: "--fast-model <model>", description: "Fast model" },
1030
- { flags: "--yes, -y", description: "Skip confirmation prompts" },
1031
- { flags: "--json", description: "Output in JSON format" },
1032
- { flags: "--test, -t", description: "Test connection" }
1033
- ],
1034
- loader: async () => {
1035
- return async (options, action, args) => {
1036
- const actionStr = action || "wizard";
1037
- const argsArr = args || [];
1038
- if (actionStr === "configure" || actionStr === "setup" && (options.provider || options.yes)) {
1039
- const { apiConfigure } = await import('./chunks/api-cli.mjs');
1040
- await apiConfigure({
1041
- provider: options.provider,
1042
- key: options.key,
1043
- url: options.url,
1044
- model: options.model,
1045
- fastModel: options.fastModel,
1046
- yes: options.yes,
1047
- lang: options.lang
1048
- });
1049
- } else if (actionStr === "list" && options.json) {
1050
- const { apiList } = await import('./chunks/api-cli.mjs');
1051
- await apiList({
1052
- json: options.json,
1053
- lang: options.lang
1054
- });
1055
- } else {
1056
- const { apiCommand } = await import('./chunks/api.mjs');
1057
- await apiCommand(actionStr, argsArr, options);
1058
- }
1059
- };
1060
- }
1061
- },
1062
- {
1063
- name: "team <action>",
1064
- description: "Team collaboration",
1065
- tier: "extended",
1066
- loader: async () => {
1067
- const { teamInit, teamShare, teamSync } = await import('./chunks/team.mjs');
1068
- return async (_options, action) => {
1069
- const actionStr = action;
1070
- if (actionStr === "init")
1071
- await teamInit();
1072
- else if (actionStr === "share")
1073
- await teamShare();
1074
- else if (actionStr === "sync")
1075
- await teamSync();
1076
- };
1077
- }
1078
- },
1079
- // ==================== Thinking Mode Commands ====================
1080
- {
1081
- name: "agent-teams",
1082
- description: "Toggle Claude Code Agent Teams (experimental)",
1083
- aliases: ["teams"],
1084
- tier: "extended",
1085
- options: [
1086
- { flags: "--on", description: "Enable Agent Teams" },
1087
- { flags: "--off", description: "Disable Agent Teams" },
1088
- { flags: "--status", description: "Show current status" },
1089
- { flags: "--mode <mode>", description: "Set teammate mode (auto/in-process/tmux)" }
1090
- ],
1091
- loader: async () => {
1092
- const { agentTeamsCommand } = await import('./chunks/agent-teams.mjs');
1093
- return async (options) => {
1094
- await agentTeamsCommand(options);
1095
- };
1096
- }
1097
- },
1098
- {
1099
- name: "thinking [action] [...args]",
1100
- description: "Thinking Mode (Opus 4.5+ extended reasoning)",
1101
- aliases: ["think"],
1102
- tier: "extended",
1103
- options: [
1104
- { flags: "--json", description: "Output in JSON format" },
1105
- { flags: "--verbose, -v", description: "Verbose output" }
1106
- ],
1107
- loader: async () => {
1108
- const { thinking } = await import('./chunks/thinking.mjs');
1109
- return async (options, action, args) => {
1110
- await thinking(action, args, options);
1111
- };
1112
- }
1113
- },
1114
- // ==================== Postmortem System ====================
1115
- {
1116
- name: "postmortem <action> [...args]",
1117
- description: "\u{1F52C} Postmortem Intelligence - Learn from historical bugs",
1118
- aliases: ["pm"],
1119
- tier: "extended",
1120
- options: [
1121
- { flags: "--severity <level>", description: "Filter by severity (critical/high/medium/low)" },
1122
- { flags: "--category <cat>", description: "Filter by category" },
1123
- { flags: "--status <status>", description: "Filter by status" },
1124
- { flags: "--staged", description: "Check staged files only" },
1125
- { flags: "--ci", description: "CI mode, exit with error on issues" },
1126
- { flags: "--since <tag>", description: "Start version/commit" },
1127
- { flags: "--until <tag>", description: "End version/commit" },
1128
- { flags: "--version <ver>", description: "Associated version" }
1129
- ],
1130
- loader: async () => {
1131
- return async (options, action, args) => {
1132
- const actionStr = action;
1133
- const argsArr = args || [];
1134
- const { getPostmortemManager } = await import('./chunks/index11.mjs');
1135
- const manager = getPostmortemManager(process.cwd());
1136
- if (actionStr === "init") {
1137
- const ora = (await import('./chunks/index8.mjs')).default;
1138
- const ansis = (await import('./chunks/index5.mjs')).default;
1139
- const spinner = ora("Analyzing historical fix commits...").start();
1140
- try {
1141
- const result = await manager.init();
1142
- spinner.succeed(ansis.green("Postmortem system initialized"));
1143
- console.log(`
1144
- ${ansis.yellow("Reports generated:")} ${result.created}`);
1145
- console.log(` ${ansis.yellow("Directory:")} ${result.directory}
1146
- `);
1147
- } catch (error) {
1148
- spinner.fail(ansis.red("Initialization failed"));
1149
- console.error(error);
1150
- }
1151
- } else if (actionStr === "generate" || actionStr === "gen") {
1152
- const ora = (await import('./chunks/index8.mjs')).default;
1153
- const ansis = (await import('./chunks/index5.mjs')).default;
1154
- const spinner = ora("Analyzing commits...").start();
1155
- try {
1156
- if (options.version) {
1157
- const summary = await manager.generateReleaseSummary({
1158
- version: options.version,
1159
- since: options.since,
1160
- until: options.until
1161
- });
1162
- spinner.succeed(ansis.green("Release summary generated"));
1163
- console.log(`
1164
- ${ansis.yellow("Version:")} ${summary.version}`);
1165
- console.log(` ${ansis.yellow("Fix commits:")} ${summary.fixCommitCount}`);
1166
- console.log(` ${ansis.yellow("New postmortems:")} ${summary.newPostmortems.length}
1167
- `);
1168
- } else {
1169
- const result = await manager.init();
1170
- spinner.succeed(ansis.green("Postmortem generation complete"));
1171
- console.log(`
1172
- ${ansis.yellow("Reports:")} ${result.created}
1173
- `);
1174
- }
1175
- } catch (error) {
1176
- spinner.fail(ansis.red("Generation failed"));
1177
- console.error(error);
1178
- }
1179
- } else if (actionStr === "list" || actionStr === "ls") {
1180
- const ansis = (await import('./chunks/index5.mjs')).default;
1181
- let reports = manager.listReports();
1182
- if (options.severity)
1183
- reports = reports.filter((r) => r.severity === options.severity);
1184
- if (options.category)
1185
- reports = reports.filter((r) => r.category === options.category);
1186
- if (options.status)
1187
- reports = reports.filter((r) => r.status === options.status);
1188
- if (reports.length === 0) {
1189
- console.log(ansis.yellow("\nNo postmortem reports found"));
1190
- console.log(ansis.gray('Run "ccjk postmortem init" to initialize\n'));
1191
- return;
1192
- }
1193
- const severityEmoji = { critical: "\u{1F534}", high: "\u{1F7E0}", medium: "\u{1F7E1}", low: "\u{1F7E2}" };
1194
- console.log(ansis.cyan.bold("\n\u{1F4CB} Postmortem Reports"));
1195
- console.log(ansis.gray("\u2500".repeat(50)));
1196
- for (const r of reports) {
1197
- console.log(`
1198
- ${severityEmoji[r.severity] || "\u26AA"} ${ansis.bold(r.id)}: ${r.title}`);
1199
- console.log(` ${ansis.gray("Category:")} ${r.category} ${ansis.gray("Status:")} ${r.status}`);
1200
- }
1201
- console.log(ansis.gray(`
1202
- \u2500 Total: ${reports.length} reports \u2500
1203
- `));
1204
- } else if (actionStr === "show") {
1205
- const ansis = (await import('./chunks/index5.mjs')).default;
1206
- const id = argsArr[0];
1207
- if (!id) {
1208
- console.log(ansis.red("Please specify a postmortem ID"));
1209
- return;
1210
- }
1211
- const report = manager.getReport(id);
1212
- if (!report) {
1213
- console.log(ansis.red(`Postmortem not found: ${id}`));
1214
- return;
1215
- }
1216
- console.log(ansis.cyan.bold(`
1217
- \u2550\u2550\u2550 ${report.id}: ${report.title} \u2550\u2550\u2550
1218
- `));
1219
- console.log(`${ansis.yellow("Severity:")} ${report.severity.toUpperCase()}`);
1220
- console.log(`${ansis.yellow("Category:")} ${report.category}`);
1221
- console.log(`${ansis.yellow("Status:")} ${report.status}`);
1222
- console.log(`
1223
- ${ansis.cyan("Description:")}
1224
- ${report.description}`);
1225
- console.log(`
1226
- ${ansis.cyan("Root Cause:")}
1227
- ${report.rootCause.map((c) => ` \u2022 ${c}`).join("\n")}`);
1228
- console.log(`
1229
- ${ansis.cyan("Prevention:")}
1230
- ${report.preventionMeasures.map((m) => ` \u2022 ${m}`).join("\n")}`);
1231
- console.log(`
1232
- ${ansis.cyan("AI Directives:")}
1233
- ${report.aiDirectives.map((d) => ` \u2022 ${d}`).join("\n")}
1234
- `);
1235
- } else if (actionStr === "check") {
1236
- const ora = (await import('./chunks/index8.mjs')).default;
1237
- const ansis = (await import('./chunks/index5.mjs')).default;
1238
- const spinner = ora("Checking code...").start();
1239
- try {
1240
- const result = await manager.checkCode({
1241
- staged: options.staged,
1242
- files: argsArr.length > 0 ? argsArr : void 0
1243
- });
1244
- spinner.stop();
1245
- console.log(ansis.cyan.bold("\n\u{1F50D} Postmortem Code Check"));
1246
- console.log(ansis.gray("\u2500".repeat(40)));
1247
- console.log(` Files checked: ${result.filesChecked}`);
1248
- console.log(` Issues found: ${result.issuesFound.length}`);
1249
- console.log(`
1250
- \u{1F534} Critical: ${result.summary.critical}`);
1251
- console.log(` \u{1F7E0} High: ${result.summary.high}`);
1252
- console.log(` \u{1F7E1} Medium: ${result.summary.medium}`);
1253
- console.log(` \u{1F7E2} Low: ${result.summary.low}`);
1254
- if (result.issuesFound.length > 0) {
1255
- console.log(ansis.yellow("\n\u26A0\uFE0F Issues:"));
1256
- for (const issue of result.issuesFound.slice(0, 10)) {
1257
- console.log(`
1258
- ${issue.file}:${issue.line}`);
1259
- console.log(` ${issue.message}`);
1260
- }
1261
- }
1262
- console.log(result.passed ? ansis.green("\n\u2705 Check passed\n") : ansis.red("\n\u274C Check failed\n"));
1263
- if (!result.passed && options.ci)
1264
- process.exit(1);
1265
- } catch (error) {
1266
- spinner.fail(ansis.red("Check failed"));
1267
- console.error(error);
1268
- }
1269
- } else if (actionStr === "sync") {
1270
- const ora = (await import('./chunks/index8.mjs')).default;
1271
- const ansis = (await import('./chunks/index5.mjs')).default;
1272
- const spinner = ora("Syncing to CLAUDE.md...").start();
1273
- try {
1274
- const result = await manager.syncToClaudeMd();
1275
- spinner.succeed(ansis.green("Sync complete"));
1276
- console.log(`
1277
- ${ansis.yellow("Synced:")} ${result.synced} items`);
1278
- console.log(` ${ansis.yellow("File:")} ${result.claudeMdPath}
1279
- `);
1280
- } catch (error) {
1281
- spinner.fail(ansis.red("Sync failed"));
1282
- console.error(error);
1283
- }
1284
- } else if (actionStr === "stats") {
1285
- const ansis = (await import('./chunks/index5.mjs')).default;
1286
- const index = manager.loadIndex();
1287
- if (!index) {
1288
- console.log(ansis.yellow("\nNo statistics available"));
1289
- console.log(ansis.gray('Run "ccjk postmortem init" to initialize\n'));
1290
- return;
1291
- }
1292
- console.log(ansis.cyan.bold("\n\u{1F4CA} Postmortem Statistics"));
1293
- console.log(ansis.gray("\u2500".repeat(40)));
1294
- console.log(`
1295
- ${ansis.yellow("Total:")} ${index.stats.total} reports`);
1296
- console.log(`
1297
- ${ansis.yellow("By Severity:")}`);
1298
- console.log(` \u{1F534} Critical: ${index.stats.bySeverity.critical}`);
1299
- console.log(` \u{1F7E0} High: ${index.stats.bySeverity.high}`);
1300
- console.log(` \u{1F7E1} Medium: ${index.stats.bySeverity.medium}`);
1301
- console.log(` \u{1F7E2} Low: ${index.stats.bySeverity.low}`);
1302
- console.log(`
1303
- ${ansis.yellow("By Status:")}`);
1304
- console.log(` \u26A1 Active: ${index.stats.byStatus.active}`);
1305
- console.log(` \u2705 Resolved: ${index.stats.byStatus.resolved}`);
1306
- console.log(` \u{1F440} Monitoring: ${index.stats.byStatus.monitoring}`);
1307
- console.log(` \u{1F4E6} Archived: ${index.stats.byStatus.archived}
1308
- `);
1309
- } else {
1310
- console.log("\n\u{1F52C} Postmortem Commands:");
1311
- console.log(" ccjk postmortem init - Initialize system");
1312
- console.log(" ccjk postmortem generate - Generate from commits");
1313
- console.log(" ccjk postmortem list - List all reports");
1314
- console.log(" ccjk postmortem show <id> - Show report details");
1315
- console.log(" ccjk postmortem check - Check code for issues");
1316
- console.log(" ccjk postmortem sync - Sync to CLAUDE.md");
1317
- console.log(" ccjk postmortem stats - Show statistics\n");
1318
- }
1319
- };
1320
- }
1321
- },
1322
- // ==================== Context Compression System ====================
1323
- {
1324
- name: "claude",
1325
- description: "Transparent claude command wrapper with context compression",
1326
- tier: "extended",
1327
- options: [
1328
- { flags: "--debug", description: "Enable debug output" },
1329
- { flags: "--no-wrap", description: "Disable wrapping (pass through)" }
1330
- ],
1331
- loader: async () => {
1332
- const { claudeWrapper } = await import('./chunks/claude-wrapper.mjs');
1333
- return async (options) => {
1334
- const argv = process.argv;
1335
- const claudeIndex = argv.findIndex((arg) => arg === "claude");
1336
- const rawArgs = claudeIndex >= 0 ? argv.slice(claudeIndex + 1) : [];
1337
- const args = rawArgs.filter((arg) => arg !== "--debug" && arg !== "--no-wrap");
1338
- await claudeWrapper(args, {
1339
- debug: options.debug,
1340
- noWrap: options.noWrap
1341
- });
1342
- };
1343
- }
1344
- },
1345
- // ==================== Performance Monitoring ====================
1346
- {
1347
- name: "monitor [action]",
1348
- description: "Real-time performance monitoring dashboard",
1349
- tier: "extended",
1350
- options: [
1351
- { flags: "--refresh, -r <ms>", description: "Refresh interval (milliseconds)" },
1352
- { flags: "--range <timeRange>", description: "Report time range (hourly|daily|weekly|monthly)" },
1353
- { flags: "--format, -f <format>", description: "Export format (json|csv|html)" },
1354
- { flags: "--output, -o <file>", description: "Output file path" },
1355
- { flags: "--json", description: "Also output JSON format" },
1356
- { flags: "--no-banner", description: "Do not display banner" }
1357
- ],
1358
- loader: async () => {
1359
- return async (options, action) => {
1360
- const { monitor } = await import('./chunks/monitor.mjs');
1361
- await monitor(action || void 0, options);
1362
- };
1363
- }
1364
- },
1365
- // ==================== Configuration Management ====================
1366
- {
1367
- name: "config [action] [key] [value]",
1368
- description: "Manage configuration",
1369
- tier: "extended",
1370
- options: [
1371
- { flags: "--json", description: "Output in JSON format" },
1372
- { flags: "--code-type, -T <type>", description: "Code tool type" }
1373
- ],
1374
- loader: async () => {
1375
- const { configCommand } = await import('./chunks/config3.mjs');
1376
- return async (options, action, key, value) => {
1377
- const args = [];
1378
- if (action !== void 0)
1379
- args.push(action);
1380
- if (key !== void 0)
1381
- args.push(key);
1382
- if (value !== void 0)
1383
- args.push(value);
1384
- await configCommand(args[0] || "list", args.slice(1), {
1385
- lang: options.lang,
1386
- codeType: options.codeType,
1387
- global: options.global,
1388
- json: options.json
1389
- });
1390
- };
1391
- }
1392
- },
1393
- // context 命令已在上面定义(第 435 行),使用 context-compression/commands/context.ts
1394
- // shell hook 管理功能通过 'ccjk context hook install/uninstall' 子命令访问
1395
- // Deprecated commands removed in v2.x cleanup
1396
- // - shencha: replaced by 'ccjk doctor'
1397
- // - features: replaced by 'ccjk' menu
1398
- // - tools: replaced by 'ccjk' menu
1399
- // ==================== CCJK v8.0.0 Commands ====================
1400
- {
1401
- name: "ccjk:mcp",
1402
- description: "Intelligent MCP service management based on project analysis",
1403
- aliases: ["ccjk-mcp"],
1404
- tier: "extended",
1405
- options: [
1406
- { flags: "--tier <tier>", description: "Service tier filter (core, ondemand, scenario, all)" },
1407
- { flags: "--services <services>", description: "Specific services to install (comma-separated)" },
1408
- { flags: "--exclude <services>", description: "Services to exclude (comma-separated)" },
1409
- { flags: "--auto-install", description: "Auto-install dependencies" },
1410
- { flags: "--skip-verification", description: "Skip service verification" },
1411
- { flags: "--dry-run", description: "Preview without installing" },
1412
- { flags: "--json", description: "JSON output for automation" },
1413
- { flags: "--force", description: "Force reinstallation" },
1414
- { flags: "--lang, -l <lang>", description: "Display language (zh-CN, en)" }
1415
- ],
1416
- loader: async () => {
1417
- return async (options) => {
1418
- const { ccjkMcp, formatResultAsJson, formatResultForConsole } = await import('./chunks/ccjk-mcp.mjs');
1419
- const services = options.services ? options.services.split(",").map((s) => s.trim()) : void 0;
1420
- const exclude = options.exclude ? options.exclude.split(",").map((s) => s.trim()) : void 0;
1421
- const result = await ccjkMcp({
1422
- interactive: !options.json && !options.dryRun,
1423
- tier: options.tier,
1424
- services,
1425
- exclude,
1426
- autoInstall: options.autoInstall,
1427
- skipVerification: options.skipVerification,
1428
- dryRun: options.dryRun,
1429
- json: options.json,
1430
- lang: options.lang,
1431
- force: options.force
1432
- });
1433
- if (options.json) {
1434
- console.log(formatResultAsJson(result));
1435
- } else {
1436
- console.log(formatResultForConsole(result));
1437
- }
1438
- };
1439
- }
1440
- },
1441
- {
1442
- name: "ccjk:skills",
1443
- description: "Auto-recommend and install CCJK skills based on project analysis",
1444
- aliases: ["ccjk-skills"],
1445
- tier: "extended",
1446
- options: [
1447
- { flags: "--category <category>", description: "Filter by skill category" },
1448
- { flags: "--tags <tags>", description: "Filter by tags (comma-separated)" },
1449
- { flags: "--exclude <skills>", description: "Exclude specific skills (comma-separated)" },
1450
- { flags: "--dry-run", description: "Show recommendations without installing" },
1451
- { flags: "--force", description: "Force installation even if already installed" },
1452
- { flags: "--json", description: "JSON output" },
1453
- { flags: "--lang, -l <lang>", description: "Display language (zh-CN, en)" }
1454
- ],
1455
- loader: async () => {
1456
- return async (options) => {
1457
- const { ccjkSkills } = await import('./chunks/ccjk-skills.mjs');
1458
- await ccjkSkills({
1459
- category: options.category,
1460
- tags: options.tags ? options.tags.split(",") : void 0,
1461
- exclude: options.exclude ? options.exclude.split(",") : void 0,
1462
- dryRun: options.dryRun,
1463
- force: options.force,
1464
- json: options.json,
1465
- lang: options.lang
1466
- });
1467
- };
1468
- }
1469
- },
1470
- {
1471
- name: "ccjk:agents",
1472
- description: "Create and manage CCJK agents",
1473
- aliases: ["ccjk-agents"],
1474
- tier: "extended",
1475
- options: [
1476
- { flags: "--create <name>", description: "Create a new agent" },
1477
- { flags: "--list", description: "List available agents" },
1478
- { flags: "--delete <name>", description: "Delete an agent" },
1479
- { flags: "--template <template>", description: "Use specific template" },
1480
- { flags: "--json", description: "JSON output" },
1481
- { flags: "--lang, -l <lang>", description: "Display language (zh-CN, en)" }
1482
- ],
1483
- loader: async () => {
1484
- return async (options) => {
1485
- const { ccjkAgents } = await import('./chunks/ccjk-agents.mjs');
1486
- await ccjkAgents({
1487
- create: options.create,
1488
- list: options.list,
1489
- delete: options.delete,
1490
- template: options.template,
1491
- json: options.json,
1492
- lang: options.lang
1493
- });
1494
- };
1495
- }
1496
- },
1497
- {
1498
- name: "ccjk:persistence",
1499
- description: "Manage context persistence and storage tiers",
1500
- aliases: ["ccjk-persistence", "persistence"],
1501
- tier: "extended",
1502
- options: [
1503
- { flags: "--lang, -l <lang>", description: "Display language (zh-CN, en)" }
1504
- ],
1505
- loader: async () => {
1506
- return async (_options) => {
1507
- const { persistenceManager } = await import('./chunks/persistence-manager.mjs');
1508
- await persistenceManager();
1509
- };
1510
- }
1511
- },
1512
- {
1513
- name: "ccjk:hooks",
1514
- description: "Auto-recommend and configure CCJK hooks based on project analysis",
1515
- aliases: ["ccjk-hooks"],
1516
- tier: "extended",
1517
- options: [
1518
- { flags: "--type <type>", description: "Filter by hook type (pre-commit, post-commit, etc.)" },
1519
- { flags: "--category <category>", description: "Filter by category (quality, security, etc.)" },
1520
- { flags: "--exclude <hooks>", description: "Exclude specific hooks (comma-separated)" },
1521
- { flags: "--enabled", description: "Only show enabled hooks" },
1522
- { flags: "--dry-run", description: "Show recommendations without installing" },
1523
- { flags: "--json", description: "JSON output" },
1524
- { flags: "--verbose", description: "Verbose output" }
1525
- ],
1526
- loader: async () => {
1527
- return async (options) => {
1528
- const { ccjkHooks } = await import('./chunks/ccjk-hooks.mjs');
1529
- await ccjkHooks({
1530
- type: options.type,
1531
- category: options.category,
1532
- exclude: options.exclude ? options.exclude.split(",") : void 0,
1533
- enabled: options.enabled,
1534
- dryRun: options.dryRun,
1535
- json: options.json,
1536
- verbose: options.verbose
1537
- });
1538
- };
1539
- }
1540
- },
1541
- {
1542
- name: "ccjk:skills",
1543
- description: "Auto-install skills based on project analysis",
1544
- aliases: ["ccjk-skills"],
1545
- tier: "extended",
1546
- options: [
1547
- { flags: "--interactive, -i", description: "Interactive mode (default: true)" },
1548
- { flags: "--category <category>", description: "Filter by skill category" },
1549
- { flags: "--tags <tags>", description: "Filter by tags (comma-separated)" },
1550
- { flags: "--exclude <skills>", description: "Exclude specific skills (comma-separated)" },
1551
- { flags: "--dry-run", description: "Show what would be installed without installing" },
1552
- { flags: "--json", description: "Output in JSON format" },
1553
- { flags: "--force", description: "Force installation (overwrite existing)" },
1554
- { flags: "--target-dir <dir>", description: "Target directory (default: current)" },
1555
- { flags: "--lang, -l <lang>", description: "Display language (zh-CN, en)" }
1556
- ],
1557
- loader: async () => {
1558
- return async (options) => {
1559
- const { ccjkSkills } = await import('./chunks/ccjk-skills.mjs');
1560
- await ccjkSkills({
1561
- interactive: options.interactive !== false,
1562
- category: options.category,
1563
- tags: options.tags ? options.tags.split(",") : void 0,
1564
- exclude: options.exclude ? options.exclude.split(",") : void 0,
1565
- dryRun: options.dryRun,
1566
- json: options.json,
1567
- force: options.force,
1568
- targetDir: options.targetDir,
1569
- lang: options.lang
1570
- });
1571
- };
1572
- }
1573
- },
1574
- // ==================== CCJK v8.0.0 Setup Commands ====================
1575
- {
1576
- name: "ccjk:all",
1577
- description: "Cloud AI-powered complete setup (Recommended)",
1578
- aliases: ["ccjk-all"],
1579
- tier: "extended",
1580
- options: [
1581
- { flags: "--strategy <type>", description: "Cloud strategy (cloud-smart/cloud-conservative/local-fallback)" },
1582
- { flags: "--use-cloud", description: "Use cloud recommendations" },
1583
- { flags: "--cloud-endpoint <url>", description: "Cloud API endpoint" },
1584
- { flags: "--cache-strategy <type>", description: "Cache strategy" },
1585
- { flags: "--show-reasons", description: "Show recommendation reasons" },
1586
- { flags: "--show-confidence", description: "Show confidence scores" },
1587
- { flags: "--show-comparison", description: "Show community comparison" },
1588
- { flags: "--submit-telemetry", description: "Submit anonymous telemetry" },
1589
- { flags: "--dry-run", description: "Preview without installing" },
1590
- { flags: "--json", description: "JSON output" },
1591
- { flags: "--lang, -l <lang>", description: "Display language (zh-CN, en)" }
1592
- ],
1593
- loader: async () => {
1594
- return async (options) => {
1595
- const { ccjkAll } = await import('./chunks/ccjk-all.mjs');
1596
- await ccjkAll({
1597
- strategy: options.strategy,
1598
- useCloud: options.useCloud,
1599
- cloudEndpoint: options.cloudEndpoint,
1600
- cacheStrategy: options.cacheStrategy,
1601
- showRecommendationReason: options.showReasons,
1602
- showConfidence: options.showConfidence,
1603
- showComparison: options.showComparison,
1604
- submitTelemetry: options.submitTelemetry,
1605
- dryRun: options.dryRun,
1606
- json: options.json,
1607
- lang: options.lang
1608
- });
1609
- };
1610
- }
1611
- },
1612
- {
1613
- name: "ccjk:setup",
1614
- description: "Complete local setup with project analysis",
1615
- aliases: ["ccjk-setup"],
1616
- tier: "extended",
1617
- options: [
1618
- { flags: "--profile <profile>", description: "Setup profile (minimal/recommended/full/custom)" },
1619
- { flags: "--resources <resources>", description: "Resources to install (comma-separated)" },
1620
- { flags: "--parallel", description: "Enable parallel execution" },
1621
- { flags: "--max-concurrency <number>", description: "Maximum parallel operations" },
1622
- { flags: "--interactive", description: "Interactive mode" },
1623
- { flags: "--auto-confirm, -y", description: "Auto-confirm all prompts" },
1624
- { flags: "--dry-run", description: "Preview without installing" },
1625
- { flags: "--json", description: "JSON output" },
1626
- { flags: "--lang, -l <lang>", description: "Display language (zh-CN, en)" }
1627
- ],
1628
- loader: async () => {
1629
- return async (options) => {
1630
- const { ccjkSetup } = await import('./chunks/ccjk-setup.mjs');
1631
- const exitCode = await ccjkSetup({
1632
- profile: options.profile,
1633
- resources: options.resources ? options.resources.split(",") : void 0,
1634
- parallel: options.parallel,
1635
- maxConcurrency: options.maxConcurrency ? Number(options.maxConcurrency) : void 0,
1636
- interactive: options.interactive !== false,
1637
- autoConfirm: options.autoConfirm,
1638
- dryRun: options.dryRun,
1639
- json: options.json,
1640
- lang: options.lang
1641
- });
1642
- if (exitCode !== 0) {
1643
- process.exit(exitCode);
1644
- }
1645
- };
1646
- }
1647
- },
1648
- // ==================== Brain Dashboard ====================
1649
- {
1650
- name: "sessions",
1651
- description: "Manage and restore Brain System sessions",
1652
- tier: "extended",
1653
- options: [
1654
- { flags: "--list", description: "List all sessions" },
1655
- { flags: "--show <id>", description: "Show session details" },
1656
- { flags: "--restore <id>", description: "Restore incomplete session" },
1657
- { flags: "--cleanup", description: "Clean up old sessions" }
1658
- ],
1659
- loader: async () => {
1660
- const { sessionsCommand } = await import('./chunks/sessions.mjs');
1661
- return async (options) => {
1662
- await sessionsCommand({
1663
- list: options.list,
1664
- show: options.show,
1665
- restore: options.restore,
1666
- cleanup: options.cleanup
1667
- });
1668
- };
1669
- }
1670
- },
1671
- // ==================== Evaluation System ====================
1672
- {
1673
- name: "eval",
1674
- description: "Run evaluation scenarios and benchmarks",
1675
- tier: "extended",
1676
- options: [
1677
- { flags: "--scenario <id>", description: "Run specific scenario" },
1678
- { flags: "--suite <name>", description: "Run specific suite" },
1679
- { flags: "--runs <n>", description: "Number of runs per scenario" },
1680
- { flags: "--verbose, -v", description: "Verbose output" },
1681
- { flags: "--html", description: "Generate HTML dashboard" },
1682
- { flags: "--json", description: "Generate JSON reports" },
1683
- { flags: "--baseline <path>", description: "Baseline report path" },
1684
- { flags: "--candidate <path>", description: "Candidate report path" },
1685
- { flags: "--compare", description: "Compare baseline and candidate" }
1686
- ],
1687
- loader: async () => {
1688
- const { evalCommand } = await import('./chunks/eval.mjs');
1689
- return async (options) => {
1690
- await evalCommand({
1691
- scenario: options.scenario,
1692
- suite: options.suite,
1693
- runs: options.runs ? parseInt(options.runs, 10) : 1,
1694
- verbose: options.verbose,
1695
- html: options.html !== false,
1696
- json: options.json !== false,
1697
- baseline: options.baseline,
1698
- candidate: options.candidate,
1699
- compare: options.compare
1700
- });
1701
- };
1702
- }
1703
- },
1704
- {
1705
- name: "context",
1706
- description: "View and manage hierarchical context loading",
1707
- tier: "extended",
1708
- options: [
1709
- { flags: "--show", description: "Show loaded context" },
1710
- { flags: "--layers <layers>", description: "Specify layers (comma-separated)" },
1711
- { flags: "--task <name>", description: "Preview context for task" },
1712
- { flags: "--clear", description: "Clear context cache" }
1713
- ],
1714
- loader: async () => {
1715
- const { contextCommand } = await import('./chunks/context.mjs');
1716
- return async (options) => {
1717
- await contextCommand({
1718
- show: options.show,
1719
- layers: options.layers,
1720
- task: options.task,
1721
- clear: options.clear
1722
- });
1723
- };
1724
- }
1725
- },
1726
- {
1727
- name: "paradigm",
1728
- description: "Detect and display project file system paradigm",
1729
- tier: "extended",
1730
- options: [
1731
- { flags: "--verbose", description: "Show detailed information" },
1732
- { flags: "--role <role>", description: "Show files for specific role" }
1733
- ],
1734
- loader: async () => {
1735
- const { paradigmCommand } = await import('./chunks/paradigm.mjs');
1736
- return async (options) => {
1737
- await paradigmCommand({
1738
- verbose: options.verbose,
1739
- role: options.role
1740
- });
1741
- };
1742
- }
1743
- },
1744
- {
1745
- name: "trace",
1746
- description: "View execution traces for Brain System operations",
1747
- tier: "extended",
1748
- options: [
1749
- { flags: "--list", description: "List all traces" },
1750
- { flags: "--last", description: "Show last trace" },
1751
- { flags: "--session-id <id>", description: "Show specific trace" },
1752
- { flags: "--cleanup", description: "Clean up old traces" }
1753
- ],
1754
- loader: async () => {
1755
- const { traceCommand } = await import('./chunks/trace.mjs');
1756
- return async (options) => {
1757
- await traceCommand({
1758
- list: options.list,
1759
- last: options.last,
1760
- sessionId: options.sessionId,
1761
- cleanup: options.cleanup
1762
- });
1763
- };
1764
- }
1765
- },
1766
- {
1767
- name: "status",
1768
- description: "Brain Dashboard - setup health score and recommendations",
1769
- aliases: ["st", "brain"],
1770
- tier: "core",
1771
- options: [
1772
- { flags: "--json", description: "Output as JSON" },
1773
- { flags: "--compact", description: "Compact output" },
1774
- { flags: "--fix", description: "Run fixable recommendations" },
1775
- { flags: "--yes, -y", description: "Auto-confirm fixes" },
1776
- { flags: "--dry-run", description: "Preview fix commands without executing" }
1777
- ],
1778
- loader: async () => {
1779
- const { statusCommand } = await import('./chunks/status.mjs');
1780
- return async (options) => {
1781
- await statusCommand({
1782
- json: options.json,
1783
- compact: options.compact,
1784
- fix: options.fix,
1785
- yes: options.yes,
1786
- dryRun: options.dryRun
1787
- });
1788
- };
1789
- }
1790
- },
1791
- {
1792
- name: "dashboard",
1793
- description: "Brain Dashboard - context compression and persistence monitoring",
1794
- aliases: ["dash", "db"],
1795
- tier: "core",
1796
- options: [
1797
- { flags: "--json", description: "Output as JSON" },
1798
- { flags: "--compact", description: "Compact output" }
1799
- ],
1800
- loader: async () => {
1801
- const { dashboardCommand } = await import('./chunks/dashboard.mjs');
1802
- return async (options) => {
1803
- await dashboardCommand({
1804
- json: options.json,
1805
- compact: options.compact
1806
- });
1807
- };
1808
- }
1809
- },
1810
- {
1811
- name: "remote",
1812
- description: "Remote control management",
1813
- tier: "core",
1814
- options: [
1815
- { flags: "setup", description: "One-command remote setup" },
1816
- { flags: "doctor", description: "Diagnose remote setup" },
1817
- { flags: "enable", description: "Enable remote control" },
1818
- { flags: "disable", description: "Disable remote control" },
1819
- { flags: "status", description: "Show remote status" },
1820
- { flags: "qr", description: "Show pairing QR code" },
1821
- { flags: "--json", description: "Output as JSON" },
1822
- { flags: "--non-interactive", description: "Fail instead of prompting" },
1823
- { flags: "--server-url <url>", description: "Remote server URL for setup" },
1824
- { flags: "--auth-token <token>", description: "Remote auth token for setup" },
1825
- { flags: "--binding-code <code>", description: "Binding code for setup" }
1826
- ],
1827
- loader: async () => {
1828
- const { doctorRemote, enableRemote, disableRemote, remoteStatus, setupRemote, showQRCode } = await import('./chunks/remote.mjs');
1829
- return async (options, ...args) => {
1830
- const action = args[0];
1831
- switch (action) {
1832
- case "setup":
1833
- await setupRemote({
1834
- json: options.json,
1835
- nonInteractive: options.nonInteractive,
1836
- serverUrl: options.serverUrl,
1837
- authToken: options.authToken,
1838
- bindingCode: options.bindingCode
1839
- });
1840
- break;
1841
- case "doctor":
1842
- await doctorRemote({
1843
- json: options.json
1844
- });
1845
- break;
1846
- case "enable":
1847
- await enableRemote();
1848
- break;
1849
- case "disable":
1850
- await disableRemote();
1851
- break;
1852
- case "status":
1853
- await remoteStatus();
1854
- break;
1855
- case "qr":
1856
- await showQRCode();
1857
- break;
1858
- default:
1859
- await remoteStatus();
1860
- }
1861
- };
1862
- }
1863
- },
1864
- {
1865
- name: "evolution",
1866
- description: "Evolution Layer - AI knowledge sharing",
1867
- tier: "core",
1868
- options: [
1869
- { flags: "top", description: "Show top capabilities" },
1870
- { flags: "search <query>", description: "Search for solutions" },
1871
- { flags: "show <geneId>", description: "Show gene details" },
1872
- { flags: "stats", description: "Show statistics" }
1873
- ],
1874
- loader: async () => {
1875
- const { handleEvolutionCommand } = await import('./chunks/evolution.mjs');
1876
- return async (options, ...args) => {
1877
- const action = args[0];
1878
- const restArgs = args.slice(1);
1879
- await handleEvolutionCommand(action, restArgs, options);
1880
- };
1881
- }
1882
- },
1883
- {
1884
- name: "daemon",
1885
- description: "Daemon management",
1886
- tier: "core",
1887
- options: [
1888
- { flags: "start", description: "Start daemon" },
1889
- { flags: "stop", description: "Stop daemon" },
1890
- { flags: "status", description: "Daemon status" }
1891
- ],
1892
- loader: async () => {
1893
- const { startDaemon, stopDaemon, remoteStatus } = await import('./chunks/remote.mjs');
1894
- return async (options, ...args) => {
1895
- const action = args[0];
1896
- switch (action) {
1897
- case "start":
1898
- await startDaemon();
1899
- break;
1900
- case "stop":
1901
- await stopDaemon();
1902
- break;
1903
- case "status":
1904
- await remoteStatus();
1905
- break;
1906
- default:
1907
- await remoteStatus();
1908
- }
1909
- };
1910
- }
1911
- },
1912
- {
1913
- name: "morning",
1914
- description: "Morning health check + stats summary",
1915
- tier: "core",
1916
- options: [
1917
- { flags: "--json", description: "Output as JSON" },
1918
- { flags: "--silent", description: "Silent mode" }
1919
- ],
1920
- loader: async () => {
1921
- const { morningCommand } = await import('./chunks/quick-actions.mjs');
1922
- return async (options) => {
1923
- await morningCommand({
1924
- json: options.json,
1925
- silent: options.silent
1926
- });
1927
- };
1928
- }
1929
- },
1930
- {
1931
- name: "review",
1932
- description: "Daily review - contexts used, tokens saved",
1933
- tier: "core",
1934
- options: [
1935
- { flags: "--json", description: "Output as JSON" },
1936
- { flags: "--silent", description: "Silent mode" }
1937
- ],
1938
- loader: async () => {
1939
- const { reviewCommand } = await import('./chunks/quick-actions.mjs');
1940
- return async (options) => {
1941
- await reviewCommand({
1942
- json: options.json,
1943
- silent: options.silent
1944
- });
1945
- };
1946
- }
1947
- },
1948
- {
1949
- name: "cleanup",
1950
- description: "Weekly cleanup - old contexts, VACUUM",
1951
- tier: "core",
1952
- options: [
1953
- { flags: "--json", description: "Output as JSON" },
1954
- { flags: "--silent", description: "Silent mode" }
1955
- ],
1956
- loader: async () => {
1957
- const { cleanupCommand } = await import('./chunks/quick-actions.mjs');
1958
- return async (options) => {
1959
- await cleanupCommand({
1960
- json: options.json,
1961
- silent: options.silent
1962
- });
1963
- };
1964
- }
1965
- },
1966
- {
1967
- name: "boost",
1968
- description: "One-click optimization - auto-apply all recommendations",
1969
- tier: "core",
1970
- options: [
1971
- { flags: "--dry-run, -d", description: "Preview without applying" },
1972
- { flags: "--yes, -y", description: "Skip confirmation" }
1973
- ],
1974
- loader: async () => {
1975
- const { boost } = await import('./chunks/boost.mjs');
1976
- return async (options) => {
1977
- await boost({
1978
- dryRun: options.dryRun,
1979
- yes: options.yes
1980
- });
1981
- };
1982
- }
1983
- },
1984
- {
1985
- name: "brain-status",
1986
- description: "Brain capability routing and telemetry stats",
1987
- aliases: ["bs"],
1988
- tier: "core",
1989
- options: [
1990
- { flags: "--detailed, -d", description: "Show detailed statistics" },
1991
- { flags: "--json, -j", description: "Output as JSON" }
1992
- ],
1993
- loader: async () => {
1994
- const { brainStatusCommand } = await import('./chunks/brain-status.mjs');
1995
- return async (options) => {
1996
- await brainStatusCommand({
1997
- detailed: options.detailed,
1998
- json: options.json
1999
- });
2000
- };
2001
- }
2002
- },
2003
- {
2004
- name: "brain-config",
2005
- description: "Configure Brain capability routing system",
2006
- aliases: ["bc"],
2007
- tier: "core",
2008
- options: [
2009
- { flags: "--preference, -p <level>", description: "Set capability preference (1-5)" },
2010
- { flags: "--threshold, -t <value>", description: "Set auto-subagent threshold (1-10)" },
2011
- { flags: "--max-agents, -m <count>", description: "Set max parallel agents" },
2012
- { flags: "--telemetry <on|off>", description: "Enable/disable telemetry" },
2013
- { flags: "--reasoning <on|off>", description: "Enable/disable reasoning display" },
2014
- { flags: "--show, -s", description: "Show current configuration" },
2015
- { flags: "--reset", description: "Reset to default configuration" }
2016
- ],
2017
- loader: async () => {
2018
- const { brainConfigCommand } = await import('./chunks/brain-config.mjs');
2019
- return async (options) => {
2020
- await brainConfigCommand({
2021
- preference: options.preference ? parseFloat(options.preference) : void 0,
2022
- threshold: options.threshold ? parseFloat(options.threshold) : void 0,
2023
- maxAgents: options.maxAgents ? parseInt(options.maxAgents, 10) : void 0,
2024
- telemetry: options.telemetry,
2025
- reasoning: options.reasoning,
2026
- show: options.show,
2027
- reset: options.reset
2028
- });
2029
- };
2030
- }
2031
- },
2032
- // ==================== Plugin Management ====================
2033
- {
2034
- name: "add <source>",
2035
- description: "Add plugins from GitHub, npm, or local path",
2036
- tier: "extended",
2037
- options: [
2038
- { flags: "--type, -t <type>", description: "Plugin type (skill, mcp, agent, hook)" },
2039
- { flags: "--force, -f", description: "Force overwrite existing" },
2040
- { flags: "--dry-run, -d", description: "Preview without installing" },
2041
- { flags: "--json", description: "JSON output" },
2042
- { flags: "--lang, -l <lang>", description: "Display language (zh-CN, en)" }
2043
- ],
2044
- loader: async () => {
2045
- const { addCommand } = await import('./chunks/index14.mjs');
2046
- return async (options, source) => {
2047
- await addCommand(source, {
2048
- type: options.type,
2049
- force: options.force,
2050
- dryRun: options.dryRun,
2051
- json: options.json,
2052
- lang: options.lang
2053
- });
2054
- };
2055
- }
2056
- }
2057
- ];
2058
-
2059
- const CLOUD_BOOTSTRAP_WORKER_ARG = "__ccjk-cloud-bootstrap";
2060
- const CLOUD_BOOTSTRAP_WORKER_ENV = "CCJK_CLOUD_BOOTSTRAP_WORKER";
2061
- const SPECIAL_STARTUP_COMMANDS = [
2062
- "cloud",
2063
- "c",
2064
- "system",
2065
- "sys",
2066
- "plugin",
2067
- "completion",
2068
- "skills-sync",
2069
- "agents-sync",
2070
- "marketplace",
2071
- "quick",
2072
- "deep",
2073
- "setup",
2074
- "sync",
2075
- "versions",
2076
- "permissions",
2077
- "config-scan",
2078
- "workspace"
2079
- ];
2080
- const EXPLICIT_STARTUP_COMMANDS = /* @__PURE__ */ new Set([
2081
- ...COMMANDS.flatMap((command) => {
2082
- const primaryName = command.name.split(/[ <[]/, 1)[0]?.toLowerCase();
2083
- const aliases = command.aliases?.map((alias) => alias.toLowerCase()) || [];
2084
- return primaryName ? [primaryName, ...aliases] : aliases;
2085
- }),
2086
- ...SPECIAL_STARTUP_COMMANDS
2087
- ]);
2088
- const CLOUD_BOOTSTRAP_COMMANDS = /* @__PURE__ */ new Set([
2089
- "cloud",
2090
- "c",
2091
- "skills-sync",
2092
- "agents-sync",
2093
- "marketplace",
2094
- "sync"
2095
- ]);
2096
- function isExplicitStartupCommandToken(token) {
2097
- return EXPLICIT_STARTUP_COMMANDS.has(token.toLowerCase());
2098
- }
2099
- function shouldBootstrapCloudServicesForArgs(args) {
2100
- if (args.length === 0) {
2101
- return false;
2102
- }
2103
- const optionArgsWithValue = /* @__PURE__ */ new Set(["-l", "--lang", "-g", "--all-lang", "-T", "--code-type"]);
2104
- for (let index = 0; index < args.length; index += 1) {
2105
- const arg = args[index];
2106
- if (!arg) {
2107
- continue;
2108
- }
2109
- if (optionArgsWithValue.has(arg)) {
2110
- index += 1;
2111
- continue;
2112
- }
2113
- if (arg.startsWith("--lang=") || arg.startsWith("--all-lang=") || arg.startsWith("--code-type=")) {
2114
- continue;
2115
- }
2116
- if (arg.startsWith("-") || arg.startsWith("/")) {
2117
- continue;
2118
- }
2119
- return CLOUD_BOOTSTRAP_COMMANDS.has(arg.toLowerCase());
2120
- }
2121
- return false;
2122
- }
2123
- function isCloudBootstrapWorkerArgs(args) {
2124
- return args[0] === CLOUD_BOOTSTRAP_WORKER_ARG;
2125
- }
2126
- async function registerSpecialCommands(cli) {
2127
- cli.command("cloud [resource] [action]", "Cloud sync (skills/agents/plugins)").alias("c").option("--dry-run, -d", "Preview changes").option("--force, -f", "Force sync").action(async (resource, action, options) => {
2128
- const resourceStr = resource || "menu";
2129
- if (resourceStr === "skills" || resourceStr === "sk") {
2130
- const { skillsSyncMenu, syncSkills, pushSkillsCommand, pullSkillsCommand } = await import('./chunks/skills-sync.mjs');
2131
- if (!action)
2132
- await skillsSyncMenu(options);
2133
- else if (action === "sync")
2134
- await syncSkills(options);
2135
- else if (action === "push")
2136
- await pushSkillsCommand(options);
2137
- else if (action === "pull")
2138
- await pullSkillsCommand(options);
2139
- } else if (resourceStr === "agents" || resourceStr === "ag") {
2140
- console.log("\n\u{1F916} Agent Commands:");
2141
- console.log(" ccjk agents list - List installed agents");
2142
- console.log(" ccjk agents search - Search agents in cloud");
2143
- console.log(" ccjk agents install - Install an agent");
2144
- console.log(" ccjk agents sync - Sync with cloud");
2145
- console.log(" ccjk agents templates - View templates\n");
2146
- } else if (resourceStr === "plugins" || resourceStr === "pl") {
2147
- const { marketplaceMenu } = await import('./chunks/marketplace.mjs');
2148
- await marketplaceMenu(action, options);
2149
- } else {
2150
- console.log("\n\u2601\uFE0F Cloud Sync Commands:");
2151
- console.log(" ccjk cloud skills [action] - Sync custom skills");
2152
- console.log(" ccjk cloud agents [action] - Sync AI agents");
2153
- console.log(" ccjk cloud plugins [action] - Plugin marketplace\n");
2154
- }
2155
- });
2156
- cli.command("skills-sync [action]", '[DEPRECATED] Use "ccjk cloud skills"').action(async () => {
2157
- console.warn('\n\u26A0\uFE0F skills-sync \u5DF2\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528 "ccjk cloud skills" \u66FF\u4EE3\n');
2158
- console.log("\u{1F4A1} \u65B0\u547D\u4EE4\uFF1Accjk cloud skills\n");
2159
- });
2160
- cli.command("agents-sync [action]", '[DEPRECATED] Use "ccjk agents"').action(async () => {
2161
- console.warn('\n\u26A0\uFE0F agents-sync \u5DF2\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528 "ccjk agents" \u66FF\u4EE3\n');
2162
- console.log("\u{1F916} Agent Commands:");
2163
- console.log(" ccjk agents list - List installed agents");
2164
- console.log(" ccjk agents search - Search agents in cloud");
2165
- console.log(" ccjk agents install - Install an agent");
2166
- console.log(" ccjk agents sync - Sync with cloud\n");
2167
- });
2168
- cli.command("marketplace [action]", '[DEPRECATED] Use "ccjk cloud plugins"').action(async () => {
2169
- console.warn('\n\u26A0\uFE0F marketplace \u5DF2\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528 "ccjk cloud plugins" \u66FF\u4EE3\n');
2170
- console.log("\u{1F4A1} \u65B0\u547D\u4EE4\uFF1Accjk cloud plugins\n");
2171
- });
2172
- cli.command("plugin [action] [...args]", "Plugin marketplace (install/search/list)").option("--verbose, -v", "Show verbose output").option("--force, -f", "Force operation").option("--version, -V <version>", "Specify plugin version").action(async (action, args, _options) => {
2173
- const { handlePluginCommand } = await import('./chunks/plugin.mjs');
2174
- const allArgs = [action, ...args || []].filter(Boolean);
2175
- await handlePluginCommand(allArgs);
2176
- });
2177
- cli.command("quick [specFile]", '[DEPRECATED] Use "ccjk interview -d quick"').action(async () => {
2178
- console.warn('\n\u26A0\uFE0F quick \u5DF2\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528 "ccjk interview -d quick" \u66FF\u4EE3\n');
2179
- console.log("\u{1F4A1} \u65B0\u547D\u4EE4\uFF1Accjk interview -d quick\n");
2180
- });
2181
- cli.command("deep [specFile]", '[DEPRECATED] Use "ccjk interview -d deep"').action(async () => {
2182
- console.warn('\n\u26A0\uFE0F deep \u5DF2\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528 "ccjk interview -d deep" \u66FF\u4EE3\n');
2183
- console.log("\u{1F4A1} \u65B0\u547D\u4EE4\uFF1Accjk interview -d deep\n");
2184
- });
2185
- cli.command("system [action] [subaction]", "System management (setup/upgrade/info)").alias("sys").option("--target <target>", "Target runtime for repair commands").action(async (action, subaction, options) => {
2186
- const actionStr = action || "info";
2187
- const subactionStr = subaction;
2188
- if (actionStr === "setup" || actionStr === "s") {
2189
- const { runOnboarding } = await import('./chunks/onboarding.mjs');
2190
- await runOnboarding();
2191
- } else if (actionStr === "sync") {
2192
- const { quickSync } = await import('./chunks/onboarding.mjs');
2193
- await quickSync();
2194
- } else if (actionStr === "versions" || actionStr === "ver") {
2195
- const { checkAllVersions } = await import('./chunks/upgrade-manager.mjs');
2196
- await checkAllVersions();
2197
- } else if (actionStr === "upgrade" || actionStr === "up") {
2198
- const { upgradeAll } = await import('./chunks/upgrade-manager.mjs');
2199
- await upgradeAll();
2200
- } else if (actionStr === "permissions" || actionStr === "perm") {
2201
- const { displayPermissions, repairPermissions } = await import('./chunks/permission-manager.mjs');
2202
- if (subactionStr === "repair") {
2203
- if (options?.target && !["clavue", "claude-code"].includes(String(options.target))) {
2204
- console.error(`Unsupported permissions repair target: ${options.target}`);
2205
- return;
2206
- }
2207
- const repaired = repairPermissions(process.cwd());
2208
- if (repaired) {
2209
- console.log("\u2713 Repaired CCJK permission bridge at ~/.ccjk/permissions.json");
2210
- } else {
2211
- console.error("\u2717 Failed to repair CCJK permission bridge");
2212
- }
2213
- } else {
2214
- displayPermissions();
2215
- }
2216
- } else if (actionStr === "config" || actionStr === "cfg") {
2217
- const { detectAllConfigs, displayConfigScan } = await import('./chunks/config-consolidator.mjs');
2218
- const configs = detectAllConfigs();
2219
- displayConfigScan(configs);
2220
- } else if (actionStr === "workspace" || actionStr === "ws") {
2221
- const { workspaceDiagnostics } = await import('./chunks/doctor.mjs');
2222
- await workspaceDiagnostics();
2223
- } else {
2224
- console.log("\n\u{1F527} System Commands:");
2225
- console.log(" ccjk system setup - First-time setup");
2226
- console.log(" ccjk system sync - Quick knowledge sync");
2227
- console.log(" ccjk system versions - Check all versions");
2228
- console.log(" ccjk system upgrade - Upgrade all components");
2229
- console.log(" ccjk system permissions- Show permissions");
2230
- console.log(" ccjk system config - Scan config files");
2231
- console.log(" ccjk system workspace - Workspace diagnostics\n");
2232
- }
2233
- });
2234
- cli.command("setup", '[DEPRECATED] Use "ccjk system setup"').action(async () => {
2235
- console.warn('\n\u26A0\uFE0F setup \u5DF2\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528 "ccjk system setup" \u66FF\u4EE3\n');
2236
- console.log("\u{1F4A1} \u65B0\u547D\u4EE4\uFF1Accjk system setup\n");
2237
- });
2238
- cli.command("sync", '[DEPRECATED] Use "ccjk system sync"').action(async () => {
2239
- console.warn('\n\u26A0\uFE0F sync \u5DF2\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528 "ccjk system sync" \u66FF\u4EE3\n');
2240
- console.log("\u{1F4A1} \u65B0\u547D\u4EE4\uFF1Accjk system sync\n");
2241
- });
2242
- cli.command("versions", '[DEPRECATED] Use "ccjk system versions"').action(async () => {
2243
- console.warn('\n\u26A0\uFE0F versions \u5DF2\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528 "ccjk system versions" \u66FF\u4EE3\n');
2244
- console.log("\u{1F4A1} \u65B0\u547D\u4EE4\uFF1Accjk system versions\n");
2245
- });
2246
- cli.command("permissions", '[DEPRECATED] Use "ccjk system permissions"').action(async () => {
2247
- console.warn('\n\u26A0\uFE0F permissions \u5DF2\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528 "ccjk system permissions" \u66FF\u4EE3\n');
2248
- console.log("\u{1F4A1} \u65B0\u547D\u4EE4\uFF1Accjk system permissions\n");
2249
- });
2250
- cli.command("config-scan", '[DEPRECATED] Use "ccjk system config"').action(async () => {
2251
- console.warn('\n\u26A0\uFE0F config-scan \u5DF2\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528 "ccjk system config" \u66FF\u4EE3\n');
2252
- console.log("\u{1F4A1} \u65B0\u547D\u4EE4\uFF1Accjk system config\n");
2253
- });
2254
- cli.command("workspace [dir]", '[DEPRECATED] Use "ccjk system workspace"').action(async () => {
2255
- console.warn('\n\u26A0\uFE0F workspace \u5DF2\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528 "ccjk system workspace" \u66FF\u4EE3\n');
2256
- console.log("\u{1F4A1} \u65B0\u547D\u4EE4\uFF1Accjk system workspace\n");
2257
- });
2258
- cli.command("completion <action> [shell]", "Shell completion management").option("--lang, -l <lang>", "Display language").action(async (action, shell, options) => {
2259
- const { completionCommand } = await import('./chunks/completion.mjs');
2260
- await completionCommand(action, shell, options);
2261
- });
2262
- }
2263
- function customizeHelpLazy(_sections, version) {
2264
- const cyan = (s) => `\x1B[36m${s}\x1B[0m`;
2265
- const yellow = (s) => `\x1B[33m${s}\x1B[0m`;
2266
- const gray = (s) => `\x1B[90m${s}\x1B[0m`;
2267
- const green = (s) => `\x1B[32m${s}\x1B[0m`;
2268
- const bold = (s) => `\x1B[1m${s}\x1B[0m`;
2269
- const cyanBold = (s) => bold(cyan(s));
2270
- const newSections = [];
2271
- newSections.push({
2272
- title: "",
2273
- body: cyanBold(`CCJK - Claude Code Jailbreak Kit v${version}
2274
- `) + gray("Lightweight CLI for Claude Code enhancement")
2275
- });
2276
- newSections.push({
2277
- title: yellow("\u{1F4E6} Core Commands"),
2278
- body: [
2279
- ` ${cyan("ccjk")} Interactive menu ${green("(default)")}`,
2280
- ` ${cyan("ccjk quick-setup")} ${gray("qs")} One-click configuration ${green("NEW")}`,
2281
- ` ${cyan("ccjk status")} ${gray("st")} Brain Dashboard - health score ${green("NEW")}`,
2282
- ` ${cyan("ccjk boost")} One-click optimization ${green("NEW")}`,
2283
- ` ${cyan("ccjk init")} ${gray("i")} Initialize configuration`,
2284
- ` ${cyan("ccjk update")} ${gray("u")} Update prompts & workflows`,
2285
- ` ${cyan("ccjk doctor")} Health check & diagnostics`,
2286
- ` ${cyan("ccjk help")} ${gray("h")} Help center & quick reference ${green("NEW")}`
2287
- ].join("\n")
2288
- });
2289
- newSections.push({
2290
- title: yellow("\u{1F6E0}\uFE0F Development"),
2291
- body: [
2292
- ` ${cyan("ccjk mcp")} <action> MCP server management`,
2293
- ` ${cyan("ccjk browser")} ${gray("ab")} Agent Browser automation ${green("NEW")}`,
2294
- ` ${cyan("ccjk skills")} ${gray("sk")} Manage CCJK skills ${green("NEW")}`,
2295
- ` ${cyan("ccjk memory")} ${gray("mem")} Manage Claude Code memory ${green("NEW")}`,
2296
- ` ${cyan("ccjk monitor")} ${gray("mon")} Performance monitoring ${green("NEW")}`,
2297
- ` ${cyan("ccjk eval")} Run evaluation scenarios ${green("NEW")}`,
2298
- ` ${cyan("ccjk interview")} ${gray("iv")} Interview-driven development`,
2299
- ` ${cyan("ccjk commit")} Smart git commit`,
2300
- ` ${cyan("ccjk config-switch")} ${gray("cs")} Switch configuration`,
2301
- ` ${cyan("ccjk postmortem")} ${gray("pm")} Postmortem intelligence`
2302
- ].join("\n")
2303
- });
2304
- newSections.push({
2305
- title: yellow("\u2601\uFE0F Unified Commands") + green(" NEW"),
2306
- body: [
2307
- ` ${cyan("ccjk cloud")} <resource> Cloud sync (skills/agents/plugins)`,
2308
- ` ${cyan("ccjk system")} <action> System management (setup/upgrade)`,
2309
- "",
2310
- gray(" Examples:"),
2311
- gray(" ccjk cloud skills sync - Sync custom skills"),
2312
- gray(" ccjk system upgrade - Upgrade all components")
2313
- ].join("\n")
2314
- });
2315
- newSections.push({
2316
- title: yellow("\u{1F4CB} Other"),
2317
- body: [
2318
- ` ${cyan("ccjk workflows")} ${gray("wf")} Manage workflows`,
2319
- ` ${cyan("ccjk ccr")} CCR proxy management`,
2320
- ` ${cyan("ccjk ccu")} Usage statistics`,
2321
- ` ${cyan("ccjk impact")} Usage impact page`,
2322
- ` ${cyan("ccjk completion")} Shell completion ${green("NEW")}`,
2323
- ` ${cyan("ccjk uninstall")} Remove configurations`
2324
- ].join("\n")
2325
- });
2326
- newSections.push({
2327
- title: yellow("\u2699\uFE0F Options"),
2328
- body: [
2329
- ` ${green("--lang, -l")} <lang> Display language (zh-CN, en)`,
2330
- ` ${green("--force, -f")} Force overwrite`,
2331
- ` ${green("--help, -h")} Show help`,
2332
- ` ${green("--version, -v")} Show version`
2333
- ].join("\n")
2334
- });
2335
- newSections.push({
2336
- title: "",
2337
- body: [
2338
- gray("\u2500".repeat(50)),
2339
- gray('Run "ccjk <command> --help" for detailed usage'),
2340
- gray('Run "ccjk" for interactive menu')
2341
- ].join("\n")
2342
- });
2343
- return newSections;
2344
- }
2345
- async function runHealthAlertsCheck() {
2346
- try {
2347
- const args = process.argv.slice(2);
2348
- if (args.includes("--silent")) {
2349
- return;
2350
- }
2351
- const shouldCheck = args.length === 0 || args[0] === "status" || args[0] === "doctor";
2352
- if (!shouldCheck) {
2353
- return;
2354
- }
2355
- const { join } = await import('./chunks/index10.mjs');
2356
- const dbPath = join(
2357
- process.env.HOME || process.env.USERPROFILE || ".",
2358
- ".ccjk",
2359
- "context",
2360
- "contexts.db"
2361
- );
2362
- const { runStartupHealthCheck } = await import('./chunks/health-alerts.mjs');
2363
- await runStartupHealthCheck(dbPath, { silent: false });
2364
- } catch {
2365
- }
2366
- }
2367
- async function showCommandDiscoveryBanner() {
2368
- try {
2369
- const args = process.argv.slice(2);
2370
- if (args.includes("--no-banner")) {
2371
- return;
2372
- }
2373
- if (args.length > 0 && !args[0].startsWith("-")) {
2374
- return;
2375
- }
2376
- const { join } = await import('./chunks/index10.mjs');
2377
- const { existsSync, writeFileSync } = await import('node:fs');
2378
- const markerPath = join(
2379
- process.env.HOME || process.env.USERPROFILE || ".",
2380
- ".ccjk",
2381
- ".banner-shown"
2382
- );
2383
- const isFirstRun = !existsSync(markerPath);
2384
- const showHelp = args.includes("--help") || args.includes("-h");
2385
- if (isFirstRun || showHelp) {
2386
- const envLang = process.env.CCJK_LANG;
2387
- if (envLang) {
2388
- const { initI18nLazy } = await Promise.resolve().then(function () { return cliLazy; });
2389
- await initI18nLazy(envLang);
2390
- }
2391
- const { displayCommandDiscovery } = await import('./chunks/banner.mjs');
2392
- displayCommandDiscovery();
2393
- if (isFirstRun) {
2394
- try {
2395
- const { ensureDir } = await import('./chunks/fs-operations.mjs');
2396
- await ensureDir(join(process.env.HOME || process.env.USERPROFILE || ".", ".ccjk"));
2397
- writeFileSync(markerPath, (/* @__PURE__ */ new Date()).toISOString());
2398
- } catch {
2399
- }
2400
- }
2401
- }
2402
- } catch {
2403
- }
2404
- }
2405
- async function showStartupSpinner() {
2406
- const args = process.argv.slice(2);
2407
- const quickFlags = ["--help", "-h", "--version", "-v", "-V"];
2408
- if (args.some((arg) => quickFlags.includes(arg))) {
2409
- return null;
2410
- }
2411
- try {
2412
- const ora = (await import('./chunks/index8.mjs')).default;
2413
- const isZh = process.env.CCJK_LANG === "zh-CN" || process.env.LANG?.includes("zh");
2414
- const spinner = ora({
2415
- text: isZh ? "\u6B63\u5728\u542F\u52A8 CCJK..." : "Starting CCJK...",
2416
- spinner: "dots"
2417
- }).start();
2418
- return {
2419
- stop: () => {
2420
- spinner.stop();
2421
- spinner.clear();
2422
- }
2423
- };
2424
- } catch {
2425
- const isZh = process.env.CCJK_LANG === "zh-CN" || process.env.LANG?.includes("zh");
2426
- process.stdout.write(isZh ? "\u6B63\u5728\u542F\u52A8 CCJK...\r" : "Starting CCJK...\r");
2427
- return {
2428
- stop: () => {
2429
- process.stdout.write("\x1B[2K\r");
2430
- }
2431
- };
2432
- }
2433
- }
2434
- async function tryQuickProviderLaunch() {
2435
- const args = process.argv.slice(2);
2436
- if (args.length === 0 || args[0].startsWith("-")) {
2437
- return false;
2438
- }
2439
- const firstArg = args[0].toLowerCase();
2440
- const { couldBeShortcode, isKnownCommand } = await import('./chunks/quick-provider.mjs');
2441
- if (isKnownCommand(firstArg)) {
2442
- return false;
2443
- }
2444
- if (!couldBeShortcode(firstArg)) {
2445
- return false;
2446
- }
2447
- const { quickProviderLaunch } = await import('./chunks/quick-provider.mjs');
2448
- try {
2449
- const handled = await quickProviderLaunch(firstArg, {
2450
- lang: process.env.CCJK_LANG
2451
- });
2452
- if (handled) {
2453
- return true;
2454
- }
2455
- return false;
2456
- } catch {
2457
- return false;
2458
- }
2459
- }
2460
- async function runCloudBootstrapTasks() {
2461
- try {
2462
- const { initializeContextFeatures } = await import('./chunks/startup.mjs');
2463
- await initializeContextFeatures();
2464
- const { autoBootstrap } = await import('./chunks/auto-bootstrap.mjs');
2465
- await autoBootstrap();
2466
- const { autoUpgrade } = await import('./chunks/silent-updater.mjs');
2467
- await autoUpgrade();
2468
- const { activateSuperpowers } = await import('./chunks/index15.mjs');
2469
- await activateSuperpowers("zh-CN");
2470
- const { setupBrainHook } = await import('./chunks/cli-hook.mjs');
2471
- await setupBrainHook({
2472
- enabled: true,
2473
- silent: true,
2474
- // 静默模式,不打扰用户
2475
- fallbackToClaudeCode: true
2476
- });
2477
- } catch {
2478
- }
2479
- }
2480
- async function runCloudBootstrapWorker() {
2481
- await runCloudBootstrapTasks();
2482
- }
2483
- function bootstrapCloudServices() {
2484
- const args = process.argv.slice(2);
2485
- if (!shouldBootstrapCloudServicesForArgs(args) || isCloudBootstrapWorkerArgs(args)) {
2486
- return;
2487
- }
2488
- if (process.env[CLOUD_BOOTSTRAP_WORKER_ENV] === "1") {
2489
- return;
2490
- }
2491
- const entrypoint = process.argv[1];
2492
- if (!entrypoint || entrypoint.endsWith(".ts")) {
2493
- return;
2494
- }
2495
- try {
2496
- const child = spawn(process.execPath, [entrypoint, CLOUD_BOOTSTRAP_WORKER_ARG], {
2497
- detached: true,
2498
- stdio: "ignore",
2499
- env: {
2500
- ...process.env,
2501
- [CLOUD_BOOTSTRAP_WORKER_ENV]: "1"
2502
- }
2503
- });
2504
- child.unref();
2505
- } catch {
2506
- }
2507
- }
2508
-
2509
- let i18nInitialized = false;
2510
- let currentLang = "en";
2511
- async function initI18nLazy(lang) {
2512
- if (i18nInitialized && lang === currentLang)
2513
- return;
2514
- const { initI18n, changeLanguage } = await import('./chunks/index2.mjs');
2515
- if (!i18nInitialized) {
2516
- await initI18n(lang || "en");
2517
- i18nInitialized = true;
2518
- } else if (lang && lang !== currentLang) {
2519
- await changeLanguage(lang);
2520
- }
2521
- currentLang = lang || "en";
2522
- }
2523
- async function resolveLanguage(options) {
2524
- const envLang = process__default.env.CCJK_LANG;
2525
- if (options?.allLang)
2526
- return options.allLang;
2527
- if (options?.lang)
2528
- return options.lang;
2529
- if (envLang)
2530
- return envLang;
2531
- try {
2532
- const { readZcfConfigAsync } = await import('./chunks/ccjk-config.mjs');
2533
- const config = await readZcfConfigAsync();
2534
- if (config?.preferredLang)
2535
- return config.preferredLang;
2536
- } catch {
2537
- }
2538
- if (!options?.skipPrompt) {
2539
- const { selectScriptLanguage } = await import('./chunks/prompts.mjs');
2540
- return await selectScriptLanguage();
2541
- }
2542
- return "en";
2543
- }
2544
- function extractLanguageOptions(options) {
2545
- if (!options || typeof options !== "object")
2546
- return {};
2547
- const obj = options;
2548
- return {
2549
- lang: typeof obj.lang === "string" ? obj.lang : void 0,
2550
- allLang: typeof obj.allLang === "string" ? obj.allLang : void 0,
2551
- skipPrompt: typeof obj.skipPrompt === "boolean" ? obj.skipPrompt : void 0
2552
- };
2553
- }
2554
- function classifyStartupPath(args) {
2555
- const positionalArgs = [];
2556
- for (let index = 0; index < args.length; index += 1) {
2557
- const arg = args[index];
2558
- if (!arg)
2559
- continue;
2560
- if (arg === "-l" || arg === "--lang" || arg === "-g" || arg === "--all-lang" || arg === "-T" || arg === "--code-type") {
2561
- index += 1;
2562
- continue;
2563
- }
2564
- if (arg.startsWith("--lang=") || arg.startsWith("--all-lang=") || arg.startsWith("--code-type=")) {
2565
- continue;
2566
- }
2567
- positionalArgs.push(arg);
2568
- }
2569
- const firstToken = positionalArgs[0];
2570
- if (!firstToken) {
2571
- return { args, kind: "interactive" };
2572
- }
2573
- if (firstToken === "-h" || firstToken === "--help" || firstToken === "help") {
2574
- return { args, kind: "help" };
2575
- }
2576
- if (firstToken === "-v" || firstToken === "--version") {
2577
- return { args, kind: "version" };
2578
- }
2579
- if (firstToken.startsWith("/")) {
2580
- return { args, kind: "slash" };
2581
- }
2582
- if (firstToken.startsWith("-")) {
2583
- return { args, kind: "plain-args" };
2584
- }
2585
- if (isExplicitStartupCommandToken(firstToken)) {
2586
- return { args, kind: "command" };
2587
- }
2588
- if (positionalArgs.length === 1) {
2589
- return { args, kind: "quick-provider" };
2590
- }
2591
- return { args, kind: "plain-args" };
2592
- }
2593
- async function setupCommandsLazy(cli) {
2594
- const envLang = process__default.env.CCJK_LANG;
2595
- if (envLang) {
2596
- await initI18nLazy(envLang);
2597
- }
2598
- for (const cmd of COMMANDS) {
2599
- const command = cli.command(cmd.name, cmd.description);
2600
- if (cmd.aliases) {
2601
- for (const alias of cmd.aliases) {
2602
- command.alias(alias);
2603
- }
2604
- }
2605
- if (cmd.options) {
2606
- for (const opt of cmd.options) {
2607
- command.option(opt.flags, opt.description);
2608
- }
2609
- }
2610
- if (cmd.name !== "claude") {
2611
- command.option("--lang, -l <lang>", "Display language (zh-CN, en)");
2612
- command.option("--all-lang, -g <lang>", "Set all language parameters");
2613
- command.option("--no-banner", "Skip command discovery banner");
2614
- } else {
2615
- command.allowUnknownOptions();
2616
- }
2617
- command.action(async (...args) => {
2618
- const options = args[args.length - 1];
2619
- if (cmd.name !== "claude") {
2620
- const langOptions = extractLanguageOptions(options);
2621
- const lang = await resolveLanguage(langOptions);
2622
- await initI18nLazy(lang);
2623
- }
2624
- if (cmd.tier === "deprecated" && cmd.deprecationMessage) {
2625
- console.warn(`
2626
- ${cmd.deprecationMessage}
2627
- `);
2628
- }
2629
- const handler = await cmd.loader();
2630
- await handler(options, ...args.slice(0, -1));
2631
- });
2632
- }
2633
- await registerSpecialCommands(cli);
2634
- const { version } = await import('./chunks/package.mjs');
2635
- cli.help((sections) => customizeHelpLazy(sections, version));
2636
- cli.version(version);
2637
- }
2638
- async function runLazyCli() {
2639
- if (isCloudBootstrapWorkerArgs(process__default.argv.slice(2))) {
2640
- await runCloudBootstrapWorker();
2641
- return;
2642
- }
2643
- const spinner = await showStartupSpinner();
2644
- const startupPath = classifyStartupPath(process__default.argv.slice(2));
2645
- try {
2646
- if (shouldBootstrapCloudServicesForArgs(startupPath.args)) {
2647
- bootstrapCloudServices();
2648
- }
2649
- if (startupPath.kind === "quick-provider") {
2650
- const handled = await tryQuickProviderLaunch();
2651
- if (handled) {
2652
- spinner?.stop();
2653
- return;
2654
- }
2655
- }
2656
- if (startupPath.kind === "slash") {
2657
- spinner?.stop();
2658
- const { executeSlashCommand } = await import('./chunks/slash-commands.mjs');
2659
- const slashHandled = await executeSlashCommand(startupPath.args.join(" "));
2660
- if (slashHandled) {
2661
- return;
2662
- }
2663
- }
2664
- const cac = (await import('./chunks/index7.mjs')).default;
2665
- const cli = cac("ccjk");
2666
- await setupCommandsLazy(cli);
2667
- spinner?.stop();
2668
- await runHealthAlertsCheck();
2669
- await showCommandDiscoveryBanner();
2670
- await cli.parse();
2671
- } catch (error) {
2672
- spinner?.stop();
2673
- throw error;
2674
- }
2675
- }
2676
-
2677
- const cliLazy = {
2678
- __proto__: null,
2679
- initI18nLazy: initI18nLazy,
2680
- runLazyCli: runLazyCli,
2681
- setupCommandsLazy: setupCommandsLazy
2682
- };
2683
-
2684
- runLazyCli().catch(console.error);