@metabase/cli 0.1.5 → 0.1.7

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 (228) hide show
  1. package/README.md +128 -115
  2. package/dist/add-collection-C9BdVBs2.mjs +11 -0
  3. package/dist/{add-collection-C_iovi9i.mjs → add-collection-DQjTlDNF.mjs} +12 -5
  4. package/dist/archive-B3qiL-kK.mjs +40 -0
  5. package/dist/{archive-DdaP94H3.mjs → archive-BXzghEQX.mjs} +10 -9
  6. package/dist/{archive-WaEW85NB.mjs → archive-CBGKzEAl.mjs} +9 -8
  7. package/dist/{archive-BKPO8lEO.mjs → archive-CuVk8iwN.mjs} +10 -9
  8. package/dist/archive-DTN9tLGT.mjs +40 -0
  9. package/dist/{archive-Dvzrmdbk.mjs → archive-De8jzzq7.mjs} +10 -9
  10. package/dist/auth-D9eAyVoG.mjs +19 -0
  11. package/dist/{body-XtR7-uCO.mjs → body-tcURGnGh.mjs} +4 -4
  12. package/dist/{branches-XUY4JY-X.mjs → branches-CIGkjXIk.mjs} +11 -7
  13. package/dist/{cancel-BrUVO_ax.mjs → cancel-pPsvgJ0Z.mjs} +9 -8
  14. package/dist/{cancel-task-oXheTOB6.mjs → cancel-task-BLGE4UlL.mjs} +12 -8
  15. package/dist/capabilities-7e9MgquN.mjs +29 -0
  16. package/dist/card-DDDrWcDU.mjs +20 -0
  17. package/dist/{card-CQxvHeyP.mjs → card-ezYiriML.mjs} +1 -1
  18. package/dist/{cards-CONTTAG9.mjs → cards-Dq3nx_9n.mjs} +8 -7
  19. package/dist/cli.mjs +264 -44
  20. package/dist/collection-DkEvCDar.mjs +20 -0
  21. package/dist/{predicates-CGO17Q15.mjs → command-augment-BH9qgQ5u.mjs} +66 -14
  22. package/dist/{create-Cs2xntFG.mjs → create-9DBTkbMq.mjs} +18 -16
  23. package/dist/{create-kYpjobrq.mjs → create-B1dyuL9Y.mjs} +16 -10
  24. package/dist/create-BIphz0kO.mjs +52 -0
  25. package/dist/create-BcgoukG4.mjs +50 -0
  26. package/dist/create-BdPoSk_7.mjs +50 -0
  27. package/dist/{create-DZxUeqdf.mjs → create-BrUqxreg.mjs} +11 -10
  28. package/dist/create-DHscDhRd.mjs +50 -0
  29. package/dist/{create-Dq25vsMu.mjs → create-aPaUEGdr.mjs} +11 -10
  30. package/dist/{create-branch-D5u14AxL.mjs → create-branch-DGoc9CUU.mjs} +12 -8
  31. package/dist/{create-Ca9lIDwP.mjs → create-w3mQg9n4.mjs} +11 -10
  32. package/dist/{credentials-BIQ1cEzM.mjs → credentials-qryRLUed.mjs} +12 -11
  33. package/dist/current-task-DZM28rnr.mjs +40 -0
  34. package/dist/{dashboard-CnMD04PQ.mjs → dashboard-B4bn3z6t.mjs} +2 -1
  35. package/dist/dashboard-BLf1RZlk.mjs +21 -0
  36. package/dist/{database-vvig8k4x.mjs → database-BXiue1in.mjs} +1 -1
  37. package/dist/{database-BSvzYlRe.mjs → database-Ce1gOJF7.mjs} +3 -3
  38. package/dist/db-CWTFe_FZ.mjs +22 -0
  39. package/dist/{delete-VTAS9EUt.mjs → delete-BPaFdHZP.mjs} +11 -8
  40. package/dist/{delete-CUx6RT9e.mjs → delete-BrJOotpW.mjs} +11 -8
  41. package/dist/{remove-C6bS0Z6w.mjs → delete-FFj1xQWO.mjs} +25 -20
  42. package/dist/{delete-runtime-DfFMWJJ6.mjs → delete-runtime-uuYbd4k2.mjs} +9 -7
  43. package/dist/{delete-table-DzUneMKe.mjs → delete-table-CNupWUO0.mjs} +11 -8
  44. package/dist/{deprovision-CpJfGgCt.mjs → deprovision-BNr9fPDY.mjs} +18 -12
  45. package/dist/{dirty-nkAOXxgC.mjs → dirty-BCkNOY8c.mjs} +11 -7
  46. package/dist/{docker-D5FTIoD0.mjs → docker-Ds252Mwc.mjs} +4 -4
  47. package/dist/{translate-Cqsd0Px5.mjs → eid-CLY5X0Uw.mjs} +43 -23
  48. package/dist/error-ZsFeevV2.mjs +191 -0
  49. package/dist/{export-BWvY7X_G.mjs → export-CgHgWW3I.mjs} +20 -18
  50. package/dist/{field-B3gvaqpK.mjs → field-E0IBy4Uw.mjs} +12 -3
  51. package/dist/field-LL6W_c-c.mjs +18 -0
  52. package/dist/{fields-dH16G5UV.mjs → fields-RkRWU-u9.mjs} +9 -8
  53. package/dist/{get-D96QEU49.mjs → get-42tJ7BNp.mjs} +8 -7
  54. package/dist/{get-C6SR3A9t.mjs → get-B8l4t4Pz.mjs} +10 -9
  55. package/dist/{get-BnBRKHr7.mjs → get-B9kwSs6U.mjs} +8 -7
  56. package/dist/{get-7macOPAI.mjs → get-Bo4Cpd_c.mjs} +7 -7
  57. package/dist/{get-BcqxMVC1.mjs → get-C9O_aEGo.mjs} +8 -7
  58. package/dist/{get-CKxlhMy1.mjs → get-CRvbChoX.mjs} +8 -7
  59. package/dist/{get-B7i_nYJB.mjs → get-CTDqioaj.mjs} +8 -7
  60. package/dist/{get-D8e_RzZ0.mjs → get-CiZrZJLt.mjs} +10 -9
  61. package/dist/{get-B08K82JV.mjs → get-CvmqPN30.mjs} +8 -7
  62. package/dist/{get-CACaBFLt.mjs → get-DmzgSgrl.mjs} +9 -8
  63. package/dist/{get-R7OaVL_t.mjs → get-DsqGHNHN.mjs} +8 -7
  64. package/dist/get-run-CBwcRc8E.mjs +38 -0
  65. package/dist/{get-DNN1X2gN.mjs → get-sMpa-X4E.mjs} +9 -8
  66. package/dist/{get-DAWofnzK.mjs → get-y17zJMnU.mjs} +8 -7
  67. package/dist/git-sync-CrWTo3YX.mjs +28 -0
  68. package/dist/{has-remote-changes-BAnIXQXU.mjs → has-remote-changes-CfRidwXT.mjs} +13 -8
  69. package/dist/{import-CfdPEMng.mjs → import-BZV0Z2KR.mjs} +21 -18
  70. package/dist/{input-BQ-BZA8h.mjs → input-cMSEqISy.mjs} +7 -4
  71. package/dist/is-dirty-CPzOnnH6.mjs +10 -0
  72. package/dist/{is-dirty-CZWcG0vj.mjs → is-dirty-hKcB4OH9.mjs} +9 -4
  73. package/dist/{items-DqwahOKf.mjs → items-C94eW2Yd.mjs} +10 -9
  74. package/dist/key-vkNkH82H.mjs +17 -0
  75. package/dist/license-B37055sr.mjs +17 -0
  76. package/dist/{list-L63TpX1t.mjs → list-B0V7FeL2.mjs} +7 -7
  77. package/dist/{list-Bkd7Nbds.mjs → list-BFlzLGlw.mjs} +7 -6
  78. package/dist/{list-yxVAE1S7.mjs → list-BJXaGk-z.mjs} +7 -6
  79. package/dist/{list-BqNMpIXy.mjs → list-BS_Bxejg.mjs} +9 -8
  80. package/dist/{list-J277Qtki.mjs → list-BmHoYJr7.mjs} +7 -6
  81. package/dist/list-C-oZe1_p.mjs +173 -0
  82. package/dist/{list-ViT2KWhv.mjs → list-CF1pMN4S.mjs} +7 -6
  83. package/dist/{list-BpNU1neq.mjs → list-CU6sOfI-.mjs} +9 -7
  84. package/dist/{list-oftHLFbE.mjs → list-CqN4gvCk.mjs} +9 -7
  85. package/dist/{list-DBOYoJtA.mjs → list-DUXdt0XI.mjs} +10 -6
  86. package/dist/{list-D41gfkKb.mjs → list-DfDZr55C.mjs} +10 -8
  87. package/dist/{list-vF4EneaE.mjs → list-DrINpVLM.mjs} +7 -6
  88. package/dist/{list-DJcGwJ4W.mjs → list-DuSoEk_J.mjs} +9 -8
  89. package/dist/{list-CQkDqphl.mjs → list-HS15y_WN.mjs} +7 -6
  90. package/dist/login-enh9Yimb.mjs +181 -0
  91. package/dist/{logout-DD4q5whi.mjs → logout-BWLPLDh8.mjs} +13 -11
  92. package/dist/{logs-Ci3mJE2z.mjs → logs-Cu3QtvPs.mjs} +9 -8
  93. package/dist/{manifest-CGM7XNLC.mjs → manifest-BNh0Lw6p.mjs} +15 -15
  94. package/dist/{measure-BEQfnLdN.mjs → measure-Bt3InQsA.mjs} +2 -2
  95. package/dist/measure-CDlEPFtB.mjs +19 -0
  96. package/dist/{metadata-BDat-jN9.mjs → metadata-BTTEBWdS.mjs} +10 -9
  97. package/dist/{metadata-29_qlqbz.mjs → metadata-D2TxboMm.mjs} +9 -8
  98. package/dist/parse-enum-CrEWOhuY.mjs +11 -0
  99. package/dist/{parse-id-CysSaCbf.mjs → parse-id-0_tOPvfI.mjs} +1 -1
  100. package/dist/{parse-ref-D1yeDOn8.mjs → parse-ref-DKag6a6I.mjs} +1 -1
  101. package/dist/{parse-schemas-B10n01ez.mjs → parse-schemas-D-qVLl4z.mjs} +2 -2
  102. package/dist/{path-DLByFMMA.mjs → path-C8GrBdgT.mjs} +7 -7
  103. package/dist/{poll-p9Y7-JEQ.mjs → poll-4eoh5J0r.mjs} +2 -2
  104. package/dist/{poll-task-BQe0NvJZ.mjs → poll-task-51WRdugU.mjs} +19 -20
  105. package/dist/{preflight-CvFu0Cct.mjs → preflight-BhsErYz3.mjs} +4 -4
  106. package/dist/{process-zJeVJZTM.mjs → process-CM7Uu5q_.mjs} +1 -1
  107. package/dist/{prompt-DgDNy_Pc.mjs → prompt-CFKoys7k.mjs} +3 -1
  108. package/dist/provision-Chf86BF0.mjs +83 -0
  109. package/dist/{ps-BxQdpkr5.mjs → ps-CEYtsKBj.mjs} +5 -3
  110. package/dist/ps-CIDwaubS.mjs +11 -0
  111. package/dist/{query-C7zTlFJA.mjs → query-BBCAF-tG.mjs} +17 -14
  112. package/dist/{query-CFH4nBlK.mjs → query-DYVBnu9d.mjs} +12 -9
  113. package/dist/query-result-ABPLz6I4.mjs +19 -0
  114. package/dist/{remove-BuWxx3hY.mjs → remove-2yInufA6.mjs} +14 -12
  115. package/dist/remove-collection-CBAHz0Dk.mjs +44 -0
  116. package/dist/{render-DuoDUTVL.mjs → render-0_GsapXa.mjs} +51 -23
  117. package/dist/render-khznBlla.mjs +32 -0
  118. package/dist/{rescan-values-DabyRYQ_.mjs → rescan-values-cfTSNQZo.mjs} +12 -11
  119. package/dist/{run-Cl-9RtC4.mjs → run-qgdEJv-I.mjs} +17 -15
  120. package/dist/{runs-BH6s1Zao.mjs → runs-BFIIH4GL.mjs} +9 -8
  121. package/dist/{runtime-CDu6fykq.mjs → runtime-Duawf5lE.mjs} +653 -428
  122. package/dist/{schema-tables-i58wp_p3.mjs → schema-tables-C2xM3dho.mjs} +9 -8
  123. package/dist/{schemas-_m8RYRl9.mjs → schemas-BP7xiktH.mjs} +7 -6
  124. package/dist/{search-DObOsjbP.mjs → search-DYP3lOlq.mjs} +12 -16
  125. package/dist/segment-B6HnNGDs.mjs +19 -0
  126. package/dist/{set-CwVWeAsi.mjs → set-DpRQqdo7.mjs} +13 -11
  127. package/dist/{set-CJA9dpK6.mjs → set-Tt-ioa4L.mjs} +14 -13
  128. package/dist/setting-DUa96KF3.mjs +17 -0
  129. package/dist/{setup-DqBOe3HZ.mjs → setup-BPlllnim.mjs} +10 -9
  130. package/dist/{skills-CHU7uuDU.mjs → skills-BkregMyb.mjs} +2 -2
  131. package/dist/{skills-C2rTVj0n.mjs → skills-SqbPo0BI.mjs} +3 -3
  132. package/dist/snippet-dJ68tGsl.mjs +19 -0
  133. package/dist/{start-CfruN4wF.mjs → start-DJZA67WF.mjs} +70 -38
  134. package/dist/{stash-CWuXKSZq.mjs → stash-C89zNKxo.mjs} +21 -18
  135. package/dist/{status-D-RYZB9G.mjs → status-B1EJ_jv0.mjs} +16 -9
  136. package/dist/status-BNvFPemM.mjs +100 -0
  137. package/dist/status-D5wSqYV_.mjs +34 -0
  138. package/dist/{stop-D8Hr4cKX.mjs → stop-5rCLmkCQ.mjs} +16 -11
  139. package/dist/{summary-Lt2XLBK9.mjs → summary-Cihbx0Qs.mjs} +8 -7
  140. package/dist/{sync-schema-BDElSynU.mjs → sync-schema-C3odu0ZH.mjs} +12 -11
  141. package/dist/table-J2f0STnB.mjs +19 -0
  142. package/dist/{table-B-PYcgGb.mjs → table-qDD2kApF.mjs} +1 -1
  143. package/dist/{transform-job-BrhOLO4M.mjs → transform-job-DjhoJbiV.mjs} +1 -1
  144. package/dist/transform-job-OW4SDhsQ.mjs +19 -0
  145. package/dist/transform-q1LYWQtW.mjs +24 -0
  146. package/dist/{tree-DfvjDjmk.mjs → tree-mvq9gM9w.mjs} +7 -6
  147. package/dist/{update-DzgXF082.mjs → update-BoIiuC70.mjs} +16 -14
  148. package/dist/{update-qnFY5IuC.mjs → update-C0jP0AKT.mjs} +12 -11
  149. package/dist/{update-zp7pCBZH.mjs → update-CbBnHz42.mjs} +16 -14
  150. package/dist/{update-B0bjPqKC.mjs → update-CtOo3LsX.mjs} +13 -12
  151. package/dist/{update-CVxOxmt6.mjs → update-DCrOQ1PW.mjs} +17 -15
  152. package/dist/{update-BYduslhn.mjs → update-DEZayTb4.mjs} +20 -15
  153. package/dist/{update-BgcroYkF.mjs → update-DwRxdflw.mjs} +12 -11
  154. package/dist/{update-D9Z8cL7h.mjs → update-Rr4usmCo.mjs} +12 -11
  155. package/dist/{update-DuA8-cCq.mjs → update-VvKMnwsM.mjs} +16 -14
  156. package/dist/{update-dashcard-CQ3kmmss.mjs → update-dashcard-DFvIz8Qj.mjs} +12 -11
  157. package/dist/{update-CqnDMNtZ.mjs → update-tRparnUs.mjs} +18 -16
  158. package/dist/{upgrade-CIgTr2CG.mjs → upgrade-D-Rl_fH9.mjs} +16 -29
  159. package/dist/{url-B5MgZXzg.mjs → url-BB6jeNQj.mjs} +11 -10
  160. package/dist/{uuid-CJz9TmHI.mjs → uuid-BSVUk8u2.mjs} +8 -6
  161. package/dist/{validate-CB0bu50i.mjs → validate-dPEOnOf8.mjs} +2 -1
  162. package/dist/{validate-query-CavIA0Q2.mjs → validate-query-CYvOP8Ld.mjs} +3 -3
  163. package/dist/values-D1RJE4H6.mjs +45 -0
  164. package/dist/verify-A7BWfBPZ.mjs +79 -0
  165. package/dist/{wait-BFqBlg0y.mjs → wait-B17I_pWy.mjs} +2 -2
  166. package/dist/{wait-tDp9ZOou.mjs → wait-DK5QDZ8n.mjs} +14 -10
  167. package/dist/{wait-flags-CN-e9zNq.mjs → wait-flags-DlfbIXHw.mjs} +20 -9
  168. package/dist/{workspace-credentials-4lIxxz4g.mjs → workspace-credentials-8CBMQJFz.mjs} +2 -2
  169. package/dist/workspace-ri6r3zWo.mjs +25 -0
  170. package/dist/{yaml-ECiog374.mjs → yaml-Gv6wRFMF.mjs} +1 -1
  171. package/package.json +2 -1
  172. package/skill-data/core/SKILL.md +55 -453
  173. package/skill-data/git-sync/SKILL.md +1 -1
  174. package/skill-data/mbql/SKILL.md +156 -0
  175. package/skill-data/mbql/references/operators.md +253 -0
  176. package/skill-data/transform/SKILL.md +2 -40
  177. package/skill-data/viz/SKILL.md +137 -0
  178. package/skill-data/viz/references/settings.md +312 -0
  179. package/skill-data/workspace/SKILL.md +45 -63
  180. package/skills/metabase-cli/SKILL.md +5 -26
  181. package/dist/add-collection-ucsyAMkV.mjs +0 -11
  182. package/dist/api-key-BENHbTbV.mjs +0 -13
  183. package/dist/auth-DICRtJDy.mjs +0 -19
  184. package/dist/card-l-UmrUIo.mjs +0 -20
  185. package/dist/collection-oV0olVY-.mjs +0 -19
  186. package/dist/command-augment-D9pI9Vbh.mjs +0 -11
  187. package/dist/create-CrUq6sib.mjs +0 -125
  188. package/dist/create-D3Z878yr.mjs +0 -50
  189. package/dist/create-Le3Bqn7b.mjs +0 -48
  190. package/dist/create-V-q2rU0T.mjs +0 -48
  191. package/dist/create-swbIXdo5.mjs +0 -48
  192. package/dist/current-task-DCq7rk9V.mjs +0 -36
  193. package/dist/dashboard-hbKDd36X.mjs +0 -20
  194. package/dist/db-qVK6NsdB.mjs +0 -22
  195. package/dist/eid-CDFXX_6H.mjs +0 -13
  196. package/dist/field-C0LE7RQI.mjs +0 -18
  197. package/dist/flag-pair-Fmcdkrfx.mjs +0 -17
  198. package/dist/get-run-CwFuR4Uw.mjs +0 -36
  199. package/dist/git-sync-DV7YjniX.mjs +0 -28
  200. package/dist/is-dirty-LxVbm2C5.mjs +0 -10
  201. package/dist/key-CCJdVWKc.mjs +0 -12
  202. package/dist/license-Cb6ewEJO.mjs +0 -17
  203. package/dist/list-DV6CONhp.mjs +0 -55
  204. package/dist/login-D1nZwgKv.mjs +0 -192
  205. package/dist/measure-XhJuL77y.mjs +0 -19
  206. package/dist/package-DFUprkSZ.mjs +0 -85
  207. package/dist/provision-BP-b4Are.mjs +0 -77
  208. package/dist/ps-Bk6unzaX.mjs +0 -11
  209. package/dist/remove-collection-Bc4roCq0.mjs +0 -38
  210. package/dist/segment-DfxZdJmR.mjs +0 -19
  211. package/dist/setting-Czy4ws6h.mjs +0 -18
  212. package/dist/snippet-BCY4KHBU.mjs +0 -19
  213. package/dist/status-1oUnw803.mjs +0 -56
  214. package/dist/status-J9HIDcA5.mjs +0 -32
  215. package/dist/table-BwX3Ib5f.mjs +0 -19
  216. package/dist/transform-iaAi37V0.mjs +0 -24
  217. package/dist/transform-job-Bemonf82.mjs +0 -19
  218. package/dist/values-BXN6tx1i.mjs +0 -36
  219. package/dist/workspace-BBsT0H0g.mjs +0 -24
  220. /package/dist/{body-flags-BK7J6Daz.mjs → body-flags-D7q87Btw.mjs} +0 -0
  221. /package/dist/{collection-B3sPXRLs.mjs → collection-Bcy8cWYH.mjs} +0 -0
  222. /package/dist/{paginate-CTSfuYiF.mjs → paginate-BexjkjbY.mjs} +0 -0
  223. /package/dist/{revision-message-flag-oyq2xrDU.mjs → revision-message-flag-DY29-cgz.mjs} +0 -0
  224. /package/dist/{segment-BMrUBz94.mjs → segment-DhBmcr_E.mjs} +0 -0
  225. /package/dist/{setting-CTaAeMci.mjs → setting-BzCng1Ub.mjs} +0 -0
  226. /package/dist/{snippet-CSWqkslB.mjs → snippet-bi_0XbNT.mjs} +0 -0
  227. /package/dist/{transform-DR4ejuPM.mjs → transform-BKahefz_.mjs} +0 -0
  228. /package/dist/{workspace-DUfqhPm5.mjs → workspace-D8HtUN0y.mjs} +0 -0
