@metabase/cli 0.1.2 → 0.1.4-alpha.skill-packaging.1c8ec40

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 (189) hide show
  1. package/.claude-plugin/marketplace.json +19 -0
  2. package/README.md +467 -388
  3. package/dist/add-collection-B3NhkLRT.mjs +11 -0
  4. package/dist/{add-collection-DwxQDXzL.mjs → add-collection-CEvZTea_.mjs} +5 -5
  5. package/dist/{api-key-BktzvPb7.mjs → api-key-BpmnzLLb.mjs} +1 -1
  6. package/dist/{archive-CLWtbvvH.mjs → archive-BPLLOdfL.mjs} +7 -7
  7. package/dist/{archive-C1mF-9Kj.mjs → archive-CazAWIrV.mjs} +6 -6
  8. package/dist/{archive-kYoy5LK5.mjs → archive-D596Cq7R.mjs} +7 -7
  9. package/dist/{archive-Cq4WKmJt.mjs → archive-DqPqXMZm.mjs} +7 -7
  10. package/dist/auth-DJp4QoWI.mjs +19 -0
  11. package/dist/{body-rDrR-C1c.mjs → body-CVSMGqZk.mjs} +3 -3
  12. package/dist/{branches-CH2UcCpX.mjs → branches--TavvEK1.mjs} +7 -7
  13. package/dist/{cancel-CgLZcItQ.mjs → cancel-BUitag4_.mjs} +6 -6
  14. package/dist/{cancel-task-DcYrFsM6.mjs → cancel-task-BHcWJUMu.mjs} +7 -7
  15. package/dist/card-DtUIadDM.mjs +20 -0
  16. package/dist/{cards-C4NIaERo.mjs → cards-Bir6wRS_.mjs} +6 -6
  17. package/dist/cli.mjs +31 -27
  18. package/dist/collection-4-gZeCWg.mjs +19 -0
  19. package/dist/{create-CNvd5T8h.mjs → create-4OjxTGAe.mjs} +10 -10
  20. package/dist/{create-bqc_rmix.mjs → create-BISpvrml.mjs} +10 -10
  21. package/dist/{create-BUCLNqiN.mjs → create-Bi8sqzL-.mjs} +13 -13
  22. package/dist/{create-Cbh1cGj9.mjs → create-C1cdoSw5.mjs} +12 -12
  23. package/dist/{create-Dh0p-c2Y.mjs → create-C3TiMJhQ.mjs} +10 -10
  24. package/dist/{create-QgN369N5.mjs → create-CZZc1KM8.mjs} +13 -13
  25. package/dist/{create-DU0ZhnZu.mjs → create-CxMpPsRO.mjs} +9 -9
  26. package/dist/{create-CB0Yp__0.mjs → create-Dj-fO-nV.mjs} +12 -12
  27. package/dist/{create-DvrVZ2hS.mjs → create-DuyWlx-S.mjs} +11 -11
  28. package/dist/{create-branch-BJFH9Hda.mjs → create-branch-CH1FmnxS.mjs} +7 -7
  29. package/dist/{create-CzfNOhOF.mjs → create-hYdLOyw_.mjs} +12 -12
  30. package/dist/{credentials-DTP1xuKz.mjs → credentials-BARfQeBr.mjs} +11 -9
  31. package/dist/{current-task-z_TiJ0kt.mjs → current-task-TX7rJmon.mjs} +7 -7
  32. package/dist/dashboard-C-azCGk-.mjs +20 -0
  33. package/dist/{database-DQkUxTLd.mjs → database-BKfGtTmB.mjs} +3 -3
  34. package/dist/db-D--IArxI.mjs +22 -0
  35. package/dist/{delete-DeZQ1r9w.mjs → delete-BxUaF8kW.mjs} +8 -8
  36. package/dist/{delete-CVYII8mq.mjs → delete-DzTd5w_y.mjs} +8 -8
  37. package/dist/{delete-runtime-BMzvfj_B.mjs → delete-runtime-DfFMWJJ6.mjs} +2 -2
  38. package/dist/{delete-table-ZiR9-ndv.mjs → delete-table-DWfA7uVn.mjs} +8 -8
  39. package/dist/{deprovision-BhD3J-Am.mjs → deprovision-CadXjs_7.mjs} +12 -12
  40. package/dist/{dirty-D9agt7Os.mjs → dirty-an-DQtBG.mjs} +7 -7
  41. package/dist/{docker-CHpV8PRz.mjs → docker-C9WQCjkt.mjs} +6 -103
  42. package/dist/{eid-B5wawMmO.mjs → eid-Cz9r5RX5.mjs} +1 -1
  43. package/dist/{export-Bfk7JAlR.mjs → export-BHq8ztFL.mjs} +10 -10
  44. package/dist/field-Do1HcUfq.mjs +18 -0
  45. package/dist/{fields-7ByLsxLg.mjs → fields-B21DeL2I.mjs} +6 -6
  46. package/dist/{flag-pair-DtR1AiBQ.mjs → flag-pair-Fmcdkrfx.mjs} +1 -1
  47. package/dist/{get-DikegGzi.mjs → get-BAqeeIQ-.mjs} +6 -6
  48. package/dist/{get-tISo-cmg.mjs → get-BHCgwPPT.mjs} +9 -9
  49. package/dist/{get-CQGeF-eP.mjs → get-BPah4iYM.mjs} +6 -6
  50. package/dist/{get-DKy3DAJX.mjs → get-C4_7ZrIS.mjs} +7 -7
  51. package/dist/{get-cuHp9-6U.mjs → get-CAYnc9sd.mjs} +6 -6
  52. package/dist/{get-BE6Izpus.mjs → get-ChEFd1sT.mjs} +7 -7
  53. package/dist/{get-gOT_RarI.mjs → get-ChxcxY2D.mjs} +7 -7
  54. package/dist/{get-DUSR5i99.mjs → get-Cy9YIesM.mjs} +6 -6
  55. package/dist/{get-bYc7eGYe.mjs → get-D-zU7VmK.mjs} +6 -6
  56. package/dist/{get-D2m4jhwT.mjs → get-DFm7pR7F.mjs} +8 -8
  57. package/dist/get-DWttywn_.mjs +79 -0
  58. package/dist/{get-StkjKuh0.mjs → get-RPL4h0It.mjs} +8 -8
  59. package/dist/{get-C3CcAJGg.mjs → get-dqrzLuwA.mjs} +8 -8
  60. package/dist/{get-run-D59Yqaoh.mjs → get-run-CG3QFs9T.mjs} +7 -7
  61. package/dist/git-sync-COKsdLkS.mjs +28 -0
  62. package/dist/{has-remote-changes-B1TciDVD.mjs → has-remote-changes-ecra9BFO.mjs} +7 -7
  63. package/dist/{import-DnnmmJbp.mjs → import-BzOKkYnp.mjs} +10 -10
  64. package/dist/{input-ikCiip6x.mjs → input-BQ-BZA8h.mjs} +1 -1
  65. package/dist/{is-dirty-DlfX7e39.mjs → is-dirty-7afLBOtn.mjs} +4 -4
  66. package/dist/is-dirty-Dnw0AHFw.mjs +10 -0
  67. package/dist/{items-DQFQSpjF.mjs → items-BEWSuEfe.mjs} +10 -10
  68. package/dist/{key-NDEARu2L.mjs → key-CCJdVWKc.mjs} +1 -1
  69. package/dist/{license-DBh13sc8.mjs → license-D3mFdxAq.mjs} +3 -3
  70. package/dist/{list-DQj-QJAs.mjs → list-B5E7LFDb.mjs} +8 -8
  71. package/dist/{list-BwjqQ6pp.mjs → list-B9mEqMZ5.mjs} +5 -5
  72. package/dist/{list-D067ZSE5.mjs → list-BJAC356Q.mjs} +7 -7
  73. package/dist/{list-Di529OJD.mjs → list-BOQWvb8b.mjs} +5 -5
  74. package/dist/{list-Cy0VhXQs.mjs → list-BZFTuiBr.mjs} +6 -6
  75. package/dist/{list-DJN-OvTZ.mjs → list-By3t67Y8.mjs} +7 -7
  76. package/dist/{list-GFfR9SuT.mjs → list-ByPzCM2G.mjs} +5 -5
  77. package/dist/{list-9AOWhxqp.mjs → list-C8b-KxY6.mjs} +8 -8
  78. package/dist/{list-iFVEdi2J.mjs → list-CiHlWufc.mjs} +6 -6
  79. package/dist/{list-DlKzgnqo.mjs → list-D_exD3LP.mjs} +7 -7
  80. package/dist/{list-4kYCGv01.mjs → list-DiAyv9l3.mjs} +6 -6
  81. package/dist/{list-CP5RNjO6.mjs → list-DtSOfMZ2.mjs} +6 -6
  82. package/dist/list-DwF6on6O.mjs +44 -0
  83. package/dist/{list-DAZP-IM5.mjs → list-nIxzXqr-.mjs} +5 -5
  84. package/dist/{login-DxgkosGx.mjs → login-Cka2HZWz.mjs} +9 -9
  85. package/dist/{logout-BlVwqBog.mjs → logout-rA25M-oa.mjs} +6 -6
  86. package/dist/{logs-CudNEkT4.mjs → logs-B5cGXoDi.mjs} +11 -10
  87. package/dist/{manifest-Dv5B9Blc.mjs → manifest-CGM7XNLC.mjs} +2 -2
  88. package/dist/measure-CwJ2o89T.mjs +19 -0
  89. package/dist/{metadata-BTJAFVvZ.mjs → metadata-BEd6s_Qf.mjs} +6 -6
  90. package/dist/{metadata-B2Td415K.mjs → metadata-DirWO0cS.mjs} +6 -6
  91. package/dist/{package-DV6Asqim.mjs → package-VV3qWWIQ.mjs} +10 -3
  92. package/dist/{parse-id-B38zTlYs.mjs → parse-id-DbSjfzoU.mjs} +1 -1
  93. package/dist/{parse-ref-DGvh4aDn.mjs → parse-ref-D1yeDOn8.mjs} +1 -1
  94. package/dist/{parse-schemas-Ds-cVE-O.mjs → parse-schemas-BXTlpoaf.mjs} +2 -2
  95. package/dist/path-DarsuSkB.mjs +58 -0
  96. package/dist/{poll-Bh6oAifO.mjs → poll-Cd8bRMmZ.mjs} +2 -2
  97. package/dist/{poll-task-vPwV31Fs.mjs → poll-task-BwKuhZ9P.mjs} +2 -2
  98. package/dist/{predicates-DiIiS3k7.mjs → predicates-CGO17Q15.mjs} +1 -1
  99. package/dist/{preflight-DxJb-hUV.mjs → preflight-RkDLqtNm.mjs} +3 -3
  100. package/dist/process-zJeVJZTM.mjs +105 -0
  101. package/dist/{prompt-Bf3DQ-qE.mjs → prompt-DgDNy_Pc.mjs} +1 -1
  102. package/dist/{provision-B-I0zuDe.mjs → provision-DBqPA-De.mjs} +15 -15
  103. package/dist/{ps-CaiOFCv2.mjs → ps-Cn3lzak-.mjs} +4 -4
  104. package/dist/ps-DIm7IScc.mjs +11 -0
  105. package/dist/{query-BtF1yWZZ.mjs → query-BoOismbH.mjs} +13 -13
  106. package/dist/{query-jmfqaXRP.mjs → query-CkNa5Nam.mjs} +9 -9
  107. package/dist/{remove-xskleeru.mjs → remove-B7NUBOqF.mjs} +6 -6
  108. package/dist/{remove-C2iv0g03.mjs → remove-C08c3vne.mjs} +10 -9
  109. package/dist/{remove-collection-DhZghaZy.mjs → remove-collection-cFO9M-qV.mjs} +9 -9
  110. package/dist/{render-DXv-D6fU.mjs → render-DuoDUTVL.mjs} +1 -1
  111. package/dist/{rescan-values-DW6u90ep.mjs → rescan-values-D1-IyyU7.mjs} +6 -6
  112. package/dist/{revision-message-flag-CWQbKhdl.mjs → revision-message-flag-oyq2xrDU.mjs} +1 -1
  113. package/dist/{run-DxVzhcF3.mjs → run-BCzKf_TV.mjs} +9 -9
  114. package/dist/{runs-BOHk1XnM.mjs → runs-pVgTv7cK.mjs} +9 -9
  115. package/dist/{runtime-cwBS8wwK.mjs → runtime-DPdP0sl1.mjs} +6 -6
  116. package/dist/{schema-tables-CcFbY_jN.mjs → schema-tables-c6K9AkS-.mjs} +6 -6
  117. package/dist/{schemas-DZmv_V62.mjs → schemas-s3PRMTwc.mjs} +6 -6
  118. package/dist/{search-CYMuc7Fg.mjs → search-DsF08cm9.mjs} +8 -8
  119. package/dist/segment-CvPF5gLG.mjs +19 -0
  120. package/dist/{set-CbGfQ7Ye.mjs → set-BNQjt8S1.mjs} +12 -12
  121. package/dist/{set-B_rrVwU4.mjs → set-DlfevPxG.mjs} +9 -9
  122. package/dist/{setting-DqZY9NXP.mjs → setting-Cc5FWSNN.mjs} +3 -3
  123. package/dist/{setup-DxmcAorA.mjs → setup-CIsvZgEA.mjs} +9 -9
  124. package/dist/skills-CHU7uuDU.mjs +191 -0
  125. package/dist/skills-Dws-azxD.mjs +18 -0
  126. package/dist/snippet-W-TaXdio.mjs +19 -0
  127. package/dist/{start-Cn0epTks.mjs → start-xREv6hev.mjs} +19 -17
  128. package/dist/{stash-BFZIl9F4.mjs → stash-ZLbOejYk.mjs} +9 -9
  129. package/dist/{status-UALK3OJl.mjs → status-CYWbB67d.mjs} +5 -5
  130. package/dist/{status-FDIDmqvM.mjs → status-DiXaGNmb.mjs} +5 -5
  131. package/dist/{status-BjCeJNLp.mjs → status-DjRAgzXl.mjs} +8 -8
  132. package/dist/{stop-DUwrDWw8.mjs → stop-CWKn_jI8.mjs} +10 -9
  133. package/dist/{summary-CS4UGiFJ.mjs → summary-CIFwiame.mjs} +6 -6
  134. package/dist/{sync-schema-IrHdJxmX.mjs → sync-schema-_SRMfBSQ.mjs} +6 -6
  135. package/dist/table-uhBlfNYj.mjs +19 -0
  136. package/dist/transform-UJ7T_BSb.mjs +24 -0
  137. package/dist/transform-job-DXs5apQ1.mjs +19 -0
  138. package/dist/{translate-B__zbDKm.mjs → translate-DVN_sIVb.mjs} +10 -10
  139. package/dist/{tree-Mh0uQ_Wy.mjs → tree-BTZfgldu.mjs} +5 -5
  140. package/dist/{update-D2VI_5cy.mjs → update-Bjd7YRyh.mjs} +13 -13
  141. package/dist/{update-Bw0WZix_.mjs → update-CCFegz4q.mjs} +15 -15
  142. package/dist/{update-BfBsM_y1.mjs → update-CDdML0mE.mjs} +14 -14
  143. package/dist/{update-B9DBMo30.mjs → update-CGYM_wWQ.mjs} +12 -12
  144. package/dist/{update-Cp1789qq.mjs → update-CYMsVUQX.mjs} +10 -10
  145. package/dist/{update-j9vgemKR.mjs → update-D48EYMKn.mjs} +10 -10
  146. package/dist/{update-1Di9hbPo.mjs → update-D6jptFDw.mjs} +14 -14
  147. package/dist/{update-B5_pp6Jj.mjs → update-DSjj9UQb.mjs} +15 -15
  148. package/dist/{update-Masp5WeT.mjs → update-DjfNbEgo.mjs} +11 -11
  149. package/dist/{update-D8GwQTcL.mjs → update-ZRF-sYqN.mjs} +16 -16
  150. package/dist/{update-dashcard-CNiQw1MD.mjs → update-dashcard-BfcB6pFx.mjs} +10 -10
  151. package/dist/upgrade-Cw_mP31_.mjs +432 -0
  152. package/dist/{url-GFM76VIK.mjs → url-DsDSVEnK.mjs} +9 -8
  153. package/dist/{uuid-Uif0lNk8.mjs → uuid-DbtHyH33.mjs} +7 -7
  154. package/dist/{validate-DCYx6jdL.mjs → validate-CB0bu50i.mjs} +3 -3
  155. package/dist/{validate-query-B07oGG4K.mjs → validate-query-CavIA0Q2.mjs} +3 -3
  156. package/dist/{values-DrwNHUAI.mjs → values-C1JRC3O2.mjs} +6 -6
  157. package/dist/{wait-DO7tS7NI.mjs → wait-Ed4Q7ccW.mjs} +2 -2
  158. package/dist/{wait-BoKk8CJy.mjs → wait-LRmiGepb.mjs} +8 -8
  159. package/dist/{wait-flags-CjX2sEGm.mjs → wait-flags-pItBfuzi.mjs} +2 -2
  160. package/dist/workspace-BozpZKez.mjs +24 -0
  161. package/dist/{workspace-credentials-B6BL-X0d.mjs → workspace-credentials-4lIxxz4g.mjs} +2 -41
  162. package/dist/yaml-ECiog374.mjs +43 -0
  163. package/package.json +8 -3
  164. package/skill-data/core/SKILL.md +575 -0
  165. package/skill-data/git-sync/SKILL.md +196 -0
  166. package/skill-data/transform/SKILL.md +235 -0
  167. package/skill-data/workspace/SKILL.md +408 -0
  168. package/skills/metabase-cli/SKILL.md +42 -0
  169. package/dist/add-collection-SL08iMub.mjs +0 -11
  170. package/dist/auth-DfYkakP3.mjs +0 -19
  171. package/dist/card-ZCGU2JEh.mjs +0 -20
  172. package/dist/collection-D_uFLIAS.mjs +0 -19
  173. package/dist/dashboard-G1-dGLUR.mjs +0 -20
  174. package/dist/db-CBaEfumR.mjs +0 -22
  175. package/dist/field-BDJ1pEgr.mjs +0 -18
  176. package/dist/git-sync-BiTWfLgY.mjs +0 -28
  177. package/dist/is-dirty-DClGFOGV.mjs +0 -10
  178. package/dist/measure-C7SbdYQk.mjs +0 -19
  179. package/dist/ps-BmYQYC7t.mjs +0 -10
  180. package/dist/segment-Df4pfjco.mjs +0 -19
  181. package/dist/snippet-CwSHjQyn.mjs +0 -19
  182. package/dist/table-Cdr5bKp1.mjs +0 -19
  183. package/dist/transform-CeZusR_w.mjs +0 -24
  184. package/dist/transform-job-BOn9-CGa.mjs +0 -19
  185. package/dist/workspace-CyEX40D-.mjs +0 -24
  186. /package/dist/{snippet-Dw0Sjzkr.mjs → snippet-CSWqkslB.mjs} +0 -0
  187. /package/dist/{transform-IEX4Mx3X.mjs → transform-DR4ejuPM.mjs} +0 -0
  188. /package/dist/{transform-job-Csr86muI.mjs → transform-job-BrhOLO4M.mjs} +0 -0
  189. /package/dist/{workspace-DVuqKJGG.mjs → workspace-DUfqhPm5.mjs} +0 -0
