netlify 27.4.3 → 27.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (552) hide show
  1. package/dist/commands/clone/clone.d.ts +7 -1
  2. package/dist/commands/clone/clone.js +207 -22
  3. package/dist/commands/clone/index.js +18 -7
  4. package/dist/commands/git-credential/git-credential.d.ts +7 -0
  5. package/dist/commands/git-credential/git-credential.js +39 -0
  6. package/dist/commands/git-credential/index.d.ts +3 -0
  7. package/dist/commands/git-credential/index.js +9 -0
  8. package/dist/commands/git-credential/option_values.d.ts +3 -0
  9. package/dist/commands/git-credential/option_values.js +2 -0
  10. package/dist/commands/logs/index.js +4 -1
  11. package/dist/commands/logs/logs.d.ts +17 -2
  12. package/dist/commands/logs/logs.js +32 -14
  13. package/dist/commands/logs/option_values.d.ts +14 -0
  14. package/dist/commands/logs/option_values.js +3 -0
  15. package/dist/commands/logs/sources/deploy.d.ts +7 -3
  16. package/dist/commands/logs/sources/deploy.js +115 -38
  17. package/dist/commands/main.js +2 -0
  18. package/package.json +5 -4
  19. package/dist/commands/agents/agents-create.d.ts.map +0 -1
  20. package/dist/commands/agents/agents-create.js.map +0 -1
  21. package/dist/commands/agents/agents-list.d.ts.map +0 -1
  22. package/dist/commands/agents/agents-list.js.map +0 -1
  23. package/dist/commands/agents/agents-show.d.ts.map +0 -1
  24. package/dist/commands/agents/agents-show.js.map +0 -1
  25. package/dist/commands/agents/agents-stop.d.ts.map +0 -1
  26. package/dist/commands/agents/agents-stop.js.map +0 -1
  27. package/dist/commands/agents/agents.d.ts.map +0 -1
  28. package/dist/commands/agents/agents.js.map +0 -1
  29. package/dist/commands/agents/constants.d.ts.map +0 -1
  30. package/dist/commands/agents/constants.js.map +0 -1
  31. package/dist/commands/agents/index.d.ts.map +0 -1
  32. package/dist/commands/agents/index.js.map +0 -1
  33. package/dist/commands/agents/types.d.ts.map +0 -1
  34. package/dist/commands/agents/types.js.map +0 -1
  35. package/dist/commands/agents/utils.d.ts.map +0 -1
  36. package/dist/commands/agents/utils.js.map +0 -1
  37. package/dist/commands/api/api.d.ts.map +0 -1
  38. package/dist/commands/api/api.js.map +0 -1
  39. package/dist/commands/api/index.d.ts.map +0 -1
  40. package/dist/commands/api/index.js.map +0 -1
  41. package/dist/commands/base-command.d.ts.map +0 -1
  42. package/dist/commands/base-command.js.map +0 -1
  43. package/dist/commands/blobs/blobs-delete.d.ts.map +0 -1
  44. package/dist/commands/blobs/blobs-delete.js.map +0 -1
  45. package/dist/commands/blobs/blobs-get.d.ts.map +0 -1
  46. package/dist/commands/blobs/blobs-get.js.map +0 -1
  47. package/dist/commands/blobs/blobs-list.d.ts.map +0 -1
  48. package/dist/commands/blobs/blobs-list.js.map +0 -1
  49. package/dist/commands/blobs/blobs-set.d.ts.map +0 -1
  50. package/dist/commands/blobs/blobs-set.js.map +0 -1
  51. package/dist/commands/blobs/blobs.d.ts.map +0 -1
  52. package/dist/commands/blobs/blobs.js.map +0 -1
  53. package/dist/commands/build/build.d.ts.map +0 -1
  54. package/dist/commands/build/build.js.map +0 -1
  55. package/dist/commands/build/index.d.ts.map +0 -1
  56. package/dist/commands/build/index.js.map +0 -1
  57. package/dist/commands/claim/claim.d.ts.map +0 -1
  58. package/dist/commands/claim/claim.js.map +0 -1
  59. package/dist/commands/claim/index.d.ts.map +0 -1
  60. package/dist/commands/claim/index.js.map +0 -1
  61. package/dist/commands/clone/clone.d.ts.map +0 -1
  62. package/dist/commands/clone/clone.js.map +0 -1
  63. package/dist/commands/clone/index.d.ts.map +0 -1
  64. package/dist/commands/clone/index.js.map +0 -1
  65. package/dist/commands/clone/option_values.d.ts.map +0 -1
  66. package/dist/commands/clone/option_values.js.map +0 -1
  67. package/dist/commands/completion/completion.d.ts.map +0 -1
  68. package/dist/commands/completion/completion.js.map +0 -1
  69. package/dist/commands/completion/index.d.ts.map +0 -1
  70. package/dist/commands/completion/index.js.map +0 -1
  71. package/dist/commands/create/create-action.d.ts.map +0 -1
  72. package/dist/commands/create/create-action.js.map +0 -1
  73. package/dist/commands/create/create.d.ts.map +0 -1
  74. package/dist/commands/create/create.js.map +0 -1
  75. package/dist/commands/create/index.d.ts.map +0 -1
  76. package/dist/commands/create/index.js.map +0 -1
  77. package/dist/commands/database/database.d.ts.map +0 -1
  78. package/dist/commands/database/database.js.map +0 -1
  79. package/dist/commands/database/db-connect.d.ts.map +0 -1
  80. package/dist/commands/database/db-connect.js.map +0 -1
  81. package/dist/commands/database/db-init.d.ts.map +0 -1
  82. package/dist/commands/database/db-init.js.map +0 -1
  83. package/dist/commands/database/db-migrate.d.ts.map +0 -1
  84. package/dist/commands/database/db-migrate.js.map +0 -1
  85. package/dist/commands/database/db-migration-new.d.ts.map +0 -1
  86. package/dist/commands/database/db-migration-new.js.map +0 -1
  87. package/dist/commands/database/db-migration-pull.d.ts.map +0 -1
  88. package/dist/commands/database/db-migration-pull.js.map +0 -1
  89. package/dist/commands/database/db-migrations-reset.d.ts.map +0 -1
  90. package/dist/commands/database/db-migrations-reset.js.map +0 -1
  91. package/dist/commands/database/db-reset.d.ts.map +0 -1
  92. package/dist/commands/database/db-reset.js.map +0 -1
  93. package/dist/commands/database/db-status.d.ts.map +0 -1
  94. package/dist/commands/database/db-status.js.map +0 -1
  95. package/dist/commands/database/index.d.ts.map +0 -1
  96. package/dist/commands/database/index.js.map +0 -1
  97. package/dist/commands/database/util/api-errors.d.ts.map +0 -1
  98. package/dist/commands/database/util/api-errors.js.map +0 -1
  99. package/dist/commands/database/util/applied-migrations.d.ts.map +0 -1
  100. package/dist/commands/database/util/applied-migrations.js.map +0 -1
  101. package/dist/commands/database/util/constants.d.ts.map +0 -1
  102. package/dist/commands/database/util/constants.js.map +0 -1
  103. package/dist/commands/database/util/db-connection.d.ts.map +0 -1
  104. package/dist/commands/database/util/db-connection.js.map +0 -1
  105. package/dist/commands/database/util/init-data.d.ts.map +0 -1
  106. package/dist/commands/database/util/init-data.js.map +0 -1
  107. package/dist/commands/database/util/meta-commands.d.ts.map +0 -1
  108. package/dist/commands/database/util/meta-commands.js.map +0 -1
  109. package/dist/commands/database/util/migrations-path.d.ts.map +0 -1
  110. package/dist/commands/database/util/migrations-path.js.map +0 -1
  111. package/dist/commands/database/util/package-json.d.ts.map +0 -1
  112. package/dist/commands/database/util/package-json.js.map +0 -1
  113. package/dist/commands/database/util/packages.d.ts.map +0 -1
  114. package/dist/commands/database/util/packages.js.map +0 -1
  115. package/dist/commands/database/util/paths.d.ts.map +0 -1
  116. package/dist/commands/database/util/paths.js.map +0 -1
  117. package/dist/commands/database/util/pg-client-executor.d.ts.map +0 -1
  118. package/dist/commands/database/util/pg-client-executor.js.map +0 -1
  119. package/dist/commands/database/util/psql-formatter.d.ts.map +0 -1
  120. package/dist/commands/database/util/psql-formatter.js.map +0 -1
  121. package/dist/commands/database/util/spawn-async.d.ts.map +0 -1
  122. package/dist/commands/database/util/spawn-async.js.map +0 -1
  123. package/dist/commands/database/util/timestamp.d.ts.map +0 -1
  124. package/dist/commands/database/util/timestamp.js.map +0 -1
  125. package/dist/commands/deploy/deploy.d.ts.map +0 -1
  126. package/dist/commands/deploy/deploy.js.map +0 -1
  127. package/dist/commands/deploy/index.d.ts.map +0 -1
  128. package/dist/commands/deploy/index.js.map +0 -1
  129. package/dist/commands/deploy/option_values.d.ts.map +0 -1
  130. package/dist/commands/deploy/option_values.js.map +0 -1
  131. package/dist/commands/dev/dev.d.ts.map +0 -1
  132. package/dist/commands/dev/dev.js.map +0 -1
  133. package/dist/commands/dev/index.d.ts.map +0 -1
  134. package/dist/commands/dev/index.js.map +0 -1
  135. package/dist/commands/dev/programmatic-netlify-dev.d.ts.map +0 -1
  136. package/dist/commands/dev/programmatic-netlify-dev.js.map +0 -1
  137. package/dist/commands/dev-exec/dev-exec.d.ts.map +0 -1
  138. package/dist/commands/dev-exec/dev-exec.js.map +0 -1
  139. package/dist/commands/dev-exec/index.d.ts.map +0 -1
  140. package/dist/commands/dev-exec/index.js.map +0 -1
  141. package/dist/commands/env/env-clone.d.ts.map +0 -1
  142. package/dist/commands/env/env-clone.js.map +0 -1
  143. package/dist/commands/env/env-get.d.ts.map +0 -1
  144. package/dist/commands/env/env-get.js.map +0 -1
  145. package/dist/commands/env/env-import.d.ts.map +0 -1
  146. package/dist/commands/env/env-import.js.map +0 -1
  147. package/dist/commands/env/env-list.d.ts.map +0 -1
  148. package/dist/commands/env/env-list.js.map +0 -1
  149. package/dist/commands/env/env-set.d.ts.map +0 -1
  150. package/dist/commands/env/env-set.js.map +0 -1
  151. package/dist/commands/env/env-unset.d.ts.map +0 -1
  152. package/dist/commands/env/env-unset.js.map +0 -1
  153. package/dist/commands/env/env.d.ts.map +0 -1
  154. package/dist/commands/env/env.js.map +0 -1
  155. package/dist/commands/env/index.d.ts.map +0 -1
  156. package/dist/commands/env/index.js.map +0 -1
  157. package/dist/commands/env/utils.d.ts.map +0 -1
  158. package/dist/commands/env/utils.js.map +0 -1
  159. package/dist/commands/functions/functions-build.d.ts.map +0 -1
  160. package/dist/commands/functions/functions-build.js.map +0 -1
  161. package/dist/commands/functions/functions-create.d.ts.map +0 -1
  162. package/dist/commands/functions/functions-create.js.map +0 -1
  163. package/dist/commands/functions/functions-invoke.d.ts.map +0 -1
  164. package/dist/commands/functions/functions-invoke.js.map +0 -1
  165. package/dist/commands/functions/functions-list.d.ts.map +0 -1
  166. package/dist/commands/functions/functions-list.js.map +0 -1
  167. package/dist/commands/functions/functions-serve.d.ts.map +0 -1
  168. package/dist/commands/functions/functions-serve.js.map +0 -1
  169. package/dist/commands/functions/functions.d.ts.map +0 -1
  170. package/dist/commands/functions/functions.js.map +0 -1
  171. package/dist/commands/functions/index.d.ts.map +0 -1
  172. package/dist/commands/functions/index.js.map +0 -1
  173. package/dist/commands/index.d.ts.map +0 -1
  174. package/dist/commands/index.js.map +0 -1
  175. package/dist/commands/init/constants.d.ts.map +0 -1
  176. package/dist/commands/init/constants.js.map +0 -1
  177. package/dist/commands/init/index.d.ts.map +0 -1
  178. package/dist/commands/init/index.js.map +0 -1
  179. package/dist/commands/init/init.d.ts.map +0 -1
  180. package/dist/commands/init/init.js.map +0 -1
  181. package/dist/commands/link/index.d.ts.map +0 -1
  182. package/dist/commands/link/index.js.map +0 -1
  183. package/dist/commands/link/link.d.ts.map +0 -1
  184. package/dist/commands/link/link.js.map +0 -1
  185. package/dist/commands/link/option_values.d.ts.map +0 -1
  186. package/dist/commands/link/option_values.js.map +0 -1
  187. package/dist/commands/login/index.d.ts.map +0 -1
  188. package/dist/commands/login/index.js.map +0 -1
  189. package/dist/commands/login/login-check.d.ts.map +0 -1
  190. package/dist/commands/login/login-check.js.map +0 -1
  191. package/dist/commands/login/login-request.d.ts.map +0 -1
  192. package/dist/commands/login/login-request.js.map +0 -1
  193. package/dist/commands/login/login.d.ts.map +0 -1
  194. package/dist/commands/login/login.js.map +0 -1
  195. package/dist/commands/logout/index.d.ts.map +0 -1
  196. package/dist/commands/logout/index.js.map +0 -1
  197. package/dist/commands/logout/logout.d.ts.map +0 -1
  198. package/dist/commands/logout/logout.js.map +0 -1
  199. package/dist/commands/logs/build.d.ts.map +0 -1
  200. package/dist/commands/logs/build.js.map +0 -1
  201. package/dist/commands/logs/index.d.ts.map +0 -1
  202. package/dist/commands/logs/index.js.map +0 -1
  203. package/dist/commands/logs/log-api.d.ts.map +0 -1
  204. package/dist/commands/logs/log-api.js.map +0 -1
  205. package/dist/commands/logs/log-levels.d.ts.map +0 -1
  206. package/dist/commands/logs/log-levels.js.map +0 -1
  207. package/dist/commands/logs/logs.d.ts.map +0 -1
  208. package/dist/commands/logs/logs.js.map +0 -1
  209. package/dist/commands/logs/sources/deploy.d.ts.map +0 -1
  210. package/dist/commands/logs/sources/deploy.js.map +0 -1
  211. package/dist/commands/logs/sources/edge-functions.d.ts.map +0 -1
  212. package/dist/commands/logs/sources/edge-functions.js.map +0 -1
  213. package/dist/commands/logs/sources/functions.d.ts.map +0 -1
  214. package/dist/commands/logs/sources/functions.js.map +0 -1
  215. package/dist/commands/main.d.ts.map +0 -1
  216. package/dist/commands/main.js.map +0 -1
  217. package/dist/commands/open/index.d.ts.map +0 -1
  218. package/dist/commands/open/index.js.map +0 -1
  219. package/dist/commands/open/open-admin.d.ts.map +0 -1
  220. package/dist/commands/open/open-admin.js.map +0 -1
  221. package/dist/commands/open/open-site.d.ts.map +0 -1
  222. package/dist/commands/open/open-site.js.map +0 -1
  223. package/dist/commands/open/open.d.ts.map +0 -1
  224. package/dist/commands/open/open.js.map +0 -1
  225. package/dist/commands/recipes/common.d.ts.map +0 -1
  226. package/dist/commands/recipes/common.js.map +0 -1
  227. package/dist/commands/recipes/index.d.ts.map +0 -1
  228. package/dist/commands/recipes/index.js.map +0 -1
  229. package/dist/commands/recipes/recipes-list.d.ts.map +0 -1
  230. package/dist/commands/recipes/recipes-list.js.map +0 -1
  231. package/dist/commands/recipes/recipes.d.ts.map +0 -1
  232. package/dist/commands/recipes/recipes.js.map +0 -1
  233. package/dist/commands/serve/index.d.ts.map +0 -1
  234. package/dist/commands/serve/index.js.map +0 -1
  235. package/dist/commands/serve/serve.d.ts.map +0 -1
  236. package/dist/commands/serve/serve.js.map +0 -1
  237. package/dist/commands/sites/index.d.ts.map +0 -1
  238. package/dist/commands/sites/index.js.map +0 -1
  239. package/dist/commands/sites/sites-create.d.ts.map +0 -1
  240. package/dist/commands/sites/sites-create.js.map +0 -1
  241. package/dist/commands/sites/sites-delete.d.ts.map +0 -1
  242. package/dist/commands/sites/sites-delete.js.map +0 -1
  243. package/dist/commands/sites/sites-list.d.ts.map +0 -1
  244. package/dist/commands/sites/sites-list.js.map +0 -1
  245. package/dist/commands/sites/sites-search.d.ts.map +0 -1
  246. package/dist/commands/sites/sites-search.js.map +0 -1
  247. package/dist/commands/sites/sites.d.ts.map +0 -1
  248. package/dist/commands/sites/sites.js.map +0 -1
  249. package/dist/commands/status/index.d.ts.map +0 -1
  250. package/dist/commands/status/index.js.map +0 -1
  251. package/dist/commands/status/status-hooks.d.ts.map +0 -1
  252. package/dist/commands/status/status-hooks.js.map +0 -1
  253. package/dist/commands/status/status.d.ts.map +0 -1
  254. package/dist/commands/status/status.js.map +0 -1
  255. package/dist/commands/switch/index.d.ts.map +0 -1
  256. package/dist/commands/switch/index.js.map +0 -1
  257. package/dist/commands/switch/switch.d.ts.map +0 -1
  258. package/dist/commands/switch/switch.js.map +0 -1
  259. package/dist/commands/teams/index.d.ts.map +0 -1
  260. package/dist/commands/teams/index.js.map +0 -1
  261. package/dist/commands/teams/teams-list.d.ts.map +0 -1
  262. package/dist/commands/teams/teams-list.js.map +0 -1
  263. package/dist/commands/teams/teams.d.ts.map +0 -1
  264. package/dist/commands/teams/teams.js.map +0 -1
  265. package/dist/commands/unlink/index.d.ts.map +0 -1
  266. package/dist/commands/unlink/index.js.map +0 -1
  267. package/dist/commands/unlink/unlink.d.ts.map +0 -1
  268. package/dist/commands/unlink/unlink.js.map +0 -1
  269. package/dist/commands/watch/index.d.ts.map +0 -1
  270. package/dist/commands/watch/index.js.map +0 -1
  271. package/dist/commands/watch/watch.d.ts.map +0 -1
  272. package/dist/commands/watch/watch.js.map +0 -1
  273. package/dist/index.d.ts.map +0 -1
  274. package/dist/index.js.map +0 -1
  275. package/dist/lib/account.d.ts.map +0 -1
  276. package/dist/lib/account.js.map +0 -1
  277. package/dist/lib/api.d.ts.map +0 -1
  278. package/dist/lib/api.js.map +0 -1
  279. package/dist/lib/blobs/blobs.d.ts.map +0 -1
  280. package/dist/lib/blobs/blobs.js.map +0 -1
  281. package/dist/lib/build.d.ts.map +0 -1
  282. package/dist/lib/build.js.map +0 -1
  283. package/dist/lib/completion/constants.d.ts.map +0 -1
  284. package/dist/lib/completion/constants.js.map +0 -1
  285. package/dist/lib/completion/generate-autocompletion.d.ts.map +0 -1
  286. package/dist/lib/completion/generate-autocompletion.js.map +0 -1
  287. package/dist/lib/completion/get-autocompletion.d.ts.map +0 -1
  288. package/dist/lib/completion/get-autocompletion.js.map +0 -1
  289. package/dist/lib/completion/index.d.ts.map +0 -1
  290. package/dist/lib/completion/index.js.map +0 -1
  291. package/dist/lib/completion/script.d.ts.map +0 -1
  292. package/dist/lib/completion/script.js.map +0 -1
  293. package/dist/lib/edge-functions/bootstrap.d.ts.map +0 -1
  294. package/dist/lib/edge-functions/bootstrap.js.map +0 -1
  295. package/dist/lib/edge-functions/consts.d.ts.map +0 -1
  296. package/dist/lib/edge-functions/consts.js.map +0 -1
  297. package/dist/lib/edge-functions/editor-helper.d.ts.map +0 -1
  298. package/dist/lib/edge-functions/editor-helper.js.map +0 -1
  299. package/dist/lib/edge-functions/get-directories.d.ts.map +0 -1
  300. package/dist/lib/edge-functions/get-directories.js.map +0 -1
  301. package/dist/lib/edge-functions/headers.d.ts.map +0 -1
  302. package/dist/lib/edge-functions/headers.js.map +0 -1
  303. package/dist/lib/edge-functions/proxy.d.ts.map +0 -1
  304. package/dist/lib/edge-functions/proxy.js.map +0 -1
  305. package/dist/lib/edge-functions/registry.d.ts.map +0 -1
  306. package/dist/lib/edge-functions/registry.js.map +0 -1
  307. package/dist/lib/exec-fetcher.d.ts.map +0 -1
  308. package/dist/lib/exec-fetcher.js.map +0 -1
  309. package/dist/lib/extensions.d.ts.map +0 -1
  310. package/dist/lib/extensions.js.map +0 -1
  311. package/dist/lib/fs.d.ts.map +0 -1
  312. package/dist/lib/fs.js.map +0 -1
  313. package/dist/lib/functions/background.d.ts.map +0 -1
  314. package/dist/lib/functions/background.js.map +0 -1
  315. package/dist/lib/functions/config.d.ts.map +0 -1
  316. package/dist/lib/functions/config.js.map +0 -1
  317. package/dist/lib/functions/form-submissions-handler.d.ts.map +0 -1
  318. package/dist/lib/functions/form-submissions-handler.js.map +0 -1
  319. package/dist/lib/functions/local-proxy.d.ts.map +0 -1
  320. package/dist/lib/functions/local-proxy.js.map +0 -1
  321. package/dist/lib/functions/netlify-function.d.ts.map +0 -1
  322. package/dist/lib/functions/netlify-function.js.map +0 -1
  323. package/dist/lib/functions/registry.d.ts.map +0 -1
  324. package/dist/lib/functions/registry.js.map +0 -1
  325. package/dist/lib/functions/runtimes/go/index.d.ts.map +0 -1
  326. package/dist/lib/functions/runtimes/go/index.js.map +0 -1
  327. package/dist/lib/functions/runtimes/index.d.ts.map +0 -1
  328. package/dist/lib/functions/runtimes/index.js.map +0 -1
  329. package/dist/lib/functions/runtimes/js/builders/zisi.d.ts.map +0 -1
  330. package/dist/lib/functions/runtimes/js/builders/zisi.js.map +0 -1
  331. package/dist/lib/functions/runtimes/js/constants.d.ts.map +0 -1
  332. package/dist/lib/functions/runtimes/js/constants.js.map +0 -1
  333. package/dist/lib/functions/runtimes/js/index.d.ts.map +0 -1
  334. package/dist/lib/functions/runtimes/js/index.js.map +0 -1
  335. package/dist/lib/functions/runtimes/js/worker.d.ts.map +0 -1
  336. package/dist/lib/functions/runtimes/js/worker.js.map +0 -1
  337. package/dist/lib/functions/runtimes/rust/index.d.ts.map +0 -1
  338. package/dist/lib/functions/runtimes/rust/index.js.map +0 -1
  339. package/dist/lib/functions/scheduled.d.ts.map +0 -1
  340. package/dist/lib/functions/scheduled.js.map +0 -1
  341. package/dist/lib/functions/server.d.ts.map +0 -1
  342. package/dist/lib/functions/server.js.map +0 -1
  343. package/dist/lib/functions/synchronous.d.ts.map +0 -1
  344. package/dist/lib/functions/synchronous.js.map +0 -1
  345. package/dist/lib/functions/utils.d.ts.map +0 -1
  346. package/dist/lib/functions/utils.js.map +0 -1
  347. package/dist/lib/geo-location.d.ts.map +0 -1
  348. package/dist/lib/geo-location.js.map +0 -1
  349. package/dist/lib/http-agent.d.ts.map +0 -1
  350. package/dist/lib/http-agent.js.map +0 -1
  351. package/dist/lib/images/proxy.d.ts.map +0 -1
  352. package/dist/lib/images/proxy.js.map +0 -1
  353. package/dist/lib/log.d.ts.map +0 -1
  354. package/dist/lib/log.js.map +0 -1
  355. package/dist/lib/path.d.ts.map +0 -1
  356. package/dist/lib/path.js.map +0 -1
  357. package/dist/lib/settings.d.ts.map +0 -1
  358. package/dist/lib/settings.js.map +0 -1
  359. package/dist/lib/spinner.d.ts.map +0 -1
  360. package/dist/lib/spinner.js.map +0 -1
  361. package/dist/lib/string.d.ts.map +0 -1
  362. package/dist/lib/string.js.map +0 -1
  363. package/dist/lib/wait-port.d.ts.map +0 -1
  364. package/dist/lib/wait-port.js.map +0 -1
  365. package/dist/recipes/ai-context/context.d.ts.map +0 -1
  366. package/dist/recipes/ai-context/context.js.map +0 -1
  367. package/dist/recipes/ai-context/index.d.ts.map +0 -1
  368. package/dist/recipes/ai-context/index.js.map +0 -1
  369. package/dist/recipes/blobs-migrate/index.d.ts.map +0 -1
  370. package/dist/recipes/blobs-migrate/index.js.map +0 -1
  371. package/dist/recipes/vscode/index.d.ts.map +0 -1
  372. package/dist/recipes/vscode/index.js.map +0 -1
  373. package/dist/recipes/vscode/settings.d.ts.map +0 -1
  374. package/dist/recipes/vscode/settings.js.map +0 -1
  375. package/dist/utils/addons/prepare.d.ts.map +0 -1
  376. package/dist/utils/addons/prepare.js.map +0 -1
  377. package/dist/utils/build-info.d.ts.map +0 -1
  378. package/dist/utils/build-info.js.map +0 -1
  379. package/dist/utils/command-error-handler.d.ts.map +0 -1
  380. package/dist/utils/command-error-handler.js.map +0 -1
  381. package/dist/utils/command-helpers.d.ts.map +0 -1
  382. package/dist/utils/command-helpers.js.map +0 -1
  383. package/dist/utils/copy-template-dir/copy-template-dir.d.ts.map +0 -1
  384. package/dist/utils/copy-template-dir/copy-template-dir.js.map +0 -1
  385. package/dist/utils/create-deferred.d.ts.map +0 -1
  386. package/dist/utils/create-deferred.js.map +0 -1
  387. package/dist/utils/create-stream-promise.d.ts.map +0 -1
  388. package/dist/utils/create-stream-promise.js.map +0 -1
  389. package/dist/utils/deploy/constants.d.ts.map +0 -1
  390. package/dist/utils/deploy/constants.js.map +0 -1
  391. package/dist/utils/deploy/deploy-site.d.ts.map +0 -1
  392. package/dist/utils/deploy/deploy-site.js.map +0 -1
  393. package/dist/utils/deploy/deploy-source.d.ts.map +0 -1
  394. package/dist/utils/deploy/deploy-source.js.map +0 -1
  395. package/dist/utils/deploy/drop-api.d.ts.map +0 -1
  396. package/dist/utils/deploy/drop-api.js.map +0 -1
  397. package/dist/utils/deploy/file.d.ts.map +0 -1
  398. package/dist/utils/deploy/file.js.map +0 -1
  399. package/dist/utils/deploy/hash-config.d.ts.map +0 -1
  400. package/dist/utils/deploy/hash-config.js.map +0 -1
  401. package/dist/utils/deploy/hash-edge-functions.d.ts.map +0 -1
  402. package/dist/utils/deploy/hash-edge-functions.js.map +0 -1
  403. package/dist/utils/deploy/hash-files.d.ts.map +0 -1
  404. package/dist/utils/deploy/hash-files.js.map +0 -1
  405. package/dist/utils/deploy/hash-fns.d.ts.map +0 -1
  406. package/dist/utils/deploy/hash-fns.js.map +0 -1
  407. package/dist/utils/deploy/hasher-segments.d.ts.map +0 -1
  408. package/dist/utils/deploy/hasher-segments.js.map +0 -1
  409. package/dist/utils/deploy/process-files.d.ts.map +0 -1
  410. package/dist/utils/deploy/process-files.js.map +0 -1
  411. package/dist/utils/deploy/status-cb.d.ts.map +0 -1
  412. package/dist/utils/deploy/status-cb.js.map +0 -1
  413. package/dist/utils/deploy/upload-files.d.ts.map +0 -1
  414. package/dist/utils/deploy/upload-files.js.map +0 -1
  415. package/dist/utils/deploy/upload-source-zip.d.ts.map +0 -1
  416. package/dist/utils/deploy/upload-source-zip.js.map +0 -1
  417. package/dist/utils/deploy/util.d.ts.map +0 -1
  418. package/dist/utils/deploy/util.js.map +0 -1
  419. package/dist/utils/detect-server-settings.d.ts.map +0 -1
  420. package/dist/utils/detect-server-settings.js.map +0 -1
  421. package/dist/utils/dev-server-banner.d.ts.map +0 -1
  422. package/dist/utils/dev-server-banner.js.map +0 -1
  423. package/dist/utils/dev.d.ts.map +0 -1
  424. package/dist/utils/dev.js.map +0 -1
  425. package/dist/utils/dot-env.d.ts.map +0 -1
  426. package/dist/utils/dot-env.js.map +0 -1
  427. package/dist/utils/env/deploy-env-vars.d.ts.map +0 -1
  428. package/dist/utils/env/deploy-env-vars.js.map +0 -1
  429. package/dist/utils/env/index.d.ts.map +0 -1
  430. package/dist/utils/env/index.js.map +0 -1
  431. package/dist/utils/execa.d.ts.map +0 -1
  432. package/dist/utils/execa.js.map +0 -1
  433. package/dist/utils/exit-codes.d.ts.map +0 -1
  434. package/dist/utils/exit-codes.js.map +0 -1
  435. package/dist/utils/feature-flags.d.ts.map +0 -1
  436. package/dist/utils/feature-flags.js.map +0 -1
  437. package/dist/utils/framework-server.d.ts.map +0 -1
  438. package/dist/utils/framework-server.js.map +0 -1
  439. package/dist/utils/frameworks-api.d.ts.map +0 -1
  440. package/dist/utils/frameworks-api.js.map +0 -1
  441. package/dist/utils/functions/constants.d.ts.map +0 -1
  442. package/dist/utils/functions/constants.js.map +0 -1
  443. package/dist/utils/functions/functions.d.ts.map +0 -1
  444. package/dist/utils/functions/functions.js.map +0 -1
  445. package/dist/utils/functions/get-functions.d.ts.map +0 -1
  446. package/dist/utils/functions/get-functions.js.map +0 -1
  447. package/dist/utils/functions/index.d.ts.map +0 -1
  448. package/dist/utils/functions/index.js.map +0 -1
  449. package/dist/utils/get-cli-package-json.d.ts.map +0 -1
  450. package/dist/utils/get-cli-package-json.js.map +0 -1
  451. package/dist/utils/get-repo-data.d.ts.map +0 -1
  452. package/dist/utils/get-repo-data.js.map +0 -1
  453. package/dist/utils/get-site.d.ts.map +0 -1
  454. package/dist/utils/get-site.js.map +0 -1
  455. package/dist/utils/gh-auth.d.ts.map +0 -1
  456. package/dist/utils/gh-auth.js.map +0 -1
  457. package/dist/utils/gitignore.d.ts.map +0 -1
  458. package/dist/utils/gitignore.js.map +0 -1
  459. package/dist/utils/headers.d.ts.map +0 -1
  460. package/dist/utils/headers.js.map +0 -1
  461. package/dist/utils/hooks/requires-site-info-with-project.d.ts.map +0 -1
  462. package/dist/utils/hooks/requires-site-info-with-project.js.map +0 -1
  463. package/dist/utils/hooks/requires-site-info.d.ts.map +0 -1
  464. package/dist/utils/hooks/requires-site-info.js.map +0 -1
  465. package/dist/utils/init/config-github.d.ts.map +0 -1
  466. package/dist/utils/init/config-github.js.map +0 -1
  467. package/dist/utils/init/config-manual.d.ts.map +0 -1
  468. package/dist/utils/init/config-manual.js.map +0 -1
  469. package/dist/utils/init/config.d.ts.map +0 -1
  470. package/dist/utils/init/config.js.map +0 -1
  471. package/dist/utils/init/plugins.d.ts.map +0 -1
  472. package/dist/utils/init/plugins.js.map +0 -1
  473. package/dist/utils/init/utils.d.ts.map +0 -1
  474. package/dist/utils/init/utils.js.map +0 -1
  475. package/dist/utils/live-tunnel.d.ts.map +0 -1
  476. package/dist/utils/live-tunnel.js.map +0 -1
  477. package/dist/utils/multimap.d.ts.map +0 -1
  478. package/dist/utils/multimap.js.map +0 -1
  479. package/dist/utils/nodejs-compile-cache.d.ts.map +0 -1
  480. package/dist/utils/nodejs-compile-cache.js.map +0 -1
  481. package/dist/utils/normalize-repo-url.d.ts.map +0 -1
  482. package/dist/utils/normalize-repo-url.js.map +0 -1
  483. package/dist/utils/object-utilities.d.ts.map +0 -1
  484. package/dist/utils/object-utilities.js.map +0 -1
  485. package/dist/utils/open-browser.d.ts.map +0 -1
  486. package/dist/utils/open-browser.js.map +0 -1
  487. package/dist/utils/parse-raw-flags.d.ts.map +0 -1
  488. package/dist/utils/parse-raw-flags.js.map +0 -1
  489. package/dist/utils/prompts/blob-delete-prompts.d.ts.map +0 -1
  490. package/dist/utils/prompts/blob-delete-prompts.js.map +0 -1
  491. package/dist/utils/prompts/blob-set-prompt.d.ts.map +0 -1
  492. package/dist/utils/prompts/blob-set-prompt.js.map +0 -1
  493. package/dist/utils/prompts/confirm-prompt.d.ts.map +0 -1
  494. package/dist/utils/prompts/confirm-prompt.js.map +0 -1
  495. package/dist/utils/prompts/env-clone-prompt.d.ts.map +0 -1
  496. package/dist/utils/prompts/env-clone-prompt.js.map +0 -1
  497. package/dist/utils/prompts/env-set-prompts.d.ts.map +0 -1
  498. package/dist/utils/prompts/env-set-prompts.js.map +0 -1
  499. package/dist/utils/prompts/env-unset-prompts.d.ts.map +0 -1
  500. package/dist/utils/prompts/env-unset-prompts.js.map +0 -1
  501. package/dist/utils/prompts/prompt-messages.d.ts.map +0 -1
  502. package/dist/utils/prompts/prompt-messages.js.map +0 -1
  503. package/dist/utils/proxy-server.d.ts.map +0 -1
  504. package/dist/utils/proxy-server.js.map +0 -1
  505. package/dist/utils/proxy.d.ts.map +0 -1
  506. package/dist/utils/proxy.js.map +0 -1
  507. package/dist/utils/read-repo-url.d.ts.map +0 -1
  508. package/dist/utils/read-repo-url.js.map +0 -1
  509. package/dist/utils/redirects.d.ts.map +0 -1
  510. package/dist/utils/redirects.js.map +0 -1
  511. package/dist/utils/request-id.d.ts.map +0 -1
  512. package/dist/utils/request-id.js.map +0 -1
  513. package/dist/utils/rules-proxy.d.ts.map +0 -1
  514. package/dist/utils/rules-proxy.js.map +0 -1
  515. package/dist/utils/run-build.d.ts.map +0 -1
  516. package/dist/utils/run-build.js.map +0 -1
  517. package/dist/utils/run-git.d.ts.map +0 -1
  518. package/dist/utils/run-git.js.map +0 -1
  519. package/dist/utils/run-program.d.ts.map +0 -1
  520. package/dist/utils/run-program.js.map +0 -1
  521. package/dist/utils/scripted-commands.d.ts.map +0 -1
  522. package/dist/utils/scripted-commands.js.map +0 -1
  523. package/dist/utils/shell.d.ts.map +0 -1
  524. package/dist/utils/shell.js.map +0 -1
  525. package/dist/utils/sign-redirect.d.ts.map +0 -1
  526. package/dist/utils/sign-redirect.js.map +0 -1
  527. package/dist/utils/static-server.d.ts.map +0 -1
  528. package/dist/utils/static-server.js.map +0 -1
  529. package/dist/utils/team.d.ts.map +0 -1
  530. package/dist/utils/team.js.map +0 -1
  531. package/dist/utils/telemetry/index.d.ts.map +0 -1
  532. package/dist/utils/telemetry/index.js.map +0 -1
  533. package/dist/utils/telemetry/report-error.d.ts.map +0 -1
  534. package/dist/utils/telemetry/report-error.js.map +0 -1
  535. package/dist/utils/telemetry/request.d.ts.map +0 -1
  536. package/dist/utils/telemetry/request.js.map +0 -1
  537. package/dist/utils/telemetry/telemetry.d.ts.map +0 -1
  538. package/dist/utils/telemetry/telemetry.js.map +0 -1
  539. package/dist/utils/telemetry/utils.d.ts.map +0 -1
  540. package/dist/utils/telemetry/utils.js.map +0 -1
  541. package/dist/utils/telemetry/validation.d.ts.map +0 -1
  542. package/dist/utils/telemetry/validation.js.map +0 -1
  543. package/dist/utils/temporary-file.d.ts.map +0 -1
  544. package/dist/utils/temporary-file.js.map +0 -1
  545. package/dist/utils/types.d.ts.map +0 -1
  546. package/dist/utils/types.js.map +0 -1
  547. package/dist/utils/validation.d.ts.map +0 -1
  548. package/dist/utils/validation.js.map +0 -1
  549. package/dist/utils/websockets/index.d.ts.map +0 -1
  550. package/dist/utils/websockets/index.js.map +0 -1
  551. package/dist/utils/zip.d.ts.map +0 -1
  552. package/dist/utils/zip.js.map +0 -1
