@geekmidas/cli 0.3.0 → 0.5.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 (309) hide show
  1. package/README.md +488 -71
  2. package/dist/CronGenerator-BPTqNYOR.d.cts +14 -0
  3. package/dist/{CronGenerator-Bh26MaNA.mjs → CronGenerator-CCRYptuT.mjs} +2 -2
  4. package/dist/{CronGenerator-Bh26MaNA.mjs.map → CronGenerator-CCRYptuT.mjs.map} +1 -1
  5. package/dist/{CronGenerator-C6MF8rlG.cjs → CronGenerator-D4TWXQbh.cjs} +2 -2
  6. package/dist/{CronGenerator-C6MF8rlG.cjs.map → CronGenerator-D4TWXQbh.cjs.map} +1 -1
  7. package/dist/CronGenerator-YAj59JUd.d.mts +14 -0
  8. package/dist/EndpointGenerator-ChAD1INz.d.cts +19 -0
  9. package/dist/EndpointGenerator-Cj3O1U8-.d.mts +19 -0
  10. package/dist/{EndpointGenerator-CWh18d92.mjs → EndpointGenerator-DGivkPLT.mjs} +77 -7
  11. package/dist/EndpointGenerator-DGivkPLT.mjs.map +1 -0
  12. package/dist/{EndpointGenerator-C73wNoih.cjs → EndpointGenerator-npWEDoK2.cjs} +77 -7
  13. package/dist/EndpointGenerator-npWEDoK2.cjs.map +1 -0
  14. package/dist/FunctionGenerator-429-9NER.d.cts +14 -0
  15. package/dist/FunctionGenerator-BQ4ehoID.d.mts +14 -0
  16. package/dist/{FunctionGenerator-BNE_GC7N.mjs → FunctionGenerator-CVk0h8tO.mjs} +2 -2
  17. package/dist/{FunctionGenerator-BNE_GC7N.mjs.map → FunctionGenerator-CVk0h8tO.mjs.map} +1 -1
  18. package/dist/{FunctionGenerator-FgZUTd8L.cjs → FunctionGenerator-DYTnyr4c.cjs} +2 -2
  19. package/dist/{FunctionGenerator-FgZUTd8L.cjs.map → FunctionGenerator-DYTnyr4c.cjs.map} +1 -1
  20. package/dist/Generator-BjHK_qce.d.mts +27 -0
  21. package/dist/{Generator-UanJW0_V.mjs → Generator-CDt4pB3W.mjs} +1 -1
  22. package/dist/{Generator-UanJW0_V.mjs.map → Generator-CDt4pB3W.mjs.map} +1 -1
  23. package/dist/{Generator-CDoEXCDg.cjs → Generator-CLVplqm2.cjs} +1 -1
  24. package/dist/{Generator-CDoEXCDg.cjs.map → Generator-CLVplqm2.cjs.map} +1 -1
  25. package/dist/Generator-DxQMCQp7.d.cts +27 -0
  26. package/dist/OpenApiTsGenerator-Be-sKGTT.cjs +501 -0
  27. package/dist/OpenApiTsGenerator-Be-sKGTT.cjs.map +1 -0
  28. package/dist/OpenApiTsGenerator-C4mHHaku.mjs +495 -0
  29. package/dist/OpenApiTsGenerator-C4mHHaku.mjs.map +1 -0
  30. package/dist/SubscriberGenerator-7uX42xyG.d.mts +15 -0
  31. package/dist/{SubscriberGenerator-Dnlj_1FK.mjs → SubscriberGenerator-DABaJXML.mjs} +2 -2
  32. package/dist/{SubscriberGenerator-Dnlj_1FK.mjs.map → SubscriberGenerator-DABaJXML.mjs.map} +1 -1
  33. package/dist/{SubscriberGenerator-Bd-a7aiw.cjs → SubscriberGenerator-D_zpNGFr.cjs} +2 -2
  34. package/dist/{SubscriberGenerator-Bd-a7aiw.cjs.map → SubscriberGenerator-D_zpNGFr.cjs.map} +1 -1
  35. package/dist/SubscriberGenerator-Dtb3HS4i.d.cts +15 -0
  36. package/dist/api-B3SCEHPf.cjs +190 -0
  37. package/dist/api-B3SCEHPf.cjs.map +1 -0
  38. package/dist/api-BKIN0s0S.mjs +184 -0
  39. package/dist/api-BKIN0s0S.mjs.map +1 -0
  40. package/dist/build/index.cjs +11 -10
  41. package/dist/build/index.d.cts +7 -0
  42. package/dist/build/index.d.mts +7 -0
  43. package/dist/build/index.mjs +11 -10
  44. package/dist/build/manifests.cjs +1 -1
  45. package/dist/build/manifests.d.cts +13 -0
  46. package/dist/build/manifests.d.mts +13 -0
  47. package/dist/build/manifests.mjs +1 -1
  48. package/dist/build/providerResolver.cjs +1 -1
  49. package/dist/build/providerResolver.d.cts +23 -0
  50. package/dist/build/providerResolver.d.mts +23 -0
  51. package/dist/build/providerResolver.mjs +1 -1
  52. package/dist/build/types.d.cts +3 -0
  53. package/dist/build/types.d.mts +3 -0
  54. package/dist/{build-C6uEGRj8.mjs → build-B8C_qHir.mjs} +15 -13
  55. package/dist/build-B8C_qHir.mjs.map +1 -0
  56. package/dist/{build-CBYBPZpC.cjs → build-D0Wr49bf.cjs} +15 -13
  57. package/dist/build-D0Wr49bf.cjs.map +1 -0
  58. package/dist/config-Ba-Gbpbc.d.cts +11 -0
  59. package/dist/config-Bq72aj8e.mjs +75 -0
  60. package/dist/config-Bq72aj8e.mjs.map +1 -0
  61. package/dist/config-CFls09Ey.cjs +93 -0
  62. package/dist/config-CFls09Ey.cjs.map +1 -0
  63. package/dist/config-CLEDqKO3.cjs +157 -0
  64. package/dist/config-CLEDqKO3.cjs.map +1 -0
  65. package/dist/config-DBsmMDhf.d.mts +11 -0
  66. package/dist/config-Dp8RonV_.mjs +151 -0
  67. package/dist/config-Dp8RonV_.mjs.map +1 -0
  68. package/dist/config.cjs +4 -2
  69. package/dist/config.d.cts +48 -0
  70. package/dist/config.d.mts +48 -0
  71. package/dist/config.mjs +2 -2
  72. package/dist/dev/index.cjs +12 -10
  73. package/dist/dev/index.d.cts +36 -0
  74. package/dist/dev/index.d.mts +36 -0
  75. package/dist/dev/index.mjs +10 -10
  76. package/dist/dev-B734w3L1.mjs +343 -0
  77. package/dist/dev-B734w3L1.mjs.map +1 -0
  78. package/dist/{dev-DbtyToc7.cjs → dev-DHqYn8k4.cjs} +161 -47
  79. package/dist/dev-DHqYn8k4.cjs.map +1 -0
  80. package/dist/docker-5d8Yh5_X.cjs +119 -0
  81. package/dist/docker-5d8Yh5_X.cjs.map +1 -0
  82. package/dist/docker-DlUqdFle.mjs +113 -0
  83. package/dist/docker-DlUqdFle.mjs.map +1 -0
  84. package/dist/env-B-OKjgI4.cjs +144 -0
  85. package/dist/env-B-OKjgI4.cjs.map +1 -0
  86. package/dist/env-HfuJRlg5.d.cts +11 -0
  87. package/dist/env-nd-iQPYM.d.mts +11 -0
  88. package/dist/env-tv1HlZlw.mjs +138 -0
  89. package/dist/env-tv1HlZlw.mjs.map +1 -0
  90. package/dist/generators/CronGenerator.cjs +2 -2
  91. package/dist/generators/CronGenerator.d.cts +5 -0
  92. package/dist/generators/CronGenerator.d.mts +5 -0
  93. package/dist/generators/CronGenerator.mjs +2 -2
  94. package/dist/generators/EndpointGenerator.cjs +2 -2
  95. package/dist/generators/EndpointGenerator.d.cts +5 -0
  96. package/dist/generators/EndpointGenerator.d.mts +5 -0
  97. package/dist/generators/EndpointGenerator.mjs +2 -2
  98. package/dist/generators/FunctionGenerator.cjs +2 -2
  99. package/dist/generators/FunctionGenerator.d.cts +5 -0
  100. package/dist/generators/FunctionGenerator.d.mts +5 -0
  101. package/dist/generators/FunctionGenerator.mjs +2 -2
  102. package/dist/generators/Generator.cjs +1 -1
  103. package/dist/generators/Generator.d.cts +4 -0
  104. package/dist/generators/Generator.d.mts +4 -0
  105. package/dist/generators/Generator.mjs +1 -1
  106. package/dist/generators/OpenApiTsGenerator.cjs +3 -0
  107. package/dist/generators/OpenApiTsGenerator.d.cts +44 -0
  108. package/dist/generators/OpenApiTsGenerator.d.mts +44 -0
  109. package/dist/generators/OpenApiTsGenerator.mjs +3 -0
  110. package/dist/generators/SubscriberGenerator.cjs +2 -2
  111. package/dist/generators/SubscriberGenerator.d.cts +5 -0
  112. package/dist/generators/SubscriberGenerator.d.mts +5 -0
  113. package/dist/generators/SubscriberGenerator.mjs +2 -2
  114. package/dist/generators/index.cjs +6 -6
  115. package/dist/generators/index.d.cts +8 -0
  116. package/dist/generators/index.d.mts +8 -0
  117. package/dist/generators/index.mjs +6 -6
  118. package/dist/index-C523No_B.d.mts +64 -0
  119. package/dist/index-DrzN4xkQ.d.cts +64 -0
  120. package/dist/index.cjs +56 -18
  121. package/dist/index.cjs.map +1 -1
  122. package/dist/index.d.cts +1 -0
  123. package/dist/index.d.mts +1 -0
  124. package/dist/index.mjs +56 -18
  125. package/dist/index.mjs.map +1 -1
  126. package/dist/init/generators/config.cjs +3 -0
  127. package/dist/init/generators/config.d.cts +3 -0
  128. package/dist/init/generators/config.d.mts +3 -0
  129. package/dist/init/generators/config.mjs +3 -0
  130. package/dist/init/generators/docker.cjs +3 -0
  131. package/dist/init/generators/docker.d.cts +11 -0
  132. package/dist/init/generators/docker.d.mts +11 -0
  133. package/dist/init/generators/docker.mjs +3 -0
  134. package/dist/init/generators/env.cjs +3 -0
  135. package/dist/init/generators/env.d.cts +3 -0
  136. package/dist/init/generators/env.d.mts +3 -0
  137. package/dist/init/generators/env.mjs +3 -0
  138. package/dist/init/generators/index.cjs +9 -0
  139. package/dist/init/generators/index.d.cts +6 -0
  140. package/dist/init/generators/index.d.mts +6 -0
  141. package/dist/init/generators/index.mjs +6 -0
  142. package/dist/init/generators/models.cjs +3 -0
  143. package/dist/init/generators/models.d.cts +11 -0
  144. package/dist/init/generators/models.d.mts +11 -0
  145. package/dist/init/generators/models.mjs +3 -0
  146. package/dist/init/generators/monorepo.cjs +3 -0
  147. package/dist/init/generators/monorepo.d.cts +11 -0
  148. package/dist/init/generators/monorepo.d.mts +11 -0
  149. package/dist/init/generators/monorepo.mjs +3 -0
  150. package/dist/init/generators/package.cjs +3 -0
  151. package/dist/init/generators/package.d.cts +3 -0
  152. package/dist/init/generators/package.d.mts +3 -0
  153. package/dist/init/generators/package.mjs +3 -0
  154. package/dist/init/generators/source.cjs +3 -0
  155. package/dist/init/generators/source.d.cts +3 -0
  156. package/dist/init/generators/source.d.mts +3 -0
  157. package/dist/init/generators/source.mjs +3 -0
  158. package/dist/init/index.cjs +16 -0
  159. package/dist/init/index.d.cts +17 -0
  160. package/dist/init/index.d.mts +17 -0
  161. package/dist/init/index.mjs +16 -0
  162. package/dist/init/templates/api.cjs +3 -0
  163. package/dist/init/templates/api.d.cts +7 -0
  164. package/dist/init/templates/api.d.mts +7 -0
  165. package/dist/init/templates/api.mjs +3 -0
  166. package/dist/init/templates/index.cjs +10 -0
  167. package/dist/init/templates/index.d.cts +2 -0
  168. package/dist/init/templates/index.d.mts +2 -0
  169. package/dist/init/templates/index.mjs +7 -0
  170. package/dist/init/templates/minimal.cjs +3 -0
  171. package/dist/init/templates/minimal.d.cts +7 -0
  172. package/dist/init/templates/minimal.d.mts +7 -0
  173. package/dist/init/templates/minimal.mjs +3 -0
  174. package/dist/init/templates/serverless.cjs +3 -0
  175. package/dist/init/templates/serverless.d.cts +7 -0
  176. package/dist/init/templates/serverless.d.mts +7 -0
  177. package/dist/init/templates/serverless.mjs +3 -0
  178. package/dist/init/templates/worker.cjs +3 -0
  179. package/dist/init/templates/worker.d.cts +7 -0
  180. package/dist/init/templates/worker.d.mts +7 -0
  181. package/dist/init/templates/worker.mjs +3 -0
  182. package/dist/init/utils.cjs +7 -0
  183. package/dist/init/utils.d.cts +25 -0
  184. package/dist/init/utils.d.mts +25 -0
  185. package/dist/init/utils.mjs +3 -0
  186. package/dist/init-CtOnZn3G.mjs +145 -0
  187. package/dist/init-CtOnZn3G.mjs.map +1 -0
  188. package/dist/init-qLFsWR-R.cjs +151 -0
  189. package/dist/init-qLFsWR-R.cjs.map +1 -0
  190. package/dist/{manifests-C2eMoMUm.mjs → manifests-DIA_2QYd.mjs} +1 -1
  191. package/dist/{manifests-C2eMoMUm.mjs.map → manifests-DIA_2QYd.mjs.map} +1 -1
  192. package/dist/{manifests-CK1VV_pM.cjs → manifests-VJ9-2JpW.cjs} +1 -1
  193. package/dist/{manifests-CK1VV_pM.cjs.map → manifests-VJ9-2JpW.cjs.map} +1 -1
  194. package/dist/minimal-Bdhhpp7v.cjs +93 -0
  195. package/dist/minimal-Bdhhpp7v.cjs.map +1 -0
  196. package/dist/minimal-C4GsE45s.mjs +87 -0
  197. package/dist/minimal-C4GsE45s.mjs.map +1 -0
  198. package/dist/models-DyNwdOcz.cjs +121 -0
  199. package/dist/models-DyNwdOcz.cjs.map +1 -0
  200. package/dist/models-cvNg6Oea.mjs +115 -0
  201. package/dist/models-cvNg6Oea.mjs.map +1 -0
  202. package/dist/monorepo-Cknwzj5C.mjs +184 -0
  203. package/dist/monorepo-Cknwzj5C.mjs.map +1 -0
  204. package/dist/monorepo-sEK8gW59.cjs +190 -0
  205. package/dist/monorepo-sEK8gW59.cjs.map +1 -0
  206. package/dist/openapi-BQWPWyNB.cjs +56 -0
  207. package/dist/openapi-BQWPWyNB.cjs.map +1 -0
  208. package/dist/openapi-DBX8cJJ8.mjs +50 -0
  209. package/dist/openapi-DBX8cJJ8.mjs.map +1 -0
  210. package/dist/{openapi-react-query-D9Z7lh0p.cjs → openapi-react-query-DxHjXQvg.cjs} +1 -1
  211. package/dist/{openapi-react-query-D9Z7lh0p.cjs.map → openapi-react-query-DxHjXQvg.cjs.map} +1 -1
  212. package/dist/{openapi-react-query-MEBlYIM1.mjs → openapi-react-query-o7Mp1Jd5.mjs} +1 -1
  213. package/dist/{openapi-react-query-MEBlYIM1.mjs.map → openapi-react-query-o7Mp1Jd5.mjs.map} +1 -1
  214. package/dist/openapi-react-query.cjs +1 -1
  215. package/dist/openapi-react-query.d.cts +11 -0
  216. package/dist/openapi-react-query.d.mts +11 -0
  217. package/dist/openapi-react-query.mjs +1 -1
  218. package/dist/openapi.cjs +5 -4
  219. package/dist/openapi.d.cts +11 -0
  220. package/dist/openapi.d.mts +11 -0
  221. package/dist/openapi.mjs +5 -4
  222. package/dist/package-C7WhWU8m.d.mts +11 -0
  223. package/dist/package-CIfmeuSW.mjs +51 -0
  224. package/dist/package-CIfmeuSW.mjs.map +1 -0
  225. package/dist/package-DvWEMz6z.d.cts +11 -0
  226. package/dist/package-PP-o1nvq.cjs +57 -0
  227. package/dist/package-PP-o1nvq.cjs.map +1 -0
  228. package/dist/{providerResolver-B_TjNF0_.mjs → providerResolver-DEVKngbC.mjs} +1 -1
  229. package/dist/{providerResolver-B_TjNF0_.mjs.map → providerResolver-DEVKngbC.mjs.map} +1 -1
  230. package/dist/{providerResolver-DgvzNfP4.cjs → providerResolver-DOTbN9jo.cjs} +1 -1
  231. package/dist/{providerResolver-DgvzNfP4.cjs.map → providerResolver-DOTbN9jo.cjs.map} +1 -1
  232. package/dist/serverless-DkHBF2vC.mjs +108 -0
  233. package/dist/serverless-DkHBF2vC.mjs.map +1 -0
  234. package/dist/serverless-Yav3GRVz.cjs +114 -0
  235. package/dist/serverless-Yav3GRVz.cjs.map +1 -0
  236. package/dist/source-D6v2BnKT.d.mts +11 -0
  237. package/dist/source-D8fK9qRo.d.cts +11 -0
  238. package/dist/source-DT5Xhiob.cjs +17 -0
  239. package/dist/source-DT5Xhiob.cjs.map +1 -0
  240. package/dist/source-DnaH_MLA.mjs +11 -0
  241. package/dist/source-DnaH_MLA.mjs.map +1 -0
  242. package/dist/templates-CBFUwpBy.mjs +64 -0
  243. package/dist/templates-CBFUwpBy.mjs.map +1 -0
  244. package/dist/templates-DM_rtYYW.cjs +87 -0
  245. package/dist/templates-DM_rtYYW.cjs.map +1 -0
  246. package/dist/types-C4KITv-y.d.mts +51 -0
  247. package/dist/types-Cxl8-uwV.d.mts +129 -0
  248. package/dist/types-DB99_qIy.d.cts +129 -0
  249. package/dist/types-DLFN49M3.d.cts +51 -0
  250. package/dist/types.d.cts +2 -0
  251. package/dist/types.d.mts +2 -0
  252. package/dist/utils-BX3F4fT8.cjs +99 -0
  253. package/dist/utils-BX3F4fT8.cjs.map +1 -0
  254. package/dist/utils-C31-SWHP.mjs +69 -0
  255. package/dist/utils-C31-SWHP.mjs.map +1 -0
  256. package/dist/worker--8O5a3Hv.cjs +150 -0
  257. package/dist/worker--8O5a3Hv.cjs.map +1 -0
  258. package/dist/worker-Jme7uOOJ.mjs +144 -0
  259. package/dist/worker-Jme7uOOJ.mjs.map +1 -0
  260. package/docs/OPENAPI_TYPESCRIPT_DESIGN.md +408 -0
  261. package/package.json +19 -4
  262. package/src/__tests__/loadEnvFiles.spec.ts +131 -0
  263. package/src/__tests__/openapi.spec.ts +78 -63
  264. package/src/build/index.ts +14 -16
  265. package/src/build/types.ts +18 -2
  266. package/src/config.ts +61 -2
  267. package/src/dev/__tests__/index.spec.ts +98 -1
  268. package/src/dev/index.ts +229 -42
  269. package/src/generators/EndpointGenerator.ts +98 -5
  270. package/src/generators/OpenApiTsGenerator.ts +798 -0
  271. package/src/index.ts +32 -3
  272. package/src/init/__tests__/generators.spec.ts +366 -0
  273. package/src/init/__tests__/init.spec.ts +341 -0
  274. package/src/init/__tests__/utils.spec.ts +104 -0
  275. package/src/init/generators/config.ts +192 -0
  276. package/src/init/generators/docker.ts +134 -0
  277. package/src/init/generators/env.ts +182 -0
  278. package/src/init/generators/index.ts +4 -0
  279. package/src/init/generators/models.ts +129 -0
  280. package/src/init/generators/monorepo.ts +211 -0
  281. package/src/init/generators/package.ts +81 -0
  282. package/src/init/generators/source.ts +15 -0
  283. package/src/init/index.ts +206 -0
  284. package/src/init/templates/api.ts +218 -0
  285. package/src/init/templates/index.ts +108 -0
  286. package/src/init/templates/minimal.ts +102 -0
  287. package/src/init/templates/serverless.ts +129 -0
  288. package/src/init/templates/worker.ts +169 -0
  289. package/src/init/utils.ts +98 -0
  290. package/src/openapi.ts +36 -15
  291. package/src/types.ts +43 -0
  292. package/tsdown.config.ts +1 -1
  293. package/dist/EndpointGenerator-C73wNoih.cjs.map +0 -1
  294. package/dist/EndpointGenerator-CWh18d92.mjs.map +0 -1
  295. package/dist/build-C6uEGRj8.mjs.map +0 -1
  296. package/dist/build-CBYBPZpC.cjs.map +0 -1
  297. package/dist/config-D1EpSGk6.cjs +0 -36
  298. package/dist/config-D1EpSGk6.cjs.map +0 -1
  299. package/dist/config-U-mdW-7Y.mjs +0 -30
  300. package/dist/config-U-mdW-7Y.mjs.map +0 -1
  301. package/dist/dev-DbtyToc7.cjs.map +0 -1
  302. package/dist/dev-DnGYXuMn.mjs +0 -241
  303. package/dist/dev-DnGYXuMn.mjs.map +0 -1
  304. package/dist/openapi-BTHbPrxS.mjs +0 -36
  305. package/dist/openapi-BTHbPrxS.mjs.map +0 -1
  306. package/dist/openapi-CewcfoRH.cjs +0 -42
  307. package/dist/openapi-CewcfoRH.cjs.map +0 -1
  308. /package/dist/{generators-CEKtVh81.cjs → generators-3IemvCLk.cjs} +0 -0
  309. /package/dist/{generators-CsLujGXs.mjs → generators-FNpdfN6J.mjs} +0 -0