package/README.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  Command-line client for Metabase. Authenticates against an instance with an API key and stores it securely on your machine.
4
4
 
5
+ ## Supported Metabase versions
6
+
7
+ The minimum supported server is **Metabase v0.58** (major `58`). Anything older is unsupported.
8
+
9
+ Commands that need more than a baseline OSS server declare it — a higher minimum major version or a premium token feature. The server version and token features are detected and cached when you run `mb auth login` (or `mb auth list`). For those commands, a preflight check runs before the first request and refuses with an actionable message (exit code `2`) when:
10
+
11
+ - the server is older than the command's minimum version, or
12
+ - the command needs a premium feature (e.g. `remote_sync`, `workspaces`) that isn't enabled.
13
+
14
+ Plain OSS commands against a v0.58+ server (the majority) carry no elevated requirement and skip the preflight entirely. When a gated command runs but the server version can't be detected (no cached probe), it proceeds with a warning rather than refusing. To bypass the check for a single run, pass `--skip-preflight`; to bypass it process-wide (e.g. in CI), set `METABASE_CLI_SKIP_PREFLIGHT=1`. Both are footguns — only for servers you know are patched.
15
+
5
16
  ## Install
6
17
 
7
18
  ```sh
@@ -32,14 +43,14 @@ Credentials are stored per-profile. The default profile is named `default`. Use
32
43
 
33
44
  ### `mb auth login`
34
45
 
35
- Save credentials for a profile.
46
+ Save credentials for a profile. On success the server is probed once — the rendered output shows the API-key user, role (`Admin`/`User`), and Metabase version, and the same values are cached in `<configDir>/profiles.json` so later commands skip re-probing. Failure of either the auth probe (`/api/user/current`) or the server probe (`/api/session/properties`) rejects the login; an existing profile keeps its last-known-good `apiKey`/`url`/`lastProbe` and gains a `lastFailure` entry.
36
47
 
37
- | Flag | Description |
38
- | ------------------- | ---------------------------------------------------------- |
39
- | `--url <url>` | Metabase URL. Falls back to `METABASE_URL`, then prompts. |
40
- | `--api-key <value>` | API key. Visible in shell history — pipe on stdin instead. |
41
- | `--profile <name>` | Profile to write to (default: `default`). |
42
- | `--skip-verify` | Save without contacting the server. |
48
+ | Flag | Description |
49
+ | ------------------------ | ---------------------------------------------------------- |
50
+ | `--url <url>` | Metabase URL. Falls back to `METABASE_URL`, then prompts. |
51
+ | `--api-key <value>` | API key. Visible in shell history — pipe on stdin instead. |
52
+ | `--profile <name>`, `-p` | Profile to write to (default: `default`). |
53
+ | `--skip-verify` | Save without contacting the server (no probe, no cache). |
43
54
 
44
55
  Resolution order for the API key: `--api-key` → piped stdin → `METABASE_API_KEY` → interactive prompt. Stdin is auto-detected when not a TTY.
45
56
 
@@ -58,14 +69,16 @@ mb auth status --json
58
69
  mb auth status --profile staging
59
70
  ```
