@metabase/cli 0.1.8 → 0.1.10

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 (215) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/README.md +89 -236
  3. package/dist/add-collection-D9wXgmRj.mjs +10 -0
  4. package/dist/{add-collection-CwrbKmC1.mjs → add-collection-DUqTrC5T.mjs} +5 -5
  5. package/dist/{archive-DqUtqRut.mjs → archive-0krZxAXq.mjs} +5 -6
  6. package/dist/{archive-ZnnJc2iT.mjs → archive-44EWiXud.mjs} +6 -7
  7. package/dist/{archive-BpKZsGAm.mjs → archive-B59Y7ajB.mjs} +6 -7
  8. package/dist/{archive-BO3DOWI4.mjs → archive-BEIyIsin.mjs} +5 -6
  9. package/dist/{archive-BzvqQd34.mjs → archive-BZfpjMir.mjs} +5 -6
  10. package/dist/{archive-BAjGIzhn.mjs → archive-DtE2H4A6.mjs} +6 -7
  11. package/dist/archive-_GMNY8wH.mjs +39 -0
  12. package/dist/auth-cFC5m69m.mjs +19 -0
  13. package/dist/{body-DDYKoyMt.mjs → body-BdRyuvU4.mjs} +2 -2
  14. package/dist/{branches-DjiGsjAz.mjs → branches-Jpv-FNds.mjs} +5 -6
  15. package/dist/{cancel-BwtDQ2MR.mjs → cancel-ChC4lFd4.mjs} +4 -5
  16. package/dist/{cancel-task-uJp18RvR.mjs → cancel-task-DyhIkNaL.mjs} +5 -6
  17. package/dist/{render-0_GsapXa.mjs → capabilities-7L9GVMd_.mjs} +45 -4
  18. package/dist/card-ClvGX6dQ.mjs +20 -0
  19. package/dist/{card-ezYiriML.mjs → card-DnIeMmUn.mjs} +18 -2
  20. package/dist/{cards-z68PANDD.mjs → cards-O-nKkQKP.mjs} +5 -6
  21. package/dist/cli.mjs +24 -34
  22. package/dist/{collection-Bcy8cWYH.mjs → collection-BPTlcFw5.mjs} +8 -2
  23. package/dist/collection-DjvowSJC.mjs +20 -0
  24. package/dist/collection-namespace-7724zUMx.mjs +12 -0
  25. package/dist/{create-BzK59YlR.mjs → create-B4f4Pldw.mjs} +11 -12
  26. package/dist/{create-4EAGYVyp.mjs → create-BbF9zVFP.mjs} +12 -10
  27. package/dist/{create-Dd_Gyg_F.mjs → create-BnFHcnlL.mjs} +7 -8
  28. package/dist/{create-GVfCQU3B.mjs → create-BuKx7kw6.mjs} +7 -8
  29. package/dist/{create-CQ4Vg4Ge.mjs → create-BxRsXQrm.mjs} +9 -10
  30. package/dist/{create-7JOWFxqu.mjs → create-CvYKJOcE.mjs} +10 -11
  31. package/dist/create-D45uFXlo.mjs +44 -0
  32. package/dist/create-DS52EhPd.mjs +52 -0
  33. package/dist/{create-DHWfmO2L.mjs → create-DeZ2x2Db.mjs} +9 -10
  34. package/dist/{create-branch-CdWGiREu.mjs → create-branch-KOWUIE72.mjs} +5 -6
  35. package/dist/{current-task-nPs-iCLi.mjs → current-task-ClcWPPMc.mjs} +5 -6
  36. package/dist/dashboard-BFeURTOw.mjs +21 -0
  37. package/dist/{database-BXiue1in.mjs → database-Dsv4QBs0.mjs} +20 -10
  38. package/dist/db-CSH1kwQr.mjs +22 -0
  39. package/dist/{delete-CJqLgr6w.mjs → delete-CX2VUA5R.mjs} +6 -7
  40. package/dist/{delete-Do1agSiL.mjs → delete-D68oS73R.mjs} +6 -7
  41. package/dist/{delete-runtime-uuYbd4k2.mjs → delete-runtime-CjFc69tS.mjs} +2 -2
  42. package/dist/{delete-table-ZiJDpMFT.mjs → delete-table-DLvL9mDA.mjs} +6 -7
  43. package/dist/{dirty-BnTG7w7v.mjs → dirty-1OrXpc7E.mjs} +5 -6
  44. package/dist/document-CcfiiV3b.mjs +100 -0
  45. package/dist/document-KdT_Xj6r.mjs +19 -0
  46. package/dist/{eid-CwQ_smOD.mjs → eid-CzLhHZMW.mjs} +6 -7
  47. package/dist/{error-CTVL5CdB.mjs → error-BWXBhqLW.mjs} +1 -1
  48. package/dist/{export-DR2cC4rL.mjs → export-B5z8w-xo.mjs} +7 -8
  49. package/dist/field-CTFnZI8G.mjs +18 -0
  50. package/dist/{fields-Ck31lDz9.mjs → fields-sC7pzmPX.mjs} +6 -7
  51. package/dist/{get-pO0wiy1e.mjs → get-4GEDd9YN.mjs} +5 -6
  52. package/dist/get-BC60bhel.mjs +36 -0
  53. package/dist/{get-CyG_P55z.mjs → get-BYw3xS0X.mjs} +6 -7
  54. package/dist/{get-C71ypFQk.mjs → get-Bo1FGyFs.mjs} +5 -6
  55. package/dist/{get-BNKsNCcx.mjs → get-ByZ4HR2T.mjs} +5 -6
  56. package/dist/{get-DxqzDKKK.mjs → get-C6n86-dS.mjs} +5 -6
  57. package/dist/{get-DyArILlF.mjs → get-CHb6J908.mjs} +5 -6
  58. package/dist/{get-F338MOK-.mjs → get-DLwb_gUh.mjs} +5 -6
  59. package/dist/{get-CICzGFSW.mjs → get-DTHLETau.mjs} +6 -7
  60. package/dist/{get-BFJ3VBPa.mjs → get-Dl62Fy6Y.mjs} +5 -6
  61. package/dist/{get-BZiu-u-9.mjs → get-Fn9WkNhS.mjs} +7 -8
  62. package/dist/{get-GWRprk7k.mjs → get-ZesERdyk.mjs} +5 -7
  63. package/dist/{get-BPOd0Rm8.mjs → get-lcX52Skc.mjs} +5 -6
  64. package/dist/{get-DauAF3sm.mjs → get-reSMTfQi.mjs} +5 -6
  65. package/dist/{get-run-DhM_PyVy.mjs → get-run-CpCbHJad.mjs} +5 -6
  66. package/dist/git-sync-C2vib8rx.mjs +28 -0
  67. package/dist/{has-remote-changes-Ca0exJmb.mjs → has-remote-changes-CPz_-uxd.mjs} +5 -6
  68. package/dist/{import-DjclIzGP.mjs → import-DaWgprK6.mjs} +7 -8
  69. package/dist/is-dirty-Bb0Rtj7x.mjs +9 -0
  70. package/dist/{is-dirty-Cke0a1ie.mjs → is-dirty-DZlI7lQx.mjs} +4 -4
  71. package/dist/{items-BSpapmCU.mjs → items-hgbRYsYD.mjs} +7 -8
  72. package/dist/{list-BI1PfPjn.mjs → list-36H-dvJZ.mjs} +5 -6
  73. package/dist/list-B9J3ujwn.mjs +32 -0
  74. package/dist/{list-BRXGDSMo.mjs → list-BGerkRHH.mjs} +5 -6
  75. package/dist/{list-CEE9yKNp.mjs → list-BWv5y307.mjs} +4 -5
  76. package/dist/{list-V5IuMr_5.mjs → list-BgHESP7b.mjs} +4 -5
  77. package/dist/{list-DWWGcUTg.mjs → list-CCZnH2-Z.mjs} +5 -7
  78. package/dist/{list-Fjjtpghb.mjs → list-CGdOC9zX.mjs} +6 -7
  79. package/dist/{list-DmO4ADQq.mjs → list-CKeVS1IZ.mjs} +4 -5
  80. package/dist/{list-D1qhCQn0.mjs → list-Cd2nOCAx.mjs} +6 -7
  81. package/dist/{list-fIV-P6wP.mjs → list-D9EuxFHO.mjs} +4 -5
  82. package/dist/{list-Br77Mw6U.mjs → list-DBlsRSpZ.mjs} +5 -6
  83. package/dist/{list-bVlCwg8g.mjs → list-DO8T-nmF.mjs} +4 -5
  84. package/dist/{list-Brt4oKO7.mjs → list-DOVX3vCb.mjs} +6 -7
  85. package/dist/{list-DUyWON1F.mjs → list-kath_2cX.mjs} +4 -5
  86. package/dist/{login-BJGhZLgZ.mjs → login-BzrAGJfu.mjs} +9 -10
  87. package/dist/{logout-BAGLqtnV.mjs → logout-CKBiltoS.mjs} +4 -5
  88. package/dist/{manifest-BNh0Lw6p.mjs → manifest-BPHqF5LY.mjs} +1 -2
  89. package/dist/measure-Dw1QpRZa.mjs +19 -0
  90. package/dist/{metadata-B-GOcWqL.mjs → metadata-BcGcUEVJ.mjs} +6 -7
  91. package/dist/{metadata-DJAdsOoh.mjs → metadata-BjOrKtnv.mjs} +7 -8
  92. package/dist/{parse-id-D1LTTt9L.mjs → parse-id--iVTCKSo.mjs} +1 -1
  93. package/dist/{path-D5kX-msX.mjs → path-LgGU6Bd0.mjs} +4 -6
  94. package/dist/{poll-DxpnK1wW.mjs → poll-BucRFJT-.mjs} +1 -1
  95. package/dist/{poll-task-D8mG49IN.mjs → poll-task-DTzKB3T3.mjs} +2 -2
  96. package/dist/{preflight-Df_FqJ6o.mjs → preflight-CzqVX0PP.mjs} +3 -3
  97. package/dist/{query-zWFRDH3T.mjs → query-BVZkK6Qk.mjs} +7 -8
  98. package/dist/{query-OIuumiXN.mjs → query-DG_jygDF.mjs} +11 -12
  99. package/dist/{query-result-ABPLz6I4.mjs → query-result-B4kTRid7.mjs} +1 -1
  100. package/dist/{remove-collection-BxmiXWKz.mjs → remove-collection-HdeAfLyi.mjs} +7 -8
  101. package/dist/{rescan-values-M7g81KIl.mjs → rescan-values-hWubCruZ.mjs} +8 -11
  102. package/dist/run-C1-lDmQF.mjs +136 -0
  103. package/dist/{runs-CqfJIuh_.mjs → runs-Q6DYQyqj.mjs} +6 -7
  104. package/dist/{runtime-B40L_bj8.mjs → runtime-colqvhLf.mjs} +11 -78
  105. package/dist/{schema-tables-CjBRF0_0.mjs → schema-tables-BEastV_8.mjs} +6 -7
  106. package/dist/{schemas-GIIbek2O.mjs → schemas-CgawwI_k.mjs} +4 -5
  107. package/dist/{search-h78uOYec.mjs → search-BWo7xSPP.mjs} +4 -5
  108. package/dist/segment-DMuYvFjg.mjs +19 -0
  109. package/dist/{set-BRDxcLcQ.mjs → set-7Nm2ZTb_.mjs} +7 -8
  110. package/dist/{setting-mKzZJpQY.mjs → setting-DSGXJehQ.mjs} +3 -3
  111. package/dist/{setup-WTIT2WbM.mjs → setup-aJLGLrIT.mjs} +6 -7
  112. package/dist/{skills-BkregMyb.mjs → skills-CY_FmaPo.mjs} +33 -2
  113. package/dist/skills-Q2AFsYvc.mjs +18 -0
  114. package/dist/snippet-Df2TrP7-.mjs +19 -0
  115. package/dist/{stash-DxoAJzcK.mjs → stash-DPQ0c-Cd.mjs} +7 -8
  116. package/dist/{status-B1dc3bbQ.mjs → status-CvAATvV0.mjs} +4 -5
  117. package/dist/{status-D0Ukfodl.mjs → status-CvKPrV5X.mjs} +6 -7
  118. package/dist/{summary-3qOMUcEX.mjs → summary-CeOnoOq2.mjs} +5 -6
  119. package/dist/sync-schema-aOPBc3CY.mjs +55 -0
  120. package/dist/{table-qDD2kApF.mjs → table-CkWja2UH.mjs} +1 -1
  121. package/dist/table-pK4OkVtL.mjs +19 -0
  122. package/dist/{transform-BKahefz_.mjs → transform--dviwMA1.mjs} +1 -0
  123. package/dist/transform-D60veFH8.mjs +24 -0
  124. package/dist/transform-job-DXt5LsrY.mjs +19 -0
  125. package/dist/{tree-DsnIPFyE.mjs → tree-MOQOBeAP.mjs} +4 -5
  126. package/dist/update-57uxZWcR.mjs +52 -0
  127. package/dist/{update-CLsqoEJ8.mjs → update-B6mg3AZD.mjs} +8 -9
  128. package/dist/{update-CZEd_Eej.mjs → update-BD9xkglP.mjs} +9 -10
  129. package/dist/{update-BEtl9LpG.mjs → update-BRrnfG0q.mjs} +8 -9
  130. package/dist/{update-DPouQi4U.mjs → update-BWyCK8QV.mjs} +13 -11
  131. package/dist/{update-DWn-nLPo.mjs → update-Bj9s0ri8.mjs} +8 -9
  132. package/dist/{update-BsgHRoZ8.mjs → update-BkMWBzvk.mjs} +11 -12
  133. package/dist/{update-Baya6OkO.mjs → update-CitS-QRN.mjs} +12 -13
  134. package/dist/{update-BRLcnSwK.mjs → update-DfNKr_vS.mjs} +10 -11
  135. package/dist/{update-UaPqSfPN.mjs → update-Dri4Zg2H.mjs} +10 -11
  136. package/dist/{update-dashcard-DK9X91ha.mjs → update-dashcard-D_-ura3Y.mjs} +8 -9
  137. package/dist/{upgrade-UqdvTikR.mjs → upgrade-CFkZ4USY.mjs} +34 -7
  138. package/dist/{uuid-BWCaWG4O.mjs → uuid-DpinhSxA.mjs} +3 -4
  139. package/dist/{validate-dPEOnOf8.mjs → validate-B62TRDGV.mjs} +1 -1
  140. package/dist/{validate-query-CYvOP8Ld.mjs → validate-query-BpiN1CFu.mjs} +2 -2
  141. package/dist/{values-D_wycrcr.mjs → values-BSS4DRxk.mjs} +5 -6
  142. package/dist/{verify-D7hb6VMy.mjs → verify-B_A7v8TY.mjs} +1 -1
  143. package/dist/{wait-B5IpNFCG.mjs → wait-D3iSnjMM.mjs} +6 -7
  144. package/dist/{wait-flags-CNIeSq0_.mjs → wait-flags-_LnHOeBA.mjs} +2 -2
  145. package/package.json +1 -1
  146. package/skill-data/core/SKILL.md +19 -32
  147. package/skill-data/document/SKILL.md +162 -0
  148. package/skill-data/git-sync/SKILL.md +8 -63
  149. package/skill-data/mbql/SKILL.md +95 -28
  150. package/skill-data/mbql/references/operators.md +13 -13
  151. package/skill-data/transform/SKILL.md +18 -7
  152. package/skills/metabase-cli/SKILL.md +1 -1
  153. package/dist/add-collection-DxtuNxeP.mjs +0 -11
  154. package/dist/auth-B9B4pUaH.mjs +0 -19
  155. package/dist/capabilities-7e9MgquN.mjs +0 -29
  156. package/dist/card-D54unw6r.mjs +0 -20
  157. package/dist/collection-B5kIKRTL.mjs +0 -20
  158. package/dist/create-6XE7GYxk.mjs +0 -45
  159. package/dist/create-C8gA-XP2.mjs +0 -54
  160. package/dist/credentials-CFA9iGZG.mjs +0 -88
  161. package/dist/dashboard-lw6IFfOs.mjs +0 -21
  162. package/dist/database-BPT6BrmF.mjs +0 -17
  163. package/dist/db-CBCj8sBg.mjs +0 -22
  164. package/dist/delete-CiV6f69N.mjs +0 -104
  165. package/dist/deprovision-C-qEnh-P.mjs +0 -67
  166. package/dist/docker-B-QQWThD.mjs +0 -515
  167. package/dist/field-DJmQ2pul.mjs +0 -18
  168. package/dist/git-sync-rmjYOGFK.mjs +0 -28
  169. package/dist/is-dirty-DFGgGLDi.mjs +0 -10
  170. package/dist/license-j0tDQLKI.mjs +0 -17
  171. package/dist/list-evetBTcH.mjs +0 -36
  172. package/dist/logs-jx5b_YDk.mjs +0 -60
  173. package/dist/measure-BfgxqewH.mjs +0 -19
  174. package/dist/parse-schemas-DDK9nXuh.mjs +0 -12
  175. package/dist/process-CM7Uu5q_.mjs +0 -105
  176. package/dist/provision-BJd6zO1D.mjs +0 -83
  177. package/dist/ps-CpyHEvv7.mjs +0 -11
  178. package/dist/ps-dEqRGeB3.mjs +0 -80
  179. package/dist/remove-BNQ1c6hB.mjs +0 -64
  180. package/dist/run-DTsx8bLb.mjs +0 -96
  181. package/dist/segment-CoElN2b-.mjs +0 -19
  182. package/dist/set-Dclba9xF.mjs +0 -68
  183. package/dist/skills-tMYd5d9v.mjs +0 -18
  184. package/dist/snippet-B84H3tfp.mjs +0 -19
  185. package/dist/start-B7ByBicB.mjs +0 -414
  186. package/dist/status-DAzD1Cn_.mjs +0 -34
  187. package/dist/stop-Cvexagxh.mjs +0 -87
  188. package/dist/sync-schema-CrmVX1cy.mjs +0 -44
  189. package/dist/table-B0fRQv91.mjs +0 -19
  190. package/dist/transform-K_kp6Rdm.mjs +0 -24
  191. package/dist/transform-job-CuNN8zgv.mjs +0 -19
  192. package/dist/update-hiJdbbsb.mjs +0 -78
  193. package/dist/url-LMJZRDv4.mjs +0 -56
  194. package/dist/wait-DHjXk3jD.mjs +0 -19
  195. package/dist/workspace-Bt8n3ojY.mjs +0 -25
  196. package/dist/workspace-D8HtUN0y.mjs +0 -72
  197. package/dist/workspace-credentials-8CBMQJFz.mjs +0 -100
  198. package/dist/yaml-Gv6wRFMF.mjs +0 -43
  199. package/skill-data/workspace/SKILL.md +0 -390
  200. /package/dist/{body-flags-D7q87Btw.mjs → body-flags-D78h_-Ua.mjs} +0 -0
  201. /package/dist/{dashboard-B4bn3z6t.mjs → dashboard-FY5UzJ_Z.mjs} +0 -0
  202. /package/dist/{field-E0IBy4Uw.mjs → field-MGxpNQUH.mjs} +0 -0
  203. /package/dist/{input-cMSEqISy.mjs → input-xewHccej.mjs} +0 -0
  204. /package/dist/{key-vkNkH82H.mjs → key-y4TtxKwU.mjs} +0 -0
  205. /package/dist/{measure-Bt3InQsA.mjs → measure-COGAoZpo.mjs} +0 -0
  206. /package/dist/{paginate-BexjkjbY.mjs → paginate-Dfm9eO9A.mjs} +0 -0
  207. /package/dist/{parse-enum-CrEWOhuY.mjs → parse-enum-Dr7ACrTR.mjs} +0 -0
  208. /package/dist/{parse-ref-DKag6a6I.mjs → parse-ref-BiETXmvm.mjs} +0 -0
  209. /package/dist/{prompt-CFKoys7k.mjs → prompt-u4WhE4T5.mjs} +0 -0
  210. /package/dist/{render-khznBlla.mjs → render-BQHJhSP1.mjs} +0 -0
  211. /package/dist/{revision-message-flag-DY29-cgz.mjs → revision-message-flag-Bo-Kvv6F.mjs} +0 -0
  212. /package/dist/{segment-DhBmcr_E.mjs → segment-d-708KKO.mjs} +0 -0
  213. /package/dist/{setting-BzCng1Ub.mjs → setting-CSJvi1-6.mjs} +0 -0
  214. /package/dist/{snippet-bi_0XbNT.mjs → snippet-BZvo05ua.mjs} +0 -0
  215. /package/dist/{transform-job-DjhoJbiV.mjs → transform-job-n8W6tLqF.mjs} +0 -0