package/README.md CHANGED
@@ -5,6 +5,8 @@ A powerful CLI tool for building and managing TypeScript-based backend APIs with
5
5
  ## Features
6
6
 
7
7
  - **Multi-Provider Support**: Generate handlers for AWS Lambda (API Gateway v1/v2) and server applications
8
+ - **Development Server**: Hot-reload development server with file watching
9
+ - **Telescope Integration**: Laravel-style debugging dashboard for inspecting requests, logs, and exceptions
8
10
  - **OpenAPI Generation**: Auto-generate OpenAPI 3.0 specifications from your endpoints
9
11
  - **Type-Safe Configuration**: Configuration with TypeScript support and validation
10
12
  - **Endpoint Auto-Discovery**: Automatically find and load endpoints from your codebase
@@ -51,6 +53,12 @@ const config: GkmConfig = {
51
53
 
52
54
  // Logger configuration
53
55
  logger: './src/logger.ts#logger',
56
+
57
+ // Optional: Telescope debugging dashboard (enabled by default in dev)
58
+ telescope: {
59
+ enabled: true,
60
+ path: '/__telescope',
61
+ },
54
62
  };
55
63
 
56
64
  export default config;
@@ -166,8 +174,8 @@ npx gkm build --provider aws-apigatewayv1
166
174
  # Generate server application
