@cimplify/cli 0.2.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 (457) hide show
  1. package/README.md +69 -0
  2. package/dist/add-ZJQJZJEF.mjs +125 -0
  3. package/dist/chunk-4YSOZ6LY.mjs +61 -0
  4. package/dist/chunk-4ZVTPMUZ.mjs +155 -0
  5. package/dist/chunk-5XH72JMJ.mjs +211 -0
  6. package/dist/chunk-D7D75ONX.mjs +36 -0
  7. package/dist/chunk-JJYWETGA.mjs +127 -0
  8. package/dist/chunk-L6474RPL.mjs +37 -0
  9. package/dist/chunk-MQMNWLMU.mjs +48 -0
  10. package/dist/chunk-NZ4RG62Z.mjs +141 -0
  11. package/dist/chunk-TAMGCHIL.mjs +81 -0
  12. package/dist/chunk-XSWWWO6H.mjs +3779 -0
  13. package/dist/deploy-WCZOGMED.mjs +206 -0
  14. package/dist/dev-4HKIXWXX.mjs +130 -0
  15. package/dist/dispatcher.mjs +321 -0
  16. package/dist/domains-3RJ4T5IX.mjs +387 -0
  17. package/dist/env-LBYBCBWV.mjs +268 -0
  18. package/dist/link-SEJNW7JS.mjs +45 -0
  19. package/dist/list-D4JC2VWY.mjs +48 -0
  20. package/dist/login-MRYWLQRY.mjs +276 -0
  21. package/dist/logout-ZFZLSJ32.mjs +16 -0
  22. package/dist/logs-LK7CMBCE.mjs +95 -0
  23. package/dist/projects-QJUGOCQZ.mjs +164 -0
  24. package/dist/repo-MV22OHON.mjs +8 -0
  25. package/dist/rollback-XO7RIG2A.mjs +107 -0
  26. package/dist/status-7CMVLD54.mjs +127 -0
  27. package/dist/unlink-5ABCT7B6.mjs +16 -0
  28. package/dist/whoami-INHDUHWA.mjs +24 -0
  29. package/package.json +44 -0
  30. package/templates/storefront-bakery/.claude/skills/cimplify-storefront/SKILL.md +145 -0
  31. package/templates/storefront-bakery/.cursor/rules/cimplify-storefront.mdc +25 -0
  32. package/templates/storefront-bakery/.env.example +16 -0
  33. package/templates/storefront-bakery/AGENTS.md +120 -0
  34. package/templates/storefront-bakery/CLAUDE.md +22 -0
  35. package/templates/storefront-bakery/README.md +73 -0
  36. package/templates/storefront-bakery/__tests__/brand.test.ts +4 -0
  37. package/templates/storefront-bakery/__tests__/cart-flow.test.ts +4 -0
  38. package/templates/storefront-bakery/__tests__/contract.test.ts +4 -0
  39. package/templates/storefront-bakery/app/about/page.tsx +38 -0
  40. package/templates/storefront-bakery/app/accessibility/page.tsx +11 -0
  41. package/templates/storefront-bakery/app/account/addresses/page.tsx +21 -0
  42. package/templates/storefront-bakery/app/account/orders/page.tsx +21 -0
  43. package/templates/storefront-bakery/app/account/page.tsx +22 -0
  44. package/templates/storefront-bakery/app/account/settings/page.tsx +21 -0
  45. package/templates/storefront-bakery/app/cart/page.tsx +9 -0
  46. package/templates/storefront-bakery/app/categories/[slug]/listing-client.tsx +19 -0
  47. package/templates/storefront-bakery/app/categories/[slug]/page.tsx +118 -0
  48. package/templates/storefront-bakery/app/checkout/page.tsx +17 -0
  49. package/templates/storefront-bakery/app/collections/[slug]/listing-client.tsx +20 -0
  50. package/templates/storefront-bakery/app/collections/[slug]/page.tsx +118 -0
  51. package/templates/storefront-bakery/app/contact/contact-form.tsx +109 -0
  52. package/templates/storefront-bakery/app/contact/page.tsx +54 -0
  53. package/templates/storefront-bakery/app/error.tsx +60 -0
  54. package/templates/storefront-bakery/app/faq/page.tsx +46 -0
  55. package/templates/storefront-bakery/app/globals.css +47 -0
  56. package/templates/storefront-bakery/app/layout.tsx +82 -0
  57. package/templates/storefront-bakery/app/llms.txt/route.ts +94 -0
  58. package/templates/storefront-bakery/app/login/page.tsx +17 -0
  59. package/templates/storefront-bakery/app/not-found.tsx +39 -0
  60. package/templates/storefront-bakery/app/opensearch.xml/route.ts +37 -0
  61. package/templates/storefront-bakery/app/orders/[id]/page.tsx +21 -0
  62. package/templates/storefront-bakery/app/page.tsx +97 -0
  63. package/templates/storefront-bakery/app/privacy/page.tsx +44 -0
  64. package/templates/storefront-bakery/app/returns/page.tsx +11 -0
  65. package/templates/storefront-bakery/app/robots.ts +18 -0
  66. package/templates/storefront-bakery/app/search/page.tsx +38 -0
  67. package/templates/storefront-bakery/app/search/search-client.tsx +7 -0
  68. package/templates/storefront-bakery/app/shipping/page.tsx +16 -0
  69. package/templates/storefront-bakery/app/shop/page.tsx +31 -0
  70. package/templates/storefront-bakery/app/shop/shop-client.tsx +27 -0
  71. package/templates/storefront-bakery/app/signup/page.tsx +17 -0
  72. package/templates/storefront-bakery/app/sitemap-page/page.tsx +167 -0
  73. package/templates/storefront-bakery/app/sitemap.ts +62 -0
  74. package/templates/storefront-bakery/app/terms/page.tsx +44 -0
  75. package/templates/storefront-bakery/app/track-order/page.tsx +24 -0
  76. package/templates/storefront-bakery/app/track-order/track-order-form.tsx +69 -0
  77. package/templates/storefront-bakery/components/account-iframe.tsx +13 -0
  78. package/templates/storefront-bakery/components/cart-drawer.tsx +14 -0
  79. package/templates/storefront-bakery/components/cart-pill.tsx +36 -0
  80. package/templates/storefront-bakery/components/category-grid.tsx +28 -0
  81. package/templates/storefront-bakery/components/collection-strip.tsx +45 -0
  82. package/templates/storefront-bakery/components/footer.tsx +148 -0
  83. package/templates/storefront-bakery/components/header.tsx +43 -0
  84. package/templates/storefront-bakery/components/hero.tsx +25 -0
  85. package/templates/storefront-bakery/components/nav-link.tsx +20 -0
  86. package/templates/storefront-bakery/components/policy-page.tsx +49 -0
  87. package/templates/storefront-bakery/components/product-modal.tsx +104 -0
  88. package/templates/storefront-bakery/components/providers.tsx +35 -0
  89. package/templates/storefront-bakery/components/store-product-card.tsx +87 -0
  90. package/templates/storefront-bakery/lib/brand.ts +570 -0
  91. package/templates/storefront-bakery/lib/cart.ts +12 -0
  92. package/templates/storefront-bakery/next.config.ts +42 -0
  93. package/templates/storefront-bakery/package.json +35 -0
  94. package/templates/storefront-bakery/postcss.config.mjs +7 -0
  95. package/templates/storefront-bakery/tsconfig.json +23 -0
  96. package/templates/storefront-bakery/vitest.config.ts +9 -0
  97. package/templates/storefront-fashion/.claude/skills/cimplify-storefront/SKILL.md +145 -0
  98. package/templates/storefront-fashion/.cursor/rules/cimplify-storefront.mdc +25 -0
  99. package/templates/storefront-fashion/.env.example +16 -0
  100. package/templates/storefront-fashion/AGENTS.md +126 -0
  101. package/templates/storefront-fashion/CLAUDE.md +22 -0
  102. package/templates/storefront-fashion/README.md +77 -0
  103. package/templates/storefront-fashion/__tests__/brand.test.ts +4 -0
  104. package/templates/storefront-fashion/__tests__/cart-flow.test.ts +55 -0
  105. package/templates/storefront-fashion/__tests__/contract.test.ts +4 -0
  106. package/templates/storefront-fashion/app/about/page.tsx +41 -0
  107. package/templates/storefront-fashion/app/accessibility/page.tsx +11 -0
  108. package/templates/storefront-fashion/app/account/addresses/page.tsx +21 -0
  109. package/templates/storefront-fashion/app/account/orders/page.tsx +21 -0
  110. package/templates/storefront-fashion/app/account/page.tsx +22 -0
  111. package/templates/storefront-fashion/app/account/settings/page.tsx +21 -0
  112. package/templates/storefront-fashion/app/cart/page.tsx +9 -0
  113. package/templates/storefront-fashion/app/categories/[slug]/listing-client.tsx +19 -0
  114. package/templates/storefront-fashion/app/categories/[slug]/page.tsx +130 -0
  115. package/templates/storefront-fashion/app/checkout/page.tsx +17 -0
  116. package/templates/storefront-fashion/app/collections/[slug]/listing-client.tsx +20 -0
  117. package/templates/storefront-fashion/app/collections/[slug]/page.tsx +130 -0
  118. package/templates/storefront-fashion/app/contact/contact-form.tsx +109 -0
  119. package/templates/storefront-fashion/app/contact/page.tsx +54 -0
  120. package/templates/storefront-fashion/app/error.tsx +61 -0
  121. package/templates/storefront-fashion/app/faq/page.tsx +46 -0
  122. package/templates/storefront-fashion/app/globals.css +46 -0
  123. package/templates/storefront-fashion/app/layout.tsx +78 -0
  124. package/templates/storefront-fashion/app/llms.txt/route.ts +94 -0
  125. package/templates/storefront-fashion/app/login/page.tsx +17 -0
  126. package/templates/storefront-fashion/app/lookbook/page.tsx +132 -0
  127. package/templates/storefront-fashion/app/not-found.tsx +39 -0
  128. package/templates/storefront-fashion/app/opensearch.xml/route.ts +37 -0
  129. package/templates/storefront-fashion/app/orders/[id]/page.tsx +24 -0
  130. package/templates/storefront-fashion/app/page.tsx +183 -0
  131. package/templates/storefront-fashion/app/privacy/page.tsx +44 -0
  132. package/templates/storefront-fashion/app/products/[slug]/page.tsx +165 -0
  133. package/templates/storefront-fashion/app/products/[slug]/product-detail.tsx +70 -0
  134. package/templates/storefront-fashion/app/returns/page.tsx +11 -0
  135. package/templates/storefront-fashion/app/robots.ts +18 -0
  136. package/templates/storefront-fashion/app/search/page.tsx +38 -0
  137. package/templates/storefront-fashion/app/search/search-client.tsx +7 -0
  138. package/templates/storefront-fashion/app/shipping/page.tsx +16 -0
  139. package/templates/storefront-fashion/app/shop/page.tsx +63 -0
  140. package/templates/storefront-fashion/app/shop/shop-client.tsx +32 -0
  141. package/templates/storefront-fashion/app/signup/page.tsx +17 -0
  142. package/templates/storefront-fashion/app/sitemap-page/page.tsx +167 -0
  143. package/templates/storefront-fashion/app/sitemap.ts +59 -0
  144. package/templates/storefront-fashion/app/size-guide/page.tsx +155 -0
  145. package/templates/storefront-fashion/app/terms/page.tsx +44 -0
  146. package/templates/storefront-fashion/app/track-order/page.tsx +24 -0
  147. package/templates/storefront-fashion/app/track-order/track-order-form.tsx +69 -0
  148. package/templates/storefront-fashion/components/account-iframe.tsx +13 -0
  149. package/templates/storefront-fashion/components/brand-marquee.tsx +27 -0
  150. package/templates/storefront-fashion/components/cart-drawer.tsx +14 -0
  151. package/templates/storefront-fashion/components/cart-pill.tsx +36 -0
  152. package/templates/storefront-fashion/components/category-grid.tsx +28 -0
  153. package/templates/storefront-fashion/components/category-tiles.tsx +104 -0
  154. package/templates/storefront-fashion/components/collection-strip.tsx +45 -0
  155. package/templates/storefront-fashion/components/feature-hero.tsx +82 -0
  156. package/templates/storefront-fashion/components/footer.tsx +153 -0
  157. package/templates/storefront-fashion/components/header.tsx +43 -0
  158. package/templates/storefront-fashion/components/hero.tsx +28 -0
  159. package/templates/storefront-fashion/components/nav-link.tsx +20 -0
  160. package/templates/storefront-fashion/components/newsletter.tsx +50 -0
  161. package/templates/storefront-fashion/components/policy-page.tsx +49 -0
  162. package/templates/storefront-fashion/components/promo-banner.tsx +41 -0
  163. package/templates/storefront-fashion/components/providers.tsx +35 -0
  164. package/templates/storefront-fashion/components/section-heading.tsx +37 -0
  165. package/templates/storefront-fashion/components/store-product-card.tsx +87 -0
  166. package/templates/storefront-fashion/components/trade-in-cta.tsx +54 -0
  167. package/templates/storefront-fashion/components/trust-bar.tsx +66 -0
  168. package/templates/storefront-fashion/e2e/visual.spec.ts +52 -0
  169. package/templates/storefront-fashion/lib/brand.ts +518 -0
  170. package/templates/storefront-fashion/lib/cart.ts +12 -0
  171. package/templates/storefront-fashion/next.config.ts +42 -0
  172. package/templates/storefront-fashion/package.json +38 -0
  173. package/templates/storefront-fashion/playwright.config.ts +48 -0
  174. package/templates/storefront-fashion/postcss.config.mjs +7 -0
  175. package/templates/storefront-fashion/tsconfig.json +23 -0
  176. package/templates/storefront-fashion/vitest.config.ts +9 -0
  177. package/templates/storefront-grocery/.claude/skills/cimplify-storefront/SKILL.md +145 -0
  178. package/templates/storefront-grocery/.cursor/rules/cimplify-storefront.mdc +25 -0
  179. package/templates/storefront-grocery/.env.example +16 -0
  180. package/templates/storefront-grocery/AGENTS.md +96 -0
  181. package/templates/storefront-grocery/CLAUDE.md +22 -0
  182. package/templates/storefront-grocery/README.md +73 -0
  183. package/templates/storefront-grocery/__tests__/brand.test.ts +4 -0
  184. package/templates/storefront-grocery/__tests__/cart-flow.test.ts +4 -0
  185. package/templates/storefront-grocery/__tests__/contract.test.ts +4 -0
  186. package/templates/storefront-grocery/app/about/page.tsx +38 -0
  187. package/templates/storefront-grocery/app/accessibility/page.tsx +11 -0
  188. package/templates/storefront-grocery/app/account/addresses/page.tsx +21 -0
  189. package/templates/storefront-grocery/app/account/orders/page.tsx +21 -0
  190. package/templates/storefront-grocery/app/account/page.tsx +22 -0
  191. package/templates/storefront-grocery/app/account/settings/page.tsx +21 -0
  192. package/templates/storefront-grocery/app/cart/page.tsx +9 -0
  193. package/templates/storefront-grocery/app/categories/[slug]/listing-client.tsx +19 -0
  194. package/templates/storefront-grocery/app/categories/[slug]/page.tsx +118 -0
  195. package/templates/storefront-grocery/app/checkout/page.tsx +17 -0
  196. package/templates/storefront-grocery/app/collections/[slug]/listing-client.tsx +20 -0
  197. package/templates/storefront-grocery/app/collections/[slug]/page.tsx +118 -0
  198. package/templates/storefront-grocery/app/contact/contact-form.tsx +109 -0
  199. package/templates/storefront-grocery/app/contact/page.tsx +54 -0
  200. package/templates/storefront-grocery/app/error.tsx +60 -0
  201. package/templates/storefront-grocery/app/faq/page.tsx +46 -0
  202. package/templates/storefront-grocery/app/globals.css +45 -0
  203. package/templates/storefront-grocery/app/layout.tsx +77 -0
  204. package/templates/storefront-grocery/app/llms.txt/route.ts +94 -0
  205. package/templates/storefront-grocery/app/login/page.tsx +17 -0
  206. package/templates/storefront-grocery/app/not-found.tsx +39 -0
  207. package/templates/storefront-grocery/app/opensearch.xml/route.ts +37 -0
  208. package/templates/storefront-grocery/app/orders/[id]/page.tsx +21 -0
  209. package/templates/storefront-grocery/app/page.tsx +97 -0
  210. package/templates/storefront-grocery/app/privacy/page.tsx +44 -0
  211. package/templates/storefront-grocery/app/returns/page.tsx +11 -0
  212. package/templates/storefront-grocery/app/robots.ts +18 -0
  213. package/templates/storefront-grocery/app/search/page.tsx +38 -0
  214. package/templates/storefront-grocery/app/search/search-client.tsx +7 -0
  215. package/templates/storefront-grocery/app/shipping/page.tsx +16 -0
  216. package/templates/storefront-grocery/app/shop/page.tsx +31 -0
  217. package/templates/storefront-grocery/app/shop/shop-client.tsx +27 -0
  218. package/templates/storefront-grocery/app/signup/page.tsx +17 -0
  219. package/templates/storefront-grocery/app/sitemap-page/page.tsx +167 -0
  220. package/templates/storefront-grocery/app/sitemap.ts +62 -0
  221. package/templates/storefront-grocery/app/terms/page.tsx +44 -0
  222. package/templates/storefront-grocery/app/track-order/page.tsx +24 -0
  223. package/templates/storefront-grocery/app/track-order/track-order-form.tsx +69 -0
  224. package/templates/storefront-grocery/components/account-iframe.tsx +13 -0
  225. package/templates/storefront-grocery/components/cart-drawer.tsx +14 -0
  226. package/templates/storefront-grocery/components/cart-pill.tsx +36 -0
  227. package/templates/storefront-grocery/components/category-grid.tsx +28 -0
  228. package/templates/storefront-grocery/components/collection-strip.tsx +45 -0
  229. package/templates/storefront-grocery/components/footer.tsx +148 -0
  230. package/templates/storefront-grocery/components/header.tsx +43 -0
  231. package/templates/storefront-grocery/components/hero.tsx +25 -0
  232. package/templates/storefront-grocery/components/nav-link.tsx +20 -0
  233. package/templates/storefront-grocery/components/policy-page.tsx +49 -0
  234. package/templates/storefront-grocery/components/product-modal.tsx +104 -0
  235. package/templates/storefront-grocery/components/providers.tsx +35 -0
  236. package/templates/storefront-grocery/components/store-product-card.tsx +87 -0
  237. package/templates/storefront-grocery/lib/brand.ts +375 -0
  238. package/templates/storefront-grocery/lib/cart.ts +12 -0
  239. package/templates/storefront-grocery/next.config.ts +42 -0
  240. package/templates/storefront-grocery/package.json +35 -0
  241. package/templates/storefront-grocery/postcss.config.mjs +7 -0
  242. package/templates/storefront-grocery/tsconfig.json +23 -0
  243. package/templates/storefront-grocery/vitest.config.ts +9 -0
  244. package/templates/storefront-restaurant/.claude/skills/cimplify-storefront/SKILL.md +145 -0
  245. package/templates/storefront-restaurant/.cursor/rules/cimplify-storefront.mdc +25 -0
  246. package/templates/storefront-restaurant/.env.example +16 -0
  247. package/templates/storefront-restaurant/AGENTS.md +102 -0
  248. package/templates/storefront-restaurant/CLAUDE.md +22 -0
  249. package/templates/storefront-restaurant/README.md +73 -0
  250. package/templates/storefront-restaurant/__tests__/brand.test.ts +4 -0
  251. package/templates/storefront-restaurant/__tests__/cart-flow.test.ts +4 -0
  252. package/templates/storefront-restaurant/__tests__/contract.test.ts +4 -0
  253. package/templates/storefront-restaurant/app/about/page.tsx +38 -0
  254. package/templates/storefront-restaurant/app/accessibility/page.tsx +11 -0
  255. package/templates/storefront-restaurant/app/account/addresses/page.tsx +21 -0
  256. package/templates/storefront-restaurant/app/account/orders/page.tsx +21 -0
  257. package/templates/storefront-restaurant/app/account/page.tsx +22 -0
  258. package/templates/storefront-restaurant/app/account/settings/page.tsx +21 -0
  259. package/templates/storefront-restaurant/app/cart/page.tsx +9 -0
  260. package/templates/storefront-restaurant/app/categories/[slug]/listing-client.tsx +19 -0
  261. package/templates/storefront-restaurant/app/categories/[slug]/page.tsx +118 -0
  262. package/templates/storefront-restaurant/app/checkout/page.tsx +17 -0
  263. package/templates/storefront-restaurant/app/collections/[slug]/listing-client.tsx +20 -0
  264. package/templates/storefront-restaurant/app/collections/[slug]/page.tsx +118 -0
  265. package/templates/storefront-restaurant/app/contact/contact-form.tsx +109 -0
  266. package/templates/storefront-restaurant/app/contact/page.tsx +54 -0
  267. package/templates/storefront-restaurant/app/error.tsx +60 -0
  268. package/templates/storefront-restaurant/app/faq/page.tsx +46 -0
  269. package/templates/storefront-restaurant/app/globals.css +44 -0
  270. package/templates/storefront-restaurant/app/layout.tsx +82 -0
  271. package/templates/storefront-restaurant/app/llms.txt/route.ts +94 -0
  272. package/templates/storefront-restaurant/app/login/page.tsx +17 -0
  273. package/templates/storefront-restaurant/app/not-found.tsx +39 -0
  274. package/templates/storefront-restaurant/app/opensearch.xml/route.ts +37 -0
  275. package/templates/storefront-restaurant/app/orders/[id]/page.tsx +21 -0
  276. package/templates/storefront-restaurant/app/page.tsx +97 -0
  277. package/templates/storefront-restaurant/app/privacy/page.tsx +44 -0
  278. package/templates/storefront-restaurant/app/reservations/page.tsx +66 -0
  279. package/templates/storefront-restaurant/app/reservations/reservations-client.tsx +234 -0
  280. package/templates/storefront-restaurant/app/returns/page.tsx +11 -0
  281. package/templates/storefront-restaurant/app/robots.ts +18 -0
  282. package/templates/storefront-restaurant/app/search/page.tsx +38 -0
  283. package/templates/storefront-restaurant/app/search/search-client.tsx +7 -0
  284. package/templates/storefront-restaurant/app/shipping/page.tsx +16 -0
  285. package/templates/storefront-restaurant/app/shop/page.tsx +31 -0
  286. package/templates/storefront-restaurant/app/shop/shop-client.tsx +27 -0
  287. package/templates/storefront-restaurant/app/signup/page.tsx +17 -0
  288. package/templates/storefront-restaurant/app/sitemap-page/page.tsx +167 -0
  289. package/templates/storefront-restaurant/app/sitemap.ts +62 -0
  290. package/templates/storefront-restaurant/app/terms/page.tsx +44 -0
  291. package/templates/storefront-restaurant/app/track-order/page.tsx +24 -0
  292. package/templates/storefront-restaurant/app/track-order/track-order-form.tsx +69 -0
  293. package/templates/storefront-restaurant/components/account-iframe.tsx +13 -0
  294. package/templates/storefront-restaurant/components/cart-drawer.tsx +14 -0
  295. package/templates/storefront-restaurant/components/cart-pill.tsx +36 -0
  296. package/templates/storefront-restaurant/components/category-grid.tsx +28 -0
  297. package/templates/storefront-restaurant/components/collection-strip.tsx +45 -0
  298. package/templates/storefront-restaurant/components/footer.tsx +148 -0
  299. package/templates/storefront-restaurant/components/header.tsx +43 -0
  300. package/templates/storefront-restaurant/components/hero.tsx +25 -0
  301. package/templates/storefront-restaurant/components/nav-link.tsx +20 -0
  302. package/templates/storefront-restaurant/components/policy-page.tsx +49 -0
  303. package/templates/storefront-restaurant/components/product-modal.tsx +104 -0
  304. package/templates/storefront-restaurant/components/providers.tsx +35 -0
  305. package/templates/storefront-restaurant/components/store-product-card.tsx +87 -0
  306. package/templates/storefront-restaurant/lib/brand.ts +377 -0
  307. package/templates/storefront-restaurant/lib/cart.ts +12 -0
  308. package/templates/storefront-restaurant/next.config.ts +42 -0
  309. package/templates/storefront-restaurant/package.json +35 -0
  310. package/templates/storefront-restaurant/postcss.config.mjs +7 -0
  311. package/templates/storefront-restaurant/tsconfig.json +23 -0
  312. package/templates/storefront-restaurant/vitest.config.ts +9 -0
  313. package/templates/storefront-retail/.claude/skills/cimplify-storefront/SKILL.md +145 -0
  314. package/templates/storefront-retail/.cursor/rules/cimplify-storefront.mdc +25 -0
  315. package/templates/storefront-retail/.env.example +16 -0
  316. package/templates/storefront-retail/AGENTS.md +117 -0
  317. package/templates/storefront-retail/CLAUDE.md +22 -0
  318. package/templates/storefront-retail/README.md +77 -0
  319. package/templates/storefront-retail/__tests__/brand.test.ts +4 -0
  320. package/templates/storefront-retail/__tests__/cart-flow.test.ts +4 -0
  321. package/templates/storefront-retail/__tests__/contract.test.ts +4 -0
  322. package/templates/storefront-retail/app/about/page.tsx +41 -0
  323. package/templates/storefront-retail/app/accessibility/page.tsx +11 -0
  324. package/templates/storefront-retail/app/account/addresses/page.tsx +21 -0
  325. package/templates/storefront-retail/app/account/orders/page.tsx +21 -0
  326. package/templates/storefront-retail/app/account/page.tsx +22 -0
  327. package/templates/storefront-retail/app/account/settings/page.tsx +21 -0
  328. package/templates/storefront-retail/app/cart/page.tsx +9 -0
  329. package/templates/storefront-retail/app/categories/[slug]/listing-client.tsx +19 -0
  330. package/templates/storefront-retail/app/categories/[slug]/page.tsx +130 -0
  331. package/templates/storefront-retail/app/checkout/page.tsx +17 -0
  332. package/templates/storefront-retail/app/collections/[slug]/listing-client.tsx +20 -0
  333. package/templates/storefront-retail/app/collections/[slug]/page.tsx +130 -0
  334. package/templates/storefront-retail/app/contact/contact-form.tsx +109 -0
  335. package/templates/storefront-retail/app/contact/page.tsx +54 -0
  336. package/templates/storefront-retail/app/error.tsx +61 -0
  337. package/templates/storefront-retail/app/faq/page.tsx +46 -0
  338. package/templates/storefront-retail/app/globals.css +47 -0
  339. package/templates/storefront-retail/app/layout.tsx +77 -0
  340. package/templates/storefront-retail/app/llms.txt/route.ts +94 -0
  341. package/templates/storefront-retail/app/login/page.tsx +17 -0
  342. package/templates/storefront-retail/app/not-found.tsx +39 -0
  343. package/templates/storefront-retail/app/opensearch.xml/route.ts +37 -0
  344. package/templates/storefront-retail/app/orders/[id]/page.tsx +24 -0
  345. package/templates/storefront-retail/app/page.tsx +182 -0
  346. package/templates/storefront-retail/app/privacy/page.tsx +44 -0
  347. package/templates/storefront-retail/app/products/[slug]/page.tsx +165 -0
  348. package/templates/storefront-retail/app/products/[slug]/product-detail.tsx +70 -0
  349. package/templates/storefront-retail/app/returns/page.tsx +11 -0
  350. package/templates/storefront-retail/app/robots.ts +18 -0
  351. package/templates/storefront-retail/app/search/page.tsx +38 -0
  352. package/templates/storefront-retail/app/search/search-client.tsx +7 -0
  353. package/templates/storefront-retail/app/shipping/page.tsx +16 -0
  354. package/templates/storefront-retail/app/shop/page.tsx +63 -0
  355. package/templates/storefront-retail/app/shop/shop-client.tsx +32 -0
  356. package/templates/storefront-retail/app/signup/page.tsx +17 -0
  357. package/templates/storefront-retail/app/sitemap-page/page.tsx +167 -0
  358. package/templates/storefront-retail/app/sitemap.ts +59 -0
  359. package/templates/storefront-retail/app/terms/page.tsx +44 -0
  360. package/templates/storefront-retail/app/track-order/page.tsx +24 -0
  361. package/templates/storefront-retail/app/track-order/track-order-form.tsx +69 -0
  362. package/templates/storefront-retail/components/account-iframe.tsx +13 -0
  363. package/templates/storefront-retail/components/brand-marquee.tsx +27 -0
  364. package/templates/storefront-retail/components/cart-drawer.tsx +14 -0
  365. package/templates/storefront-retail/components/cart-pill.tsx +36 -0
  366. package/templates/storefront-retail/components/category-grid.tsx +28 -0
  367. package/templates/storefront-retail/components/category-tiles.tsx +104 -0
  368. package/templates/storefront-retail/components/collection-strip.tsx +45 -0
  369. package/templates/storefront-retail/components/feature-hero.tsx +84 -0
  370. package/templates/storefront-retail/components/footer.tsx +153 -0
  371. package/templates/storefront-retail/components/header.tsx +45 -0
  372. package/templates/storefront-retail/components/hero.tsx +28 -0
  373. package/templates/storefront-retail/components/nav-link.tsx +20 -0
  374. package/templates/storefront-retail/components/newsletter.tsx +50 -0
  375. package/templates/storefront-retail/components/policy-page.tsx +49 -0
  376. package/templates/storefront-retail/components/promo-banner.tsx +41 -0
  377. package/templates/storefront-retail/components/providers.tsx +35 -0
  378. package/templates/storefront-retail/components/section-heading.tsx +37 -0
  379. package/templates/storefront-retail/components/store-product-card.tsx +87 -0
  380. package/templates/storefront-retail/components/trade-in-cta.tsx +54 -0
  381. package/templates/storefront-retail/components/trust-bar.tsx +66 -0
  382. package/templates/storefront-retail/lib/brand.ts +664 -0
  383. package/templates/storefront-retail/lib/cart.ts +12 -0
  384. package/templates/storefront-retail/next.config.ts +42 -0
  385. package/templates/storefront-retail/package.json +35 -0
  386. package/templates/storefront-retail/postcss.config.mjs +7 -0
  387. package/templates/storefront-retail/tsconfig.json +23 -0
  388. package/templates/storefront-retail/vitest.config.ts +9 -0
  389. package/templates/storefront-services/.claude/skills/cimplify-storefront/SKILL.md +145 -0
  390. package/templates/storefront-services/.cursor/rules/cimplify-storefront.mdc +25 -0
  391. package/templates/storefront-services/.env.example +16 -0
  392. package/templates/storefront-services/AGENTS.md +101 -0
  393. package/templates/storefront-services/CLAUDE.md +22 -0
  394. package/templates/storefront-services/README.md +73 -0
  395. package/templates/storefront-services/__tests__/brand.test.ts +4 -0
  396. package/templates/storefront-services/__tests__/cart-flow.test.ts +4 -0
  397. package/templates/storefront-services/__tests__/contract.test.ts +4 -0
  398. package/templates/storefront-services/app/about/page.tsx +38 -0
  399. package/templates/storefront-services/app/accessibility/page.tsx +11 -0
  400. package/templates/storefront-services/app/account/addresses/page.tsx +21 -0
  401. package/templates/storefront-services/app/account/orders/page.tsx +21 -0
  402. package/templates/storefront-services/app/account/page.tsx +22 -0
  403. package/templates/storefront-services/app/account/settings/page.tsx +21 -0
  404. package/templates/storefront-services/app/book/book-client.tsx +195 -0
  405. package/templates/storefront-services/app/book/page.tsx +65 -0
  406. package/templates/storefront-services/app/cart/page.tsx +9 -0
  407. package/templates/storefront-services/app/categories/[slug]/listing-client.tsx +19 -0
  408. package/templates/storefront-services/app/categories/[slug]/page.tsx +118 -0
  409. package/templates/storefront-services/app/checkout/page.tsx +17 -0
  410. package/templates/storefront-services/app/collections/[slug]/listing-client.tsx +20 -0
  411. package/templates/storefront-services/app/collections/[slug]/page.tsx +118 -0
  412. package/templates/storefront-services/app/contact/contact-form.tsx +109 -0
  413. package/templates/storefront-services/app/contact/page.tsx +54 -0
  414. package/templates/storefront-services/app/error.tsx +60 -0
  415. package/templates/storefront-services/app/faq/page.tsx +46 -0
  416. package/templates/storefront-services/app/globals.css +45 -0
  417. package/templates/storefront-services/app/layout.tsx +82 -0
  418. package/templates/storefront-services/app/llms.txt/route.ts +94 -0
  419. package/templates/storefront-services/app/login/page.tsx +17 -0
  420. package/templates/storefront-services/app/not-found.tsx +39 -0
  421. package/templates/storefront-services/app/opensearch.xml/route.ts +37 -0
  422. package/templates/storefront-services/app/orders/[id]/page.tsx +21 -0
  423. package/templates/storefront-services/app/page.tsx +97 -0
  424. package/templates/storefront-services/app/privacy/page.tsx +44 -0
  425. package/templates/storefront-services/app/returns/page.tsx +11 -0
  426. package/templates/storefront-services/app/robots.ts +18 -0
  427. package/templates/storefront-services/app/search/page.tsx +38 -0
  428. package/templates/storefront-services/app/search/search-client.tsx +7 -0
  429. package/templates/storefront-services/app/shipping/page.tsx +16 -0
  430. package/templates/storefront-services/app/shop/page.tsx +31 -0
  431. package/templates/storefront-services/app/shop/shop-client.tsx +27 -0
  432. package/templates/storefront-services/app/signup/page.tsx +17 -0
  433. package/templates/storefront-services/app/sitemap-page/page.tsx +167 -0
  434. package/templates/storefront-services/app/sitemap.ts +62 -0
  435. package/templates/storefront-services/app/terms/page.tsx +44 -0
  436. package/templates/storefront-services/app/track-order/page.tsx +24 -0
  437. package/templates/storefront-services/app/track-order/track-order-form.tsx +69 -0
  438. package/templates/storefront-services/components/account-iframe.tsx +13 -0
  439. package/templates/storefront-services/components/cart-drawer.tsx +14 -0
  440. package/templates/storefront-services/components/cart-pill.tsx +36 -0
  441. package/templates/storefront-services/components/category-grid.tsx +28 -0
  442. package/templates/storefront-services/components/collection-strip.tsx +45 -0
  443. package/templates/storefront-services/components/footer.tsx +148 -0
  444. package/templates/storefront-services/components/header.tsx +43 -0
  445. package/templates/storefront-services/components/hero.tsx +25 -0
  446. package/templates/storefront-services/components/nav-link.tsx +20 -0
  447. package/templates/storefront-services/components/policy-page.tsx +49 -0
  448. package/templates/storefront-services/components/product-modal.tsx +104 -0
  449. package/templates/storefront-services/components/providers.tsx +35 -0
  450. package/templates/storefront-services/components/store-product-card.tsx +87 -0
  451. package/templates/storefront-services/lib/brand.ts +396 -0
  452. package/templates/storefront-services/lib/cart.ts +12 -0
  453. package/templates/storefront-services/next.config.ts +42 -0
  454. package/templates/storefront-services/package.json +35 -0
  455. package/templates/storefront-services/postcss.config.mjs +7 -0
  456. package/templates/storefront-services/tsconfig.json +23 -0
  457. package/templates/storefront-services/vitest.config.ts +9 -0
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env node
2
+ import { REGISTRY_INDEX } from './chunk-XSWWWO6H.mjs';
3
+ import { parseArgs, flagBool } from './chunk-D7D75ONX.mjs';
4
+ import { CliError, CLI_ERROR_CODE, info, bold, dim, green, result } from './chunk-NZ4RG62Z.mjs';
5
+
6
+ // src/commands/list.ts
7
+ async function run(argv) {
8
+ const args = parseArgs(argv);
9
+ const utilitiesOnly = flagBool(args, "utilities");
10
+ const componentsOnly = flagBool(args, "components");
11
+ const index = REGISTRY_INDEX;
12
+ if (!index || !Array.isArray(index.components)) {
13
+ throw new CliError(
14
+ CLI_ERROR_CODE.NOT_FOUND,
15
+ "Embedded SDK component registry is empty.",
16
+ {
17
+ remediation: "Rebuild the CLI with the SDK present: `cd packages/sdk && bun run build && cd ../cli && bun run build`."
18
+ }
19
+ );
20
+ }
21
+ const filtered = index.components.filter((entry) => {
22
+ if (utilitiesOnly) return entry.type === "utility";
23
+ if (componentsOnly) return entry.type === "component";
24
+ return true;
25
+ });
26
+ const maxName = filtered.reduce((max, c) => Math.max(max, c.name.length), 0);
27
+ info("");
28
+ info(bold(`Available registry entries (${filtered.length})`));
29
+ info("");
30
+ for (const entry of filtered) {
31
+ const tag = entry.type === "utility" ? dim(" (utility)") : "";
32
+ info(` ${green(entry.name.padEnd(maxName))} ${entry.description}${tag}`);
33
+ }
34
+ info("");
35
+ info(dim("Eject a component into your project with `cimplify add <name>`."));
36
+ result({
37
+ count: filtered.length,
38
+ components: filtered.map((c) => ({
39
+ name: c.name,
40
+ title: c.title,
41
+ description: c.description,
42
+ type: c.type,
43
+ registryDependencies: c.registryDependencies
44
+ }))
45
+ });
46
+ }
47
+
48
+ export { run as default };
@@ -0,0 +1,276 @@
1
+ #!/usr/bin/env node
2
+ import { parseArgs, flagString, flagBool } from './chunk-D7D75ONX.mjs';
3
+ import { resolveBaseUrl, ApiClient } from './chunk-4ZVTPMUZ.mjs';
4
+ import { writeAuth } from './chunk-JJYWETGA.mjs';
5
+ import { CliError, CLI_ERROR_CODE, success, result, isJsonMode, step, info, dim } from './chunk-NZ4RG62Z.mjs';
6
+ import os from 'os';
7
+ import { randomBytes, createHash } from 'crypto';
8
+ import { createServer } from 'http';
9
+ import { spawn } from 'child_process';
10
+
11
+ var CODE_VERIFIER_BYTES = 32;
12
+ var STATE_BYTES = 16;
13
+ var LOOPBACK_HOST = "127.0.0.1";
14
+ var CALLBACK_PATH = "/callback";
15
+ var CALLBACK_TIMEOUT_MS = 10 * 60 * 1e3;
16
+ function generatePkcePair() {
17
+ const codeVerifier = base64UrlEncode(randomBytes(CODE_VERIFIER_BYTES));
18
+ const codeChallenge = base64UrlEncode(
19
+ createHash("sha256").update(codeVerifier).digest()
20
+ );
21
+ return { codeVerifier, codeChallenge, codeChallengeMethod: "S256" };
22
+ }
23
+ function generateState() {
24
+ return base64UrlEncode(randomBytes(STATE_BYTES));
25
+ }
26
+ function base64UrlEncode(buf) {
27
+ return buf.toString("base64").replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
28
+ }
29
+ var HTML_SUCCESS = (apiBaseUrl) => `<!doctype html>
30
+ <html lang="en"><head><meta charset="utf-8"><title>Cimplify CLI</title>
31
+ <style>
32
+ body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
33
+ background:#0a0a0a;color:#e5e5e5;display:flex;align-items:center;
34
+ justify-content:center;height:100vh;margin:0}
35
+ .card{background:#141414;border:1px solid #262626;border-radius:12px;
36
+ padding:32px 40px;max-width:420px;text-align:center}
37
+ .tick{color:#22c55e;font-size:32px}
38
+ h1{margin:8px 0 4px;font-size:20px;font-weight:600}
39
+ p{margin:4px 0;color:#a3a3a3;font-size:14px}
40
+ .host{color:#737373;font-family:ui-monospace,monospace;font-size:12px;margin-top:16px}
41
+ </style></head><body><div class="card">
42
+ <div class="tick">\u2713</div>
43
+ <h1>You're logged in</h1>
44
+ <p>Return to your terminal \u2014 it'll continue from here.</p>
45
+ <p>You can close this tab.</p>
46
+ <div class="host">${apiBaseUrl}</div>
47
+ </div></body></html>`;
48
+ var HTML_ERROR = (msg) => `<!doctype html>
49
+ <html lang="en"><head><meta charset="utf-8"><title>Cimplify CLI</title>
50
+ <style>body{font-family:sans-serif;padding:40px;max-width:480px;margin:auto}
51
+ h1{color:#dc2626}</style></head><body>
52
+ <h1>Sign-in failed</h1><p>${escapeHtml(msg)}</p>
53
+ <p>Return to your terminal and try <code>cimplify login</code> again.</p>
54
+ </body></html>`;
55
+ function escapeHtml(s) {
56
+ return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
57
+ }
58
+ async function startLoopbackServer(apiBaseUrl) {
59
+ let resolveCb = null;
60
+ let rejectCb = null;
61
+ const callbackPromise = new Promise((resolve, reject) => {
62
+ resolveCb = resolve;
63
+ rejectCb = reject;
64
+ });
65
+ const server = createServer((req, res) => {
66
+ if (!req.url) {
67
+ res.writeHead(400).end();
68
+ return;
69
+ }
70
+ const parsed = new URL(req.url, `http://${LOOPBACK_HOST}`);
71
+ if (parsed.pathname !== CALLBACK_PATH) {
72
+ res.writeHead(404).end("Not Found");
73
+ return;
74
+ }
75
+ const code = parsed.searchParams.get("code");
76
+ const state = parsed.searchParams.get("state");
77
+ const error = parsed.searchParams.get("error");
78
+ if (error) {
79
+ res.writeHead(400, { "Content-Type": "text/html; charset=utf-8" }).end(HTML_ERROR(error));
80
+ rejectCb?.(new CliError(CLI_ERROR_CODE.UNAUTHORIZED, `OAuth error: ${error}`));
81
+ return;
82
+ }
83
+ if (!code || !state) {
84
+ res.writeHead(400, { "Content-Type": "text/html; charset=utf-8" }).end(HTML_ERROR("Missing code or state in callback"));
85
+ rejectCb?.(new CliError(CLI_ERROR_CODE.UNAUTHORIZED, "Malformed callback"));
86
+ return;
87
+ }
88
+ res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" }).end(HTML_SUCCESS(apiBaseUrl));
89
+ resolveCb?.({ code, state });
90
+ });
91
+ await new Promise((resolve, reject) => {
92
+ server.once("error", reject);
93
+ server.listen(0, LOOPBACK_HOST, resolve);
94
+ });
95
+ const address = server.address();
96
+ if (!address || typeof address === "string") {
97
+ server.close();
98
+ throw new CliError(
99
+ CLI_ERROR_CODE.UNAUTHORIZED,
100
+ "Could not bind loopback server"
101
+ );
102
+ }
103
+ const redirectUri = `http://${LOOPBACK_HOST}:${address.port}${CALLBACK_PATH}`;
104
+ return {
105
+ redirectUri,
106
+ async awaitCallback(timeoutMs = CALLBACK_TIMEOUT_MS) {
107
+ let timer = null;
108
+ const timeoutPromise = new Promise((_, reject) => {
109
+ timer = setTimeout(() => {
110
+ reject(
111
+ new CliError(
112
+ CLI_ERROR_CODE.TIMEOUT,
113
+ `Login timed out after ${Math.round(timeoutMs / 1e3)}s`
114
+ )
115
+ );
116
+ }, timeoutMs);
117
+ });
118
+ try {
119
+ return await Promise.race([callbackPromise, timeoutPromise]);
120
+ } finally {
121
+ if (timer) clearTimeout(timer);
122
+ server.close();
123
+ }
124
+ },
125
+ close() {
126
+ server.close();
127
+ }
128
+ };
129
+ }
130
+ function openBrowser(url) {
131
+ const platformCommand = (() => {
132
+ switch (process.platform) {
133
+ case "darwin":
134
+ return { cmd: "open", args: [url] };
135
+ case "win32":
136
+ return { cmd: "cmd", args: ["/c", "start", '""', url] };
137
+ default:
138
+ return { cmd: "xdg-open", args: [url] };
139
+ }
140
+ })();
141
+ try {
142
+ const child = spawn(platformCommand.cmd, platformCommand.args, {
143
+ detached: true,
144
+ stdio: "ignore"
145
+ });
146
+ child.on("error", () => {
147
+ });
148
+ child.unref();
149
+ } catch {
150
+ }
151
+ }
152
+
153
+ // src/commands/login.ts
154
+ var FLAG_API_KEY = "api-key";
155
+ var FLAG_BASE_URL = "base-url";
156
+ var FLAG_NO_BROWSER = "no-browser";
157
+ var ENDPOINT_AUTH_ME = "/v1/auth/me";
158
+ var ENDPOINT_CLI_START = "/v1/auth/cli/start";
159
+ var ENDPOINT_CLI_TOKEN = "/v1/auth/cli/token";
160
+ var KEY_PREFIX_DK = "dk_";
161
+ var KEY_PREFIX_SK = "sk_";
162
+ var PRODUCT_NAME = "cimplify-cli";
163
+ async function run(argv) {
164
+ const args = parseArgs(argv);
165
+ const baseUrl = resolveBaseUrl(flagString(args, FLAG_BASE_URL));
166
+ const explicitKey = flagString(args, FLAG_API_KEY);
167
+ if (explicitKey) {
168
+ await loginWithKey(baseUrl, explicitKey);
169
+ return;
170
+ }
171
+ await loginWithBrowser(baseUrl, flagBool(args, FLAG_NO_BROWSER));
172
+ }
173
+ async function loginWithKey(baseUrl, apiKey) {
174
+ if (!apiKey.startsWith(KEY_PREFIX_DK) && !apiKey.startsWith(KEY_PREFIX_SK)) {
175
+ throw new CliError(
176
+ CLI_ERROR_CODE.INVALID_INPUT,
177
+ `API key must start with "${KEY_PREFIX_DK}" or "${KEY_PREFIX_SK}".`
178
+ );
179
+ }
180
+ const client = ApiClient.withKey(apiKey, baseUrl);
181
+ const me = await client.get(ENDPOINT_AUTH_ME);
182
+ await writeAuth({
183
+ apiKey,
184
+ apiBaseUrl: baseUrl,
185
+ accountId: me.id,
186
+ businessId: me.business_id,
187
+ email: me.email,
188
+ name: me.name,
189
+ savedAt: (/* @__PURE__ */ new Date()).toISOString()
190
+ });
191
+ success(`Logged in as ${me.email ?? me.name ?? me.id} (business ${me.business_id})`);
192
+ result({
193
+ logged_in: true,
194
+ account: { id: me.id, email: me.email ?? null, name: me.name ?? null },
195
+ business: { id: me.business_id },
196
+ method: "api_key"
197
+ });
198
+ }
199
+ async function loginWithBrowser(baseUrl, noBrowser) {
200
+ if (isJsonMode()) {
201
+ throw new CliError(
202
+ CLI_ERROR_CODE.INTERACTIVE_REQUIRED,
203
+ "browser login is not supported in --json mode",
204
+ { remediation: "pass --api-key dk_\u2026 (create one in the dashboard or via `cimplify auth keys create`)" }
205
+ );
206
+ }
207
+ const pkce = generatePkcePair();
208
+ const state = generateState();
209
+ const loopback = await startLoopbackServer(baseUrl);
210
+ const startBody = {
211
+ code_challenge: pkce.codeChallenge,
212
+ code_challenge_method: pkce.codeChallengeMethod,
213
+ redirect_uri: loopback.redirectUri,
214
+ state,
215
+ client_meta: {
216
+ hostname: os.hostname(),
217
+ platform: process.platform,
218
+ arch: process.arch,
219
+ node_version: process.version,
220
+ product: PRODUCT_NAME
221
+ }
222
+ };
223
+ const unauthClient = ApiClient.unauthenticated(baseUrl);
224
+ const startResponse = await unauthClient.post(
225
+ ENDPOINT_CLI_START,
226
+ startBody
227
+ );
228
+ step("Opening browser to authorize this CLI...");
229
+ info(dim(startResponse.approval_url));
230
+ if (!noBrowser) {
231
+ openBrowser(startResponse.approval_url);
232
+ } else {
233
+ info("");
234
+ info(dim("Open the URL above in any browser to continue."));
235
+ }
236
+ let callback;
237
+ try {
238
+ callback = await loopback.awaitCallback(startResponse.expires_in_secs * 1e3);
239
+ } catch (err) {
240
+ loopback.close();
241
+ throw err;
242
+ }
243
+ if (callback.state !== state) {
244
+ throw new CliError(
245
+ CLI_ERROR_CODE.UNAUTHORIZED,
246
+ "OAuth state mismatch. Possible CSRF attempt \u2014 try again."
247
+ );
248
+ }
249
+ const token = await unauthClient.post(ENDPOINT_CLI_TOKEN, {
250
+ auth_code: callback.code,
251
+ code_verifier: pkce.codeVerifier,
252
+ redirect_uri: loopback.redirectUri
253
+ });
254
+ const meClient = ApiClient.withKey(token.access_token, baseUrl);
255
+ const me = await meClient.get(ENDPOINT_AUTH_ME);
256
+ await writeAuth({
257
+ apiKey: token.access_token,
258
+ apiBaseUrl: baseUrl,
259
+ accountId: me.id,
260
+ businessId: me.business_id,
261
+ email: me.email,
262
+ name: me.name,
263
+ savedAt: (/* @__PURE__ */ new Date()).toISOString()
264
+ });
265
+ success(
266
+ `Logged in as ${me.email ?? me.name ?? me.id} (business ${me.business_id})`
267
+ );
268
+ result({
269
+ logged_in: true,
270
+ account: { id: me.id, email: me.email ?? null, name: me.name ?? null },
271
+ business: { id: me.business_id },
272
+ method: "oauth_pkce"
273
+ });
274
+ }
275
+
276
+ export { run as default };
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env node
2
+ import { clearAuth } from './chunk-JJYWETGA.mjs';
3
+ import { success, info, result } from './chunk-NZ4RG62Z.mjs';
4
+
5
+ // src/commands/logout.ts
6
+ async function run(_argv) {
7
+ const removed = await clearAuth();
8
+ if (removed) {
9
+ success("Logged out.");
10
+ } else {
11
+ info("Not logged in.");
12
+ }
13
+ result({ logged_out: removed });
14
+ }
15
+
16
+ export { run as default };
@@ -0,0 +1,95 @@
1
+ #!/usr/bin/env node
2
+ import { TERMINAL_DEPLOYMENT_STATUSES } from './chunk-MQMNWLMU.mjs';
3
+ import { parseArgs, flagString, flagBool } from './chunk-D7D75ONX.mjs';
4
+ import { ApiClient } from './chunk-4ZVTPMUZ.mjs';
5
+ import { readAuth, readProjectLink, readProjectState } from './chunk-JJYWETGA.mjs';
6
+ import { CliError, CLI_ERROR_CODE, isJsonMode, failure, result, red } from './chunk-NZ4RG62Z.mjs';
7
+
8
+ // src/commands/logs.ts
9
+ var FLAG_DEPLOYMENT = "deployment";
10
+ var FLAG_FOLLOW = "follow";
11
+ var POLL_INTERVAL_MS = 1e3;
12
+ var POLL_MAX_MS = 60 * 60 * 1e3;
13
+ function progressEndpoint(businessId, projectId, deploymentId) {
14
+ return `/v1/businesses/${encodeURIComponent(businessId)}/projects/${encodeURIComponent(projectId)}/deployments/${encodeURIComponent(deploymentId)}/progress`;
15
+ }
16
+ function nextChunk(cursor, full) {
17
+ if (!full) return "";
18
+ if (full.length <= cursor.printed) return "";
19
+ const chunk = full.slice(cursor.printed);
20
+ cursor.printed = full.length;
21
+ return chunk;
22
+ }
23
+ function sleep(ms) {
24
+ return new Promise((resolve) => setTimeout(resolve, ms));
25
+ }
26
+ async function run(argv) {
27
+ const args = parseArgs(argv);
28
+ const auth = await readAuth();
29
+ const link = await readProjectLink();
30
+ const client = ApiClient.fromAuth(auth);
31
+ let deploymentId = flagString(args, FLAG_DEPLOYMENT);
32
+ if (!deploymentId) {
33
+ const state = await readProjectState();
34
+ deploymentId = state?.lastDeploymentId;
35
+ }
36
+ if (!deploymentId) {
37
+ throw new CliError(
38
+ CLI_ERROR_CODE.INVALID_INPUT,
39
+ "No deployment specified and no recent deployment in state.\nPass --deployment <id> or run `cimplify deploy` first."
40
+ );
41
+ }
42
+ const endpoint = progressEndpoint(link.businessId, link.projectId, deploymentId);
43
+ const follow = flagBool(args, FLAG_FOLLOW);
44
+ const json = isJsonMode();
45
+ if (!follow) {
46
+ const progress = await client.get(endpoint);
47
+ if (!json) {
48
+ if (progress.build_logs) process.stdout.write(progress.build_logs);
49
+ if (progress.error_message) failure(progress.error_message);
50
+ }
51
+ result({
52
+ deployment_id: deploymentId,
53
+ status: progress.status,
54
+ build_logs: progress.build_logs ?? null,
55
+ error_message: progress.error_message ?? null
56
+ });
57
+ return;
58
+ }
59
+ const cursor = { printed: 0 };
60
+ const startedAt = Date.now();
61
+ let lastErrorMessage;
62
+ let finalProgress = null;
63
+ while (true) {
64
+ const progress = await client.get(endpoint);
65
+ if (!json) {
66
+ const chunk = nextChunk(cursor, progress.build_logs);
67
+ if (chunk.length > 0) process.stdout.write(chunk);
68
+ if (progress.error_message && progress.error_message !== lastErrorMessage) {
69
+ process.stdout.write(`
70
+ ${red(progress.error_message)}
71
+ `);
72
+ lastErrorMessage = progress.error_message;
73
+ }
74
+ }
75
+ if (TERMINAL_DEPLOYMENT_STATUSES.has(progress.status)) {
76
+ finalProgress = progress;
77
+ break;
78
+ }
79
+ if (Date.now() - startedAt > POLL_MAX_MS) {
80
+ throw new CliError(
81
+ CLI_ERROR_CODE.NETWORK_ERROR,
82
+ "Logs polling timed out (1 hour). Re-run `cimplify logs --follow` to resume."
83
+ );
84
+ }
85
+ await sleep(POLL_INTERVAL_MS);
86
+ }
87
+ result({
88
+ deployment_id: deploymentId,
89
+ status: finalProgress.status,
90
+ build_logs: finalProgress.build_logs ?? null,
91
+ error_message: finalProgress.error_message ?? null
92
+ });
93
+ }
94
+
95
+ export { run as default, nextChunk };
@@ -0,0 +1,164 @@
1
+ #!/usr/bin/env node
2
+ import { REPO_PROVIDER } from './chunk-MQMNWLMU.mjs';
3
+ import { parseArgs, flagString, flagBool } from './chunk-D7D75ONX.mjs';
4
+ import { ApiClient } from './chunk-4ZVTPMUZ.mjs';
5
+ import { readAuth } from './chunk-JJYWETGA.mjs';
6
+ import { CliError, CLI_ERROR_CODE, info, dim, result, bold, success } from './chunk-NZ4RG62Z.mjs';
7
+
8
+ // src/commands/projects.ts
9
+ var SUB_LS = "ls";
10
+ var SUB_LIST = "list";
11
+ var SUB_CREATE = "create";
12
+ var FLAG_NO_REPO = "no-repo";
13
+ var FLAG_CONNECT = "connect";
14
+ var PROJECT_TYPE_DEFAULT = "nextjs-app";
15
+ var COL_GAP = " ";
16
+ function projectsEndpoint(businessId) {
17
+ return `/v1/businesses/${encodeURIComponent(businessId)}/projects`;
18
+ }
19
+ function provisionRepoEndpoint(businessId, projectId) {
20
+ return `/v1/businesses/${encodeURIComponent(businessId)}/projects/${encodeURIComponent(projectId)}/repo/provision`;
21
+ }
22
+ function connectRepoEndpoint(businessId, projectId) {
23
+ return `/v1/businesses/${encodeURIComponent(businessId)}/projects/${encodeURIComponent(projectId)}/repo/connect`;
24
+ }
25
+ function detectProviderFromUrl(url) {
26
+ try {
27
+ const parsed = new URL(url);
28
+ if (parsed.hostname === "git.freestyle.sh") return REPO_PROVIDER.FREESTYLE;
29
+ if (parsed.hostname === "github.com" || parsed.hostname.endsWith(".github.com")) {
30
+ return REPO_PROVIDER.GITHUB;
31
+ }
32
+ if (parsed.hostname.includes("gitea")) return REPO_PROVIDER.GITEA;
33
+ } catch {
34
+ }
35
+ return REPO_PROVIDER.EXTERNAL;
36
+ }
37
+ async function run(argv) {
38
+ const args = parseArgs(argv);
39
+ const sub = args.positional[0];
40
+ if (!sub) {
41
+ throw new CliError(
42
+ CLI_ERROR_CODE.INVALID_INPUT,
43
+ `Usage: cimplify projects <${SUB_LS}|${SUB_CREATE}>`
44
+ );
45
+ }
46
+ const auth = await readAuth();
47
+ const client = ApiClient.fromAuth(auth);
48
+ if (sub === SUB_LS || sub === SUB_LIST) {
49
+ await listProjects(client, auth.businessId);
50
+ return;
51
+ }
52
+ if (sub === SUB_CREATE) {
53
+ const name = args.positional[1];
54
+ if (!name) {
55
+ throw new CliError(
56
+ CLI_ERROR_CODE.INVALID_INPUT,
57
+ `Usage: cimplify projects ${SUB_CREATE} <name> [--no-repo | --connect <url>]`
58
+ );
59
+ }
60
+ await createProject(client, auth.businessId, name, {
61
+ noRepo: flagBool(args, FLAG_NO_REPO),
62
+ connectRemote: flagString(args, FLAG_CONNECT)
63
+ });
64
+ return;
65
+ }
66
+ throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, `Unknown subcommand "${sub}"`);
67
+ }
68
+ async function listProjects(client, businessId) {
69
+ const projects = await client.get(projectsEndpoint(businessId));
70
+ if (projects.length === 0) {
71
+ info(dim("No projects yet. Create one: `cimplify projects create <name>`"));
72
+ result({ projects: [] });
73
+ return;
74
+ }
75
+ const idWidth = Math.max(...projects.map((p) => p.id.length));
76
+ const nameWidth = Math.max(...projects.map((p) => p.name.length));
77
+ info(
78
+ bold(
79
+ [
80
+ "ID".padEnd(idWidth),
81
+ "NAME".padEnd(nameWidth),
82
+ "TYPE"
83
+ ].join(COL_GAP)
84
+ )
85
+ );
86
+ for (const p of projects) {
87
+ info(
88
+ [
89
+ p.id.padEnd(idWidth),
90
+ p.name.padEnd(nameWidth),
91
+ p.project_type ?? ""
92
+ ].join(COL_GAP)
93
+ );
94
+ }
95
+ result({
96
+ projects: projects.map((p) => ({
97
+ id: p.id,
98
+ name: p.name,
99
+ project_type: p.project_type ?? null
100
+ }))
101
+ });
102
+ }
103
+ async function createProject(client, businessId, name, options = {}) {
104
+ if (options.noRepo && options.connectRemote) {
105
+ throw new CliError(
106
+ CLI_ERROR_CODE.INVALID_INPUT,
107
+ "Cannot pass both --no-repo and --connect."
108
+ );
109
+ }
110
+ const body = { name, project_type: PROJECT_TYPE_DEFAULT };
111
+ const project = await client.post(projectsEndpoint(businessId), body);
112
+ success(`Created project ${project.name} (${project.id})`);
113
+ if (options.noRepo) {
114
+ info(dim("Skipped repo provisioning (--no-repo). Use `cimplify repo provision` later."));
115
+ info(dim(`Link locally: cimplify link ${project.id}`));
116
+ result({
117
+ project: { id: project.id, name: project.name },
118
+ repo: null
119
+ });
120
+ return;
121
+ }
122
+ if (options.connectRemote) {
123
+ const provider = detectProviderFromUrl(options.connectRemote);
124
+ if (provider === REPO_PROVIDER.FREESTYLE) {
125
+ throw new CliError(
126
+ CLI_ERROR_CODE.INVALID_INPUT,
127
+ "Cannot connect a Freestyle URL \u2014 Freestyle repos are provisioned, not connected."
128
+ );
129
+ }
130
+ const repoBody = {
131
+ provider,
132
+ remote_url: options.connectRemote
133
+ };
134
+ const repo2 = await client.post(
135
+ connectRepoEndpoint(businessId, project.id),
136
+ repoBody
137
+ );
138
+ success(`Connected ${repo2.provider} remote ${repo2.remote_url}`);
139
+ info(dim(`Link locally: cimplify link ${project.id}`));
140
+ result({
141
+ project: { id: project.id, name: project.name },
142
+ repo: { provider: repo2.provider, id: repo2.id, remote_url: repo2.remote_url, default_branch: repo2.default_branch }
143
+ });
144
+ return;
145
+ }
146
+ const repo = await client.post(
147
+ provisionRepoEndpoint(businessId, project.id),
148
+ {}
149
+ );
150
+ success(`Provisioned ${repo.provider} repo`);
151
+ info(dim(` remote: ${repo.remote_url}`));
152
+ info("");
153
+ info(dim("Wire your local repo:"));
154
+ info(dim(` cimplify link ${project.id}`));
155
+ info(dim(` git init && git remote add origin ${repo.remote_url}`));
156
+ info(dim(` git add . && git commit -m "Initial commit"`));
157
+ info(dim(` cimplify deploy`));
158
+ result({
159
+ project: { id: project.id, name: project.name },
160
+ repo: { provider: repo.provider, id: repo.id, remote_url: repo.remote_url, default_branch: repo.default_branch }
161
+ });
162
+ }
163
+
164
+ export { run as default, detectProviderFromUrl };
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ export { run as default, fetchCloneToken } from './chunk-5XH72JMJ.mjs';
3
+ import './chunk-L6474RPL.mjs';
4
+ import './chunk-MQMNWLMU.mjs';
5
+ import './chunk-D7D75ONX.mjs';
6
+ import './chunk-4ZVTPMUZ.mjs';
7
+ import './chunk-JJYWETGA.mjs';
8
+ import './chunk-NZ4RG62Z.mjs';