@@ -9,7 +9,7 @@
9
9
  "plugins": [
10
10
  {
11
11
  "name": "metabase-cli",
12
- "description": "Drive a Metabase instance from the terminal via the `mb` CLI: auth, list/get/create/update/delete on every resource, run queries and transforms, git-sync content to and from a remote, manage Enterprise workspaces. Bundles workspace, transform, and git-sync references as on-demand skills served by `mb skills get`.",
12
+ "description": "Drive a Metabase instance from the terminal via the `mb` CLI: auth, list/get/create/update/delete on every resource, run queries and transforms, git-sync content to and from a remote. Bundles transform and git-sync references as on-demand skills served by `mb skills get`.",
13
13
  "source": "./",
14
14
  "strict": false,
15
15
  "skills": ["./skills/metabase-cli"],
package/README.md CHANGED
@@ -9,7 +9,7 @@ The minimum supported server is **Metabase v0.58** (major `58`). Anything older
9
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
10
 
11
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.
12
+ - the command needs a premium feature (e.g. `remote_sync`, `transforms`) that isn't enabled.
13
13
 
14
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
15
 
@@ -152,18 +152,20 @@ mb transform delete 1 --yes
152
152
 
153
153
  ### `mb transform run <id>`
154
154
 
155
- Trigger a manual run. Returns `{message, run_id}` and exits immediately. Pass `--wait` to poll until the run reaches a terminal status (`succeeded`, `failed`, `timeout`, `canceled`); the `final` field on the result holds the polled run state, and the command exits 1 if the final status is anything but `succeeded`.
155
+ Trigger a manual run. Returns `{message, run_id}` and exits immediately. Pass `--wait` to poll until the run reaches a terminal status (`succeeded`, `failed`, `timeout`, `canceled`); the `final` field on the result holds the polled run state, and the command exits 1 if the final status is anything but `succeeded`. Pass `--sync` to additionally wait until the run's output table is registered and surface its `target_table_id`, so you can build MBQL cards against it — the run registers the table itself, so no separate `db sync-schema` is needed; `--sync` implies `--wait`.
156
156
 
157
157
  ```sh
158
158
  mb transform run 1
159
159
  mb transform run 1 --wait --json
160
+ mb transform run 1 --sync --json
160
161
  ```
161
162
 
162
- | Flag | Description |
163
- | ----------------- | ----------------------------------------------------------- |
164
- | `--wait` | Poll until the run reaches a terminal status. |
165
- | `--timeout <ms>` | Polling timeout in ms (default 600000). Used with `--wait`. |
166
- | `--interval <ms>` | Polling interval in ms (default 2000). Used with `--wait`. |
163
+ | Flag | Description |
164
+ | ----------------- | ---------------------------------------------------------------------------------------------------------------------- |
165
+ | `--wait` | Poll until the run reaches a terminal status. |
166
+ | `--sync` | After a successful run, wait until the output table is registered and return its `target_table_id` (implies `--wait`). |
167
+ | `--timeout <ms>` | Polling timeout in ms (default 600000). Used with `--wait`. |
168
+ | `--interval <ms>` | Polling interval in ms (default 2000). Used with `--wait`. |
167
169
 
168
170
  ### `mb transform cancel <id>`
169
171
 
@@ -303,13 +305,19 @@ mb db schema-tables 1 analytics --json
303
305
 
304
306
  ### `mb db sync-schema <id>`
305
307
 
306
- Trigger a manual schema sync (`POST /api/database/:id/sync_schema`). Returns `{ id, status: "ok" }` once the sync has been queued; the actual work happens asynchronously on the server.
308
+ Trigger a manual schema sync (`POST /api/database/:id/sync_schema`). Returns `{ id, status: "ok" }` once the sync has been queued; the actual work happens asynchronously on the server. Pass `--wait` to poll the database until its `initial_sync_status` reports `complete` (a database that has already finished its initial sync returns at once). To wait for a specific newly-materialized transform table to register, prefer `mb transform run <id> --sync`.
307
309
 
308
310
  ```sh
309
311
  mb db sync-schema 1
310
- mb db sync-schema 1 --json
312
+ mb db sync-schema 1 --wait --json
311
313
  ```
312
314
 
315
+ | Flag | Description |
316
+ | ----------------- | ----------------------------------------------------------- |
317
+ | `--wait` | Poll until `initial_sync_status` reports `complete`. |
318
+ | `--timeout <ms>` | Polling timeout in ms (default 600000). Used with `--wait`. |
319
+ | `--interval <ms>` | Polling interval in ms (default 2000). Used with `--wait`. |
320
+
313
321
  ### `mb db rescan-values <id>`
314
322
 
315
323
  Trigger a rescan of cached field values (`POST /api/database/:id/rescan_values`). Returns `{ id, status: "ok" }` once the rescan has been queued.
@@ -848,12 +856,14 @@ Create a collection from a JSON spec. The body accepts the same fields as `POST
848
856
  cat collection.json | mb collection create
849
857
  mb collection create --file collection.json
850
858
  mb collection create --body '{"name":"My Collection","parent_id":4}'
859
+ mb collection create --body '{"name":"ETL"}' --namespace transforms
851
860
  ```
852
861
 
853
- | Flag | Description |
854
- | --------------- | --------------------------------------------------- |
855
- | `--body <json>` | Inline JSON body. |
856
- | `--file <path>` | Path to JSON body file. Use `-` to read from stdin. |
862
+ | Flag | Description |
863
+ | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
864
+ | `--body <json>` | Inline JSON body. |
865
+ | `--file <path>` | Path to JSON body file. Use `-` to read from stdin. |
866
+ | `--namespace <ns>` | Collection namespace (`transforms`, `snippets`, `analytics`, `shared-tenant-collection`, `tenant-specific`). Omit for a normal collection; required for a collection a transform's `collection_id` can point at. |
857
867
 
858
868
  ### `mb collection archive <id>`
859
869
 
@@ -864,6 +874,68 @@ mb collection archive 4
864
874
  mb collection archive 4 --json
865
875
  ```
866
876
 
877
+ ## Documents
878
+
879
+ CRUD on `/api/document`. A document is a rich-text page that mixes prose with embedded saved questions (`cardEmbed`) and inline links to Metabase entities (`smartLink`). The body is a [TipTap](https://tiptap.dev/) (ProseMirror) JSON tree stored under `content_type: application/json+vnd.prose-mirror`. The agent-facing format reference lives in the bundled `document` skill (`mb skills get document`). It's a baseline OSS feature — no elevated server version or premium token required.
880
+
881
+ ### `mb document list`
882
+
883
+ Returns non-archived documents visible to you. The compact item omits the (potentially large) `document` body — pull it with `get --full`.
884
+
885
+ ```sh
886
+ mb document list
887
+ mb document list --json
888
+ ```
889
+
890
+ ### `mb document get <id>`
891
+
892
+ ```sh
893
+ mb document get 1
894
+ mb document get 1 --json --full
895
+ ```
896
+
897
+ ### `mb document create`
898
+
899
+ ```sh
900
+ cat document.json | mb document create
901
+ mb document create --file document.json
902
+ mb document create --body '{"name":"Notes","document":{"type":"doc","content":[]}}'
903
+ ```
904
+
905
+ | Flag | Description |
906
+ | --------------- | ----------------------- |
907
+ | `--body <json>` | Inline JSON body. |
908
+ | `--file <path>` | Path to JSON body file. |
909
+
910
+ Body fields: `name` (required), `document` (required — the TipTap `doc` tree), `collection_id` (optional positive integer; `null` files it under "Our analytics"), `collection_position` (optional positive integer). New cards can be created inline by referencing them with negative ids in `cardEmbed` nodes and supplying their definitions in a top-level `cards` map — see the `document` skill.
911
+
912
+ For a document to open clean (no spurious "unsaved changes"), each id-bearing node (`paragraph`, `heading`, `codeBlock`, `orderedList`, `bulletList`, `blockquote`, `cardEmbed`, `supportingText`) must carry a unique `_id` — `create`/`update` **validate** this and reject a body where any such node is missing one (mint ids with `mb uuid`). Other node types don't take an `_id`. See the `document` skill (`mb skills get document`) for the full authoring guide.
913
+
914
+ ### `mb document update <id>`
915
+
916
+ Patch a document. Body is a partial subset of the create shape plus `archived`. Only the keys you send are touched; replacing `document` replaces the whole body.
917
+
918
+ ```sh
919
+ cat patch.json | mb document update 1
920
+ mb document update 1 --file patch.json
921
+ mb document update 1 --body '{"name":"renamed"}'
922
+ mb document update 1 --body '{"archived":false}'
923
+ ```
924
+
925
+ | Flag | Description |
926
+ | --------------- | ----------------------- |
927
+ | `--body <json>` | Inline JSON body. |
928
+ | `--file <path>` | Path to JSON body file. |
929
+
930
+ ### `mb document archive <id>`
931
+
932
+ Soft-delete a document by setting `archived: true`. To unarchive use `mb document update <id> --body '{"archived":false}'`.
933
+
934
+ ```sh
935
+ mb document archive 1
936
+ mb document archive 1 --json
937
+ ```
938
+
867
939
  ## Settings
868
940
 
869
941
  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.
@@ -1089,226 +1161,6 @@ mb git-sync remove-collection 12
1089
1161
  mb git-sync remove-collection 12 --json --profile prod
1090
1162
  ```
1091
1163
 
1092
- ## Workspaces
1093
-
1094
- CRUD on `/api/ee/workspace-manager`. Run against the workspace-manager parent instance.
1095
-
1096
- ### `mb workspace list`
1097
-
1098
- ```sh
1099
- mb workspace list
1100
- mb workspace list --json
1101
- ```
1102
-
1103
- ### `mb workspace create`
1104
-
1105
- ```sh
1106
- mb workspace create --name analytics
1107
- echo '{"name":"analytics"}' | mb workspace create
1108
- mb workspace create --file workspace.json
1109
- ```
1110
-
1111
- | Flag | Description |
1112
- | --------------- | ------------------------------------------------------- |
1113
- | `--name <name>` | Workspace name. Shortcut for `--body '{"name":"<n>"}'`. |
1114
- | `--body <json>` | Inline JSON body. |
1115
- | `--file <path>` | Path to JSON body file. |
1116
-
1117
- ### `mb workspace database provision <workspace-id> [db-id]`
1118
-
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.
1120
-
1121
- ```sh
1122
- mb workspace database provision 1 5 --schemas analytics,github
1123
- mb workspace database provision 1 5 --schemas analytics --wait
1124
- mb workspace database provision 1 --file provision.json
1125
- ```
1126
-
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`. |
1136
-
1137
- ### `mb workspace database update <workspace-id> <db-id>`
1138
-
1139
- Update a workspace's provisioned database (server-side this is deprovision + provision). Body accepts only `input` — the database id comes from the URL.
1140
-
1141
- ```sh
1142
- mb workspace database update 1 5 --schemas analytics,github
1143
- mb workspace database update 1 5 --schemas analytics --wait
1144
- mb workspace database update 1 5 --file update.json
1145
- ```
1146
-
1147
- | Flag | Description |
1148
- | ----------------- | ----------------------------------------------------------------- |
1149
- | `--schemas <csv>` | Comma-separated input schemas. Shortcut for body. |
1150
- | `--body <json>` | Inline JSON body (`{"input":[{"schema":"..."}]}`). |
1151
- | `--file <path>` | Path to JSON body file. |
1152
- | `--wait` | Poll until the database entry returns to `status: "provisioned"`. |
1153
- | `--timeout <ms>` | Polling timeout in ms (default 600000). Used with `--wait`. |
1154
- | `--interval <ms>` | Polling interval in ms (default 2000). Used with `--wait`. |
1155
-
1156
- ### `mb workspace database deprovision <workspace-id> <db-id>`
1157
-
1158
- ```sh
1159
- mb workspace database deprovision 1 5 --yes
1160
- mb workspace database deprovision 1 5 --yes --wait
1161
- ```
1162
-
1163
- | Flag | Description |
1164
- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------- |
1165
- | `--yes` | Skip the interactive confirmation prompt. In non-TTY contexts the prompt is skipped automatically (kubectl/gh/docker convention). |
1166
- | `--wait` | Poll until the database entry is removed from the workspace. |
1167
- | `--timeout <ms>` | Polling timeout in ms (default 600000). Used with `--wait`. |
1168
- | `--interval <ms>` | Polling interval in ms (default 2000). Used with `--wait`. |
1169
-
1170
- ### Local runtime
1171
-
1172
- These commands manage a Docker container that serves as the workspace's child Metabase instance. State lives in Docker labels and a named volume — there is no per-workspace local state directory. The container is named `metabase-workspace-<id>`; the app-db volume is `metabase-workspace-<id>-appdb`.
1173
-
1174
- ### `mb workspace start <id>`
1175
-
1176
- ```sh
1177
- mb workspace start 1
1178
- mb workspace start 1 --wait
1179
- mb workspace start 1 --port 3100
1180
- mb workspace start 1 --image metabase/metabase-enterprise:latest --no-pull
1181
- mb workspace start 1 --force
1182
- mb workspace start 1 --repo /path/to/sync-repo --wait
1183
- mb workspace start 1 --repo /path/to/sync-repo --repo-branch dev --repo-mode read-only
1184
- ```
1185
-
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"`.
1187
-
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.
1189
-
1190
- By default `start` returns once the bundle has been consumed by the child (`state: "starting"`); pass `--wait` to also block until `/api/health` reports ready and the response reports `state: "running"`.
1191
-
1192
- When `--repo <host-path>` is passed, the CLI bind-mounts the host directory at `/mnt/repo` inside the container and injects three settings into the workspace's `config.yml` so the child boots already wired to the repo: `remote-sync-url=file:///mnt/repo`, `remote-sync-branch=<branch>` (defaults to the current branch of the host repo, read via `git -C <path> symbolic-ref --short HEAD`; override with `--repo-branch`), and `remote-sync-type=<mode>` (defaults to `read-write`; override with `--repo-mode read-only`, which also makes the bind mount read-only). The bind mount is set at container-create time only — to add or change it after the fact, run `start --force` again with the new flags. The host path must be an existing directory; the CLI does not create or `git init` it for you.
1193
-
1194
- | Flag | Description |
1195
- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1196
- | `--port <n>` | Host port (default: 3000; auto-shifts up to 100 ports if taken). |
1197
- | `--image <ref>` | Docker image. Default: `metabase/metabase-enterprise:latest` once Metabase v62 is released, otherwise `metabase/metabase-enterprise-head:latest`. |
1198
- | `--wait` | Block until `/api/health` is ready. Default: return as soon as consumed. |
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. |
1200
- | `--no-pull` | Skip `docker pull` (useful if the image is already present). |
1201
- | `--no-metadata` | Skip the warehouse metadata export. |
1202
- | `--force` | If a container for this workspace already exists, remove it before starting. |
1203
- | `--repo <host-path>` | Bind-mount a host directory at `/mnt/repo` and set `remote-sync-url=file:///mnt/repo` in `config.yml`. |
1204
- | `--repo-branch <name>` | `remote-sync-branch` value (default: current branch of the host repo). |
1205
- | `--repo-mode <mode>` | `remote-sync-type`: `read-write` (default) or `read-only`. Read-only also makes the bind mount read-only. |
1206
-
1207
- ### `mb workspace stop <id>`
1208
-
1209
- ```sh
1210
- mb workspace stop 1
1211
- mb workspace stop 1 --json
1212
- ```
1213
-
1214
- Stops the running container; no-ops if it's already exited or missing. Reports the prior state.
1215
-
1216
- ### `mb workspace delete <id>`
1217
-
1218
- ```sh
1219
- mb workspace delete 1 --yes
1220
- mb workspace delete 1 --keep-volume --yes
1221
- ```
1222
-
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.
1224
-
1225
- | Flag | Description |
1226
- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |
1227
- | `--yes` | Skip the interactive confirmation prompt. In non-TTY contexts the prompt is skipped automatically (kubectl/gh/docker convention). |
1228
- | `--keep-volume` | Preserve the app-db volume (`metabase-workspace-<id>-appdb`). |
1229
-
1230
- ### `mb workspace logs <id>`
1231
-
1232
- ```sh
1233
- mb workspace logs 1
1234
- mb workspace logs 1 --follow
1235
- mb workspace logs 1 --tail 500
1236
- ```
1237
-
1238
- Passthrough to `docker logs`. Output streams directly to your terminal; Ctrl-C terminates a follow.
1239
-
1240
- | Flag | Description |
1241
- | -------------- | --------------------------------------------- |
1242
- | `--follow, -f` | Stream indefinitely. |
1243
- | `--tail <n>` | Lines from the end of the logs (default 200). |
1244
-
1245
- ### `mb workspace url <id>`
1246
-
1247
- ```sh
1248
- mb workspace url 1
1249
- mb workspace url 1 --json
1250
- ```
1251
-
1252
- Prints `http://localhost:<port>` for the workspace's container. Reads the host port from the container's `com.metabase.workspace.host-port` label.
1253
-
1254
- ### `mb workspace credentials <id>`
1255
-
1256
- ```sh
1257
- mb workspace credentials 1
1258
- mb workspace credentials 1 --json
1259
- ```
1260
-
1261
- Reads the workspace child's admin credentials (email, password, admin API key) from `/mw-config/credentials.json` inside the container. The file is written by `workspace start` from CLI-generated, per-workspace values; the same values are injected into `config.yml`'s `:users` and `:api-keys` sections so they take effect on the child's first boot. Works against running and stopped containers (uses `docker cp`); errors clearly if no container exists for the given workspace id. Removing the container destroys the file — recover by `workspace start <id> --force`.
1262
-
1263
- ### `mb workspace ps`
1264
-
1265
- ```sh
1266
- mb workspace ps
1267
- mb workspace ps --json
1268
- ```
1269
-
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).
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
-
1312
1164
  ## Instance setup
1313
1165
 
1314
1166
  Bootstrapping a fresh, not-yet-configured Metabase instance.
@@ -1342,6 +1194,8 @@ mb eid --file translate.json
1342
1194
  mb eid --body '{"entity_ids":{"card":["abc123XYZ"]}}'
1343
1195
  ```
1344
1196
 
1197
+ Entity ids are NanoIDs that can start with `-`, which the positional `<eids>` form misreads as a flag (shell quoting doesn't help — the leading `-` survives into argv). For an id that may start with `-`, pass it via `--body`, where the id is a JSON string value immune to flag parsing: `mb eid --body '{"entity_ids":{"card":["-abc123XYZ"]}}'`.
1198
+
1345
1199
  | Arg / Flag | Description |
1346
1200
  | ---------------- | ------------------------------------------------------------------------------ |
1347
1201
  | `<eids>` | Comma-separated EIDs positional. Used with `--model`. |
@@ -1474,7 +1328,7 @@ The CLI ships with bundled agent skills (Claude Code / `npx skills add` compatib
1474
1328
  mb skills list # discover bundled skills (table or JSON)
1475
1329
  mb skills get core # print the top-level guide
1476
1330
  mb skills get core --full # include references and templates
1477
- mb skills get workspace,transform # comma-separated, multi-skill fetch
1331
+ mb skills get git-sync,transform # comma-separated, multi-skill fetch
1478
1332
  mb skills get --all --json --max-bytes 0 # every non-hidden skill, structured (default cap truncates)
1479
1333
  mb skills path # absolute paths for direct Read
1480
1334
  mb skills path core # one path
@@ -1487,8 +1341,8 @@ Bundled skills:
1487
1341
  | Name | Use |
1488
1342
  | ----------- | -------------------------------------------------------------------------------------- |
1489
1343
  | `core` | Top-level guide: auth, flag conventions, output flags, body input, every command group |
1490
- | `workspace` | Enterprise workspace lifecycle (create, provision, start, child credentials, diagnose) |
1491
1344
  | `transform` | Authoring and running transforms (native SQL + MBQL 5), iteration, run inspection |
1345
+ | `document` | Authoring document bodies: the TipTap JSON tree, embedding cards, entity links |
1492
1346
  | `git-sync` | Round-tripping Metabase content to/from a git remote |
1493
1347
 
1494
1348
  Discovery surfaces:
@@ -1505,7 +1359,6 @@ Exit codes: `0` success, `2` `ConfigError` (missing name, unknown name, `MB_SKIL
1505
1359
  | `METABASE_URL` | Default URL for `auth login` and config resolution. |
1506
1360
  | `METABASE_API_KEY` | Default API key (overrides interactive prompt; not stored). |
1507
1361
  | `METABASE_PROFILE` | Default profile when `--profile` is omitted. Falls back to `default`. |
1508
- | `METABASE_LICENSE_TOKEN` | Default license token for `workspace license set`. |
1509
1362
  | `METABASE_VERBOSE` | When set to `1`, prints structured developer-detail JSON to stderr on failure. |
1510
1363
  | `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
1364
  | `MB_SKILLS_DIR` | Override the directory `mb skills` scans (dev/test only; defaults to the CLI's bundled `skills` + `skill-data` trees). |
@@ -0,0 +1,10 @@
1
+ import "./command-augment-BH9qgQ5u.mjs";
2
+ import "./error-BWXBhqLW.mjs";
3
+ import "./runtime-colqvhLf.mjs";
4
+ import "./capabilities-7L9GVMd_.mjs";
5
+ import "./parse-id--iVTCKSo.mjs";
6
+ import "./poll-BucRFJT-.mjs";
7
+ import "./poll-task-DTzKB3T3.mjs";
8
+ import { SyncSettingsUpdateResult, add_collection_default, setCollectionRemoteSynced, syncSettingsUpdateView } from "./add-collection-DUqTrC5T.mjs";
9
+
10
+ export { add_collection_default as default };
@@ -1,8 +1,8 @@
1
- import { connectionFlags, outputFlags, profileFlag } from "./error-CTVL5CdB.mjs";
2
- import { defineMetabaseCommand } from "./runtime-B40L_bj8.mjs";
3
- import { renderSummary } from "./render-0_GsapXa.mjs";
4
- import { parseId } from "./parse-id-D1LTTt9L.mjs";
5
- import { REMOTE_SYNC_PATHS } from "./poll-task-D8mG49IN.mjs";
1
+ import { connectionFlags, outputFlags, profileFlag } from "./error-BWXBhqLW.mjs";
2
+ import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
3
+ import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
4
+ import { parseId } from "./parse-id--iVTCKSo.mjs";
5
+ import { REMOTE_SYNC_PATHS } from "./poll-task-DTzKB3T3.mjs";
6
6
  import { z } from "zod";
7
7
 
8
8
  //#region src/commands/git-sync/add-collection.ts
@@ -1,10 +1,9 @@
1
1
  import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-CTVL5CdB.mjs";
3
- import { defineMetabaseCommand } from "./runtime-B40L_bj8.mjs";
4
- import "./capabilities-7e9MgquN.mjs";
5
- import { renderSummary } from "./render-0_GsapXa.mjs";
6
- import { parseId } from "./parse-id-D1LTTt9L.mjs";
7
- import { Dashboard, dashboardView } from "./dashboard-B4bn3z6t.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-BWXBhqLW.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
4
+ import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
+ import { parseId } from "./parse-id--iVTCKSo.mjs";
6
+ import { Dashboard, dashboardView } from "./dashboard-FY5UzJ_Z.mjs";
8
7
 
9
8
  //#region src/commands/dashboard/archive.ts
10
9
  var archive_default = defineMetabaseCommand({
@@ -1,11 +1,10 @@
1
1
  import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-CTVL5CdB.mjs";
3
- import { defineMetabaseCommand } from "./runtime-B40L_bj8.mjs";
4
- import "./capabilities-7e9MgquN.mjs";
5
- import { renderSummary } from "./render-0_GsapXa.mjs";
6
- import "./field-E0IBy4Uw.mjs";
7
- import { Card, cardView } from "./card-ezYiriML.mjs";
8
- import { parseId } from "./parse-id-D1LTTt9L.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-BWXBhqLW.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
4
+ import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
+ import "./field-MGxpNQUH.mjs";
6
+ import { Card, cardView } from "./card-DnIeMmUn.mjs";
7
+ import { parseId } from "./parse-id--iVTCKSo.mjs";
9
8
 
10
9
  //#region src/commands/card/archive.ts
11
10
  var archive_default = defineMetabaseCommand({
@@ -1,11 +1,10 @@
1
1
  import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-CTVL5CdB.mjs";
3
- import { defineMetabaseCommand } from "./runtime-B40L_bj8.mjs";
4
- import "./capabilities-7e9MgquN.mjs";
5
- import { renderSummary } from "./render-0_GsapXa.mjs";
6
- import { parseId } from "./parse-id-D1LTTt9L.mjs";
7
- import { Measure, measureView } from "./measure-Bt3InQsA.mjs";
8
- import { revisionMessageFlag } from "./revision-message-flag-DY29-cgz.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-BWXBhqLW.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
4
+ import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
+ import { parseId } from "./parse-id--iVTCKSo.mjs";
6
+ import { Measure, measureView } from "./measure-COGAoZpo.mjs";
7
+ import { revisionMessageFlag } from "./revision-message-flag-Bo-Kvv6F.mjs";
9
8
 
10
9
  //#region src/commands/measure/archive.ts
11
10
  var archive_default = defineMetabaseCommand({
@@ -1,10 +1,9 @@
1
1
  import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-CTVL5CdB.mjs";
3
- import { defineMetabaseCommand } from "./runtime-B40L_bj8.mjs";
4
- import "./capabilities-7e9MgquN.mjs";
5
- import { renderSummary } from "./render-0_GsapXa.mjs";
6
- import { parseId } from "./parse-id-D1LTTt9L.mjs";
7
- import { Snippet, snippetView } from "./snippet-bi_0XbNT.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-BWXBhqLW.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
4
+ import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
+ import { parseId } from "./parse-id--iVTCKSo.mjs";
6
+ import { Snippet, snippetView } from "./snippet-BZvo05ua.mjs";
8
7
 
9
8
  //#region src/commands/snippet/archive.ts
10
9
  var archive_default = defineMetabaseCommand({
@@ -1,10 +1,9 @@
1
1
  import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-CTVL5CdB.mjs";
3
- import { defineMetabaseCommand } from "./runtime-B40L_bj8.mjs";
4
- import "./capabilities-7e9MgquN.mjs";
5
- import { renderSummary } from "./render-0_GsapXa.mjs";
6
- import { parseId } from "./parse-id-D1LTTt9L.mjs";
7
- import { Collection, collectionView } from "./collection-Bcy8cWYH.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-BWXBhqLW.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
4
+ import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
+ import { parseId } from "./parse-id--iVTCKSo.mjs";
6
+ import { Collection, collectionView } from "./collection-BPTlcFw5.mjs";
8
7
 
9
8
  //#region src/commands/collection/archive.ts
10
9
  var archive_default = defineMetabaseCommand({
@@ -1,11 +1,10 @@
1
1
  import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-CTVL5CdB.mjs";
3
- import { defineMetabaseCommand } from "./runtime-B40L_bj8.mjs";
4
- import "./capabilities-7e9MgquN.mjs";
5
- import { renderSummary } from "./render-0_GsapXa.mjs";
6
- import { parseId } from "./parse-id-D1LTTt9L.mjs";
7
- import { revisionMessageFlag } from "./revision-message-flag-DY29-cgz.mjs";
8
- import { Segment, segmentView } from "./segment-DhBmcr_E.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-BWXBhqLW.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
4
+ import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
+ import { parseId } from "./parse-id--iVTCKSo.mjs";
6
+ import { revisionMessageFlag } from "./revision-message-flag-Bo-Kvv6F.mjs";
7
+ import { Segment, segmentView } from "./segment-d-708KKO.mjs";
9
8
 
10
9
  //#region src/commands/segment/archive.ts
11
10
  var archive_default = defineMetabaseCommand({
@@ -0,0 +1,39 @@
1
+ import "./command-augment-BH9qgQ5u.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-BWXBhqLW.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
4
+ import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
+ import { parseId } from "./parse-id--iVTCKSo.mjs";
6
+ import { Document, documentView } from "./document-CcfiiV3b.mjs";
7
+
8
+ //#region src/commands/document/archive.ts
9
+ var archive_default = defineMetabaseCommand({
10
+ meta: {
11
+ name: "archive",
12
+ description: "Archive (soft-delete) a document by id"
13
+ },
14
+ capabilities: { minVersion: 58 },
15
+ args: {
16
+ ...outputFlags,
17
+ ...profileFlag,
18
+ ...connectionFlags,
19
+ id: {
20
+ type: "positional",
21
+ description: "Document id",
22
+ required: true
23
+ }
24
+ },
25
+ outputSchema: Document,
26
+ examples: ["mb document archive 1", "mb document archive 1 --json"],
27
+ async run({ args, ctx, getClient }) {
28
+ const id = parseId(args.id);
29
+ const client = await getClient();
30
+ const updated = await client.requestParsed(Document, `/api/document/${id}`, {
31
+ method: "PUT",
32
+ body: { archived: true }
33
+ });
34
+ renderSummary(updated, documentView, `Archived document ${updated.id} "${updated.name}".`, ctx);
35
+ }
36
+ });
37
+
38
+ //#endregion
39
+ export { archive_default as default };
@@ -0,0 +1,19 @@
1
+ import { defineCommand } from "citty";
2
+
3
+ //#region src/commands/auth/index.ts
4
+ var auth_default = defineCommand({
5
+ meta: {
6
+ name: "auth",
7
+ description: "Authenticate against a Metabase instance"
8
+ },
9
+ default: "login",
10
+ subCommands: {
11
+ login: () => import("./login-BzrAGJfu.mjs").then((m) => m.default),
12
+ status: () => import("./status-CvAATvV0.mjs").then((m) => m.default),
13
+ list: () => import("./list-BGerkRHH.mjs").then((m) => m.default),
14
+ logout: () => import("./logout-CKBiltoS.mjs").then((m) => m.default)
15
+ }
16
+ });
17
+
18
+ //#endregion
19
+ export { auth_default as default };
@@ -1,6 +1,6 @@
1
1
  import { ConfigError } from "./command-augment-BH9qgQ5u.mjs";
2
- import { parseJson } from "./runtime-B40L_bj8.mjs";
3
- import { DEFAULT_FLAG_NAME, readInput } from "./input-cMSEqISy.mjs";
2
+ import { parseJson } from "./runtime-colqvhLf.mjs";
3
+ import { DEFAULT_FLAG_NAME, readInput } from "./input-xewHccej.mjs";
4
4
 
5
5
  //#region src/runtime/body.ts
6
6
  async function readBody(sources, schema) {