167
175
  npx gkm build --provider server
168
176
 
169
- # Generate OpenAPI specification
170
- npx gkm openapi --output api-docs.json
177
+ # Generate OpenAPI TypeScript module
178
+ npx gkm openapi --output src/api.ts
171
179
  ```
172
180
 
173
181
  ## CLI Commands
@@ -197,19 +205,141 @@ gkm build --provider server
197
205
 
198
206
  ### `gkm openapi`
199
207
 
200
- Generate OpenAPI 3.0 specification from your endpoints.
208
+ Generate OpenAPI TypeScript module from your endpoints. This is the recommended approach as it provides full type safety and a ready-to-use API client.
201
209
 
202
210
  ```bash
203
211
  gkm openapi [options]
204
212
  ```
205
213
 
206
214
  **Options:**
207
- - `--output <path>`: Output file path (default: `openapi.json`)
215
+ - `--output <path>`: Output file path (default: `openapi.ts`)
216
+ - `--json`: Generate legacy JSON format instead of TypeScript module
217
+
218
+ **Example:**
219
+ ```bash
220
+ # Generate TypeScript module (recommended)
221
+ gkm openapi --output src/api.ts
222
+
223
+ # Generate legacy JSON format
224
+ gkm openapi --output docs/api.json --json
225
+ ```
226
+
227
+ #### Generated TypeScript Module
228
+
229
+ The generated TypeScript module includes:
230
+
231
+ ```typescript
232
+ // src/api.ts (auto-generated)
233
+
234
+ // Security schemes defined in your endpoints
235
+ export const securitySchemes = {
236
+ jwt: { type: 'http', scheme: 'bearer', bearerFormat: 'JWT' },
237
+ apiKey: { type: 'apiKey', in: 'header', name: 'X-API-Key' },
238
+ } as const;
239
+
240
+ export type SecuritySchemeId = 'jwt' | 'apiKey';
241
+
242
+ // Endpoint-to-auth mapping
243
+ export const endpointAuth = {
244
+ 'GET /users': 'jwt',
245
+ 'POST /users': 'jwt',
246
+ 'GET /health': null,
247
+ } as const;
248
+
249
+ // TypeScript interfaces for request/response types
250
+ export interface GetUsersOutput {
251
+ id: string;
252
+ name: string;
253
+ }
254
+
255
+ // OpenAPI paths interface
256
+ export interface paths {
257
+ '/users': {
258
+ get: {
259
+ responses: {
260
+ 200: { content: { 'application/json': GetUsersOutput[] } };
261
+ };
262
+ };
263
+ };
264
+ }
265
+
266
+ // Ready-to-use API client factory
267
+ export function createApi(options: CreateApiOptions) {
268
+ // ... implementation
269
+ }
270
+ ```
271
+
272
+ #### Using the Generated Client
273
+
274
+ ```typescript
275
+ import { createApi } from './api';
276
+
277
+ const api = createApi({
278
+ baseURL: 'https://api.example.com',
279
+ authStrategies: {
280
+ jwt: {
281
+ type: 'bearer',
282
+ tokenProvider: async () => localStorage.getItem('token'),
283
+ },
284
+ },
285
+ });
286
+
287
+ // Imperative fetching
288
+ const users = await api('GET /users');
289
+
290
+ // React Query hooks
291
+ const { data } = api.useQuery('GET /users');
292
+ const mutation = api.useMutation('POST /users');
293
+ ```
294
+
295
+ ### `gkm dev`
296
+
297
+ Start a development server with hot-reload and optional Telescope debugging dashboard.
298
+
299
+ ```bash
300
+ gkm dev [options]
301
+ ```
302
+
303
+ **Options:**
304
+ - `--port <port>`: Server port (default: `3000`)
305
+
306
+ **Features:**
307
+ - Hot-reload on file changes (endpoints, functions, crons, subscribers)
308
+ - Automatic port switching if requested port is in use
309
+ - Telescope debugging dashboard (enabled by default)
310
+ - Real-time WebSocket updates in Telescope
208
311
 
209
312
  **Example:**
210
313
  ```bash
