@appinit/cli 1.1.0 → 1.3.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 (259) hide show
  1. package/LICENSE +68 -0
  2. package/README.md +27 -95
  3. package/dist/index.d.ts +371 -2
  4. package/dist/index.js +3795 -24
  5. package/dist/templates/backend-express/.appinit-generate/project/.appinit/project.json +6 -0
  6. package/dist/templates/backend-express/.appinit-generate/project/.appinit/template.json +6 -0
  7. package/dist/templates/backend-express/.appinit-generate/project/.env.example +4 -0
  8. package/dist/templates/backend-express/.appinit-generate/project/.husky/pre-commit +1 -0
  9. package/dist/templates/backend-express/.appinit-generate/project/.prettierignore +3 -0
  10. package/dist/templates/backend-express/.appinit-generate/project/.prettierrc +28 -0
  11. package/dist/templates/backend-express/.appinit-generate/project/.vscode/settings.json +6 -0
  12. package/dist/templates/backend-express/.appinit-generate/project/Dockerfile +14 -0
  13. package/dist/templates/backend-express/.appinit-generate/project/README.md +26 -0
  14. package/dist/templates/backend-express/.appinit-generate/project/eslint.config.js +76 -0
  15. package/dist/templates/backend-express/.appinit-generate/project/nodemon.json +8 -0
  16. package/dist/templates/backend-express/.appinit-generate/project/package.json +69 -0
  17. package/dist/templates/backend-express/.appinit-generate/project/src/__tests__/health.test.ts +19 -0
  18. package/dist/templates/backend-express/.appinit-generate/project/src/__tests__/validation.test.ts +36 -0
  19. package/dist/templates/backend-express/.appinit-generate/project/src/app.ts +72 -0
  20. package/dist/templates/backend-express/.appinit-generate/project/src/config/defaults.ts +5 -0
  21. package/dist/templates/backend-express/.appinit-generate/project/src/config/dev.ts +3 -0
  22. package/dist/templates/backend-express/.appinit-generate/project/src/config/env.ts +62 -0
  23. package/dist/templates/backend-express/.appinit-generate/project/src/config/prod.ts +3 -0
  24. package/dist/templates/backend-express/.appinit-generate/project/src/config/test.ts +3 -0
  25. package/dist/templates/backend-express/.appinit-generate/project/src/errors/app-error.ts +20 -0
  26. package/dist/templates/backend-express/.appinit-generate/project/src/errors/not-found.ts +16 -0
  27. package/dist/templates/backend-express/.appinit-generate/project/src/middleware/error-handler.ts +73 -0
  28. package/dist/templates/backend-express/.appinit-generate/project/src/middleware/http-logger.ts +5 -0
  29. package/dist/templates/backend-express/.appinit-generate/project/src/middleware/validate.ts +17 -0
  30. package/dist/templates/backend-express/.appinit-generate/project/src/routes/health.ts +13 -0
  31. package/dist/templates/backend-express/.appinit-generate/project/src/routes/users.ts +12 -0
  32. package/dist/templates/backend-express/.appinit-generate/project/src/schema/create-user.schema.ts +8 -0
  33. package/dist/templates/backend-express/.appinit-generate/project/src/server.ts +54 -0
  34. package/dist/templates/backend-express/.appinit-generate/project/src/utils/logger.ts +21 -0
  35. package/dist/templates/backend-express/.appinit-generate/project/tsconfig.json +30 -0
  36. package/dist/templates/backend-express/.appinit-generate/project/vitest.config.ts +15 -0
  37. package/dist/templates/backend-express/.appinit-preview/project/.appinit/project.json +6 -0
  38. package/dist/templates/backend-express/.appinit-preview/project/.appinit/template.json +6 -0
  39. package/dist/templates/backend-express/.appinit-preview/project/.env.example +4 -0
  40. package/dist/templates/backend-express/.appinit-preview/project/.husky/pre-commit +1 -0
  41. package/dist/templates/backend-express/.appinit-preview/project/.prettierignore +3 -0
  42. package/dist/templates/backend-express/.appinit-preview/project/.prettierrc +28 -0
  43. package/dist/templates/backend-express/.appinit-preview/project/.vscode/settings.json +6 -0
  44. package/dist/templates/backend-express/.appinit-preview/project/Dockerfile +14 -0
  45. package/dist/templates/backend-express/.appinit-preview/project/README.md +26 -0
  46. package/dist/templates/backend-express/.appinit-preview/project/eslint.config.js +76 -0
  47. package/dist/templates/backend-express/.appinit-preview/project/nodemon.json +8 -0
  48. package/dist/templates/backend-express/.appinit-preview/project/package.json +69 -0
  49. package/dist/templates/backend-express/.appinit-preview/project/src/__tests__/health.test.ts +19 -0
  50. package/dist/templates/backend-express/.appinit-preview/project/src/__tests__/validation.test.ts +36 -0
  51. package/dist/templates/backend-express/.appinit-preview/project/src/app.ts +72 -0
  52. package/dist/templates/backend-express/.appinit-preview/project/src/config/defaults.ts +5 -0
  53. package/dist/templates/backend-express/.appinit-preview/project/src/config/dev.ts +3 -0
  54. package/dist/templates/backend-express/.appinit-preview/project/src/config/env.ts +62 -0
  55. package/dist/templates/backend-express/.appinit-preview/project/src/config/prod.ts +3 -0
  56. package/dist/templates/backend-express/.appinit-preview/project/src/config/test.ts +3 -0
  57. package/dist/templates/backend-express/.appinit-preview/project/src/errors/app-error.ts +20 -0
  58. package/dist/templates/backend-express/.appinit-preview/project/src/errors/not-found.ts +16 -0
  59. package/dist/templates/backend-express/.appinit-preview/project/src/middleware/error-handler.ts +73 -0
  60. package/dist/templates/backend-express/.appinit-preview/project/src/middleware/http-logger.ts +5 -0
  61. package/dist/templates/backend-express/.appinit-preview/project/src/middleware/validate.ts +17 -0
  62. package/dist/templates/backend-express/.appinit-preview/project/src/routes/health.ts +13 -0
  63. package/dist/templates/backend-express/.appinit-preview/project/src/routes/users.ts +12 -0
  64. package/dist/templates/backend-express/.appinit-preview/project/src/schema/create-user.schema.ts +8 -0
  65. package/dist/templates/backend-express/.appinit-preview/project/src/server.ts +54 -0
  66. package/dist/templates/backend-express/.appinit-preview/project/src/utils/logger.ts +21 -0
  67. package/dist/templates/backend-express/.appinit-preview/project/tsconfig.json +30 -0
  68. package/dist/templates/backend-express/.appinit-preview/project/vitest.config.ts +15 -0
  69. package/dist/templates/backend-express/README.md +107 -0
  70. package/dist/templates/backend-express/appinit.template.json +25 -0
  71. package/dist/templates/backend-express/docs/README.md +11 -0
  72. package/dist/templates/backend-express/package.json +5 -0
  73. package/dist/templates/backend-express/template/.env.example +4 -0
  74. package/dist/templates/backend-express/template/.husky/pre-commit +1 -0
  75. package/dist/templates/backend-express/template/.prettierignore +3 -0
  76. package/dist/templates/backend-express/template/.prettierrc +28 -0
  77. package/dist/templates/backend-express/template/.vscode/settings.json +6 -0
  78. package/dist/templates/backend-express/template/Dockerfile +14 -0
  79. package/dist/templates/backend-express/template/README.md__tmpl +26 -0
  80. package/dist/templates/backend-express/template/eslint.config.js +76 -0
  81. package/dist/templates/backend-express/template/nodemon.json +8 -0
  82. package/dist/templates/backend-express/template/package.json__tmpl +69 -0
  83. package/dist/templates/backend-express/template/src/__tests__/health.test.ts +19 -0
  84. package/dist/templates/backend-express/template/src/__tests__/validation.test.ts +36 -0
  85. package/dist/templates/backend-express/template/src/app.ts +72 -0
  86. package/dist/templates/backend-express/template/src/config/defaults.ts +5 -0
  87. package/dist/templates/backend-express/template/src/config/dev.ts +3 -0
  88. package/dist/templates/backend-express/template/src/config/env.ts +62 -0
  89. package/dist/templates/backend-express/template/src/config/prod.ts +3 -0
  90. package/dist/templates/backend-express/template/src/config/test.ts +3 -0
  91. package/dist/templates/backend-express/template/src/errors/app-error.ts +20 -0
  92. package/dist/templates/backend-express/template/src/errors/not-found.ts +16 -0
  93. package/dist/templates/backend-express/template/src/middleware/error-handler.ts +73 -0
  94. package/dist/templates/backend-express/template/src/middleware/http-logger.ts +5 -0
  95. package/dist/templates/backend-express/template/src/middleware/validate.ts +17 -0
  96. package/dist/templates/backend-express/template/src/routes/health.ts +13 -0
  97. package/dist/templates/backend-express/template/src/routes/users.ts +12 -0
  98. package/dist/templates/backend-express/template/src/schema/create-user.schema.ts +8 -0
  99. package/dist/templates/backend-express/template/src/server.ts +54 -0
  100. package/dist/templates/backend-express/template/src/utils/logger.ts +21 -0
  101. package/dist/templates/backend-express/template/tsconfig.json +30 -0
  102. package/dist/templates/backend-express/template/vitest.config.ts +15 -0
  103. package/dist/templates/backend-express/template.config.ts +36 -0
  104. package/dist/templates/backend-express/variables/defaults.json +7 -0
  105. package/dist/templates/backend-express/variables/defaults.ts +4 -0
  106. package/dist/templates/backend-express/variables/schema.json +22 -0
  107. package/dist/templates/backend-express/variables/schema.ts +11 -0
  108. package/dist/templates/backend-express/variables/transform.ts +6 -0
  109. package/dist/templates/backend-fastify/.appinit-generate/project/.appinit/project.json +6 -0
  110. package/dist/templates/backend-fastify/.appinit-generate/project/.appinit/template.json +6 -0
  111. package/dist/templates/backend-fastify/.appinit-generate/project/README.md +26 -0
  112. package/dist/templates/backend-fastify/.appinit-generate/project/nodemon.json +8 -0
  113. package/dist/templates/backend-fastify/.appinit-generate/project/package-lock.json +3245 -0
  114. package/dist/templates/backend-fastify/.appinit-generate/project/package.json +24 -0
  115. package/dist/templates/backend-fastify/.appinit-generate/project/src/app.ts +13 -0
  116. package/dist/templates/backend-fastify/.appinit-generate/project/src/server.ts +15 -0
  117. package/dist/templates/backend-fastify/.appinit-generate/project/tsconfig.json +30 -0
  118. package/dist/templates/backend-fastify/README.md +27 -0
  119. package/dist/templates/backend-fastify/appinit.template.json +25 -0
  120. package/dist/templates/backend-fastify/docs/README.md +12 -0
  121. package/dist/templates/backend-fastify/package.json +5 -0
  122. package/dist/templates/backend-fastify/template/README.md__tmpl +26 -0
  123. package/dist/templates/backend-fastify/template/nodemon.json +8 -0
  124. package/dist/templates/backend-fastify/template/package.json__tmpl +24 -0
  125. package/dist/templates/backend-fastify/template/src/app.ts +13 -0
  126. package/dist/templates/backend-fastify/template/src/server.ts +15 -0
  127. package/dist/templates/backend-fastify/template/tsconfig.json +30 -0
  128. package/dist/templates/backend-fastify/template.config.ts +32 -0
  129. package/dist/templates/backend-fastify/variables/defaults.json +4 -0
  130. package/dist/templates/backend-fastify/variables/defaults.ts +3 -0
  131. package/dist/templates/backend-fastify/variables/schema.json +7 -0
  132. package/dist/templates/backend-fastify/variables/schema.ts +1 -0
  133. package/dist/templates/backend-fastify/variables/transform.ts +3 -0
  134. package/dist/templates/frontend-nextjs/.appinit-generate/project/.appinit/project.json +6 -0
  135. package/dist/templates/frontend-nextjs/.appinit-generate/project/.appinit/template.json +6 -0
  136. package/dist/templates/frontend-nextjs/.appinit-generate/project/README.md +33 -0
  137. package/dist/templates/frontend-nextjs/.appinit-generate/project/app/favicon.ico +0 -0
  138. package/dist/templates/frontend-nextjs/.appinit-generate/project/app/globals.css +42 -0
  139. package/dist/templates/frontend-nextjs/.appinit-generate/project/app/layout.tsx +33 -0
  140. package/dist/templates/frontend-nextjs/.appinit-generate/project/app/page.module.css +141 -0
  141. package/dist/templates/frontend-nextjs/.appinit-generate/project/app/page.tsx +67 -0
  142. package/dist/templates/frontend-nextjs/.appinit-generate/project/next-env.d.ts +6 -0
  143. package/dist/templates/frontend-nextjs/.appinit-generate/project/next.config.ts +8 -0
  144. package/dist/templates/frontend-nextjs/.appinit-generate/project/package.json +25 -0
  145. package/dist/templates/frontend-nextjs/.appinit-generate/project/public/file.svg +1 -0
  146. package/dist/templates/frontend-nextjs/.appinit-generate/project/public/globe.svg +1 -0
  147. package/dist/templates/frontend-nextjs/.appinit-generate/project/public/next.svg +1 -0
  148. package/dist/templates/frontend-nextjs/.appinit-generate/project/public/vercel.svg +1 -0
  149. package/dist/templates/frontend-nextjs/.appinit-generate/project/public/window.svg +1 -0
  150. package/dist/templates/frontend-nextjs/.appinit-generate/project/tsconfig.json +34 -0
  151. package/dist/templates/frontend-nextjs/.appinit-preview/project/.appinit/project.json +6 -0
  152. package/dist/templates/frontend-nextjs/.appinit-preview/project/.appinit/template.json +6 -0
  153. package/dist/templates/frontend-nextjs/.appinit-preview/project/README.md +33 -0
  154. package/dist/templates/frontend-nextjs/.appinit-preview/project/app/favicon.ico +0 -0
  155. package/dist/templates/frontend-nextjs/.appinit-preview/project/app/globals.css +42 -0
  156. package/dist/templates/frontend-nextjs/.appinit-preview/project/app/layout.tsx +33 -0
  157. package/dist/templates/frontend-nextjs/.appinit-preview/project/app/page.module.css +141 -0
  158. package/dist/templates/frontend-nextjs/.appinit-preview/project/app/page.tsx +67 -0
  159. package/dist/templates/frontend-nextjs/.appinit-preview/project/next-env.d.ts +6 -0
  160. package/dist/templates/frontend-nextjs/.appinit-preview/project/next.config.ts +8 -0
  161. package/dist/templates/frontend-nextjs/.appinit-preview/project/package.json +25 -0
  162. package/dist/templates/frontend-nextjs/.appinit-preview/project/public/file.svg +1 -0
  163. package/dist/templates/frontend-nextjs/.appinit-preview/project/public/globe.svg +1 -0
  164. package/dist/templates/frontend-nextjs/.appinit-preview/project/public/next.svg +1 -0
  165. package/dist/templates/frontend-nextjs/.appinit-preview/project/public/vercel.svg +1 -0
  166. package/dist/templates/frontend-nextjs/.appinit-preview/project/public/window.svg +1 -0
  167. package/dist/templates/frontend-nextjs/.appinit-preview/project/tsconfig.json +34 -0
  168. package/dist/templates/frontend-nextjs/README.md +27 -0
  169. package/dist/templates/frontend-nextjs/appinit.template.json +25 -0
  170. package/dist/templates/frontend-nextjs/docs/README.md +12 -0
  171. package/dist/templates/frontend-nextjs/package.json +5 -0
  172. package/dist/templates/frontend-nextjs/template/README.md__tmpl +33 -0
  173. package/dist/templates/frontend-nextjs/template/app/favicon.ico +0 -0
  174. package/dist/templates/frontend-nextjs/template/app/globals.css +42 -0
  175. package/dist/templates/frontend-nextjs/template/app/layout.tsx +33 -0
  176. package/dist/templates/frontend-nextjs/template/app/page.module.css +141 -0
  177. package/dist/templates/frontend-nextjs/template/app/page.tsx +67 -0
  178. package/dist/templates/frontend-nextjs/template/next-env.d.ts +6 -0
  179. package/dist/templates/frontend-nextjs/template/next.config.ts +8 -0
  180. package/dist/templates/frontend-nextjs/template/package.json__tmpl +25 -0
  181. package/dist/templates/frontend-nextjs/template/public/file.svg +1 -0
  182. package/dist/templates/frontend-nextjs/template/public/globe.svg +1 -0
  183. package/dist/templates/frontend-nextjs/template/public/next.svg +1 -0
  184. package/dist/templates/frontend-nextjs/template/public/vercel.svg +1 -0
  185. package/dist/templates/frontend-nextjs/template/public/window.svg +1 -0
  186. package/dist/templates/frontend-nextjs/template/tsconfig.json +34 -0
  187. package/dist/templates/frontend-nextjs/template.config.ts +28 -0
  188. package/dist/templates/frontend-nextjs/variables/defaults.json +6 -0
  189. package/dist/templates/frontend-nextjs/variables/defaults.ts +4 -0
  190. package/dist/templates/frontend-nextjs/variables/schema.json +22 -0
  191. package/dist/templates/frontend-nextjs/variables/schema.ts +7 -0
  192. package/dist/templates/frontend-nextjs/variables/transform.ts +3 -0
  193. package/dist/templates/frontend-react/.appinit-generate/project/.appinit/project.json +6 -0
  194. package/dist/templates/frontend-react/.appinit-generate/project/.appinit/template.json +6 -0
  195. package/dist/templates/frontend-react/.appinit-generate/project/README.md +14 -0
  196. package/dist/templates/frontend-react/.appinit-generate/project/index.html +12 -0
  197. package/dist/templates/frontend-react/.appinit-generate/project/package.json +26 -0
  198. package/dist/templates/frontend-react/.appinit-generate/project/public/vite.svg +30 -0
  199. package/dist/templates/frontend-react/.appinit-generate/project/src/App.tsx +16 -0
  200. package/dist/templates/frontend-react/.appinit-generate/project/src/assets/react.svg +1 -0
  201. package/dist/templates/frontend-react/.appinit-generate/project/src/index.css +9 -0
  202. package/dist/templates/frontend-react/.appinit-generate/project/src/main.tsx +10 -0
  203. package/dist/templates/frontend-react/.appinit-generate/project/tsconfig.app.json +31 -0
  204. package/dist/templates/frontend-react/.appinit-generate/project/tsconfig.json +7 -0
  205. package/dist/templates/frontend-react/.appinit-generate/project/tsconfig.node.json +26 -0
  206. package/dist/templates/frontend-react/.appinit-generate/project/vite.config.ts +16 -0
  207. package/dist/templates/frontend-react/appinit.template.json +26 -0
  208. package/dist/templates/frontend-react/docs/README.md +12 -0
  209. package/dist/templates/frontend-react/hooks/afterRender.ts +3 -0
  210. package/dist/templates/frontend-react/hooks/afterWrite.ts +3 -0
  211. package/dist/templates/frontend-react/hooks/beforeRender.ts +3 -0
  212. package/dist/templates/frontend-react/hooks/beforeWrite.ts +3 -0
  213. package/dist/templates/frontend-react/package.json +16 -0
  214. package/dist/templates/frontend-react/template/.env.example__tmpl +1 -0
  215. package/dist/templates/frontend-react/template/README.md__tmpl +14 -0
  216. package/dist/templates/frontend-react/template/_gitignore +41 -0
  217. package/dist/templates/frontend-react/template/index.html__tmpl +12 -0
  218. package/dist/templates/frontend-react/template/package.json__tmpl +26 -0
  219. package/dist/templates/frontend-react/template/public/vite.svg +30 -0
  220. package/dist/templates/frontend-react/template/src/App.tsx__tmpl +16 -0
  221. package/dist/templates/frontend-react/template/src/assets/react.svg +1 -0
  222. package/dist/templates/frontend-react/template/src/index.css__tmpl +9 -0
  223. package/dist/templates/frontend-react/template/src/main.tsx__tmpl +10 -0
  224. package/dist/templates/frontend-react/template/tsconfig.app.json__tmpl +31 -0
  225. package/dist/templates/frontend-react/template/tsconfig.json__tmpl +7 -0
  226. package/dist/templates/frontend-react/template/tsconfig.node.json__tmpl +26 -0
  227. package/dist/templates/frontend-react/template/vite.config.ts__tmpl +16 -0
  228. package/dist/templates/frontend-react/template.config.ts +26 -0
  229. package/dist/templates/frontend-react/template.meta.json +10 -0
  230. package/dist/templates/frontend-react/variables/defaults.json +6 -0
  231. package/dist/templates/frontend-react/variables/defaults.ts +6 -0
  232. package/dist/templates/frontend-react/variables/schema.json +15 -0
  233. package/dist/templates/frontend-react/variables/schema.ts +17 -0
  234. package/dist/templates/frontend-react/variables/transform.ts +10 -0
  235. package/dist/templates/frontend-vue/README.md +27 -0
  236. package/dist/templates/frontend-vue/appinit.template.json +25 -0
  237. package/dist/templates/frontend-vue/docs/README.md +12 -0
  238. package/dist/templates/frontend-vue/package.json +5 -0
  239. package/dist/templates/frontend-vue/template/README.md__tmpl +31 -0
  240. package/dist/templates/frontend-vue/template/index.html +13 -0
  241. package/dist/templates/frontend-vue/template/package.json__tmpl +25 -0
  242. package/dist/templates/frontend-vue/template/public/vite.svg +1 -0
  243. package/dist/templates/frontend-vue/template/src/App.vue +30 -0
  244. package/dist/templates/frontend-vue/template/src/assets/vue.svg +1 -0
  245. package/dist/templates/frontend-vue/template/src/components/HelloWorld.vue +42 -0
  246. package/dist/templates/frontend-vue/template/src/main.ts +6 -0
  247. package/dist/templates/frontend-vue/template/src/style.css +79 -0
  248. package/dist/templates/frontend-vue/template/tsconfig.app.json +16 -0
  249. package/dist/templates/frontend-vue/template/tsconfig.json +7 -0
  250. package/dist/templates/frontend-vue/template/tsconfig.node.json +26 -0
  251. package/dist/templates/frontend-vue/template/vite.config.ts +7 -0
  252. package/dist/templates/frontend-vue/template.config.ts +32 -0
  253. package/dist/templates/frontend-vue/variables/defaults.json +6 -0
  254. package/dist/templates/frontend-vue/variables/defaults.ts +3 -0
  255. package/dist/templates/frontend-vue/variables/schema.json +22 -0
  256. package/dist/templates/frontend-vue/variables/schema.ts +1 -0
  257. package/dist/templates/frontend-vue/variables/transform.ts +3 -0
  258. package/package.json +40 -29
  259. package/bin/appinit.js +0 -15