60
71
 
61
- | Flag | Description |
62
- | ------------------ | ---------------------------------------- |
63
- | `--profile <name>` | Profile to inspect (default: `default`). |
64
- | `--json` | Emit JSON. Auto-enabled on non-TTY. |
72
+ | Flag | Description |
73
+ | ------------------------ | ---------------------------------------- |
74
+ | `--profile <name>`, `-p` | Profile to inspect (default: `default`). |
75
+ | `--json` | Emit JSON. Auto-enabled on non-TTY. |
65
76
 
66
77
  ### `mb auth list`
67
78
 
68
- List configured authentication profiles. The index is maintained at `<configDir>/profiles.json` and updated on every `auth login` / `auth logout`. Profiles whose URL/API key were stored in the OS keychain before the index existed are picked up by a one-time backfill from `credentials.json`; profiles that exist only in the keyring (no entry in `credentials.json`) appear after the next `auth login` or `auth logout` against them.
79
+ List configured authentication profiles. All profile metadata (URL, last successful probe, last failure) lives in `<configDir>/profiles.json` at mode `0600`; the API key sits in the OS keychain when available, or inline in the same file when the keychain is unavailable.
80
+
81
+ `auth list` re-probes every profile in parallel — on success it refreshes `lastProbe` (Metabase version, token features, API-key user identity) and clears `lastFailure`; on failure it updates `lastFailure` and leaves the prior `lastProbe`/`url`/`apiKey` untouched. Rendered columns: `Profile | URL | Status | Role | Version | Last probed`. Failed rows append a one-line footer pointing at `mb auth login --profile <name>`.
69
82
 