211
- # Generate OpenAPI spec
212
- gkm openapi --output docs/api.json
314
+ # Start development server on port 3000
315
+ gkm dev
316
+
317
+ # Start on custom port
318
+ gkm dev --port 8080
319
+ ```
320
+
321
+ **Output:**
322
+ ```
323
+ 🚀 Starting development server...
324
+ Loading routes from: ./src/endpoints/**/*.ts
325
+ Loading subscribers from: ./src/subscribers/**/*.ts
326
+ Using envParser: ./src/config/env
327
+ 🔭 Telescope enabled at /__telescope
328
+ Generated server with 5 endpoints
329
+
330
+ ✨ Starting server on port 3000...
331
+ 🔌 Telescope real-time updates enabled
332
+
333
+ 🎉 Server running at http://localhost:3000
334
+ 🔭 Telescope available at http://localhost:3000/__telescope
335
+ 👀 Watching for changes in: src/endpoints/**/*.ts, src/subscribers/**/*.ts
336
+ ```
337
+
338
+ When files change, the server automatically rebuilds and restarts:
339
+ ```
340
+ 📝 File changed: src/endpoints/users.ts
341
+ 🔄 Rebuilding...
342
+ ✅ Rebuild complete, restarting server...
213
343
  ```
214
344
 
215
345
  ### Future Commands
@@ -231,6 +361,20 @@ interface GkmConfig {
231
361
  routes: string | string[]; // Glob patterns for endpoint files
232
362
  envParser: string; // Path to environment parser
233
363
  logger: string; // Path to logger configuration
364
+ functions?: string | string[]; // Glob patterns for function files
365
+ crons?: string | string[]; // Glob patterns for cron files
366
+ subscribers?: string | string[];// Glob patterns for subscriber files
367
+ runtime?: 'node' | 'bun'; // Runtime environment (default: 'node')
368
+ telescope?: boolean | TelescopeConfig; // Telescope debugging config
369
+ }
370
+
371
+ interface TelescopeConfig {
372
+ enabled?: boolean; // Enable/disable (default: true in dev)
373
+ path?: string; // Dashboard path (default: '/__telescope')
374
+ ignore?: string[]; // URL patterns to ignore
375
+ recordBody?: boolean; // Record request/response bodies (default: true)
376
+ maxEntries?: number; // Max entries to keep (default: 1000)
377
+ websocket?: boolean; // Enable real-time updates (default: true)
234
378
  }
235
379
  ```