package/LICENSE ADDED
@@ -0,0 +1,68 @@
1
+ # AppInit CLI License (Proprietary – Compiled Distribution Only)
2
+
3
+ Copyright © 2025 Pradeep, AppInit OS Authors
4
+ All Rights Reserved.
5
+
6
+ ---
7
+
8
+ ## Grant of Permission
9
+
10
+ Permission is hereby granted, free of charge, to any person who obtains an
11
+ **official, unmodified, compiled distribution** of the AppInit CLI package
12
+ (`appinit`, the “Software”) to install and use the Software solely for
13
+ project initialization and related workflows on local or authorized environments,
14
+ subject to the restrictions below.
15
+
16
+ This license applies **only** to the compiled CLI distributable and does **not**
17
+ grant access to source code, internal implementations, or architectural details.
18
+
19
+ ---
20
+
21
+ ## Permitted Uses
22
+
23
+ You may:
24
+
25
+ 1. Install and execute the official AppInit CLI via approved distribution channels
26
+ (e.g. `npx appinit`, `npm install --global appinit`)
27
+ 2. Use the CLI to initialize projects and install owner-approved templates or addons
28
+ 3. Modify, extend, and distribute the **generated output** created by the CLI
29
+ 4. Develop addons, plugins, or templates using AppInit’s public APIs or SDKs
30
+ (when officially provided)
31
+
32
+ ---
33
+
34
+ ## Prohibited Uses
35
+
36
+ You may **not**:
37
+
38
+ 1. Copy, extract, clone, or otherwise access the CLI’s internal implementation,
39
+ bundled engine, or private modules
40
+ 2. Reverse engineer, decompile, disassemble, or de-bundle the Software
41
+ 3. Republish or disclose internal architecture, resolution logic, or system behavior
42
+ 4. Create derivative tools, generators, runtimes, or competing systems based on
43
+ AppInit’s internal implementation
44
+ 5. Distribute modified versions of the AppInit CLI or its core components as
45
+ standalone or competing products
46
+
47
+ ---
48
+
49
+ ## Attribution
50
+
51
+ This license notice must be included in all written references to the
52
+ official AppInit CLI distributable.
53
+
54
+ ---
55
+
56
+ ## Disclaimer of Warranty
57
+
58
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
59
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
60
+ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
61
+
62
+ ---
63
+
64
+ ## Limitation of Liability
65
+
66
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
67
+ DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE,
68
+ ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF THE SOFTWARE.
package/README.md CHANGED
@@ -1,111 +1,43 @@
1
- # **@appinit/cli**
1
+ # AppInit CLI
2
2
 