70
83
  ```sh
71
84
  mb auth list
@@ -85,52 +98,10 @@ mb auth logout --yes
85
98
  mb auth logout --profile staging --yes
86
99
  ```
87
100
 
88
- | Flag | Description |
89
- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
90
- | `--profile <name>` | Profile to clear (default: `default`). |
91
- | `--yes` | Skip the interactive confirmation prompt. In non-TTY contexts the prompt is skipped automatically (kubectl/gh/docker convention). |
92
-
93
- ## License
94
-
95
- Manage the Metabase Enterprise license token.
96
-
97
- ### `mb license set [token]`
98
-
99
- Store a license token. Resolution order: positional → piped stdin → `METABASE_LICENSE_TOKEN` → interactive prompt. Stdin is auto-detected when not a TTY.
100
-
101
- Common output flags (`--json`, `--format`, `--detail`, `--fields`, `--max-bytes`) are accepted; the result payload is rendered through the standard output layer.
102
-
103
- ```sh
104
- echo "$MB_LICENSE" | mb license set
105
- mb license set < token.txt
106
- ```
107
-
108
- ### `mb license status`
109
-
110
- Show whether a license is stored. Does not reveal the value.
111
-
112
- ```sh
113
- mb license status
114
- mb license status --json
115
- ```
116
-
117
- | Flag | Description |
118
- | -------- | ----------------------------------- |
119
- | `--json` | Emit JSON. Auto-enabled on non-TTY. |
120
-
121
- ### `mb license remove`
122
-
123
- Clear the stored license.
124
-
125
- ```sh
126
- mb license remove --yes
127
- ```
128
-
129
- | Flag | Description |
130
- | ------- | --------------------------------------------------------------------------------------------------------------------------------- |
131
- | `--yes` | Skip the interactive confirmation prompt. In non-TTY contexts the prompt is skipped automatically (kubectl/gh/docker convention). |
132
-
133
- Common output flags (`--json`, `--format`, `--detail`, `--fields`, `--max-bytes`) are accepted; the result payload is rendered through the standard output layer.
101
+ | Flag | Description |
102
+ | ------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
103
+ | `--profile <name>`, `-p` | Profile to clear (default: `default`). |
104
+ | `--yes` | Skip the interactive confirmation prompt. In non-TTY contexts the prompt is skipped automatically (kubectl/gh/docker convention). |
134
105
 