236
380
 
@@ -282,6 +426,65 @@ logger: './src/logger.ts#logger'
282
426
  logger: './src/utils.ts#appLogger'
283
427
  ```
284
428
 
429
+ #### `telescope`
430
+
431
+ Configuration for the Telescope debugging dashboard. Telescope is enabled by default when using `gkm dev`.
432
+
433
+ ```typescript
434
+ // Disable telescope
435
+ telescope: false
436
+
437
+ // Enable with defaults
438
+ telescope: true
439
+
440
+ // Custom configuration
441
+ telescope: {
442
+ enabled: true,
443
+ path: '/__telescope',
444
+ ignore: ['/health', '/metrics'],
445
+ recordBody: true,
446
+ maxEntries: 1000,
447
+ websocket: true,
448
+ }
449
+ ```
450
+
451
+ **Options:**
452
+
453
+ | Option | Type | Default | Description |
454
+ |--------|------|---------|-------------|
455
+ | `enabled` | `boolean` | `true` | Enable/disable Telescope |
456
+ | `path` | `string` | `/__telescope` | Dashboard URL path |
457
+ | `ignore` | `string[]` | `[]` | URL patterns to exclude from recording |
458
+ | `recordBody` | `boolean` | `true` | Record request/response bodies |
459
+ | `maxEntries` | `number` | `1000` | Maximum entries per type to keep |
460
+ | `websocket` | `boolean` | `true` | Enable real-time WebSocket updates |
461
+
462
+ **Logger Integration:**
463
+
464
+ Telescope automatically captures logs when using `gkm dev`. To manually integrate with your logger:
465
+
466
+ ```typescript
467
+ // Pino Transport
468
+ import pino from 'pino';
469
+ import { createPinoDestination } from '@geekmidas/telescope/logger/pino';
470
+
471
+ const logger = pino(
472
+ { level: 'debug' },
473
+ pino.multistream([
474
+ { stream: process.stdout },
475
+ { stream: createPinoDestination({ telescope }) }
476
+ ])
477
+ );
478
+
479
+ // ConsoleLogger wrapper
480
+ import { createTelescopeLogger } from '@geekmidas/telescope/logger/console';
481
+ import { ConsoleLogger } from '@geekmidas/logger/console';
482
+
483
+ const logger = createTelescopeLogger(telescope, new ConsoleLogger());
484
+ ```
485
+
486
+ See the [@geekmidas/telescope documentation](../telescope/README.md) for more details.
487
+
285
488
  ## Providers
286
489
 
287
490
  ### AWS API Gateway v1
@@ -366,95 +569,193 @@ The CLI generates files in the `.gkm/<provider>` directory:
366
569
  ├── aws-apigatewayv1/
367
570
  │ ├── getUsers.ts # Individual Lambda handler
368
571
  │ ├── createUser.ts # Individual Lambda handler
369
- │ └── manifest.json # Build manifest
370
572
  ├── server/
371
573
  │ ├── app.ts # Server application
372
- └── manifest.json # Build manifest
574
+ ├── endpoints.ts # Endpoint exports
575
+ ├── manifest/
576
+ │ ├── aws.ts # AWS manifest with types
577
+ │ └── server.ts # Server manifest with types
373
578
  └── openapi.json # OpenAPI specification
374
579
  ```