3
- The official command-line interface for **AppInit OS**.
3
+ The official AppInit command-line interface for creating projects from built-in templates.
4
4
 
5
- `@appinit/cli` provides all executable commands used to create, configure, and manage AppInit projects.
6
- It connects the user experience (prompts, commands, flags) with the internal systems (core engine, resolver, and template/module execution pipeline).
5
+ ## Requirements
7
6
 
8
- This is the primary entrypoint for developers using AppInit.
7
+ - Node.js 20.11 or newer
8
+ - npm, pnpm, yarn, or bun for installing generated project dependencies
9
9
 
10
- ---
10
+ ## Install
11
11
 
12
- ## 📦 About
12
+ Run without installing:
13
13
 
14
- `@appinit/cli` enables:
15
-
16
- - project creation
17
-
18
- ```
19
- appinit create <project-name>
20
- ```
21
-
22
- - feature / module installation
23
-
24
- ```
25
- appinit add <feature>
26
- ```
27
-
28
- - generating components, routes, API handlers
29
-
30
- ```
31
- appinit generate <component|page|api>
32
- ```
33
-
34
- - doctor, sync, upgrade, debugging tools
35
-
36
- ```
37
- appinit doctor
38
- appinit sync
39
- appinit upgrade
40
- ```
41
-
42
- - interactive prompts powered by **APS (AppInit Prompt Spec)**
43
-
44
- - smart suggestions & stack detection
45
-
46
- - safe, deterministic scaffolding
47
-
48
- The CLI orchestrates interactions between:
49
-
50
- - **resolver** (`@appinit/resolver`)
51
- - **engine** (`@appinit/engine`)
52
- - **core context** (`@appinit/core`)
53
- - **types & specs** (`@appinit/types`)
54
-
55
- ---
56
-
57
- ## 📘 Usage
58
-
59
- Global usage:
60
-
61
- ```sh
62
- npx appinit create my-app
63
- ```
64
-
65
- Local workspace usage:
66
-
67
- ```sh
68
- pnpm appinit create my-app
69
- ```
70
-
71
- Internal usage:
72
-
73
- ```ts
74
- import { runCLI } from "@appinit/cli";
75
-
76
- runCLI(process.argv.slice(2));
77
- ```
78
-
79
- ---
80
-
81
- ## 🛠 Development
82
-
83
- Build:
84
-
85
- ```
86
- pnpm -F @appinit/cli build
14
+ ```bash
15
+ npx @appinit/cli --help
16
+ npx @appinit/cli create my-app
87
17
  ```
88
18
 
89
- Watch mode:
19
+ Or install globally:
90
20
 
91
- ```
92
- pnpm -F @appinit/cli dev
21
+ ```bash
22
+ npm install --global @appinit/cli
23
+ appinit create my-app
93
24
  ```