135
106
  ## Transforms
136
107
 
@@ -464,7 +435,7 @@ mb card list --filter using_model --model-id 42 --json
464
435
 
465
436
  ```sh
466
437
  mb card get 1
467
- mb card get 1 --json --detail full
438
+ mb card get 1 --json --full
468
439
  ```
469
440
 
470
441
  ### `mb card query <id>`
@@ -612,6 +583,15 @@ cat patch.json | mb dashboard update-dashcard 1 5
612
583
 
613
584
  The patch must contain at least one field; an empty object is rejected before the network round-trip.
614
585
 
586
+ ### `mb dashboard archive <id>`
587
+
588
+ Soft-delete a dashboard by setting `archived: true`. The archived dashboard stays available via `dashboard list --filter archived` and `dashboard get <id>` until permanently deleted server-side. To unarchive use `mb dashboard update <id> --body '{"archived":false}'`.
589
+
590
+ ```sh
591
+ mb dashboard archive 1
592
+ mb dashboard archive 1 --json
593
+ ```
594
+
615
595
  ## Snippets
616
596
 
617
597
  CRUD on `/api/native-query-snippet`. A snippet is a named, reusable piece of native (SQL) query text — referenced from cards via `{{snippet: Name}}`. The list endpoint returns either active or archived rows (mutually exclusive — pass `--archived` to swap).
@@ -875,6 +855,15 @@ mb collection create --body '{"name":"My Collection","parent_id":4}'
875
855
  | `--body <json>` | Inline JSON body. |
876
856
  | `--file <path>` | Path to JSON body file. Use `-` to read from stdin. |
877
857
 
858
+ ### `mb collection archive <id>`
859
+
860
+ Soft-delete a collection by setting `archived: true`. The archived collection stays available via `collection list --filter archived` until permanently deleted server-side. Restore it from the trash in the Metabase UI.
861
+
862
+ ```sh
863
+ mb collection archive 4
864
+ mb collection archive 4 --json
865
+ ```
866
+
878
867
  ## Settings
879
868
 
880
869
  Read and write Metabase instance settings via `/api/setting`. Listing all settings requires admin privileges; per-key reads/writes additionally enforce per-setting access. Setting values are always JSON — `"main"` is the string `main`, `42` is a number, `null` deletes the override and resets the value to its default.
@@ -919,7 +908,7 @@ Sources are resolved in this order: positional, `--file`, piped stdin. Provide e
919
908
 
920
909
  ### `mb search [query]`
921
910
 
922
- Search Metabase content (cards, dashboards, collections, tables, …). Returns a `ListEnvelope` of compact search results by default; pass `--detail full` for the full per-row payload.
911
+ Search Metabase content (cards, dashboards, collections, tables, …). Returns a `ListEnvelope` of compact search results by default; pass `--full` for the full per-row payload.
923
912
 
924
913
  ```sh
925
914
  mb search orders
@@ -932,7 +921,7 @@ mb search products --archived
932
921
  | `--models`, `-m` | Comma-separated model filter: `card,dataset,metric,dashboard,collection,database,table,segment,measure,snippet,document,action,transform,indexed-entity`. |
933
922
  | `--archived` | Include archived items only. |
934
923
  | `--limit` | Max results to return (default `20`). |
935
- | `--table-db-id` | Restrict to items on a given database id. |
924
+ | `--db-id` | Restrict to items on a given database id. |
936
925
  | `--verified` | Only verified content. |
937
926
 
938
927
  ## Git Sync
@@ -1125,25 +1114,25 @@ mb workspace create --file workspace.json
1125
1114
  | `--body <json>` | Inline JSON body. |
1126
1115
  | `--file <path>` | Path to JSON body file. |
1127
1116
 
1128
- ### `mb workspace database provision <workspace-id>`
1117
+ ### `mb workspace database provision <workspace-id> [db-id]`
1129
1118
 
1130
1119
  Provision a database into a workspace. The backend kicks off the work asynchronously and returns the workspace with the new entry in `status: "provisioning"`. Pass `--wait` to poll until the entry reaches `status: "provisioned"` and surface the polled state instead of the initial response.
1131
1120
 
1132
1121
  ```sh
1133
- mb workspace database provision 1 --database-id 5 --schemas analytics,github
1134
- mb workspace database provision 1 --database-id 5 --schemas analytics --wait
1122
+ mb workspace database provision 1 5 --schemas analytics,github
1123
+ mb workspace database provision 1 5 --schemas analytics --wait
1135
1124
  mb workspace database provision 1 --file provision.json
1136
1125
  ```
1137
1126
 
1138
- | Flag | Description |
1139
- | -------------------- | -------------------------------------------------------------- |
1140
- | `--database-id <id>` | Database id (used with `--schemas`). |
1141
- | `--schemas <csv>` | Comma-separated input schemas (used with `--database-id`). |
1142
- | `--body <json>` | Inline JSON body. |
1143
- | `--file <path>` | Path to JSON body file. |
1144
- | `--wait` | Poll until the database entry reaches `status: "provisioned"`. |
1145
- | `--timeout <ms>` | Polling timeout in ms (default 600000). Used with `--wait`. |
1146
- | `--interval <ms>` | Polling interval in ms (default 2000). Used with `--wait`. |
1127
+ | Arg / Flag | Description |
1128
+ | ----------------- | -------------------------------------------------------------- |
1129
+ | `<db-id>` | Database id positional (used with `--schemas`). |
1130
+ | `--schemas <csv>` | Comma-separated input schemas (used with the `db-id`). |
1131
+ | `--body <json>` | Inline JSON body. |
1132
+ | `--file <path>` | Path to JSON body file. |
1133
+ | `--wait` | Poll until the database entry reaches `status: "provisioned"`. |
1134
+ | `--timeout <ms>` | Polling timeout in ms (default 600000). Used with `--wait`. |
1135
+ | `--interval <ms>` | Polling interval in ms (default 2000). Used with `--wait`. |
1147
1136
 
1148
1137
  ### `mb workspace database update <workspace-id> <db-id>`
1149
1138
 
@@ -1188,13 +1177,13 @@ These commands manage a Docker container that serves as the workspace's child Me
1188
1177
  mb workspace start 1
1189
1178
  mb workspace start 1 --wait
1190
1179
  mb workspace start 1 --port 3100
1191
- mb workspace start 1 --image metabase/metabase-dev:feature-workspaces-v2 --no-pull
1180
+ mb workspace start 1 --image metabase/metabase-enterprise:latest --no-pull
1192
1181
  mb workspace start 1 --force
1193
1182
  mb workspace start 1 --repo /path/to/sync-repo --wait
1194
1183
  mb workspace start 1 --repo /path/to/sync-repo --repo-branch dev --repo-mode read-only
1195
1184
  ```
1196
1185
 
1197
- Resolves the parent via the active profile (or `--profile`/`--url`/`--api-key`) and the EE license via `resolveLicenseToken` (the same path `mb license set` writes to). Refuses to start if the workspace has any database that isn't `status: "provisioned"`.
1186
+ Resolves the parent via the active profile (or `--profile`/`--url`/`--api-key`) and the EE license via `resolveLicenseToken` (the same path `mb workspace license set` writes to). Refuses to start if the workspace has any database that isn't `status: "provisioned"`.
1198
1187
 