375
580
 
376
581
  ### Build Manifest
377
582
 
378
- Each provider generates a `manifest.json` file with build information:
583
+ The CLI generates TypeScript manifests with full type information in the `.gkm/manifest/` directory. These manifests export both the data and derived types for type-safe usage.
379
584
 
380
- ```json
381
- {
382
- "routes": [
585
+ #### AWS Manifest (`.gkm/manifest/aws.ts`)
586
+
587
+ ```typescript
588
+ export const manifest = {
589
+ routes: [
383
590
  {
384
- "path": "/users",
385
- "method": "GET",
386
- "handler": ".gkm/aws-apigatewayv1/getUsers.handler"
591
+ path: '/users',
592
+ method: 'GET',
593
+ handler: '.gkm/aws-apigatewayv1/getUsers.handler',
594
+ authorizer: 'jwt',
387
595
  },
388
596
  {
389
- "path": "/users",
390
- "method": "POST",
391
- "handler": ".gkm/aws-apigatewayv1/createUser.handler"
392
- }
597
+ path: '/users',
598
+ method: 'POST',
599
+ handler: '.gkm/aws-apigatewayv1/createUser.handler',
600
+ authorizer: 'jwt',
601
+ },
393
602
  ],
394
- "functions": [
603
+ functions: [
395
604
  {
396
- "name": "processData",
397
- "handler": ".gkm/aws-lambda/functions/processData.handler",
398
- "timeout": 60,
399
- "memorySize": 256
400
- }
605
+ name: 'processData',
606
+ handler: '.gkm/aws-lambda/functions/processData.handler',
607
+ timeout: 60,
608
+ memorySize: 256,
609
+ },
401
610
  ],
402
- "crons": [
611
+ crons: [
403
612
  {
404
- "name": "dailyCleanup",
405
- "handler": ".gkm/aws-lambda/crons/dailyCleanup.handler",
406
- "schedule": "rate(1 day)",
407
- "timeout": 300,
408
- "memorySize": 512
409
- }
410
- ]
613
+ name: 'dailyCleanup',
614
+ handler: '.gkm/aws-lambda/crons/dailyCleanup.handler',
615
+ schedule: 'rate(1 day)',
616
+ timeout: 300,
617
+ memorySize: 512,
618
+ },
619
+ ],
620
+ subscribers: [],
621
+ } as const;
622
+
623
+ // Derived types
624
+ export type Route = (typeof manifest.routes)[number];
625
+ export type Function = (typeof manifest.functions)[number];
626
+ export type Cron = (typeof manifest.crons)[number];
627
+ export type Subscriber = (typeof manifest.subscribers)[number];
628
+
629
+ // Useful union types
630
+ export type Authorizer = Route['authorizer'];
631
+ export type HttpMethod = Route['method'];
632
+ export type RoutePath = Route['path'];
633
+ ```
634
+
635
+ #### Server Manifest (`.gkm/manifest/server.ts`)
636
+
637
+ ```typescript
638
+ export const manifest = {
639
+ app: {
640
+ handler: '.gkm/server/app.ts',
641
+ endpoints: '.gkm/server/endpoints.ts',
642
+ },
643
+ routes: [
644
+ { path: '/users', method: 'GET', authorizer: 'jwt' },
645
+ { path: '/users', method: 'POST', authorizer: 'jwt' },
646
+ ],
647
+ subscribers: [
648
+ { name: 'orderHandler', subscribedEvents: ['order.created'] },
649
+ ],
650
+ } as const;
651
+
652
+ // Derived types
653
+ export type Route = (typeof manifest.routes)[number];
654
+ export type Subscriber = (typeof manifest.subscribers)[number];
655
+
656
+ // Useful union types
657
+ export type Authorizer = Route['authorizer'];
658
+ export type HttpMethod = Route['method'];
659
+ export type RoutePath = Route['path'];
660
+ ```
661
+
662
+ #### Using Manifest Types
663
+
664
+ Import the manifest types for type-safe infrastructure configuration:
665
+
666
+ ```typescript
667
+ import { manifest, type Route, type Authorizer } from './.gkm/manifest/aws';
668
+
669
+ // Type-safe route iteration
670
+ for (const route of manifest.routes) {
671
+ console.log(`${route.method} ${route.path} -> ${route.handler}`);
672
+ }
673
+
674
+ // Use union types for validation
675
+ function isValidMethod(method: string): method is HttpMethod {
676
+ return manifest.routes.some((r) => r.method === method);
411
677
  }