@@ -0,0 +1,408 @@
1
+ ---
2
+ name: workspace
3
+ description: Enterprise workspace lifecycle for `mb` — create, provision databases, start (with Remote Sync wiring + branch guard), save child credentials as a profile, diagnose. Load when the user touches `mb workspace …` — "spin up a workspace", "provision a database", "start a local Metabase against my prod", "save the child's API key", "diagnose a workspace that won't start", or anything Enterprise workspaces.
4
+ allowed-tools: Read, Write, Edit, Bash, AskUserQuestion
5
+ ---
6
+
7
+ # Workspaces (Enterprise)
8
+
9
+ A **workspace** is a child Metabase instance bound to a parent's databases. Local lifecycle is `mb workspace <verb>`; the parent is reached via a profile (the parent's profile — typically `prod` / `staging`). Each provisioned database gets a per-workspace isolation schema on the warehouse, and the QP rewrites references from canonical names (`public.foo`) to that isolation schema (`mb__isolation_<hash>_<ws-id>.foo`) on the fly. Cards, transforms, and queries authored in the workspace target canonical names; the rewrite is invisible to the author.
10
+
11
+ This skill covers the full lifecycle. The general flag conventions, auth setup, and output flags live in the `core` skill; load that first (`mb skills get core`).
12
+
13
+ ## Always ask about Remote Sync before starting
14
+
15
+ Before running `mb workspace start`, **ask the user how they want Remote Sync wired**. The bind mount is set at container-create time — you cannot add it later without a recreate, so this decision belongs at start time. Use `AskUserQuestion` with three options:
16
+
17
+ > "How should I wire Remote Sync for this workspace?"
18
+ >
19
+ > 1. **Current directory** — bind-mount the directory you're running Claude from (`pwd`) as `file:///mnt/repo` and set the workspace to remote-sync against it (read-write). Pick this when the conversation is happening inside the sync repo.
20
+ > 2. **Custom path** — you specify a different host directory; same wiring as option 1.
21
+ > 3. **No sync** — start the workspace without a repo bind mount; you can configure remote-sync against a remote URL later via `setting set`.
22
+
23
+ Default-suggest option 1 if the current working directory looks like a git repo (a `.git/` is present). Otherwise default-suggest option 3 and let the user volunteer a path.
24
+
25
+ Map the answer to flags on `workspace start`:
26
+
27
+ | Choice | Flags to add to `workspace start` |
28
+ | ----------------- | ----------------------------------------------------------------- |
29
+ | Current directory | `--repo "$(pwd)"` |
30
+ | Custom path | `--repo <path>` |
31
+ | No sync | (omit `--repo` — no bind mount, no remote-sync settings injected) |
32
+
33
+ The `--repo` flag (a) bind-mounts the host path into the container at `/mnt/repo`, and (b) injects three settings into the workspace's config.yml at boot: `remote-sync-url=file:///mnt/repo`, `remote-sync-branch=<HEAD>`, `remote-sync-type=read-write`. The branch defaults to the current branch of the host repo (read via `git -C <path> symbolic-ref --short HEAD`); override with `--repo-branch <name>`. Switch to read-only with `--repo-mode read-only` (also makes the bind mount read-only).
34
+
35
+ Do not skip this question — silently picking "no sync" loses the user's repo context, and silently picking "current directory" pushes work into a repo they didn't intend.
36
+
37
+ ## Branch guard before `--repo`
38
+
39
+ When the user picks a `--repo` option (current dir or custom path), check the host's branch before `workspace start`. `--repo` reads `git -C <path> symbolic-ref --short HEAD` and injects it as the workspace's `remote-sync-branch` setting; that branch then becomes the default target for every subsequent `git-sync import` and `git-sync export`. If the host is on `main` (or `master`), every export commits straight to it — usually not what the user wants for ephemeral workspace work.
40
+
41
+ ```bash
42
+ HOST_BRANCH=$(git -C <repo-path> symbolic-ref --short HEAD)
43
+ ```
44
+
45
+ If `HOST_BRANCH` is `main` or `master`, ask the user via `AskUserQuestion`:
46
+
47
+ > "The host repo is on `<branch>` — the workspace will track and export to that branch by default. Switch to a feature branch first?"
48
+ >
49
+ > 1. **Create + checkout a feature branch on the host** — agent suggests a name (e.g., `agent/<task>`); run `git -C <repo-path> checkout -b <name>` then proceed with `workspace start --repo …` so the workspace tracks `<name>`.
50
+ > 2. **Pin the workspace to a specific branch** — pass `--repo-branch <name>` on `workspace start` to override host HEAD. The branch must exist **locally** in the bind-mounted host repo before `workspace start` (create it first with `git -C <repo-path> branch <name>` or `git -C <repo-path> checkout -b <name>`); it does **not** need to exist on `origin`. Local-only branches are fine — the workspace never pushes, and the remote side gets created on the user's first `git push` later.
51
+ > 3. **Proceed on `main`/`master`** — explicitly accepted; downstream `git-sync export` will commit to that branch unless overridden per-call.
52
+
53
+ Skip this question only when the user's instructions already named the branch (e.g., they explicitly asked to work against `main`). The same guard applies later at `git-sync export` time — see the `git-sync` skill, "Branch guard".
54
+
55
+ ## Quick start (copy-pasteable, end-to-end)
56
+
57
+ When a parent profile + license are in place, this whole sequence runs in one go. Replace the four shell vars; pick whether to bind-mount a sync repo with `REPO_FLAGS` per the question above.
58
+
59
+ ```bash
60
+ PARENT=<parent> # e.g. prod — the parent profile name
61
+ WS_NAME=<ws-name> # e.g. my_nice_ws — also reused as the child profile name
62
+ DB_ID=<db-id> # parent database id from `mb database list --profile $PARENT --json`
63
+ SCHEMAS=<schema1,schema2> # comma-separated; no "all" wildcard
64
+ REPO_FLAGS=(--repo "$(pwd)") # OR (--repo /path/to/sync-repo) OR () for no sync
65
+
66
+ # 0. Branch guard (only when REPO_FLAGS is non-empty). If the host repo is on
67
+ # main/master, ask the user before continuing — see "Branch guard before --repo"
68
+ # above. Skip when REPO_FLAGS is () (no sync = no branch).
69
+ if [ ${#REPO_FLAGS[@]} -gt 0 ]; then
70
+ HOST_BRANCH=$(git -C "$(pwd)" symbolic-ref --short HEAD)
71
+ case "$HOST_BRANCH" in main|master) ;; # ask user; not auto-resolvable
72
+ esac
73
+ fi
74
+
75
+ # 1. Create empty workspace, capture id
76
+ WS_ID=$(mb workspace create --name "$WS_NAME" --profile "$PARENT" --json | jq -r '.id')
77
+
78
+ # 2. Provision a database into it (blocks on :provisioned)
79
+ mb workspace database provision "$WS_ID" \
80
+ --database-id "$DB_ID" \
81
+ --schemas "$SCHEMAS" \
82
+ --wait \
83
+ --profile "$PARENT"
84
+
85
+ # 3. Start the child container, block on state=running.
86
+ # With REPO_FLAGS set, the child boots already wired to the local repo:
87
+ # bind-mounted at /mnt/repo, remote-sync-url=file:///mnt/repo, branch from HEAD.
88
+ mb workspace start "$WS_ID" --wait --profile "$PARENT" "${REPO_FLAGS[@]}"
89
+
90
+ # 4. Save the child's API key as its own profile (use the workspace name as profile name).
91
+ # This is the documented exception to "the agent doesn't run auth login" — the child
92
+ # key was minted by the parent the human authorized, and reading it via
93
+ # `workspace credentials` is the supported path.
94
+ WS_URL=$(mb workspace url "$WS_ID" --profile "$PARENT" --json | jq -r '.url')
95
+ WS_API_KEY=$(mb workspace credentials "$WS_ID" --profile "$PARENT" --json | jq -r '.api_key')
96
+ printf '%s' "$WS_API_KEY" | mb auth login \
97
+ --url "$WS_URL" \
98
+ --api-key-stdin \
99
+ --profile "$WS_NAME" \
100
+ --json
101
+
102
+ # 5. Smoke test: list child databases
103
+ mb database list --profile "$WS_NAME" --json
104
+
105
+ # 6. (If REPO_FLAGS was set) Verify sync is wired:
106
+ mb setting get remote-sync-url --profile "$WS_NAME" --json # → "file:///mnt/repo"
107
+ mb git-sync status --profile "$WS_NAME" --json # → branch, dirty, current task
108
+
109
+ # 7. (If REPO_FLAGS was set) Ensure the repo has been applied to the fresh workspace.
110
+ # The container's boot-time auto-import usually handles this on its own, so check
111
+ # `git-sync status` first — if `current_task` already shows a successful `import` for
112
+ # the current branch, skip the explicit call (it's a no-op round-trip).
113
+ # Only when the auto-import hasn't landed yet do you need an explicit import.
114
+ # The first explicit import on a fresh instance can spuriously report
115
+ # `status: conflict` (stale task state from the boot-time import); retry once,
116
+ # then `--force` is safe because the workspace is empty (nothing to lose).
117
+ # Skipping the import entirely is *not* safe — without it the instance has none
118
+ # of the repo content and subsequent edits will diverge.
119
+ HOST_BRANCH=$(git -C "$(pwd)" symbolic-ref --short HEAD)
120
+ SYNC_STATUS=$(mb git-sync status --profile "$WS_NAME" --json)
121
+ if ! echo "$SYNC_STATUS" | jq -e --arg b "$HOST_BRANCH" \
122
+ '.current_task.sync_task_type == "import" and .current_task.status == "successful" and (.branch == $b)' >/dev/null; then
123
+ mb git-sync import --branch "$HOST_BRANCH" --profile "$WS_NAME" --json \
124
+ || mb git-sync import --branch "$HOST_BRANCH" --profile "$WS_NAME" --json \
125
+ || mb git-sync import --branch "$HOST_BRANCH" --force --profile "$WS_NAME" --json
126
+ fi
127
+ ```
128
+
129
+ After step 5, drive the child via `mb <verb> --profile $WS_NAME` for everything (cards, transforms, queries, …). To author a transform on the workspace, load the `transform` skill (`mb skills get transform`). To use the sync flow (import host commits, export instance changes), load the `git-sync` skill (`mb skills get git-sync`).
130
+
131
+ ## Setup (steps in order)
132
+
133
+ ### 1. Parent profile
134
+
135
+ ```bash
136
+ mb auth status --profile <parent> --json
137
+ ```
138
+
139
+ If a profile is missing or expired, **stop and ask the operator** to run, themselves:
140
+
141
+ > Please run `mb auth login --url <parent-base-url> --profile <parent>` from your terminal and tell me the profile name when you're done.
142
+
143
+ Don't run `auth login` for them and don't suggest a URL — they pick. Verify with `mb auth status --profile <parent> --json` once they confirm. If multiple parent profiles exist and the user hasn't named one, use `AskUserQuestion` to disambiguate.
144
+
145
+ ### 2. License
146
+
147
+ ```bash
148
+ mb license status --profile <parent> --json
149
+ ```
150
+
151
+ If `present: false`, ask the operator to run, themselves:
152
+
153
+ ```bash
154
+ echo "<your-token>" | mb license set --profile <parent>
155
+ ```
156
+
157
+ A workspace child cannot start without a parent license — it inherits feature gates from the parent.
158
+
159
+ ### 3. Find or create a workspace
160
+
161
+ ```bash
162
+ mb workspace list --profile <parent> --json
163
+ ```
164
+
165
+ - Empty → create one (below).
166
+ - One workspace → use its `id`. Surface name + id to the user.
167
+ - Multiple → `AskUserQuestion`.
168
+
169
+ Create:
170
+
171
+ ```bash
172
+ mb workspace create --name "<descriptive-name>" --profile <parent> --json
173
+ ```
174
+
175
+ Note the returned `id`. The workspace is empty; you must provision at least one database before `start` will succeed.
176
+
177
+ ### 4. Provision databases
178
+
179
+ A workspace needs at least one provisioned database. Source databases come from the parent.
180
+
181
+ ```bash
182
+ mb database list --profile <parent> --json
183
+ ```
184
+
185
+ For each source database, decide which schemas to expose. Enumerate the schemas the parent already syncs for that database:
186
+
187
+ ```bash
188
+ mb table list --db-id <db-id> --profile <parent> --json \
189
+ | jq -r '[.data[].schema] | unique | .[]'
190
+ ```
191
+
192
+ Provision (one db per call; `--schemas` is required, no "all" wildcard):
193
+
194
+ ```bash
195
+ mb workspace database provision <ws-id> \
196
+ --database-id <db-id> \
197
+ --schemas <schema1>,<schema2> \
198
+ --wait \
199
+ --profile <parent>
200
+ ```
201
+
202
+ `--wait` blocks until status is `provisioned`. Repeat per source database.
203
+
204
+ Verify all are ready:
205
+
206
+ ```bash
207
+ mb workspace list --profile <parent> --full --json \
208
+ | jq '.data[] | select(.id==<ws-id>) | .databases'
209
+ ```
210
+
211
+ Every entry's `status` must be `provisioned`.
212
+
213
+ ## Start
214
+
215
+ Before running `start`, ask the user about Remote Sync (see "Always ask about Remote Sync before starting" at the top of this file). The bind mount is decided at container-create time and cannot be added later without recreate.
216
+
217
+ ### Pick a free port up front
218
+
219
+ Despite the `--port` flag's "auto-shifts up if taken" hint, in practice `workspace start` fails with `docker start failed for metabase-workspace-<id>` when the host port is occupied — typically by a stale workspace container from a prior session. **List local containers first** and pass an explicit free `--port`:
220
+
221
+ ```bash
222
+ mb workspace ps --profile <parent> # → currently-running workspace containers + their host ports
223
+ docker ps --filter "name=metabase-workspace" \
224
+ --format "{{.Names}}\t{{.Ports}}\t{{.Status}}" # also surfaces stopped containers
225
+ ```
226
+
227
+ If 3000 is taken, pass e.g. `--port 3322`. The child's URL in `workspace credentials` and `workspace url` reflects the chosen port automatically.
228
+
229
+ ```bash
230
+ # No sync:
231
+ mb workspace start <ws-id> --wait --profile <parent>
232
+
233
+ # With sync against the current directory:
234
+ mb workspace start <ws-id> --repo "$(pwd)" --wait --profile <parent>
235
+
236
+ # With sync against a custom path, branch override, read-only:
237
+ mb workspace start <ws-id> --repo /path/to/repo --repo-branch dev --repo-mode read-only --wait --profile <parent>
238
+ ```
239
+
240
+ `--wait` blocks until `state: "running"`. Don't omit it for interactive bring-up — without it the next step (saving credentials as a child profile) races the container's HTTP listener and you'll get spurious connection errors.
241
+
242
+ | Flag | Purpose |
243
+ | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
244
+ | `--port <n>` | Host port (default 3000; **does not** auto-shift reliably — pass an explicit free port if 3000 might be taken). |
245
+ | `--wait` | Block until `/api/health` reports ready before returning. |
246
+ | `--no-pull` | Skip `docker pull` (image already present). |
247
+ | `--no-metadata` | Skip the warehouse metadata export. |
248
+ | `--force` | Recreate even if a container for this workspace exists. Preserves the app db. |
249
+ | `--timeout <ms>` | Per-phase readiness deadline (default 240000). Covers the post-create config-consumption wait, (with `--wait`) the `/api/health` probe, and (with `--metadata`) the metadata-import status poll on the child. Bump if the first cold boot exceeds the default — image pull + JVM startup can stretch on slow disks/networks. |
250
+ | `--repo <host-path>` | Bind-mount a host directory at `/mnt/repo` and inject `remote-sync-url=file:///mnt/repo` into config.yml. |
251
+ | `--repo-branch <name>` | `remote-sync-branch` value. Default: current branch of the host repo (`git symbolic-ref --short HEAD`). |
252
+ | `--repo-mode <mode>` | `read-write` (default) or `read-only`. Also flips the bind mount's mount mode. |
253
+
254
+ **Notes on `--repo`:**
255
+
256
+ - `--repo` is honored only on container create. To change the mount on an existing container you must `start --force` (which recreates), passing `--repo` again. The app db volume persists, so users/sessions/saved questions survive.
257
+ - The host path must be a directory and must already exist. The CLI does not create or initialize a git repo for you.
258
+ - For `--repo-branch` auto-detection, the path needs to be a git repo (a `.git/` ancestor); otherwise pass `--repo-branch` explicitly.
259
+ - The `--repo-branch` value must name a branch that already exists **locally** in the host repo. Local-only branches (never pushed to `origin`) are fine — the workspace operates against the bind-mounted working tree, never pushes anywhere itself, and the remote side is created on the user's first `git push` later. If the branch doesn't exist locally yet, create it before `workspace start`: `git -C <repo-path> branch <name>` (or `checkout -b <name>` if you also want to switch HEAD).
260
+ - File-permission gotcha (Linux only): the Metabase container runs as uid 2000 by default; the host directory must be writable by that uid for `git-sync export` to succeed. macOS Docker Desktop / OrbStack / Colima handle this via their file-sharing layer.
261
+
262
+ ## Interact with a running workspace
263
+
264
+ `url` and `credentials` both return JSON envelopes. Extract fields with `jq`:
265
+
266
+ ```bash
267
+ mb workspace url <ws-id> --profile <parent> --json
268
+ # → {"workspace_id": ..., "url": "http://localhost:3000"}
269
+
270
+ mb workspace credentials <ws-id> --profile <parent> --json
271
+ # → {"email": ..., "password": ..., "api_key": ...}
272
+ ```
273
+
274
+ Save the child's API key as its own named profile. **Always pipe the key on stdin** (the CLI rejects `--api-key "$VAR"`).
275
+
276
+ ```bash
277
+ WS_URL=$(mb workspace url <ws-id> --profile <parent> --json | jq -r '.url')
278
+ WS_API_KEY=$(mb workspace credentials <ws-id> --profile <parent> --json | jq -r '.api_key')
279
+ printf '%s' "$WS_API_KEY" | mb auth login \
280
+ --url "$WS_URL" \
281
+ --api-key-stdin \
282
+ --profile <ws-name> \
283
+ --json
284
+ ```
285
+
286
+ Convention: use the workspace name as the profile name (`my_nice_ws` workspace → `my_nice_ws` profile). Then drive the child with the same CLI verbs:
287
+
288
+ ```bash
289
+ mb database list --profile <ws-name> --json
290
+ mb card list --profile <ws-name> --json
291
+ mb transform list --profile <ws-name> --json
292
+ ```
293
+
294
+ To create and run a transform in the workspace, load the `transform` skill. The `<db-id-in-child>` referenced there comes from `mb database list --profile <ws-name> --json` — the child re-numbers databases independently of the parent.
295
+
296
+ ## Open the UI
297
+
298
+ ```
299
+ http://localhost:<port> # default 3000; honors `--port` from `workspace start`
300
+ http://localhost:<port>/admin/transforms/<transform-id>
301
+ ```
302
+
303
+ Log in with the **admin email + password** from `workspace credentials` (the API key authenticates as a synthetic api-key user, not as the admin — many UI screens hide content from the api-key user).
304
+
305
+ **Don't open the URL before `state: "running"`** — the Metabase setup wizard will hijack it and create a fresh app db, bypassing the workspace bring-up.
306
+
307
+ ## Lifecycle
308
+
309
+ | User intent | Command |
310
+ | --------------------------------- | -------------------------------------------------------------------- |
311
+ | List local workspace containers | `mb workspace ps --profile <parent>` |
312
+ | Tail logs | `mb workspace logs <ws-id> --tail 200 --profile <parent>` |
313
+ | Follow logs | `mb workspace logs <ws-id> --follow --profile <parent>` |
314
+ | Read admin email/password/API key | `mb workspace credentials <ws-id> --profile <parent> --json` |
315
+ | Stop (preserves app db) | `mb workspace stop <ws-id> --profile <parent>` |
316
+ | Restart | `mb workspace start <ws-id> --force --wait --profile <parent>` |
317
+ | Remove container + app db | `mb workspace remove <ws-id> --yes --profile <parent>` |
318
+ | Remove container, keep app db | `mb workspace remove <ws-id> --keep-volume --yes --profile <parent>` |
319
+
320
+ The supported restart path is `stop` + `start --force` (or `start --force` directly). The app db volume persists across `stop`/`start` cycles, so users/sessions/saved questions survive. `remove`, `start --force`, and `stop` are destructive enough to confirm before running unless the user explicitly asked for them.
321
+
322
+ ## Diagnose
323
+
324
+ Pick the symptom.
325
+
326
+ ### `start` succeeds but the database isn't visible in the UI
327
+
328
+ ```bash
329
+ mb workspace logs <ws-id> --tail 300 --profile <parent> | grep -iE "advanced-config|workspace|error"
330
+ ```
331
+
332
+ | Log signal | Cause | Fix |
333
+ | ---------------------------------------------------------------- | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
334
+ | `Spec assertion failed ... :input ... :output` | Parent emits keys the child's spec doesn't accept (server-side). | File against the parent. Not a CLI issue. |
335
+ | `Connection refused` / `unknown host` against the warehouse host | Container can't reach the source DB. | Source DB credentials configured on the parent use a host that doesn't resolve from inside docker. Use a routable hostname. |
336
+ | `Invalid token` / `License expired` | EE license bad or unset on the parent (forwarded into the child). | Re-set on the parent: `mb license set` (operator pastes). |
337
+
338
+ ### `workspace credentials` returns values that don't authenticate
339
+
340
+ Symptom: right after `workspace start`, the API key returned by `mb workspace credentials <ws-id>` is rejected by the child (`Unauthenticated` on `/api/user/current`, or `Invalid or unauthorized API key` from `mb auth login --skip-verify` followed by any verb). The admin password from the same response also fails (`did not match stored password`). The values inside the container's `/mw-config/credentials.json` match what the parent reports, but the child's app db has different state.
341
+
342
+ This is a parent↔child credential drift bug — the parent's record for the workspace can desync from the child's app db, especially after a rapid `start` → `start --force` sequence on the same port. **`start --force` alone does not fix it** (the volume persists across the recreate; the api-key already exists from the prior init and the new credentials.json is ignored).
343
+
344
+ Recovery (works reliably):
345
+
346
+ ```bash
347
+ mb workspace remove <ws-id> --yes --profile <parent> # destroys container + volume; keeps parent record + provisioned dbs
348
+ mb workspace start <ws-id> --port <fresh-port> --wait --profile <parent> # different port from the bad attempt
349
+ mb workspace credentials <ws-id> --profile <parent> --json | jq -r '.api_key' \
350
+ | xargs -I{} curl -s -H "x-api-key: {}" http://localhost:<fresh-port>/api/user/current # smoke check
351
+ ```
352
+
353
+ Why "different port": empirically, restarting on the same port after the drifted attempt can cling to the same broken state; switching ports forces a clean parent-side handoff. If you must reuse the original port, `workspace remove --yes` plus a brief pause (a few seconds) before `start` increases the success rate.
354
+
355
+ `workspace remove --yes` is destructive — it drops the container _and_ the app db volume — but in the bring-up window (before any user content has been imported) there's nothing to lose. The provisioned-database records on the parent survive the remove and don't need to be re-created.
356
+
357
+ ### Container exited shortly after `start`
358
+
359
+ ```bash
360
+ mb workspace ps --profile <parent>
361
+ ```
362
+
363
+ `Exited (137)` → OOM. Bump Docker host memory to ≥ 6 GB.
364
+
365
+ - Colima: `colima stop && colima start --memory 6 --cpu 2`
366
+ - Docker Desktop: Settings → Resources → Memory.
367
+
368
+ Then `mb workspace start <ws-id> --force --wait --profile <parent>`.
369
+
370
+ ### `Endpoint not found — is this a Metabase instance?`
371
+
372
+ The parent doesn't expose `/api/ee/workspace-manager/*`. Either:
373
+
374
+ - Parent is OSS (no EE).
375
+ - Parent has no license, or license lacks the workspace feature.
376
+ - Parent is on a Metabase version that predates workspaces.
377
+
378
+ Confirm the URL points at the right instance with `mb auth status --profile <parent> --json`. If the URL is correct, the parent simply lacks the workspace feature — pick a different instance.
379
+
380
+ ### `workspace has no databases — provision at least one before starting`
381
+
382
+ `mb workspace list --profile <parent> --full --json` will show the workspace with `databases: []`. Run a `provision` (step 4) and retry.
383
+
384
+ ### `workspace ... is not ready: database X=provisioning`
385
+
386
+ Provisioning is async on the parent. Re-run the original `provision` with `--wait`, or poll:
387
+
388
+ ```bash
389
+ mb workspace list --profile <parent> --full --json \
390
+ | jq '.data[] | select(.id==<ws-id>) | .databases[] | {database_id, status}'
391
+ ```
392
+
393
+ ### Workspace UI demands the setup wizard
394
+
395
+ You opened the URL before health passed and walked through the wizard, which created a fresh app db and bypassed the workspace bring-up. `mb workspace remove <ws-id> --yes --profile <parent>` then `start --wait` again. Don't open the URL before `state: "running"`.
396
+
397
+ ### `git status` on the host shows confusing "staged changes" after `git-sync export`
398
+
399
+ The in-container exporter writes the new commit object directly into the bind-mounted `.git/` and advances HEAD, but does not update the host's working tree or index. The host then shows the export's content as "Changes to be committed" reverting to the prior commit — display artifact, not a real revert. The non-destructive realignment is `git -C <repo> restore --staged --worktree .` (only touches paths that disagree with HEAD; refuses on unmerged paths; does not move HEAD). See the `git-sync` skill, "Working-tree drift on `--repo` bind-mount workspaces" for the full decision tree (when to stash first, when `reset --hard` is acceptable).
400
+
401
+ ## Don't (workspace-specific)
402
+
403
+ - Don't run raw `docker` commands against the workspace container — use the `mb workspace` subcommands. They wrap the right labels, volumes, network, and lifecycle hooks.
404
+ - Don't open the workspace URL before `state: "running"` — the setup wizard will hijack it.
405
+ - Don't try to share an API key across workspaces — each child mints its own. Save credentials per-workspace under a profile named after the workspace.
406
+ - Don't write the workspace's isolation schema (`mb__isolation_<hash>_<ws-id>`) into transform/card SQL or `target.schema`. Author against the **canonical** schema (e.g. `public`); the QP rewrites at execution time. Hard-coding the isolation prefix breaks portability across workspaces and bypasses the rewrite contract.
407
+ - Don't run `workspace start` without first asking the user about Remote Sync (current dir / custom path / no sync). The bind mount is set at create time; "I'll add it after start" is not supported.
408
+ - Don't run `workspace start --repo <path>` when the host repo is on `main`/`master` without first asking the user (see "Branch guard before `--repo`"). The host's HEAD becomes the workspace's `remote-sync-branch`, so every subsequent export targets `main` by default.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: metabase-cli
3
+ description: Drive a Metabase instance from the terminal via the `mb` CLI. Authenticate with named profiles; inspect databases (list, get, full metadata rollup, schemas, tables in a schema) and trigger manual schema sync / field-values rescan; inspect tables, fields; list/get/create/update/archive cards (questions, models, metrics) and run them as JSON/CSV/XLSX; list/get/create/update dashboards and patch dashcards; list/get/create collections and traverse the hierarchy by id, entity_id, or "root"/"trash" (with items and recursive tree); list/get/create/update/archive native query snippets, segments, and measures; author/update/run transforms and schedule transform-jobs; read/update settings; search content (cards, dashboards, collections, transforms, metrics); manage Enterprise workspaces; git-sync to/from a git remote (status, dirty, import, export, branches, stash, add/remove a collection from sync). Use whenever the user wants to interact with a Metabase from the terminal — "log into metabase", "what profiles do I have", "list cards", "run card 42 as CSV", "create a transform", "list dashboards", "move a dashcard", "list collections", "what's in collection 4", "show the collection tree", "list snippets", "create a segment", "archive a measure", "search metabase for X", "spin up a workspace", "import the latest changes", "add a directory to git sync", "set a setting", "what schemas are in this database", "trigger a sync", "rescan field values", or anything hitting `mb <verb>`.
4
+ allowed-tools: Bash(mb:*), Bash(npx mb:*), Read, Write, Edit, AskUserQuestion
5
+ hidden: true
6
+ ---
7
+
8
+ # metabase-cli
9
+
10
+ The official Metabase CLI (`mb`) drives a Metabase instance over its REST API.
11
+
12
+ Install: `npm i -g @metabase/cli`
13
+
14
+ ## Start here
15
+
16
+ This file is a discovery stub, not the usage guide. Before running any `mb` command, load the actual workflow content from the CLI:
17
+
18
+ ```bash
19
+ mb skills get core # start here — auth, flag conventions, every command group
20
+ mb skills get core --full # include all references for the deep dive
21
+ ```
22
+
23
+ The CLI serves skill content bundled with the installed version, so instructions never go stale. The content in this stub cannot change between releases, which is why it just points at `mb skills get core`.
24
+
25
+ ## Specialized skills
26
+
27
+ Load a specialized skill when the task falls outside one-shot CLI use:
28
+
29
+ ```bash
30
+ mb skills get workspace # Enterprise workspaces: create, provision, start, child credentials, diagnose
31
+ mb skills get transform # author + run transforms (native SQL and MBQL 5), iterate on failures
32
+ mb skills get git-sync # round-trip Metabase content to/from a git remote
33
+ ```
34
+
35
+ Run `mb skills list` to see everything available on the installed version.
36
+
37
+ ## Why mb
38
+
39
+ - Native `fetch`, typed Zod schemas, redacted secrets — the supported path for Metabase REST automation.
40
+ - One `--profile` per command targets staging, prod, a workspace child, whatever the user has configured.
41
+ - Output is shaped for agents: compact projection by default, `--full` / `--fields a,b.c` / `--json` / `--max-bytes` on every list/get.
42
+ - `mb __manifest` returns the canonical, machine-readable inventory of every command — name, args, output schema. Use it instead of scraping `--help`.
@@ -1,11 +0,0 @@
1
- import "./package-DV6Asqim.mjs";
2
- import "./command-augment-D9pI9Vbh.mjs";
3
- import "./render-DXv-D6fU.mjs";
4
- import "./predicates-DiIiS3k7.mjs";
5
- import "./runtime-cwBS8wwK.mjs";
6
- import "./parse-id-B38zTlYs.mjs";
7
- import "./poll-task-vPwV31Fs.mjs";
8
- import "./poll-Bh6oAifO.mjs";
9
- import { SyncSettingsUpdateResult, add_collection_default, setCollectionRemoteSynced, syncSettingsUpdateView } from "./add-collection-DwxQDXzL.mjs";
10
-
11
- export { add_collection_default as default };
@@ -1,19 +0,0 @@
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-DxgkosGx.mjs").then((m) => m.default),
12
- status: () => import("./status-FDIDmqvM.mjs").then((m) => m.default),
13
- list: () => import("./list-Di529OJD.mjs").then((m) => m.default),
14
- logout: () => import("./logout-BlVwqBog.mjs").then((m) => m.default)
15
- }
16
- });
17
-
18
- //#endregion
19
- export { auth_default as default };
@@ -1,20 +0,0 @@
1
- import { defineCommand } from "citty";
2
-
3
- //#region src/commands/card/index.ts
4
- var card_default = defineCommand({
5
- meta: {
6
- name: "card",
7
- description: "Manage Metabase cards (questions, models, metrics)"
8
- },
9
- subCommands: {
10
- list: () => import("./list-DlKzgnqo.mjs").then((mod) => mod.default),
11
- get: () => import("./get-cuHp9-6U.mjs").then((mod) => mod.default),
12
- query: () => import("./query-jmfqaXRP.mjs").then((mod) => mod.default),
13
- create: () => import("./create-QgN369N5.mjs").then((mod) => mod.default),
14
- update: () => import("./update-D8GwQTcL.mjs").then((mod) => mod.default),
15
- archive: () => import("./archive-C1mF-9Kj.mjs").then((mod) => mod.default)
16
- }
17
- });
18
-
19
- //#endregion
20
- export { card_default as default };
@@ -1,19 +0,0 @@
1
- import { defineCommand } from "citty";
2
-
3
- //#region src/commands/collection/index.ts
4
- var collection_default = defineCommand({
5
- meta: {
6
- name: "collection",
7
- description: "Browse Metabase collections"
8
- },
9
- subCommands: {
10
- list: () => import("./list-DJN-OvTZ.mjs").then((mod) => mod.default),
11
- get: () => import("./get-tISo-cmg.mjs").then((mod) => mod.default),
12
- items: () => import("./items-DQFQSpjF.mjs").then((mod) => mod.default),
13
- tree: () => import("./tree-Mh0uQ_Wy.mjs").then((mod) => mod.default),
14
- create: () => import("./create-DU0ZhnZu.mjs").then((mod) => mod.default)
15
- }
16
- });
17
-
18
- //#endregion
19
- export { collection_default as default };
@@ -1,20 +0,0 @@
1
- import { defineCommand } from "citty";
2
-
3
- //#region src/commands/dashboard/index.ts
4
- var dashboard_default = defineCommand({
5
- meta: {
6
- name: "dashboard",
7
- description: "Manage Metabase dashboards"
8
- },
9
- subCommands: {
10
- list: () => import("./list-D067ZSE5.mjs").then((mod) => mod.default),
11
- get: () => import("./get-StkjKuh0.mjs").then((mod) => mod.default),
12
- cards: () => import("./cards-C4NIaERo.mjs").then((mod) => mod.default),
13
- create: () => import("./create-CB0Yp__0.mjs").then((mod) => mod.default),
14
- update: () => import("./update-D2VI_5cy.mjs").then((mod) => mod.default),
15
- "update-dashcard": () => import("./update-dashcard-CNiQw1MD.mjs").then((mod) => mod.default)
16
- }
17
- });
18
-
19
- //#endregion
20
- export { dashboard_default as default };
@@ -1,22 +0,0 @@
1
- import { defineCommand } from "citty";
2
-
3
- //#region src/commands/db/index.ts
4
- var db_default = defineCommand({
5
- meta: {
6
- name: "db",
7
- description: "Inspect Metabase databases",
8
- alias: "database"
9
- },
10
- subCommands: {
11
- list: () => import("./list-9AOWhxqp.mjs").then((m) => m.default),
12
- get: () => import("./get-C3CcAJGg.mjs").then((m) => m.default),
13
- metadata: () => import("./metadata-B2Td415K.mjs").then((m) => m.default),
14
- schemas: () => import("./schemas-DZmv_V62.mjs").then((m) => m.default),
15
- "schema-tables": () => import("./schema-tables-CcFbY_jN.mjs").then((m) => m.default),
16
- "sync-schema": () => import("./sync-schema-IrHdJxmX.mjs").then((m) => m.default),
17
- "rescan-values": () => import("./rescan-values-DW6u90ep.mjs").then((m) => m.default)
18
- }
19
- });
20
-
21
- //#endregion
22
- export { db_default as default };
@@ -1,18 +0,0 @@
1
- import { defineCommand } from "citty";
2
-
3
- //#region src/commands/field/index.ts
4
- var field_default = defineCommand({
5
- meta: {
6
- name: "field",
7
- description: "Inspect Metabase fields"
8
- },
9
- subCommands: {
10
- get: () => import("./get-CQGeF-eP.mjs").then((m) => m.default),
11
- values: () => import("./values-DrwNHUAI.mjs").then((m) => m.default),
12
- summary: () => import("./summary-CS4UGiFJ.mjs").then((m) => m.default),
13
- update: () => import("./update-j9vgemKR.mjs").then((m) => m.default)
14
- }
15
- });
16
-
17
- //#endregion
18
- export { field_default as default };
@@ -1,28 +0,0 @@
1
- import { defineCommand } from "citty";
2
-
3
- //#region src/commands/git-sync/index.ts
4
- var git_sync_default = defineCommand({
5
- meta: {
6
- name: "git-sync",
7
- description: "Sync Metabase content with a git remote"
8
- },
9
- subCommands: {
10
- status: () => import("./status-BjCeJNLp.mjs").then((mod) => mod.default),
11
- "is-dirty": () => import("./is-dirty-DClGFOGV.mjs").then((mod) => mod.default),
12
- "has-remote-changes": () => import("./has-remote-changes-B1TciDVD.mjs").then((mod) => mod.default),
13
- dirty: () => import("./dirty-D9agt7Os.mjs").then((mod) => mod.default),
14
- "current-task": () => import("./current-task-z_TiJ0kt.mjs").then((mod) => mod.default),
15
- "cancel-task": () => import("./cancel-task-DcYrFsM6.mjs").then((mod) => mod.default),
16
- wait: () => import("./wait-BoKk8CJy.mjs").then((mod) => mod.default),
17
- import: () => import("./import-DnnmmJbp.mjs").then((mod) => mod.default),
18
- export: () => import("./export-Bfk7JAlR.mjs").then((mod) => mod.default),
19
- stash: () => import("./stash-BFZIl9F4.mjs").then((mod) => mod.default),
20
- branches: () => import("./branches-CH2UcCpX.mjs").then((mod) => mod.default),
21
- "create-branch": () => import("./create-branch-BJFH9Hda.mjs").then((mod) => mod.default),
22
- "add-collection": () => import("./add-collection-SL08iMub.mjs").then((mod) => mod.default),
23
- "remove-collection": () => import("./remove-collection-DhZghaZy.mjs").then((mod) => mod.default)
24
- }
25
- });
26
-
27
- //#endregion
28
- export { git_sync_default as default };
@@ -1,10 +0,0 @@
1
- import "./package-DV6Asqim.mjs";
2
- import "./command-augment-D9pI9Vbh.mjs";
3
- import "./render-DXv-D6fU.mjs";
4
- import "./predicates-DiIiS3k7.mjs";
5
- import "./runtime-cwBS8wwK.mjs";
6
- import "./poll-task-vPwV31Fs.mjs";
7
- import "./poll-Bh6oAifO.mjs";
8
- import { IsDirtyResult, is_dirty_default } from "./is-dirty-DlfX7e39.mjs";
9
-
10
- export { is_dirty_default as default };