1199
1188
  The boot bundle (`config.yml`, `credentials.json`, optional `metadata.json`) is built in process memory and tar-streamed into the container's `/mw-config/` directory through `docker cp -`; no host-disk artifact is created. The CLI generates a per-workspace admin user + API key, injects them into the YAML before shipping, and stores the same values in `credentials.json` for later retrieval via `mb workspace credentials`. Once the child logs that it has read `config.yml`, the CLI scrubs the in-container copy (`docker exec rm /mw-config/config.yml`) so the warehouse credentials in `details.password` no longer linger; `credentials.json` stays.
1200
1189
 
@@ -1205,7 +1194,7 @@ When `--repo <host-path>` is passed, the CLI bind-mounts the host directory at `
1205
1194
  | Flag | Description |
1206
1195
  | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1207
1196
  | `--port <n>` | Host port (default: 3000; auto-shifts up to 100 ports if taken). |
1208
- | `--image <ref>` | Docker image (default: `metabase/metabase-dev:feature-workspaces-v2`). |
1197
+ | `--image <ref>` | Docker image. Default: `metabase/metabase-enterprise:latest` once Metabase v62 is released, otherwise `metabase/metabase-enterprise-head:latest`. |
1209
1198
  | `--wait` | Block until `/api/health` is ready. Default: return as soon as consumed. |
1210
1199
  | `--timeout <ms>` | Per-phase readiness deadline (default: 240000). Covers post-create config consumption, (with `--wait`) the `/api/health` probe, and (with `--metadata`) the metadata-import status poll. |
1211
1200
  | `--no-pull` | Skip `docker pull` (useful if the image is already present). |
@@ -1224,11 +1213,11 @@ mb workspace stop 1 --json
1224
1213
 
1225
1214
  Stops the running container; no-ops if it's already exited or missing. Reports the prior state.
1226
1215
 
1227
- ### `mb workspace remove <id>`
1216
+ ### `mb workspace delete <id>`
1228
1217
 
1229
1218
  ```sh
1230
- mb workspace remove 1 --yes
1231
- mb workspace remove 1 --keep-volume --yes
1219
+ mb workspace delete 1 --yes
1220
+ mb workspace delete 1 --keep-volume --yes
1232
1221
  ```
1233
1222
 
1234
1223
  Stops and removes the container. By default, also removes the app-db volume — pass `--keep-volume` to preserve it across rebuilds. **Does not affect the remote workspace** on the parent.
@@ -1280,9 +1269,49 @@ mb workspace ps --json
1280
1269
 
1281
1270
  Lists every container that carries the `com.metabase.workspace.id` label, running or stopped. The `--json` envelope is the canonical agent-facing shape and contains only `workspace_id`, `workspace_name`, `state`, and `url`; `--full --json` emits the wider record (image, profile, parent URL, container name, status string, host port).
1282
1271
 
1272
+ ### License
1273
+
1274
+ The Metabase Enterprise license token is stored locally and forwarded to the child instance by `mb workspace start`. It is global to the CLI install (not per-profile).
1275
+
1276
+ #### `mb workspace license set [token]`
1277
+
1278
+ Store a license token. Resolution order: positional → piped stdin → `METABASE_LICENSE_TOKEN` → interactive prompt. Stdin is auto-detected when not a TTY.
1279
+
1280
+ Common output flags (`--json`, `--format`, `--full`, `--fields`, `--max-bytes`) are accepted; the result payload is rendered through the standard output layer.
1281
+
1282
+ ```sh
1283
+ echo "$MB_LICENSE" | mb workspace license set
1284
+ mb workspace license set < token.txt
1285
+ ```
1286
+
1287
+ #### `mb workspace license status`
1288
+
1289
+ Show whether a license is stored. Does not reveal the value.
1290
+
1291
+ ```sh
1292
+ mb workspace license status
1293
+ mb workspace license status --json
1294
+ ```
1295
+
1296
+ | Flag | Description |
1297
+ | -------- | ----------------------------------- |
1298
+ | `--json` | Emit JSON. Auto-enabled on non-TTY. |
1299
+
1300
+ #### `mb workspace license remove`
1301
+
1302
+ Clear the stored license.
1303
+
1304
+ ```sh
1305
+ mb workspace license remove --yes
1306
+ ```
1307
+
1308
+ | Flag | Description |
1309
+ | ------- | --------------------------------------------------------------------------------------------------------------------------------- |
1310
+ | `--yes` | Skip the interactive confirmation prompt. In non-TTY contexts the prompt is skipped automatically (kubectl/gh/docker convention). |
1311
+
1283
1312
  ## Instance setup
1284
1313
 
1285
- Operations against a workspace-instance Metabase. The setup wizard and API key creation are distinct endpoints — there is no shared body schema.
1314
+ Bootstrapping a fresh, not-yet-configured Metabase instance.
1286
1315
 
1287
1316
  ### `mb setup`
1288
1317
 
@@ -1299,43 +1328,26 @@ mb setup --body '{"token":"<setup-token>","user":{"email":"a@b.c","password":"..
1299
1328
  | `--body <json>` | Inline JSON body. |
1300
1329
  | `--file <path>` | Path to JSON body file. |
1301
1330
 
1302
- ### `mb api-key create`
1303
-
1304
- Create a new API key (`POST /api/api-key`). The unmasked key is returned on creation only; capture it from the output.
1305
-
1306
- ```sh
1307
- mb api-key create --name deploy-bot --group-id 2
1308
- echo '{"name":"k","group_id":2}' | mb api-key create
1309
- mb api-key create --file key.json
1310
- ```
1311
-
1312
- | Flag | Description |
1313
- | ----------------- | ----------------------------------------- |
1314
- | `--name <name>` | API key name (used with `--group-id`). |
1315
- | `--group-id <id>` | Permission group id (used with `--name`). |
1316
- | `--body <json>` | Inline JSON body. |
1317
- | `--file <path>` | Path to JSON body file. |
1318
-
1319
1331
  ## Agent helpers
1320
1332
 
1321
1333
  Endpoints commonly used by agents driving the instance. `card query` and `transform run` are documented in their own sections; the helper below covers entity-id translation.
1322
1334
 
1323
- ### `mb eid translate`
1335
+ ### `mb eid [eids]`
1324
1336
 
1325
1337
  Translate string entity ids (EIDs) to numeric ids (`POST /api/eid-translation/translate`).
1326
1338
 
1327
1339
  ```sh