@@ -1,7 +1,13 @@
1
1
  import type BaseCommand from '../base-command.js';
2
2
  import type { CloneOptionValues } from './option_values.js';
3
+ export declare const getCredentialHelper: () => string;
4
+ export declare const finalizeClone: (options: CloneOptionValues, command: BaseCommand, workingDir: string, linkOverrides: {
5
+ id?: string;
6
+ name?: string;
7
+ gitRemoteUrl?: string;
8
+ }) => Promise<void>;
3
9
  export declare const clone: (options: CloneOptionValues, command: BaseCommand, args: {
4
10
  repo: string;
5
11
  targetDir?: string;
6
- }) => Promise<undefined>;
12
+ }) => Promise<void>;
7
13
  //# sourceMappingURL=clone.d.ts.map
@@ -1,9 +1,23 @@
1
+ import { resolve } from 'path';
2
+ import { LocalState } from '@netlify/dev-utils';
1
3
  import inquirer from 'inquirer';
2
4
  import { normalizeRepoUrl } from '../../utils/normalize-repo-url.js';
3
- import { chalk, logAndThrowError, log } from '../../utils/command-helpers.js';
5
+ import { chalk, logAndThrowError, log, getToken, netlifyCommand } from '../../utils/command-helpers.js';
4
6
  import { runGit } from '../../utils/run-git.js';