678
+
679
+ // Access authorizer names
680
+ const authorizers = new Set(manifest.routes.map((r) => r.authorizer));
412
681
  ```
413
682
 
414
683
  ## OpenAPI Generation
415
684
 
416
- The CLI automatically generates OpenAPI 3.0 specifications from your endpoints:
685
+ The CLI generates a TypeScript module with full type safety and a ready-to-use API client:
417
686
 
418
687
  ```bash
419
- gkm openapi --output api-docs.json
688
+ gkm openapi --output src/api.ts
420
689
  ```
421
690
 
422
- **Generated OpenAPI:**
423
- ```json
424
- {
425
- "openapi": "3.0.0",
426
- "info": {
427
- "title": "API Documentation",
428
- "version": "1.0.0",
429
- "description": "Auto-generated API documentation from endpoints"
691
+ **Generated TypeScript Module:**
692
+
693
+ The generated module exports:
694
+
695
+ | Export | Description |
696
+ |--------|-------------|
697
+ | `securitySchemes` | OpenAPI security scheme definitions |
698
+ | `SecuritySchemeId` | Union type of security scheme names |
699
+ | `endpointAuth` | Map of endpoints to their auth requirements |
700
+ | `paths` | TypeScript interface for OpenAPI paths |
701
+ | `createApi()` | Factory function to create typed API client |
702
+
703
+ **Example Generated Output:**
704
+
705
+ ```typescript
706
+ // Security schemes from your endpoint authorizers
707
+ export const securitySchemes = {
708
+ jwt: {
709
+ type: 'http',
710
+ scheme: 'bearer',
711
+ bearerFormat: 'JWT',
430
712
  },
431
- "paths": {
432
- "/users": {
433
- "get": {
434
- "summary": "Get Users",
435
- "responses": {
436
- "200": {
437
- "description": "Success",
438
- "content": {
439
- "application/json": {
440
- "schema": {
441
- "type": "array",
442
- "items": {
443
- "type": "object",
444
- "properties": {
445
- "id": { "type": "string" },
446
- "name": { "type": "string" }
447
- }
448
- }
449
- }
450
- }
451
- }
452
- }
453
- }
454
- }
455
- }
456
- }
713
+ } as const;
714
+
715
+ export type SecuritySchemeId = 'jwt';
716
+
717
+ // Which endpoints require which auth
718
+ export const endpointAuth = {
719
+ 'GET /users': 'jwt',
720
+ 'POST /users': 'jwt',
721
+ 'GET /health': null, // Public endpoint
722
+ } as const;
723
+
724
+ // Type-safe paths interface
725
+ export interface paths {
726
+ '/users': {
727
+ get: {
728
+ responses: {
729
+ 200: { content: { 'application/json': GetUsersOutput[] } };
730
+ };
731
+ };
732
+ post: {
733
+ requestBody: { content: { 'application/json': CreateUserInput } };
734
+ responses: {
735
+ 201: { content: { 'application/json': GetUsersOutput } };
736
+ };
737
+ };
738
+ };
457
739
  }
740
+
741
+ // Factory to create API client
742
+ export interface CreateApiOptions {
743
+ baseURL: string;
744
+ authStrategies: Record<SecuritySchemeId, AuthStrategy>;
745
+ queryClient?: QueryClient;
746
+ }
747
+
748
+ export function createApi(options: CreateApiOptions) {
749
+ // Returns callable fetcher with React Query hooks
750
+ }
751
+ ```
752
+
753
+ ### Legacy JSON Output
754
+
755
+ For compatibility with other tools, you can still generate JSON:
756
+
757
+ ```bash
758
+ gkm openapi --output api-docs.json --json
458
759
  ```
459
760
 
460
761
  ## Deployment Examples
@@ -556,6 +857,97 @@ export const envParser = new EnvironmentParser(process.env)
556
857
  .parse();
557
858
  ```
558
859
 
860
+ ### Authentication Integration
861
+
862
+ Integrate `@geekmidas/auth` for JWT/OIDC authentication in your endpoints:
863
+
864
+ ```typescript
865
+ // src/env.ts
866
+ import { EnvironmentParser } from '@geekmidas/envkit';
867
+
868
+ export const envParser = new EnvironmentParser(process.env)
869
+ .create((get) => ({
870
+ auth: {
871
+ jwtSecret: get('JWT_SECRET').string(),
872
+ jwtIssuer: get('JWT_ISSUER').string().optional(),
873
+ jwtAudience: get('JWT_AUDIENCE').string().optional(),
874
+ },
875
+ }))
876
+ .parse();
877
+ ```
878
+
879
+ #### With Hono Middleware (Server Provider)
880
+
881
+ ```typescript
882
+ // src/routes/protected.ts
883
+ import { e } from '@geekmidas/constructs/endpoints';
884
+ import { JwtMiddleware } from '@geekmidas/auth/hono/jwt';
885
+ import { envParser } from '../env.js';
886
+
887
+ const jwt = new JwtMiddleware({
888
+ config: {
889
+ secret: envParser.auth.jwtSecret,
890
+ issuer: envParser.auth.jwtIssuer,
891
+ audience: envParser.auth.jwtAudience,
892
+ },
893
+ });
894
+
895
+ // Apply middleware to Hono app
896
+ app.use('/api/*', jwt.handler());
897
+ app.use('/public/*', jwt.optional());
898
+ ```
899
+
900
+ #### With Lambda Authorizers (AWS Provider)
901
+
902
+ ```typescript
903
+ // src/authorizers/jwt.ts
904
+ import { JwtAuthorizer } from '@geekmidas/auth/lambda/jwt';
905
+ import { envParser } from '../env.js';
906
+
907
+ const authorizer = new JwtAuthorizer({
908
+ config: {
909
+ secret: envParser.auth.jwtSecret,
910
+ issuer: envParser.auth.jwtIssuer,
911
+ },
912
+ getContext: (claims) => ({
913
+ userId: claims.sub!,
914
+ }),
915
+ });
916
+
917
+ export const handler = authorizer.requestHandler();
918
+ ```
919
+
920
+ #### With OIDC (Auth0, Cognito, etc.)
921
+
922
+ ```typescript
923
+ // src/env.ts
924
+ export const envParser = new EnvironmentParser(process.env)
925
+ .create((get) => ({
926
+ oidc: {
927
+ issuer: get('OIDC_ISSUER').string().url(),
928
+ audience: get('OIDC_AUDIENCE').string(),
929
+ },
930
+ }))
931
+ .parse();
932
+
933
+ // src/authorizers/oidc.ts
934
+ import { OidcAuthorizer } from '@geekmidas/auth/lambda/oidc';
935
+ import { envParser } from '../env.js';
936
+
937
+ const authorizer = new OidcAuthorizer({
938
+ config: {
939
+ issuer: envParser.oidc.issuer,
940
+ audience: envParser.oidc.audience,
941
+ },
942
+ getContext: (claims) => ({
943
+ userId: claims.sub!,
944
+ email: claims.email,
945
+ }),
946
+ });
947
+
948
+ export const handler = authorizer.requestHandler();
949
+ ```
950
+
559
951
  ### Custom Logger Configuration
560
952
 
561
953
  Set up structured logging with different levels:
@@ -635,11 +1027,12 @@ Error: OpenAPI generation failed: Invalid endpoint schema
635
1027
  ```json
636
1028
  {
637
1029
  "scripts": {
1030
+ "dev": "gkm dev",
1031
+ "dev:port": "gkm dev --port 8080",
638
1032
  "build": "gkm build",
639
1033
  "build:lambda": "gkm build --provider aws-apigatewayv1",
640
1034
  "build:server": "gkm build --provider server",
641
- "docs": "gkm openapi --output docs/api.json",
642
- "dev": "npm run build:server && node server.js"
1035
+ "docs": "gkm openapi --output src/api.ts"
643
1036
  }
644
1037
  }
645
1038
  ```
@@ -734,11 +1127,29 @@ DEBUG=gkm:* npx gkm build
734
1127
  // Provider options
735
1128
  type Provider = 'server' | 'aws-apigatewayv1' | 'aws-apigatewayv2';
736
1129
 
1130
+ // Runtime options
1131
+ type Runtime = 'node' | 'bun';
1132
+
737
1133
  // Configuration interface
738
1134
  interface GkmConfig {
739
1135
  routes: string | string[];
740
1136
  envParser: string;
741
1137
  logger: string;
1138
+ functions?: string | string[];
1139
+ crons?: string | string[];
1140
+ subscribers?: string | string[];
1141
+ runtime?: Runtime;
1142
+ telescope?: boolean | TelescopeConfig;
1143
+ }
1144
+
1145
+ // Telescope configuration
1146
+ interface TelescopeConfig {
1147
+ enabled?: boolean;
1148
+ path?: string;
1149
+ ignore?: string[];
1150
+ recordBody?: boolean;
1151
+ maxEntries?: number;
1152
+ websocket?: boolean;
742
1153
  }
743
1154
 
744
1155
  // Build options
@@ -746,6 +1157,12 @@ interface BuildOptions {
746
1157
  provider: Provider;
747
1158
  }
748
1159
 
1160
+ // Dev options
1161
+ interface DevOptions {
1162
+ port?: number;
1163
+ enableOpenApi?: boolean;
1164
+ }
1165
+
749
1166
  // Route information
750
1167
  interface RouteInfo {
751
1168
  path: string;
@@ -0,0 +1,14 @@
1
+ import { CronInfo } from "./types-DB99_qIy.cjs";
2
+ import { BuildContext } from "./types-DLFN49M3.cjs";
3
+ import { ConstructGenerator, GeneratedConstruct, GeneratorOptions } from "./Generator-DxQMCQp7.cjs";
4
+ import { Cron } from "@geekmidas/constructs/crons";
5
+
6
+ //#region src/generators/CronGenerator.d.ts
7
+ declare class CronGenerator extends ConstructGenerator<Cron<any, any, any, any, any, any, any, any>, CronInfo[]> {
8
+ build(context: BuildContext, constructs: GeneratedConstruct<Cron<any, any, any, any, any, any, any, any>>[], outputDir: string, options?: GeneratorOptions): Promise<CronInfo[]>;
9
+ isConstruct(value: any): value is Cron<any, any, any, any, any, any, any, any>;
10
+ private generateCronHandler;
11
+ }
12
+ //#endregion
13
+ export { CronGenerator };
14
+ //# sourceMappingURL=CronGenerator-BPTqNYOR.d.cts.map
@@ -1,4 +1,4 @@
1
- import { ConstructGenerator } from "./Generator-UanJW0_V.mjs";
1
+ import { ConstructGenerator } from "./Generator-CDt4pB3W.mjs";
2
2
  import { mkdir, writeFile } from "node:fs/promises";
3
3
  import { dirname, join, relative } from "node:path";
4
4
  import { Cron } from "@geekmidas/constructs/crons";
@@ -52,4 +52,4 @@ export const handler = adapter.handler;
52
52
 
53
53
  //#endregion
54
54
  export { CronGenerator };
55
- //# sourceMappingURL=CronGenerator-Bh26MaNA.mjs.map
55
+ //# sourceMappingURL=CronGenerator-CCRYptuT.mjs.map