1328
- mb eid translate --model card --eids abc123XYZ,def456ABC
1329
- mb eid translate --file translate.json
1330
- mb eid translate --body '{"entity_ids":{"card":["abc123XYZ"]}}'
1340
+ mb eid --model card abc123XYZ,def456ABC
1341
+ mb eid --file translate.json
1342
+ mb eid --body '{"entity_ids":{"card":["abc123XYZ"]}}'
1331
1343
  ```
1332
1344
 
1333
- | Flag | Description |
1334
- | ---------------- | ------------------------------------------------------------------------------------------------ |
1335
- | `--model <name>` | Entity model for the shortcut form (e.g. `card`, `dashboard`, `collection`). Used with `--eids`. |
1336
- | `--eids <csv>` | Comma-separated EIDs. Used with `--model`. |
1337
- | `--body <json>` | Inline JSON body. |
1338
- | `--file <path>` | Path to JSON body file. |
1345
+ | Arg / Flag | Description |
1346
+ | ---------------- | ------------------------------------------------------------------------------ |
1347
+ | `<eids>` | Comma-separated EIDs positional. Used with `--model`. |
1348
+ | `--model <name>` | Entity model for the positional EIDs (e.g. `card`, `dashboard`, `collection`). |
1349
+ | `--body <json>` | Inline JSON body. |
1350
+ | `--file <path>` | Path to JSON body file. |
1339
1351
 
1340
1352
  ## Query
1341
1353
 
@@ -1488,14 +1500,15 @@ Exit codes: `0` success, `2` `ConfigError` (missing name, unknown name, `MB_SKIL
1488
1500
 
1489
1501
  ## Environment variables
1490
1502
 