94
25
 
95
- Type-check:
26
+ ## Commands
96
27
 
97
- ```
98
- pnpm -F @appinit/cli typecheck
99
- ```
100
-
101
- Run locally (linked):
102
-
103
- ```
104
- pnpm -F @appinit/cli appinit create test
28
+ ```bash
29
+ appinit --help
30
+ appinit create --help
31
+ appinit template list
32
+ appinit doctor
33
+ appinit history
34
+ appinit context
35
+ appinit state inspect
36
+ appinit validate
105
37
  ```
106
38
 
107
- ---
39
+ AppInit includes the built-in Express, Fastify, Next.js, React, and Vue template families. You can also point the CLI at a custom template directory with `--template-dir` or `APPINIT_TEMPLATES_DIR`.
108
40
 
109
- ## 📄 License
41
+ ## License
110
42
 
111
- Internal – © AppInit
43
+ The compiled CLI is distributed under the proprietary license included in the `LICENSE` file. The private workspace implementation is not included as source code.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,373 @@
1
1
  #!/usr/bin/env node
2
- declare function start(argv: string[]): void;
2
+ interface CreateCommandOptions {
3
+ readonly template?: string;
4
+ readonly target?: string;
5
+ readonly dryRun: boolean;
6
+ readonly yes: boolean;
7
+ readonly templateDirectory?: string;
8
+ readonly variables: Readonly<Record<string, unknown>>;
9
+ readonly install: boolean;
10
+ readonly git: boolean;
11
+ readonly packageManager?: "pnpm" | "npm" | "yarn" | "bun";
12
+ }
13
+ declare function parseCreateArguments(args: readonly string[]): CreateCommandOptions;
3
14
 
4
- export { start };
15
+ /**
16
+ * TemplateKind
17
+ * ──────────────────────────────────────────────────────────────
18
+ *
19
+ * Declares **what a template represents architecturally**.
20
+ *
21
+ * A TemplateKind describes the **role of the template itself**,
22
+ * not the artifact it produces.
23
+ *
24
+ * Templates are NOT artifacts.
25
+ * They are **blueprints** that can generate artifacts.
26
+ *
27
+ * This distinction is critical for:
28
+ * - ATS 2.0 composition
29
+ * - capability reuse
30
+ * - future marketplace semantics
31
+ *
32
+ * ATS 1.0 implicitly assumed all templates were "project".
33
+ * ATS 2.0 makes this explicit and extensible.
34
+ *
35
+ * ──────────────────────────────────────────────────────────────
36
+ * Design invariants (LOCKED)
37
+ * ──────────────────────────────────────────────────────────────
38
+ *
39
+ * 1. TemplateKind MUST NOT:
40
+ * ❌ imply filesystem layout
41
+ * ❌ imply execution behavior
42
+ * ❌ imply ArtifactKind
43
+ *
44
+ * 2. TemplateKind MAY:
45
+ * - influence validation rules
46
+ * - influence resolver behavior
47
+ * - enable composition semantics (ATS 2.0)
48
+ *
49
+ * 3. TemplateKind is REQUIRED metadata
50
+ * in TemplateConfig.
51
+ *
52
+ * ──────────────────────────────────────────────────────────────
53
+ * Used by
54
+ * ──────────────────────────────────────────────────────────────
55
+ *
56
+ * - TemplateConfig
57
+ * - Resolver
58
+ * - Validator
59
+ * - Doctor
60
+ * - Marketplace / registry
61
+ */
62
+ type TemplateKind =
63
+ /**
64
+ * Project template
65
+ *
66
+ * Represents a full, standalone project.
67
+ */
68
+ "project"
69
+ /**
70
+ * Module template
71
+ *
72
+ * Represents a reusable module intended
73
+ * to be integrated into a project.
74
+ */
75
+ | "module"
76
+ /**
77
+ * Capability template
78
+ *
79
+ * Represents a composable feature or concern
80
+ * (e.g. auth, linting, CI).
81
+ *
82
+ * Not standalone.
83
+ */
84
+ | "capability"
85
+ /**
86
+ * Preset template
87
+ *
88
+ * Represents a predefined combination
89
+ * of templates or capabilities.
90
+ */
91
+ | "preset"
92
+ /**
93
+ * Composition template
94
+ *
95
+ * Represents a higher-order template that
96
+ * composes other templates.
97
+ *
98
+ * ATS 2.0 only.
99
+ */
100
+ | "composition";
101
+
102
+ type TemplateRendererEngine = "liquid" | "none";
103
+ interface TemplateManifest {
104
+ readonly schemaVersion: 1;
105
+ readonly id: string;
106
+ readonly version: string;
107
+ readonly kind: TemplateKind;
108
+ readonly atsVersion: string;
109
+ readonly name: string;
110
+ readonly description: string;
111
+ readonly category: string;
112
+ readonly language: string;
113
+ readonly packageName: string;
114
+ readonly renderer: {
115
+ readonly engine: TemplateRendererEngine;
116
+ };
117
+ readonly paths: {
118
+ readonly template: string;
119
+ readonly variables?: string;
120
+ readonly hooks?: string;
121
+ };
122
+ readonly tags: readonly string[];
123
+ /** Capability identifiers this template requires from other selected templates. */
124
+ readonly requires?: readonly string[];
125
+ /** Capability identifiers this template provides to other selected templates. */
126
+ readonly provides?: readonly string[];
127
+ /** Template IDs or capability identifiers incompatible with this template. */
128
+ readonly conflicts?: readonly string[];
129
+ }
130
+
131
+ interface VirtualFile {
132
+ /** Normalized POSIX path relative to the generated project root. */
133
+ dest: string;
134
+ content: string | Buffer;
135
+ /** Whether the content should pass through a template renderer. */
136
+ render: boolean;
137
+ /** Whether content is binary and must not be decoded as UTF-8. */
138
+ binary: boolean;
139
+ }
140
+
141
+ declare class VirtualFileSystem {
142
+ private readonly files;
143
+ add(file: VirtualFile): void;
144
+ get(destination: string): VirtualFile | undefined;
145
+ list(): Iterable<VirtualFile>;
146
+ remove(destination: string): boolean;
147
+ updateContent(destination: string, content: string | Buffer): void;
148
+ get size(): number;
149
+ }
150
+
151
+ interface AppInitProjectHistoryEntry {
152
+ readonly path: string;
153
+ readonly templateId: string;
154
+ readonly createdAt: string;
155
+ }
156
+ interface AppInitState {
157
+ readonly schemaVersion: 1;
158
+ readonly projects: readonly AppInitProjectHistoryEntry[];
159
+ /** Fields retained for compatibility with the existing update-check state. */
160
+ readonly lastUpdateCheck?: unknown;
161
+ readonly latestVersion?: unknown;
162
+ }
163
+
164
+ interface ResolvedTemplate {
165
+ readonly root: string;
166
+ readonly manifest: TemplateManifest;
167
+ readonly vfs: VirtualFileSystem;
168
+ }
169
+
170
+ interface LocalTemplate {
171
+ readonly id: string;
172
+ readonly name: string;
173
+ readonly description: string;
174
+ readonly category: string;
175
+ readonly root: string;
176
+ readonly template: ResolvedTemplate;
177
+ }
178
+ interface ResolvedCreateOptions extends CreateCommandOptions {
179
+ readonly template: string;
180
+ readonly target: string;
181
+ }
182
+ declare function runCreateCommand(options: ResolvedCreateOptions): Promise<void>;
183
+
184
+ interface ContextCommandOptions {
185
+ readonly cwd?: string;
186
+ readonly json?: boolean;
187
+ }
188
+ interface ContextCommandIO {
189
+ readonly write: (message: string) => void;
190
+ }
191
+ type JsonRecord = Record<string, unknown>;
192
+ interface ProjectContextReport {
193
+ readonly rootDir: string;
194
+ readonly package?: {
195
+ readonly name?: string;
196
+ readonly version?: string;
197
+ };
198
+ readonly appinit?: {
199
+ readonly project?: JsonRecord;
200
+ readonly template?: JsonRecord;
201
+ readonly context?: JsonRecord;
202
+ };
203
+ readonly history?: AppInitProjectHistoryEntry;
204
+ readonly diagnostics: readonly string[];
205
+ }
206
+ /** Collect the current project's existing metadata and matching global history. */
207
+ declare function readProjectContext(cwd?: string): Promise<ProjectContextReport>;
208
+ /** Display the current project's AppInit metadata and related global history. */
209
+ declare function runContextCommand(options?: ContextCommandOptions, io?: ContextCommandIO): Promise<void>;
210
+
211
+ type PackageManager = "pnpm" | "npm" | "yarn" | "bun";
212
+
213
+ interface FinalizeOptions {
214
+ readonly install: boolean;
215
+ readonly git: boolean;
216
+ readonly packageManager?: PackageManager;
217
+ }
218
+ interface FinalizeIO {
219
+ readonly interactive: boolean;
220
+ ask(message: string, fallback?: string): Promise<string>;
221
+ confirm(message: string): Promise<boolean>;
222
+ write(message: string): void;
223
+ }
224
+ declare function finalizeProject(directory: string, options: FinalizeOptions, io: FinalizeIO): Promise<void>;
225
+
226
+ interface DoctorCommandIO {
227
+ write(message: string): void;
228
+ }
229
+ interface DoctorCommandOptions {
230
+ readonly cwd?: string;
231
+ readonly json?: boolean;
232
+ }
233
+ declare function runDoctorCommand(options?: DoctorCommandOptions, io?: DoctorCommandIO): Promise<void>;
234
+
235
+ interface HistoryCommandOptions {
236
+ readonly json?: boolean;
237
+ }
238
+ interface HistoryCommandIO {
239
+ readonly write: (message: string) => void;
240
+ }
241
+ /** Read and validate the user's global project history. */
242
+ declare function readProjectHistory(): Promise<AppInitState>;
243
+ /** Render previously generated projects from the global AppInit state file. */
244
+ declare function runHistoryCommand(options?: HistoryCommandOptions, io?: HistoryCommandIO): Promise<void>;
245
+
246
+ interface StatePathCommandOptions {
247
+ /** Environment source is injectable for deterministic tests. */
248
+ readonly env?: NodeJS.ProcessEnv;
249
+ /** Home directory source is injectable for deterministic tests. */
250
+ readonly homeDirectory?: string;
251
+ }
252
+ interface StatePathCommandIO {
253
+ readonly write: (message: string) => void;
254
+ }
255
+ interface AppInitStatePathInfo {
256
+ readonly path: string;
257
+ readonly source: "APPINIT_HOME" | "default";
258
+ readonly exists: boolean;
259
+ readonly isDirectory: boolean;
260
+ }
261
+ /** Inspect the configured global state path without creating or modifying it. */
262
+ declare function inspectAppInitStatePath(options?: StatePathCommandOptions): Promise<AppInitStatePathInfo>;
263
+ /** Print the resolved global state location and whether it is initialized. */
264
+ declare function runStatePathCommand(options?: StatePathCommandOptions, io?: StatePathCommandIO): Promise<void>;
265
+
266
+ interface StateInspectCommandOptions {
267
+ readonly env?: NodeJS.ProcessEnv;
268
+ readonly homeDirectory?: string;
269
+ readonly json?: boolean;
270
+ }
271
+ interface StateInspectCommandIO {
272
+ readonly write: (message: string) => void;
273
+ }
274
+ interface AppInitStateInspection {
275
+ readonly path: string;
276
+ readonly source: "APPINIT_HOME" | "default";
277
+ readonly stateFile: "missing" | "valid" | "invalid";
278
+ readonly schemaVersion?: number;
279
+ readonly projectCount?: number;
280
+ readonly diagnostics: readonly string[];
281
+ }
282
+ /** Inspect global state without creating, repairing, or modifying persisted data. */
283
+ declare function inspectAppInitState(options?: StateInspectCommandOptions): Promise<AppInitStateInspection>;
284
+ /** Display a safe summary of global state; project paths and stored values are not exposed. */
285
+ declare function runStateInspectCommand(options?: StateInspectCommandOptions, io?: StateInspectCommandIO): Promise<void>;
286
+
287
+ interface StateDoctorOptions {
288
+ readonly env?: NodeJS.ProcessEnv;
289
+ readonly homeDirectory?: string;
290
+ readonly json?: boolean;
291
+ }
292
+ interface StateDoctorIO {
293
+ readonly write: (message: string) => void;
294
+ }
295
+ interface StateDoctorDiagnostic {
296
+ readonly code: string;
297
+ readonly level: "info" | "warn" | "error";
298
+ readonly message: string;
299
+ readonly hint?: string;
300
+ }
301
+ interface StateDoctorReport {
302
+ readonly path: string;
303
+ readonly source: "APPINIT_HOME" | "default";
304
+ readonly stateFile: "missing" | "valid" | "invalid";
305
+ readonly ok: boolean;
306
+ readonly diagnostics: readonly StateDoctorDiagnostic[];
307
+ readonly summary: Readonly<{
308
+ info: number;
309
+ warn: number;
310
+ error: number;
311
+ }>;
312
+ }
313
+ /** Diagnose global state health without creating, repairing, or modifying files. */
314
+ declare function diagnoseAppInitState(options?: StateDoctorOptions): Promise<StateDoctorReport>;
315
+ /** Print a human-readable or machine-readable global state health report. */
316
+ declare function runStateDoctorCommand(options?: StateDoctorOptions, io?: StateDoctorIO): Promise<void>;
317
+
318
+ interface ValidateCommandIO {
319
+ write(message: string): void;
320
+ }
321
+ interface ValidateCommandOptions {
322
+ readonly cwd?: string;
323
+ readonly templateDir?: string;
324
+ readonly json?: boolean;
325
+ }
326
+ declare function runValidateCommand(options?: ValidateCommandOptions, io?: ValidateCommandIO): Promise<void>;
327
+
328
+ interface RemoteTemplateOptions {
329
+ readonly registryUrl: string;
330
+ readonly templateId?: string;
331
+ readonly version?: string;
332
+ readonly cacheDirectory?: string;
333
+ readonly templatesDirectory?: string;
334
+ readonly fetch?: typeof fetch;
335
+ }
336
+ interface RemoteTemplateListing {
337
+ readonly id: string;
338
+ readonly version: string;
339
+ readonly name: string;
340
+ readonly description: string;
341
+ readonly category: string;
342
+ readonly language: string;
343
+ readonly tags: readonly string[];
344
+ }
345
+ declare function listRemoteTemplates(options: RemoteTemplateOptions): Promise<readonly RemoteTemplateListing[]>;
346
+ /**
347
+ * Download, verify, safely extract, and validate one exact registry version.
348
+ * Registry archives must contain appinit.template.json at their archive root.
349
+ */
350
+ declare function installRemoteTemplate(options: RemoteTemplateOptions & {
351
+ readonly templateId: string;
352
+ readonly version?: string;
353
+ }): Promise<{
354
+ readonly id: string;
355
+ readonly version: string;
356
+ readonly directory: string;
357
+ readonly cached: boolean;
358
+ }>;
359
+
360
+ declare function searchLocalTemplates(templates: readonly LocalTemplate[], query: string): readonly LocalTemplate[];
361
+ declare function findLocalTemplate(templates: readonly LocalTemplate[], reference: string): LocalTemplate | undefined;
362
+ declare function formatTemplateList(templates: readonly LocalTemplate[], heading?: string): string;
363
+ declare function formatTemplateInfo(template: LocalTemplate): string;
364
+
365
+ interface CreateWizardIO {
366
+ readonly interactive: boolean;
367
+ ask(message: string, fallback?: string): Promise<string>;
368
+ confirm(message: string): Promise<boolean>;
369
+ write(message: string): void;
370
+ }
371
+ declare function resolveGuidedCreate(options: CreateCommandOptions, io: CreateWizardIO): Promise<ResolvedCreateOptions | null>;
372
+
373
+ export { diagnoseAppInitState, finalizeProject, findLocalTemplate, formatTemplateInfo, formatTemplateList, inspectAppInitState, inspectAppInitStatePath, installRemoteTemplate, listRemoteTemplates, parseCreateArguments, readProjectContext, readProjectHistory, resolveGuidedCreate, runContextCommand, runCreateCommand, runDoctorCommand, runHistoryCommand, runStateDoctorCommand, runStateInspectCommand, runStatePathCommand, runValidateCommand, searchLocalTemplates };