7
+ import execa from '../../utils/execa.js';
8
+ import { NETLIFY_GIT_HOST } from '../git-credential/git-credential.js';
5
9
  import { link } from '../link/link.js';
6
10
  import { startSpinner } from '../../lib/spinner.js';
11
+ const NETLIFY_GIT_SERVICE_HOST = 'hgit.services-prod.nsvcs.net';
12
+ const isNetlifyGitServiceUrl = (repoUrl) => {
13
+ try {
14
+ const host = new URL(repoUrl).host;
15
+ return host === NETLIFY_GIT_HOST || host === NETLIFY_GIT_SERVICE_HOST;
16
+ }
17
+ catch {
18
+ return false;
19
+ }
20
+ };
7
21
  const getTargetDir = async (defaultDir) => {
8
22
  const { selectedDir } = await inquirer.prompt([
9
23
  {
@@ -23,42 +37,213 @@ const cloneRepo = async (repoUrl, targetDir, debug) => {
23
37
  throw new Error(`Failed to clone repository: ${error instanceof Error ? error.message : (error?.toString() ?? '')}`);
24
38
  }
25
39
  };
26
- export const clone = async (options, command, args) => {
27
- await command.authenticate();
28
- const { repoUrl, httpsUrl, repoName } = normalizeRepoUrl(args.repo);
29
- const targetDir = args.targetDir ?? (await getTargetDir(`./${repoName}`));
30
- const cloneSpinner = startSpinner({ text: `Cloning repository to ${chalk.cyan(targetDir)}` });
40
+ // Under `npx`/`pnpx`/`npm exec`, `process.argv[1]` points into a temp cache dir that
41
+ // gets cleaned up, so a git credential helper pinned to that path breaks after the
42
+ // fact. Fall back to the resolved invocation (e.g. `npx netlify`) in that case.
43
+ export const getCredentialHelper = () => {
44
+ const cliCommand = netlifyCommand();
45
+ const invocation = cliCommand === 'netlify' ? `'${process.execPath}' '${resolve(process.argv[1])}'` : cliCommand;
46
+ return `!${invocation} git-credential`;
47
+ };
48
+ const configureGitAuth = async (repoDir) => {
49
+ await execa('git', ['config', `credential.https://${NETLIFY_GIT_HOST}.helper`, ''], { cwd: repoDir });
50
+ await execa('git', ['config', '--add', `credential.https://${NETLIFY_GIT_HOST}.helper`, getCredentialHelper()], {
51
+ cwd: repoDir,
52
+ });
53
+ await execa('git', ['config', 'http.postBuffer', '524288000'], { cwd: repoDir });
54
+ };
55
+ const cloneFromNetlifyGit = async (repoUrl, targetDir, debug) => {
31
56
  try {
32
- await cloneRepo(repoUrl, targetDir, options.debug ?? false);
57
+ await execa('git', [
58
+ '-c',
59
+ `credential.https://${NETLIFY_GIT_HOST}.helper=`,
60
+ '-c',
61
+ `credential.https://${NETLIFY_GIT_HOST}.helper=${getCredentialHelper()}`,
62
+ 'clone',
63
+ repoUrl,
64
+ targetDir,
65
+ ], {
66
+ ...(debug ? { stdio: 'inherit' } : {}),
67
+ });
33
68
  }
34
69
  catch (error) {
35
- return logAndThrowError(error);
70
+ const message = error instanceof Error ? error.message : String(error);
71
+ throw new Error(`Failed to clone repository: ${message}`);
36
72
  }
37
- cloneSpinner.success(`Cloned repository to ${chalk.cyan(targetDir)}`);
38
- command.workingDir = targetDir;
73
+ };
74
+ const parseNetlifySiteInput = (input) => {
75
+ const netlifyAppUrlRegex = /^https?:\/\/([^.]+)\.netlify\.app\/?$/;
76
+ const netlifyAppUrlMatch = netlifyAppUrlRegex.exec(input);
77
+ if (netlifyAppUrlMatch) {
78
+ return { isNetlifySite: true, siteName: netlifyAppUrlMatch[1] };
79
+ }
80
+ const appNetlifyUrlRegex = /^https?:\/\/app\.netlify\.com\/(?:sites|projects)\/([^/]+)\/?/;
81
+ const appNetlifyUrlMatch = appNetlifyUrlRegex.exec(input);
82
+ if (appNetlifyUrlMatch) {
83
+ return { isNetlifySite: true, siteName: appNetlifyUrlMatch[1] };
84
+ }
85
+ if (!input.includes('/') && !input.includes(':') && !input.includes('.')) {
86
+ return { isNetlifySite: true, siteName: input };
87
+ }
88
+ return { isNetlifySite: false };
89
+ };
90
+ // FIXME(serhalp): This suffers from the same egregious performance problem as `link`/`init`.
91
+ // We should fix it rather than keep spreading it.
92
+ const lookupSiteByName = async (api, siteName) => {
93
+ try {
94
+ const sites = await api.listSites({ name: siteName, filter: 'all' });
95
+ const site = sites.find((s) => s.name === siteName);
96
+ return site ? site : null;
97
+ }
98
+ catch (error) {
99
+ if (error.status === 404) {
100
+ return null;
101
+ }
102
+ throw error;
103
+ }
104
+ };
105
+ export const finalizeClone = async (options, command, workingDir, linkOverrides) => {
106
+ // `workingDir` may be relative (e.g. a user-entered target dir), and must be resolved
107
+ // against the *current* cwd before it changes below, not after.
108
+ const absoluteWorkingDir = resolve(workingDir);
109
+ command.workingDir = absoluteWorkingDir;
39
110
  // TODO(serhalp): This shouldn't be necessary but `getPathInProject` does not take
40
111
  // `command.workingDir` into account. Carefully fix this and remove this line.
41
- process.chdir(targetDir);
112
+ process.chdir(absoluteWorkingDir);
113
+ // `command.netlify.repositoryRoot`/`state` were resolved from the pre-clone working
114
+ // directory before this command's action ran, so `link()` below would otherwise read
115
+ // and write against the original directory instead of the freshly cloned one.
116
+ command.netlify.repositoryRoot = absoluteWorkingDir;
117
+ command.netlify.state = new LocalState(absoluteWorkingDir);
42
118
  const { id, name, ...globalOptions } = options;
43
- const linkOptions = {
44
- ...globalOptions,
45
- id,
46
- name,
47
- // Use the normalized HTTPS URL as the canonical git URL for linking to ensure
48
- // we have a consistent URL format for looking up projects.
49
- gitRemoteUrl: httpsUrl,
50
- };
51
- await link(linkOptions, command);
119
+ await link({ ...globalOptions, ...linkOverrides }, command);
120
+ };
121
+ const logCloneSuccess = (targetDir, { credentialsConfigured = false, devCommand } = {}) => {
52
122
  log();
53
123
  log(chalk.green('✔ Your project is ready to go!'));
54
124
  log(`→ Next, enter your project directory using ${chalk.cyanBright(`cd ${targetDir}`)}`);
55
125
  log();
56
126
  log(`→ You can now run other ${chalk.cyanBright('netlify')} CLI commands in this directory`);
127
+ if (credentialsConfigured) {
128
+ log(`Git is configured to use your Netlify credentials for this repository.`);
129
+ }
57
130
  log(`→ To build and deploy your project: ${chalk.cyanBright('netlify deploy')}`);
58
- if (command.netlify.config.dev?.command) {
59
- log(`→ To run your dev server: ${chalk.cyanBright(command.netlify.config.dev.command)}`);
131
+ if (devCommand) {
132
+ log(`→ To run your dev server: ${chalk.cyanBright(devCommand)}`);
60
133
  }
61
134
  log(`→ To see all available commands: ${chalk.cyanBright('netlify help')}`);
62
135
  log();
63
136
  };
137
+ const cloneFromNetlifyGitService = async (options, command, args, siteInfo) => {
138
+ const [token] = await getToken();
139
+ if (!token) {
140
+ return logAndThrowError(`No authentication token found. Run ${chalk.cyanBright('netlify login')} to authenticate first.`);
141
+ }
142
+ const accountSlug = siteInfo.account_slug;
143
+ const siteSlug = siteInfo.name;
144
+ if (!accountSlug || !siteSlug) {
145
+ return logAndThrowError('Could not determine account or site slug from the site.');
146
+ }
147
+ const repoUrl = `https://${NETLIFY_GIT_HOST}/${accountSlug}/${siteSlug}.git`;
148
+ const targetDir = args.targetDir ?? (await getTargetDir(`./${siteSlug}`));
149
+ const resolvedTargetDir = resolve(targetDir);
150
+ log(`Remote: ${chalk.dim(repoUrl)}`);
151
+ const cloneSpinner = startSpinner({ text: `Cloning repository to ${chalk.cyan(targetDir)}` });
152
+ try {
153
+ await cloneFromNetlifyGit(repoUrl, resolvedTargetDir, options.debug ?? false);
154
+ }
155
+ catch (error) {
156
+ cloneSpinner.error();
157
+ return logAndThrowError(error);
158
+ }
159
+ cloneSpinner.success(`Cloned repository to ${chalk.cyan(targetDir)}`);
160
+ const configSpinner = startSpinner({ text: 'Configuring git credentials' });
161
+ try {
162
+ await configureGitAuth(resolvedTargetDir);
163
+ }
164
+ catch (error) {
165
+ configSpinner.error();
166
+ return logAndThrowError(error);
167
+ }
168
+ configSpinner.success('Configured git credentials');
169
+ await finalizeClone(options, command, resolvedTargetDir, { id: siteInfo.id });
170
+ logCloneSuccess(targetDir, { credentialsConfigured: true });
171
+ };
172
+ const isInsideGitRepo = async () => {
173
+ try {
174
+ await execa('git', ['rev-parse', '--is-inside-work-tree']);
175
+ return true;
176
+ }
177
+ catch {
178
+ return false;
179
+ }
180
+ };
181
+ export const clone = async (options, command, args) => {
182
+ await command.authenticate();
183
+ const { api, site } = command.netlify;
184
+ if (site.id) {
185
+ return logAndThrowError(`This directory is already linked to a Netlify project. Run ${chalk.cyanBright('netlify clone')} from outside any existing linked project directory.`);
186
+ }
187
+ if (await isInsideGitRepo()) {
188
+ return logAndThrowError(`This directory is already inside a git repository. Run ${chalk.cyanBright('netlify clone')} from outside any existing git repository.`);
189
+ }
190
+ const parsedInput = parseNetlifySiteInput(args.repo);
191
+ if (parsedInput.isNetlifySite) {
192
+ const siteSpinner = startSpinner({ text: `Looking up site ${chalk.cyan(parsedInput.siteName)}...` });
193
+ const siteInfo = await lookupSiteByName(api, parsedInput.siteName);
194
+ if (!siteInfo) {
195
+ siteSpinner.error();
196
+ return logAndThrowError(`Could not find a Netlify site named "${parsedInput.siteName}"`);
197
+ }
198
+ siteSpinner.success(`Found site ${chalk.cyan(siteInfo.name)}`);
199
+ const connectedRepoUrl = siteInfo.build_settings?.repo_url;
200
+ if (connectedRepoUrl && isNetlifyGitServiceUrl(connectedRepoUrl)) {
201
+ log(`Site is connected to Netlify's managed git service.`);
202
+ log(`Cloning from Netlify's managed git service...`);
203
+ log();
204
+ return cloneFromNetlifyGitService(options, command, args, siteInfo);
205
+ }
206
+ if (connectedRepoUrl) {
207
+ log(`Site has a connected repository: ${chalk.dim(connectedRepoUrl)}`);
208
+ log(`Cloning from the connected repository...`);
209
+ log();
210
+ const { repoUrl, repoName } = normalizeRepoUrl(connectedRepoUrl);
211
+ const targetDir = args.targetDir ?? (await getTargetDir(`./${repoName}`));
212
+ const cloneSpinner = startSpinner({ text: `Cloning repository to ${chalk.cyan(targetDir)}` });
213
+ try {
214
+ await cloneRepo(repoUrl, targetDir, options.debug ?? false);
215
+ }
216
+ catch (error) {
217
+ cloneSpinner.error();
218
+ return logAndThrowError(error);
219
+ }
220
+ cloneSpinner.success(`Cloned repository to ${chalk.cyan(targetDir)}`);
221
+ await finalizeClone(options, command, targetDir, { id: siteInfo.id, gitRemoteUrl: connectedRepoUrl });
222
+ logCloneSuccess(targetDir);
223
+ }
224
+ else {
225
+ log(`Site does not have a connected repository.`);
226
+ log(`Cloning from Netlify's managed git service...`);
227
+ log();
228
+ return cloneFromNetlifyGitService(options, command, args, siteInfo);
229
+ }
230
+ }
231
+ else {
232
+ const { repoUrl, httpsUrl, repoName } = normalizeRepoUrl(args.repo);
233
+ const targetDir = args.targetDir ?? (await getTargetDir(`./${repoName}`));
234
+ const cloneSpinner = startSpinner({ text: `Cloning repository to ${chalk.cyan(targetDir)}` });
235
+ try {
236
+ await cloneRepo(repoUrl, targetDir, options.debug ?? false);
237
+ }
238
+ catch (error) {
239
+ cloneSpinner.error();
240
+ return logAndThrowError(error);
241
+ }
242
+ cloneSpinner.success(`Cloned repository to ${chalk.cyan(targetDir)}`);
243
+ // Use the normalized HTTPS URL as the canonical git URL for linking to ensure
244
+ // we have a consistent URL format for looking up projects.
245
+ await finalizeClone(options, command, targetDir, { id: options.id, name: options.name, gitRemoteUrl: httpsUrl });
246
+ logCloneSuccess(targetDir, { devCommand: command.netlify.config.dev?.command });
247
+ }
248
+ };
64
249
  //# sourceMappingURL=clone.js.map
@@ -1,23 +1,34 @@
1
1
  import terminalLink from 'terminal-link';
2
2
  export const createCloneCommand = (program) => program
3
3
  .command('clone')
4
- .description(`Clone a remote repository and link it to an existing project on Netlify
5
- Use this command when the existing Netlify project is already configured to deploy from the existing repo.
4
+ // TODO(serhalp): When making this feature public, add this line:
5
+ // When cloning a Netlify site without a connected repository, the repository will be cloned from Netlify's managed git service with automatic credential configuration.
6
+ .description(`Clone a repository and link it to a Netlify project
6
7
 
7
- If you specify a target directory, the repo will be cloned into that directory. By default, a directory will be created with the name of the repo.
8
+ You can clone from:
9
+ - A GitHub/GitLab repository URL or shorthand (e.g., owner/repo)
10
+ - A Netlify site name (e.g., my-site)
11
+ - A Netlify site URL (e.g., https://my-site.netlify.app)
8
12
 
9
- To specify a project, use --id or --name. By default, the Netlify project to link will be automatically detected if exactly one project found is found with a matching git URL. If we cannot find such a project, you will be interactively prompted to select one.`)
10
- .argument('<repo>', 'URL of the repository to clone or Github `owner/repo` (required)')
13
+ When cloning a Netlify site that has a connected repository, the repository will be cloned from the connected source (GitHub, GitLab, etc.).
14
+
15
+
16
+ If you specify a target directory, the repo will be cloned into that directory. By default, a directory will be created with the name of the repo or site.`)
17
+ .argument('<repository>', 'Repository URL, GitHub shorthand (owner/repo), Netlify site name, or Netlify site URL')
11
18
  .argument('[targetDir]', 'directory in which to clone the repository - will be created if it does not exist')
12
- .option('--id <id>', 'ID of existing Netlify project to link to')
13
- .option('--name <name>', 'Name of existing Netlify project to link to')
19
+ .option('--id <id>', 'ID of existing Netlify project to link to (only for GitHub/GitLab repos)')
20
+ .option('--name <name>', 'Name of existing Netlify project to link to (only for GitHub/GitLab repos)')
14
21
  .addExamples([
22
+ 'netlify clone my-site-name',
23
+ 'netlify clone https://my-site.netlify.app',
24
+ 'netlify clone https://app.netlify.com/sites/my-site',
15
25
  'netlify clone vibecoder/next-unicorn',
16
26
  'netlify clone https://github.com/vibecoder/next-unicorn.git',
17
27
  'netlify clone git@github.com:vibecoder/next-unicorn.git',
18
28
  'netlify clone vibecoder/next-unicorn ./next-unicorn-shh-secret',
19
29
  'netlify clone --id 123-123-123-123 vibecoder/next-unicorn',
20
30
  'netlify clone --name my-project-name vibecoder/next-unicorn',
31
+ 'netlify clone my-site-name ./local-folder',
21
32
  ])
22
33
  .addHelpText('after', () => {
23
34
  const docsUrl = 'https://docs.netlify.com/cli/get-started/#link-and-unlink-sites';
@@ -0,0 +1,7 @@
1
+ import type { Readable, Writable } from 'stream';
2
+ import type { GitCredentialOptionValues } from './option_values.js';
3
+ export declare const NETLIFY_GIT_HOST = "git.netlify.com";
4
+ export declare const parseGitCredentialInput: (input: Readable) => Promise<Partial<Record<string, string>>>;
5
+ export declare const writeCredentials: (output: Writable, token: string) => void;
6
+ export declare const gitCredential: (operation: string, _options: GitCredentialOptionValues) => Promise<void>;
7
+ //# sourceMappingURL=git-credential.d.ts.map
@@ -0,0 +1,39 @@
1
+ import process from 'process';
2
+ import readline from 'readline';
3
+ import { getToken } from '../../utils/command-helpers.js';
4
+ export const NETLIFY_GIT_HOST = 'git.netlify.com';
5
+ export const parseGitCredentialInput = async (input) => {
6
+ const rl = readline.createInterface({
7
+ input,
8
+ terminal: false,
9
+ });
10
+ const data = {};
11
+ for await (const line of rl) {
12
+ if (line === '')
13
+ break;
14
+ const [key, ...valueParts] = line.split('=');
15
+ if (key) {
16
+ data[key] = valueParts.join('=');
17
+ }
18
+ }
19
+ return data;
20
+ };
21
+ export const writeCredentials = (output, token) => {
22
+ output.write(`username=x-access-token\n`);
23
+ output.write(`password=${token}\n`);
24
+ };
25
+ export const gitCredential = async (operation, _options) => {
26
+ if (operation !== 'get') {
27
+ return;
28
+ }
29
+ const input = await parseGitCredentialInput(process.stdin);
30
+ if (input.host?.split(':')[0] !== NETLIFY_GIT_HOST) {
31
+ return;
32
+ }
33
+ const [token] = await getToken();
34
+ if (!token) {
35
+ return;
36
+ }
37
+ writeCredentials(process.stdout, token);
38
+ };
39
+ //# sourceMappingURL=git-credential.js.map
@@ -0,0 +1,3 @@
1
+ import type BaseCommand from '../base-command.js';
2
+ export declare const createGitCredentialCommand: (program: BaseCommand) => BaseCommand;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,9 @@
1
+ export const createGitCredentialCommand = (program) => program
2
+ .command('git-credential', { hidden: true })
3
+ .description('Git credential helper for Netlify authentication (used internally by git)')
4
+ .argument('<operation>', 'Git credential operation (get, store, erase)')
5
+ .action(async (operation, options) => {
6
+ const { gitCredential } = await import('./git-credential.js');
7
+ await gitCredential(operation, options);
8
+ });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ import type { BaseOptionValues } from '../base-command.js';
2
+ export type GitCredentialOptionValues = BaseOptionValues;
3
+ //# sourceMappingURL=option_values.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=option_values.js.map
@@ -84,12 +84,15 @@ export const createLogsCommand = (program) => {
84
84
  .addOption(new Option('--since <time>', 'Start of the historical log window. Accepts a duration (e.g. 10m, 1h, 24h) or an ISO 8601 timestamp. Defaults to 10m'))
85
85
  .addOption(new Option('--until <time>', 'End of the historical log window. Accepts a duration or an ISO 8601 timestamp (defaults to now)'))
86
86
  .addOption(new Option('-f, --follow', 'Stream logs in real time instead of showing historical logs'))
87
- .addOption(new Option('-u, --url <url>', 'Show logs for the deploy behind the given URL. Supports deploy permalinks and branch subdomains'))
87
+ .addOption(new Option('-u, --url <url>', 'Show logs for the deploy behind the given URL. Supports deploy permalinks and branch subdomains. Can be used with all sources.'))
88
+ .addOption(new Option('-d, --deploy-id <deploy-id>', 'Show logs for a specific deploy by ID, including failed builds. Can be used with all sources.'))
88
89
  .addOption(new Option('-l, --level <levels...>', `Log levels to include. Choices are:${CLI_LOG_LEVEL_CHOICES_STRING}`))
89
90
  .addOption(new Option('--json', 'Output logs as JSON Lines'))
90
91
  .addExamples([
91
92
  'netlify logs',
92
93
  'netlify logs --since 1h',
94
+ 'netlify logs --source deploy --deploy-id <deploy-id> --since 7d',
95
+ 'netlify logs --source functions --deploy-id <deploy-id>',
93
96
  'netlify logs --source functions --function checkout --since 24h',
94
97
  'netlify logs --source edge-functions --since 30m',
95
98
  'netlify logs --source deploy --source functions --since 1h',
@@ -1,4 +1,19 @@
1
- import { OptionValues } from 'commander';
1
+ import type { NetlifyAPI } from '@netlify/api';
2
2
  import type BaseCommand from '../base-command.js';
3
- export declare const logsCommand: (options: OptionValues, command: BaseCommand) => Promise<undefined>;
3
+ import type { LogsOptionValues } from './option_values.js';
4
+ type Source = 'functions' | 'edge-functions' | 'deploy';
5
+ export declare const logsCommand: (options: LogsOptionValues, command: BaseCommand) => Promise<undefined>;
6
+ export declare const runFollowMode: ({ sources, client, siteId, accessToken, deployId, deployTargeted, functionNames, edgeFunctionNames, levelsToPrint, json, }: {
7
+ sources: Source[];
8
+ client: NetlifyAPI;
9
+ siteId: string;
10
+ accessToken: string | null | undefined;
11
+ deployId?: string;
12
+ deployTargeted: boolean;
13
+ functionNames: string[];
14
+ edgeFunctionNames: string[];
15
+ levelsToPrint: string[];
16
+ json: boolean;
17
+ }) => Promise<undefined>;
18
+ export {};
4
19
  //# sourceMappingURL=logs.d.ts.map
@@ -1,11 +1,12 @@
1
1
  import { chalk, log, logAndThrowError, netlifyCommand } from '../../utils/command-helpers.js';
2
- import { createColorAssigner, formatJsonLine, formatLogLine, parseTimeValue, resolveDeployIdFromUrl, SOURCE_INDICATORS, SOURCE_LABELS, } from './log-api.js';
2
+ import { createColorAssigner, DEPLOY_ID_RE, formatJsonLine, formatLogLine, parseTimeValue, resolveDeployIdFromUrl, SOURCE_INDICATORS, SOURCE_LABELS, } from './log-api.js';
3
3
  import { LOG_LEVELS_LIST, CLI_LOG_LEVEL_CHOICES_STRING } from './log-levels.js';
4
- import { fetchDeployHistoricalLogs, findCurrentBuildingDeploy, findLatestReadyDeploy, streamDeploy, } from './sources/deploy.js';
4
+ import { fetchDeployHistoricalLogs, findCurrentBuildingDeploy, findLatestFinishedDeploy, findLatestReadyDeploy, isDeployFinished, streamDeploy, } from './sources/deploy.js';
5
5
  import { fetchEdgeFunctionHistoricalLogs, streamEdgeFunctions } from './sources/edge-functions.js';
6
6
  import { fetchFunctionHistoricalLogs, listFunctions, selectFunctions, streamFunctions, validateFunctionCount, } from './sources/functions.js';
7
7
  const VALID_SOURCES = ['functions', 'edge-functions', 'deploy'];
8
8
  const DEFAULT_SINCE = '10m';
9
+ const DEPLOY_STREAM_IDLE_CLOSE_MS = 3_000;
9
10
  const parseSources = (rawSources) => {
10
11
  const sources = [];
11
12
  for (const s of rawSources) {
@@ -122,9 +123,22 @@ export const logsCommand = async (options, command) => {
122
123
  }
123
124
  }
124
125
  let deployId;
125
- if (options.url) {
126
+ let deployTargeted = false;
127
+ if (options.deployId) {
128
+ const explicitDeployId = options.deployId.trim();
129
+ if (!DEPLOY_ID_RE.test(explicitDeployId)) {
130
+ return logAndThrowError(`Invalid --deploy-id value: ${explicitDeployId}. Expected a deploy ID.`);
131
+ }
132
+ if (options.url) {
133
+ return logAndThrowError('--deploy-id cannot be used together with --url.');
134
+ }
135
+ deployId = explicitDeployId;
136
+ deployTargeted = true;
137
+ }
138
+ else if (options.url) {
126
139
  try {
127
140
  deployId = await resolveDeployIdFromUrl(options.url, client, siteId, siteInfo);
141
+ deployTargeted = deployId !== undefined;
128
142
  }
129
143
  catch (error) {
130
144
  const message = error.message;
@@ -170,20 +184,20 @@ export const logsCommand = async (options, command) => {
170
184
  }
171
185
  }
172
186
  if (!deployId) {
173
- const latestId = await findLatestReadyDeploy(client, siteId);
187
+ const latestId = sources.includes('deploy')
188
+ ? await findLatestFinishedDeploy(client, siteId)
189
+ : await findLatestReadyDeploy(client, siteId);
174
190
  if (latestId) {
175
191
  deployId = latestId;
176
192
  }
177
193
  }
178
194
  }
179
- const apiBase = client.basePath;
180
195
  const sinceValue = options.since ?? DEFAULT_SINCE;
181
196
  const untilValue = options.until;
182
197
  if (historicalRange) {
183
198
  await runHistoricalMode({
184
199
  sources,
185
200
  client,
186
- apiBase,
187
201
  siteId,
188
202
  accessToken: client.accessToken,
189
203
  deployId,
@@ -206,17 +220,18 @@ export const logsCommand = async (options, command) => {
206
220
  siteId,
207
221
  accessToken: client.accessToken,
208
222
  deployId,
223
+ deployTargeted,
209
224
  functionNames,
210
225
  edgeFunctionNames,
211
226
  levelsToPrint,
212
227
  json,
213
228
  });
214
229
  };
215
- const runHistoricalMode = async ({ sources, client, apiBase, siteId, accessToken, deployId, functionNames, edgeFunctionNames, from, to, levelsToPrint, json, timeDescription, }) => {
230
+ const runHistoricalMode = async ({ sources, client, siteId, accessToken, deployId, functionNames, edgeFunctionNames, from, to, levelsToPrint, json, timeDescription, }) => {
216
231
  const allEntries = [];
217
232
  if (sources.includes('deploy') && deployId) {
218
233
  const deployEntries = await fetchDeployHistoricalLogs({
219
- apiBase,
234
+ siteId,
220
235
  accessToken,
221
236
  deployId,
222
237
  from,
@@ -264,20 +279,23 @@ const runHistoricalMode = async ({ sources, client, apiBase, siteId, accessToken
264
279
  printEntry(entry, levelsToPrint, json, assignColor(key));
265
280
  }
266
281
  };
267
- const runFollowMode = async ({ sources, client, siteId, accessToken, deployId, functionNames, edgeFunctionNames, levelsToPrint, json, }) => {
282
+ export const runFollowMode = async ({ sources, client, siteId, accessToken, deployId, deployTargeted, functionNames, edgeFunctionNames, levelsToPrint, json, }) => {
268
283
  const assignColor = createColorAssigner();
269
284
  const onEntry = (entry) => {
270
285
  const key = `${entry.source}:${entry.name}`;
271
286
  printEntry(entry, levelsToPrint, json, assignColor(key));
272
287
  };
273
- if (sources.includes('deploy') && deployId) {
274
- const buildingDeployId = await findCurrentBuildingDeploy(client, siteId);
275
- if (buildingDeployId) {
276
- streamDeploy(siteId, buildingDeployId, accessToken, onEntry, () => {
288
+ if (sources.includes('deploy')) {
289
+ const deployStreamId = deployTargeted ? deployId : await findCurrentBuildingDeploy(client, siteId);
290
+ if (deployStreamId) {
291
+ const finished = deployTargeted
292
+ ? await isDeployFinished(client, siteId, deployStreamId).catch(() => false)
293
+ : false;
294
+ streamDeploy(siteId, deployStreamId, accessToken, onEntry, () => {
277
295
  if (!json) {
278
296
  log(chalk.dim('Deploy stream closed.'));
279
297
  }
280
- });
298
+ }, { closeWhenIdleMs: finished ? DEPLOY_STREAM_IDLE_CLOSE_MS : undefined });
281
299
  }
282
300
  }
283
301
  if (sources.includes('functions')) {
@@ -0,0 +1,14 @@
1
+ import type { BaseOptionValues } from '../base-command.js';
2
+ export type LogsOptionValues = BaseOptionValues & {
3
+ source?: string[];
4
+ function?: string[];
5
+ edgeFunction?: string[];
6
+ since?: string;
7
+ until?: string;
8
+ follow?: boolean;
9
+ url?: string;
10
+ deployId?: string;
11
+ level?: string[];
12
+ json?: boolean;
13
+ };
14
+ //# sourceMappingURL=option_values.d.ts.map
@@ -0,0 +1,3 @@
1
+ // This type lives in a separate file to prevent import cycles.
2
+ export {};
3
+ //# sourceMappingURL=option_values.js.map
@@ -1,13 +1,17 @@
1
1
  import type { NetlifyAPI } from '@netlify/api';
2
2
  import type { LogEntry } from '../log-api.js';
3
- export declare const fetchDeployHistoricalLogs: ({ apiBase, accessToken, deployId, from, to, }: {
4
- apiBase: string;
3
+ export declare const fetchDeployHistoricalLogs: ({ siteId, accessToken, deployId, from, to, }: {
4
+ siteId: string;
5
5
  accessToken: string | null | undefined;
6
6
  deployId: string;
7
7
  from: number;
8
8
  to: number;
9
9
  }) => Promise<LogEntry[]>;
10
- export declare const streamDeploy: (siteId: string, deployId: string, accessToken: string | null | undefined, onEntry: (entry: LogEntry) => void, onClose: () => void) => (() => void);
10
+ export declare const streamDeploy: (siteId: string, deployId: string, accessToken: string | null | undefined, onEntry: (entry: LogEntry) => void, onClose: () => void, { closeWhenIdleMs }?: {
11
+ closeWhenIdleMs?: number;
12
+ }) => (() => void);
11
13
  export declare const findCurrentBuildingDeploy: (client: NetlifyAPI, siteId: string) => Promise<string | undefined>;
12
14
  export declare const findLatestReadyDeploy: (client: NetlifyAPI, siteId: string) => Promise<string | undefined>;
15
+ export declare const findLatestFinishedDeploy: (client: NetlifyAPI, siteId: string) => Promise<string | undefined>;
16
+ export declare const isDeployFinished: (client: NetlifyAPI, siteId: string, deployId: string) => Promise<boolean>;
13
17
  //# sourceMappingURL=deploy.d.ts.map