1491
- | Variable | Effect |
1492
- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
1493
- | `METABASE_URL` | Default URL for `auth login` and config resolution. |
1494
- | `METABASE_API_KEY` | Default API key (overrides interactive prompt; not stored). |
1495
- | `METABASE_PROFILE` | Default profile when `--profile` is omitted. Falls back to `default`. |
1496
- | `METABASE_LICENSE_TOKEN` | Default license token for `license set`. |
1497
- | `METABASE_VERBOSE` | When set to `1`, prints structured developer-detail JSON to stderr on failure. |
1498
- | `MB_SKILLS_DIR` | Override the directory `mb skills` scans (dev/test only; defaults to the CLI's bundled `skills` + `skill-data` trees). |
1503
+ | Variable | Effect |
1504
+ | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1505
+ | `METABASE_URL` | Default URL for `auth login` and config resolution. |
1506
+ | `METABASE_API_KEY` | Default API key (overrides interactive prompt; not stored). |
1507
+ | `METABASE_PROFILE` | Default profile when `--profile` is omitted. Falls back to `default`. |
1508
+ | `METABASE_LICENSE_TOKEN` | Default license token for `workspace license set`. |
1509
+ | `METABASE_VERBOSE` | When set to `1`, prints structured developer-detail JSON to stderr on failure. |
1510
+ | `METABASE_CLI_SKIP_PREFLIGHT` | When set to `1`, bypasses the per-command server version / token-feature preflight check. Escape hatch for patched Metabase builds; can mask real compatibility problems. |
1511
+ | `MB_SKILLS_DIR` | Override the directory `mb skills` scans (dev/test only; defaults to the CLI's bundled `skills` + `skill-data` trees). |
1499
1512
 
1500
1513
  ## Agent integration
1501
1514
 
@@ -0,0 +1,11 @@
1
+ import "./command-augment-BH9qgQ5u.mjs";
2
+ import "./error-ZsFeevV2.mjs";
3
+ import "./runtime-Duawf5lE.mjs";
4
+ import "./capabilities-7e9MgquN.mjs";
5
+ import "./render-0_GsapXa.mjs";
6
+ import "./parse-id-0_tOPvfI.mjs";
7
+ import "./poll-task-51WRdugU.mjs";
8
+ import "./poll-4eoh5J0r.mjs";
9
+ import { SyncSettingsUpdateResult, add_collection_default, setCollectionRemoteSynced, syncSettingsUpdateView } from "./add-collection-DQjTlDNF.mjs";
10
+
11
+ export { add_collection_default as default };
@@ -1,7 +1,8 @@
1
- import { renderItem } from "./render-DuoDUTVL.mjs";
2
- import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-CDu6fykq.mjs";
3
- import { parseId } from "./parse-id-CysSaCbf.mjs";
4
- import { REMOTE_SYNC_PATHS } from "./poll-task-BQe0NvJZ.mjs";
1
+ import { connectionFlags, outputFlags, profileFlag } from "./error-ZsFeevV2.mjs";
2
+ import { defineMetabaseCommand } from "./runtime-Duawf5lE.mjs";
3
+ import { renderSummary } from "./render-0_GsapXa.mjs";
4
+ import { parseId } from "./parse-id-0_tOPvfI.mjs";
5
+ import { REMOTE_SYNC_PATHS } from "./poll-task-51WRdugU.mjs";
5
6
  import { z } from "zod";
6
7
 
7
8
  //#region src/commands/git-sync/add-collection.ts
@@ -30,6 +31,10 @@ var add_collection_default = defineMetabaseCommand({
30
31
  name: "add-collection",
31
32
  description: "Mark a collection as git-synced; cascades to descendants by location prefix"
32
33
  },
34
+ capabilities: {
35
+ minVersion: 60,
36
+ tokenFeature: "remote_sync"
37
+ },
33
38
  args: {
34
39
  ...outputFlags,
35
40
  ...profileFlag,
@@ -46,7 +51,9 @@ var add_collection_default = defineMetabaseCommand({
46
51
  const collectionId = parseId(args.id, "id");
47
52
  const client = await getClient();
48
53
  const result = await setCollectionRemoteSynced(client, collectionId, true);
49
- renderItem(result, syncSettingsUpdateView, ctx);
54
+ const taskPart = result.task_id !== void 0 ? ` (task #${result.task_id})` : "";
55
+ const message = result.success ? `Collection ${collectionId} is now git-synced${taskPart}.` : `Could not update git-sync setting for collection ${collectionId}.`;
56
+ renderSummary(result, syncSettingsUpdateView, message, ctx);
50
57
  }
51
58
  });
52
59
 
@@ -0,0 +1,40 @@
1
+ import "./command-augment-BH9qgQ5u.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-ZsFeevV2.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-Duawf5lE.mjs";
4
+ import "./capabilities-7e9MgquN.mjs";
5
+ import { renderSummary } from "./render-0_GsapXa.mjs";
6
+ import { parseId } from "./parse-id-0_tOPvfI.mjs";
7
+ import { Dashboard, dashboardView } from "./dashboard-B4bn3z6t.mjs";
8
+
9
+ //#region src/commands/dashboard/archive.ts
10
+ var archive_default = defineMetabaseCommand({
11
+ meta: {
12
+ name: "archive",
13
+ description: "Archive (soft-delete) a dashboard by id"
14
+ },
15
+ capabilities: { minVersion: 58 },
16
+ args: {
17
+ ...outputFlags,
18
+ ...profileFlag,
19
+ ...connectionFlags,
20
+ id: {
21
+ type: "positional",
22
+ description: "Dashboard id",
23
+ required: true
24
+ }
25
+ },
26
+ outputSchema: Dashboard,
27
+ examples: ["mb dashboard archive 1", "mb dashboard archive 1 --json"],
28
+ async run({ args, ctx, getClient }) {
29
+ const id = parseId(args.id);
30
+ const client = await getClient();
31
+ const updated = await client.requestParsed(Dashboard, `/api/dashboard/${id}`, {
32
+ method: "PUT",
33
+ body: { archived: true }
34
+ });
35
+ renderSummary(updated, dashboardView, `Archived dashboard ${updated.id} "${updated.name}".`, ctx);
36
+ }
37
+ });
38
+
39
+ //#endregion
40
+ export { archive_default as default };
@@ -1,11 +1,11 @@
1
- import "./package-DFUprkSZ.mjs";
2
- import "./command-augment-D9pI9Vbh.mjs";
3
- import { renderItem } from "./render-DuoDUTVL.mjs";
4
- import "./predicates-CGO17Q15.mjs";
5
- import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-CDu6fykq.mjs";
6
- import { parseId } from "./parse-id-CysSaCbf.mjs";
7
- import { revisionMessageFlag } from "./revision-message-flag-oyq2xrDU.mjs";
8
- import { Segment, segmentView } from "./segment-BMrUBz94.mjs";
1
+ import "./command-augment-BH9qgQ5u.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-ZsFeevV2.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-Duawf5lE.mjs";
4
+ import "./capabilities-7e9MgquN.mjs";
5
+ import { renderSummary } from "./render-0_GsapXa.mjs";
6
+ import { parseId } from "./parse-id-0_tOPvfI.mjs";
7
+ import { revisionMessageFlag } from "./revision-message-flag-DY29-cgz.mjs";
8
+ import { Segment, segmentView } from "./segment-DhBmcr_E.mjs";
9
9
 
10
10
  //#region src/commands/segment/archive.ts
11
11
  var archive_default = defineMetabaseCommand({
@@ -13,6 +13,7 @@ var archive_default = defineMetabaseCommand({
13
13
  name: "archive",
14
14
  description: "Archive (soft-delete) a segment by id"
15
15
  },
16
+ capabilities: { minVersion: 58 },
16
17
  args: {
17
18
  ...outputFlags,
18
19
  ...profileFlag,
@@ -36,7 +37,7 @@ var archive_default = defineMetabaseCommand({
36
37
  revision_message: args.revisionMessage
37
38
  }
38
39
  });
39
- renderItem(updated, segmentView, ctx);
40
+ renderSummary(updated, segmentView, `Archived segment ${updated.id} "${updated.name}".`, ctx);
40
41
  }
41
42
  });
42
43
 
@@ -1,10 +1,10 @@
1
- import "./package-DFUprkSZ.mjs";
2
- import "./command-augment-D9pI9Vbh.mjs";
3
- import { renderItem } from "./render-DuoDUTVL.mjs";
4
- import "./predicates-CGO17Q15.mjs";
5
- import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-CDu6fykq.mjs";
6
- import { parseId } from "./parse-id-CysSaCbf.mjs";
7
- import { Snippet, snippetView } from "./snippet-CSWqkslB.mjs";
1
+ import "./command-augment-BH9qgQ5u.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-ZsFeevV2.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-Duawf5lE.mjs";
4
+ import "./capabilities-7e9MgquN.mjs";
5
+ import { renderSummary } from "./render-0_GsapXa.mjs";
6
+ import { parseId } from "./parse-id-0_tOPvfI.mjs";
7
+ import { Snippet, snippetView } from "./snippet-bi_0XbNT.mjs";
8
8
 
9
9
  //#region src/commands/snippet/archive.ts
10
10
  var archive_default = defineMetabaseCommand({
@@ -12,6 +12,7 @@ var archive_default = defineMetabaseCommand({
12
12
  name: "archive",
13
13
  description: "Archive (soft-delete) a native query snippet by id"
14
14
  },
15
+ capabilities: { minVersion: 58 },
15
16
  args: {
16
17
  ...outputFlags,
17
18
  ...profileFlag,
@@ -31,7 +32,7 @@ var archive_default = defineMetabaseCommand({
31
32
  method: "PUT",
32
33
  body: { archived: true }
33
34
  });
34
- renderItem(updated, snippetView, ctx);
35
+ renderSummary(updated, snippetView, `Archived snippet ${updated.id} "${updated.name}".`, ctx);
35
36
  }
36
37
  });
37
38
 
@@ -1,11 +1,11 @@
1
- import "./package-DFUprkSZ.mjs";
2
- import "./command-augment-D9pI9Vbh.mjs";
3
- import { renderItem } from "./render-DuoDUTVL.mjs";
4
- import "./predicates-CGO17Q15.mjs";
5
- import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-CDu6fykq.mjs";
6
- import { parseId } from "./parse-id-CysSaCbf.mjs";
7
- import { Measure, measureView } from "./measure-BEQfnLdN.mjs";
8
- import { revisionMessageFlag } from "./revision-message-flag-oyq2xrDU.mjs";
1
+ import "./command-augment-BH9qgQ5u.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-ZsFeevV2.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-Duawf5lE.mjs";
4
+ import "./capabilities-7e9MgquN.mjs";
5
+ import { renderSummary } from "./render-0_GsapXa.mjs";
6
+ import { parseId } from "./parse-id-0_tOPvfI.mjs";
7
+ import { Measure, measureView } from "./measure-Bt3InQsA.mjs";
8
+ import { revisionMessageFlag } from "./revision-message-flag-DY29-cgz.mjs";
9
9
 
10
10
  //#region src/commands/measure/archive.ts
11
11
  var archive_default = defineMetabaseCommand({
@@ -13,6 +13,7 @@ var archive_default = defineMetabaseCommand({
13
13
  name: "archive",
14
14
  description: "Archive (soft-delete) a measure by id"
15
15
  },
16
+ capabilities: { minVersion: 59 },
16
17
  args: {
17
18
  ...outputFlags,
18
19
  ...profileFlag,
@@ -36,7 +37,7 @@ var archive_default = defineMetabaseCommand({
36
37
  revision_message: args.revisionMessage
37
38
  }
38
39
  });
39
- renderItem(updated, measureView, ctx);
40
+ renderSummary(updated, measureView, `Archived measure ${updated.id} "${updated.name}".`, ctx);
40
41
  }
41
42
  });
42
43
 
@@ -0,0 +1,40 @@
1
+ import "./command-augment-BH9qgQ5u.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-ZsFeevV2.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-Duawf5lE.mjs";
4
+ import "./capabilities-7e9MgquN.mjs";
5
+ import { renderSummary } from "./render-0_GsapXa.mjs";
6
+ import { parseId } from "./parse-id-0_tOPvfI.mjs";
7
+ import { Collection, collectionView } from "./collection-Bcy8cWYH.mjs";
8
+
9
+ //#region src/commands/collection/archive.ts
10
+ var archive_default = defineMetabaseCommand({
11
+ meta: {
12
+ name: "archive",
13
+ description: "Archive (soft-delete) a collection by id"
14
+ },
15
+ capabilities: { minVersion: 58 },
16
+ args: {
17
+ ...outputFlags,
18
+ ...profileFlag,
19
+ ...connectionFlags,
20
+ id: {
21
+ type: "positional",
22
+ description: "Collection id",
23
+ required: true
24
+ }
25
+ },
26
+ outputSchema: Collection,
27
+ examples: ["mb collection archive 4", "mb collection archive 4 --json"],
28
+ async run({ args, ctx, getClient }) {
29
+ const id = parseId(args.id);
30
+ const client = await getClient();
31
+ const updated = await client.requestParsed(Collection, `/api/collection/${id}`, {
32
+ method: "PUT",
33
+ body: { archived: true }
34
+ });
35
+ renderSummary(updated, collectionView, `Archived collection ${updated.id} "${updated.name}".`, ctx);
36
+ }
37
+ });
38
+
39
+ //#endregion
40
+ export { archive_default as default };