@metabase/cli 0.1.6 → 0.1.8

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 (195) hide show
  1. package/README.md +14 -14
  2. package/dist/{add-collection-BU8r3r2M.mjs → add-collection-CwrbKmC1.mjs} +8 -6
  3. package/dist/add-collection-DxtuNxeP.mjs +11 -0
  4. package/dist/{archive-DMPS8Kih.mjs → archive-BAjGIzhn.mjs} +7 -7
  5. package/dist/{archive-C1enZgKV.mjs → archive-BO3DOWI4.mjs} +6 -6
  6. package/dist/{archive-CRhiBpPJ.mjs → archive-BpKZsGAm.mjs} +7 -7
  7. package/dist/{archive-lWgqiFAt.mjs → archive-BzvqQd34.mjs} +6 -6
  8. package/dist/{archive-CDA0KxL8.mjs → archive-DqUtqRut.mjs} +6 -6
  9. package/dist/{archive-BNinrUak.mjs → archive-ZnnJc2iT.mjs} +7 -7
  10. package/dist/auth-B9B4pUaH.mjs +19 -0
  11. package/dist/{body-DjdFxjpg.mjs → body-DDYKoyMt.mjs} +1 -1
  12. package/dist/{branches-B1WRfG7-.mjs → branches-DjiGsjAz.mjs} +5 -5
  13. package/dist/{cancel-Dl_Ho056.mjs → cancel-BwtDQ2MR.mjs} +6 -6
  14. package/dist/{cancel-task-CdigdCaO.mjs → cancel-task-uJp18RvR.mjs} +6 -6
  15. package/dist/card-D54unw6r.mjs +20 -0
  16. package/dist/{card-DlCAaAPq.mjs → card-ezYiriML.mjs} +1 -1
  17. package/dist/{cards-BGiJS675.mjs → cards-z68PANDD.mjs} +5 -5
  18. package/dist/cli.mjs +24 -24
  19. package/dist/collection-B5kIKRTL.mjs +20 -0
  20. package/dist/{create-BYlIju0b.mjs → create-4EAGYVyp.mjs} +7 -7
  21. package/dist/{create-BTcpaop_.mjs → create-6XE7GYxk.mjs} +6 -6
  22. package/dist/{create-BNiva__H.mjs → create-7JOWFxqu.mjs} +8 -8
  23. package/dist/{create-dhxPxfF3.mjs → create-BzK59YlR.mjs} +10 -10
  24. package/dist/{create-CHF313Qg.mjs → create-C8gA-XP2.mjs} +8 -6
  25. package/dist/{create-DGth_uOp.mjs → create-CQ4Vg4Ge.mjs} +7 -7
  26. package/dist/{create-CwGtmwqm.mjs → create-DHWfmO2L.mjs} +7 -7
  27. package/dist/{create-CzzrbL0u.mjs → create-Dd_Gyg_F.mjs} +6 -6
  28. package/dist/{create-Be_0Vier.mjs → create-GVfCQU3B.mjs} +6 -6
  29. package/dist/{create-branch-DKZkoQ64.mjs → create-branch-CdWGiREu.mjs} +6 -6
  30. package/dist/{credentials-dzeq7ckm.mjs → credentials-CFA9iGZG.mjs} +9 -9
  31. package/dist/{current-task-CCRzm0_7.mjs → current-task-nPs-iCLi.mjs} +7 -7
  32. package/dist/dashboard-lw6IFfOs.mjs +21 -0
  33. package/dist/{database-CIXwHKjK.mjs → database-BPT6BrmF.mjs} +3 -3
  34. package/dist/{database-lH-B3G1I.mjs → database-BXiue1in.mjs} +1 -1
  35. package/dist/db-CBCj8sBg.mjs +22 -0
  36. package/dist/{delete-ZjnV35OJ.mjs → delete-CJqLgr6w.mjs} +7 -5
  37. package/dist/{delete-CM3jnAeQ.mjs → delete-CiV6f69N.mjs} +12 -8
  38. package/dist/{delete-Dimc-2y8.mjs → delete-Do1agSiL.mjs} +7 -5
  39. package/dist/{delete-runtime-B6RQo_pw.mjs → delete-runtime-uuYbd4k2.mjs} +5 -5
  40. package/dist/{delete-table-agZJpivt.mjs → delete-table-ZiJDpMFT.mjs} +7 -5
  41. package/dist/{deprovision-CwxcIT3k.mjs → deprovision-C-qEnh-P.mjs} +11 -9
  42. package/dist/{dirty-D4d0yHqj.mjs → dirty-BnTG7w7v.mjs} +5 -5
  43. package/dist/{docker-Oq80q3tu.mjs → docker-B-QQWThD.mjs} +3 -3
  44. package/dist/{eid-BXzaQh0o.mjs → eid-CwQ_smOD.mjs} +10 -5
  45. package/dist/{error-C9S6PN3-.mjs → error-CTVL5CdB.mjs} +3 -2
  46. package/dist/{export-DTygoXBP.mjs → export-DR2cC4rL.mjs} +10 -9
  47. package/dist/field-DJmQ2pul.mjs +18 -0
  48. package/dist/{field-yomXlkvl.mjs → field-E0IBy4Uw.mjs} +12 -3
  49. package/dist/{fields-CoQi99gv.mjs → fields-Ck31lDz9.mjs} +6 -6
  50. package/dist/{get-C3HdQ91a.mjs → get-BFJ3VBPa.mjs} +5 -5
  51. package/dist/{get-DSWFjy7O.mjs → get-BNKsNCcx.mjs} +5 -5
  52. package/dist/{get-C2p383Qc.mjs → get-BPOd0Rm8.mjs} +5 -5
  53. package/dist/{get-CzuzeKSe.mjs → get-BZiu-u-9.mjs} +7 -7
  54. package/dist/{get-Bzys7vgp.mjs → get-C71ypFQk.mjs} +5 -5
  55. package/dist/{get-C_w1kvN3.mjs → get-CICzGFSW.mjs} +6 -6
  56. package/dist/{get-CP3Z3NiH.mjs → get-CyG_P55z.mjs} +6 -6
  57. package/dist/{get-lb7q3JYs.mjs → get-DauAF3sm.mjs} +5 -5
  58. package/dist/{get-DQTZG_NP.mjs → get-DxqzDKKK.mjs} +5 -5
  59. package/dist/{get-D3SbEQSE.mjs → get-DyArILlF.mjs} +6 -6
  60. package/dist/{get-Ddr0XLh7.mjs → get-F338MOK-.mjs} +5 -5
  61. package/dist/{get-DFxZXaKz.mjs → get-GWRprk7k.mjs} +5 -5
  62. package/dist/{get-Hc93A0Yz.mjs → get-pO0wiy1e.mjs} +5 -5
  63. package/dist/{get-run-B7sKdaDU.mjs → get-run-DhM_PyVy.mjs} +5 -5
  64. package/dist/git-sync-rmjYOGFK.mjs +28 -0
  65. package/dist/{has-remote-changes-BY10-nnE.mjs → has-remote-changes-Ca0exJmb.mjs} +7 -6
  66. package/dist/{import-CiMz4Wz-.mjs → import-DjclIzGP.mjs} +11 -9
  67. package/dist/{is-dirty-BZOaryxT.mjs → is-dirty-Cke0a1ie.mjs} +5 -5
  68. package/dist/is-dirty-DFGgGLDi.mjs +10 -0
  69. package/dist/{items-BWfvkY-J.mjs → items-BSpapmCU.mjs} +7 -7
  70. package/dist/{license-Dxarh-gG.mjs → license-j0tDQLKI.mjs} +3 -3
  71. package/dist/{list-Brgh-Z2v.mjs → list-BI1PfPjn.mjs} +4 -4
  72. package/dist/{list-D4sFiqX8.mjs → list-BRXGDSMo.mjs} +5 -5
  73. package/dist/{list-DXH7TlkU.mjs → list-Br77Mw6U.mjs} +4 -4
  74. package/dist/{list-sD5N3fGk.mjs → list-Brt4oKO7.mjs} +6 -6
  75. package/dist/{list--OYdUTtu.mjs → list-CEE9yKNp.mjs} +4 -4
  76. package/dist/{list-DZ8fNUoQ.mjs → list-D1qhCQn0.mjs} +6 -6
  77. package/dist/{list-SOG0whQ-.mjs → list-DUyWON1F.mjs} +4 -4
  78. package/dist/{list-Clz5igWg.mjs → list-DWWGcUTg.mjs} +5 -5
  79. package/dist/{list-CL7eCOQE.mjs → list-DmO4ADQq.mjs} +4 -4
  80. package/dist/{list-BI4zr8LW.mjs → list-Fjjtpghb.mjs} +5 -5
  81. package/dist/{list-2j7GsXsl.mjs → list-V5IuMr_5.mjs} +4 -4
  82. package/dist/{list-C3hfovHv.mjs → list-bVlCwg8g.mjs} +4 -4
  83. package/dist/{list-zSO0DMw-.mjs → list-evetBTcH.mjs} +4 -4
  84. package/dist/{list-d58BprgJ.mjs → list-fIV-P6wP.mjs} +4 -4
  85. package/dist/{login-Bm2AnCez.mjs → login-BJGhZLgZ.mjs} +13 -9
  86. package/dist/{logout-BlyRJODO.mjs → logout-BAGLqtnV.mjs} +8 -7
  87. package/dist/{logs-CywPikkL.mjs → logs-jx5b_YDk.mjs} +6 -6
  88. package/dist/{manifest-BBR46KFM.mjs → manifest-BNh0Lw6p.mjs} +1 -1
  89. package/dist/measure-BfgxqewH.mjs +19 -0
  90. package/dist/{metadata-DqiI2q9q.mjs → metadata-B-GOcWqL.mjs} +6 -6
  91. package/dist/{metadata-B8ZSF9LA.mjs → metadata-DJAdsOoh.mjs} +7 -7
  92. package/dist/{parse-id-lk_K-CEF.mjs → parse-id-D1LTTt9L.mjs} +1 -1
  93. package/dist/{parse-schemas-BqUdWUwq.mjs → parse-schemas-DDK9nXuh.mjs} +1 -1
  94. package/dist/{path-AEtZ3mBq.mjs → path-D5kX-msX.mjs} +5 -5
  95. package/dist/{poll-DHKDpCiq.mjs → poll-DxpnK1wW.mjs} +1 -1
  96. package/dist/{poll-task-Cooi0lQV.mjs → poll-task-D8mG49IN.mjs} +19 -3
  97. package/dist/{preflight-aXV5LyDs.mjs → preflight-Df_FqJ6o.mjs} +3 -3
  98. package/dist/{provision-UWcNDoDe.mjs → provision-BJd6zO1D.mjs} +12 -11
  99. package/dist/ps-CpyHEvv7.mjs +11 -0
  100. package/dist/{ps-CJU0EbrC.mjs → ps-dEqRGeB3.mjs} +4 -4
  101. package/dist/{query-BlsVNZpD.mjs → query-OIuumiXN.mjs} +9 -8
  102. package/dist/query-result-ABPLz6I4.mjs +19 -0
  103. package/dist/{query-AaKzYnTY.mjs → query-zWFRDH3T.mjs} +9 -7
  104. package/dist/{remove-BFWun0e8.mjs → remove-BNQ1c6hB.mjs} +8 -7
  105. package/dist/{remove-collection-CoCmrrQs.mjs → remove-collection-BxmiXWKz.mjs} +10 -8
  106. package/dist/{render-CfznwleY.mjs → render-0_GsapXa.mjs} +39 -9
  107. package/dist/{render-OQn3iRsI.mjs → render-khznBlla.mjs} +1 -1
  108. package/dist/{rescan-values-C0FDsjT7.mjs → rescan-values-M7g81KIl.mjs} +9 -9
  109. package/dist/{run-B4Wn43zm.mjs → run-DTsx8bLb.mjs} +14 -13
  110. package/dist/{runs-Bbaszr18.mjs → runs-CqfJIuh_.mjs} +6 -6
  111. package/dist/{runtime-Dmv5VtUK.mjs → runtime-B40L_bj8.mjs} +7 -11
  112. package/dist/{schema-tables-CaWinbuK.mjs → schema-tables-CjBRF0_0.mjs} +6 -6
  113. package/dist/{schemas-DUgGpAyB.mjs → schemas-GIIbek2O.mjs} +4 -4
  114. package/dist/{search-BLrBXLUk.mjs → search-h78uOYec.mjs} +4 -4
  115. package/dist/segment-CoElN2b-.mjs +19 -0
  116. package/dist/{set-DfGsta5O.mjs → set-BRDxcLcQ.mjs} +8 -7
  117. package/dist/{set-B8cUbRLD.mjs → set-Dclba9xF.mjs} +4 -4
  118. package/dist/setting-mKzZJpQY.mjs +17 -0
  119. package/dist/{setup-C9ikBRw_.mjs → setup-WTIT2WbM.mjs} +5 -5
  120. package/dist/{skills-CiN1OQ8W.mjs → skills-BkregMyb.mjs} +1 -1
  121. package/dist/{skills-CUHIcQS6.mjs → skills-tMYd5d9v.mjs} +3 -3
  122. package/dist/snippet-B84H3tfp.mjs +19 -0
  123. package/dist/{start-3PX3ahjT.mjs → start-B7ByBicB.mjs} +12 -11
  124. package/dist/{stash-EIDcSvpF.mjs → stash-DxoAJzcK.mjs} +11 -9
  125. package/dist/{status-B0_MiZEf.mjs → status-B1dc3bbQ.mjs} +4 -4
  126. package/dist/{status-95ElRAu9.mjs → status-D0Ukfodl.mjs} +10 -7
  127. package/dist/{status-CEplmC44.mjs → status-DAzD1Cn_.mjs} +4 -4
  128. package/dist/{stop-CQ0XGrN8.mjs → stop-Cvexagxh.mjs} +13 -9
  129. package/dist/{summary-C12LiEuJ.mjs → summary-3qOMUcEX.mjs} +5 -5
  130. package/dist/{sync-schema-Ba8M3DiX.mjs → sync-schema-CrmVX1cy.mjs} +9 -9
  131. package/dist/table-B0fRQv91.mjs +19 -0
  132. package/dist/{table-C7a5V6Zn.mjs → table-qDD2kApF.mjs} +1 -1
  133. package/dist/transform-K_kp6Rdm.mjs +24 -0
  134. package/dist/transform-job-CuNN8zgv.mjs +19 -0
  135. package/dist/{tree-Des2ZG9d.mjs → tree-DsnIPFyE.mjs} +4 -4
  136. package/dist/{update-F6DmZncY.mjs → update-BEtl9LpG.mjs} +7 -7
  137. package/dist/{update-njHe3j-s.mjs → update-BRLcnSwK.mjs} +8 -8
  138. package/dist/{update-Bx54nWEI.mjs → update-Baya6OkO.mjs} +10 -10
  139. package/dist/{update-DBi5U8zb.mjs → update-BsgHRoZ8.mjs} +9 -9
  140. package/dist/{update-CyIZdbIQ.mjs → update-CLsqoEJ8.mjs} +7 -7
  141. package/dist/{update-_QfgNa53.mjs → update-CZEd_Eej.mjs} +8 -8
  142. package/dist/{update-mYVnoYNV.mjs → update-DPouQi4U.mjs} +8 -8
  143. package/dist/{update-DSgceARZ.mjs → update-DWn-nLPo.mjs} +7 -7
  144. package/dist/{update-DzAN4SPj.mjs → update-UaPqSfPN.mjs} +8 -8
  145. package/dist/{update-dashcard-wpSjv4M7.mjs → update-dashcard-DK9X91ha.mjs} +7 -7
  146. package/dist/{update-DHZubok3.mjs → update-hiJdbbsb.mjs} +12 -11
  147. package/dist/{upgrade-iAuvhX-W.mjs → upgrade-UqdvTikR.mjs} +11 -25
  148. package/dist/{url-DWaT6WIZ.mjs → url-LMJZRDv4.mjs} +8 -8
  149. package/dist/{uuid-CMKnS8-z.mjs → uuid-BWCaWG4O.mjs} +3 -3
  150. package/dist/{validate-query-Cw6WE5Y8.mjs → validate-query-CYvOP8Ld.mjs} +1 -1
  151. package/dist/{values-BfSTAbzc.mjs → values-D_wycrcr.mjs} +14 -6
  152. package/dist/{verify-D5YtTqqp.mjs → verify-D7hb6VMy.mjs} +1 -1
  153. package/dist/{wait-Bv3Tsnv4.mjs → wait-B5IpNFCG.mjs} +8 -8
  154. package/dist/{wait-8yV9_WIo.mjs → wait-DHjXk3jD.mjs} +2 -2
  155. package/dist/{wait-flags-Dzq9BGQY.mjs → wait-flags-CNIeSq0_.mjs} +2 -2
  156. package/dist/workspace-Bt8n3ojY.mjs +25 -0
  157. package/dist/{workspace-credentials-BXpABsNZ.mjs → workspace-credentials-8CBMQJFz.mjs} +1 -1
  158. package/package.json +1 -1
  159. package/skill-data/visualization/SKILL.md +158 -0
  160. package/skill-data/visualization/references/settings.md +414 -0
  161. package/dist/add-collection-C0w6ACQF.mjs +0 -11
  162. package/dist/auth-CzXb_zB2.mjs +0 -19
  163. package/dist/card-DP4rfoOi.mjs +0 -21
  164. package/dist/collection-tY18ezvn.mjs +0 -21
  165. package/dist/dashboard-ChM_Tu0l.mjs +0 -22
  166. package/dist/db-DrQn_i3W.mjs +0 -22
  167. package/dist/field-Z6Pcxf4n.mjs +0 -19
  168. package/dist/git-sync-CiGAad76.mjs +0 -28
  169. package/dist/is-dirty-Ume4oV0j.mjs +0 -10
  170. package/dist/measure-C44EK_xt.mjs +0 -20
  171. package/dist/ps-DEroLgbI.mjs +0 -11
  172. package/dist/segment-B3Uwwcsm.mjs +0 -20
  173. package/dist/setting-D2p2MA7f.mjs +0 -18
  174. package/dist/snippet-B7D0uWlz.mjs +0 -20
  175. package/dist/table-e6h8SLVX.mjs +0 -20
  176. package/dist/transform-BMYh1lsC.mjs +0 -25
  177. package/dist/transform-job-Cm7z5TfH.mjs +0 -20
  178. package/dist/workspace-CKLZrR7l.mjs +0 -26
  179. package/skill-data/viz/SKILL.md +0 -137
  180. package/skill-data/viz/references/settings.md +0 -312
  181. /package/dist/{collection-B3sPXRLs.mjs → collection-Bcy8cWYH.mjs} +0 -0
  182. /package/dist/{dashboard-FY5UzJ_Z.mjs → dashboard-B4bn3z6t.mjs} +0 -0
  183. /package/dist/{key-C2XG394c.mjs → key-vkNkH82H.mjs} +0 -0
  184. /package/dist/{measure-ClESGxIb.mjs → measure-Bt3InQsA.mjs} +0 -0
  185. /package/dist/{paginate-Dfm9eO9A.mjs → paginate-BexjkjbY.mjs} +0 -0
  186. /package/dist/{parse-ref-BiETXmvm.mjs → parse-ref-DKag6a6I.mjs} +0 -0
  187. /package/dist/{process-C7V8LJ-j.mjs → process-CM7Uu5q_.mjs} +0 -0
  188. /package/dist/{revision-message-flag-WmsIzUOM.mjs → revision-message-flag-DY29-cgz.mjs} +0 -0
  189. /package/dist/{segment-Be2v4ilr.mjs → segment-DhBmcr_E.mjs} +0 -0
  190. /package/dist/{setting-oL97SNeO.mjs → setting-BzCng1Ub.mjs} +0 -0
  191. /package/dist/{snippet-COggaWxx.mjs → snippet-bi_0XbNT.mjs} +0 -0
  192. /package/dist/{transform-GTW3G-01.mjs → transform-BKahefz_.mjs} +0 -0
  193. /package/dist/{transform-job-DeTDPMxt.mjs → transform-job-DjhoJbiV.mjs} +0 -0
  194. /package/dist/{workspace-BBXJczJK.mjs → workspace-D8HtUN0y.mjs} +0 -0
  195. /package/dist/{yaml-YTQiYJ9s.mjs → yaml-Gv6wRFMF.mjs} +0 -0
@@ -1,8 +1,8 @@
1
1
  import { ConfigError } from "./command-augment-BH9qgQ5u.mjs";
2
- import { outputFlags } from "./error-C9S6PN3-.mjs";
3
- import { defineMetabaseCommand, parseInteger } from "./runtime-Dmv5VtUK.mjs";
2
+ import { outputFlags } from "./error-CTVL5CdB.mjs";
3
+ import { defineMetabaseCommand, parseInteger } from "./runtime-B40L_bj8.mjs";
4
4
  import "./capabilities-7e9MgquN.mjs";
5
- import { writeJson, writeText } from "./render-CfznwleY.mjs";
5
+ import { writeJson, writeText } from "./render-0_GsapXa.mjs";
6
6
  import { z } from "zod";
7
7
  import { randomUUID } from "node:crypto";
8
8
 
@@ -1,5 +1,5 @@
1
1
  import { ConfigError } from "./command-augment-BH9qgQ5u.mjs";
2
- import { writeJson } from "./render-CfznwleY.mjs";
2
+ import { writeJson } from "./render-0_GsapXa.mjs";
3
3
  import { assertNotLegacyEnvelopeWrappingMbql5, isMbql5Query, validateQuery } from "./validate-dPEOnOf8.mjs";
4
4
 
5
5
  //#region src/commands/validate-query.ts
@@ -1,10 +1,10 @@
1
1
  import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-C9S6PN3-.mjs";
3
- import { defineMetabaseCommand } from "./runtime-Dmv5VtUK.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-CTVL5CdB.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-B40L_bj8.mjs";
4
4
  import "./capabilities-7e9MgquN.mjs";
5
- import { renderItem } from "./render-CfznwleY.mjs";
6
- import { FieldValues, fieldValuesView } from "./field-yomXlkvl.mjs";
7
- import { parseId } from "./parse-id-lk_K-CEF.mjs";
5
+ import { formatScalar, renderSummary } from "./render-0_GsapXa.mjs";
6
+ import { FieldValues, fieldValuesView } from "./field-E0IBy4Uw.mjs";
7
+ import { parseId } from "./parse-id-D1LTTt9L.mjs";
8
8
 
9
9
  //#region src/commands/field/values.ts
10
10
  var values_default = defineMetabaseCommand({
@@ -29,7 +29,15 @@ var values_default = defineMetabaseCommand({
29
29
  const id = parseId(args.id);
30
30
  const client = await getClient();
31
31
  const values = await client.requestParsed(FieldValues, `/api/field/${id}/values`);
32
- renderItem(values, fieldValuesView, ctx);
32
+ const fieldId = values.field_id ?? id;
33
+ const count = values.values.length;
34
+ renderSummary(values, fieldValuesView, () => {
35
+ if (count === 0) return `Field ${fieldId} has no cached values.`;
36
+ const more = values.has_more_values === true ? " (more available; rescan for the full set)" : "";
37
+ const header = `Field ${fieldId} has ${count} cached value${count === 1 ? "" : "s"}${more}:`;
38
+ const lines = values.values.map((row) => ` ${formatScalar(row[0])}`);
39
+ return [header, ...lines].join("\n");
40
+ }, ctx);
33
41
  }
34
42
  });
35
43
 
@@ -1,5 +1,5 @@
1
1
  import { MetabaseError, NetworkError, TimeoutError, errorMessage } from "./command-augment-BH9qgQ5u.mjs";
2
- import { HttpError, createClient, probeServer } from "./runtime-Dmv5VtUK.mjs";
2
+ import { HttpError, createClient, probeServer } from "./runtime-B40L_bj8.mjs";
3
3
  import { z } from "zod";
4
4
 
5
5
  //#region src/domain/user.ts
@@ -1,11 +1,11 @@
1
1
  import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-C9S6PN3-.mjs";
3
- import { defineMetabaseCommand } from "./runtime-Dmv5VtUK.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-CTVL5CdB.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-B40L_bj8.mjs";
4
4
  import "./capabilities-7e9MgquN.mjs";
5
- import { renderItem } from "./render-CfznwleY.mjs";
6
- import { parseId } from "./parse-id-lk_K-CEF.mjs";
7
- import { SyncTaskOrIdle, pollSyncTask, syncTaskIdleView, syncTaskView, throwIfFailedTask } from "./poll-task-Cooi0lQV.mjs";
8
- import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-DHKDpCiq.mjs";
5
+ import { renderSummary } from "./render-0_GsapXa.mjs";
6
+ import { parseId } from "./parse-id-D1LTTt9L.mjs";
7
+ import { SyncTaskOrIdle, formatSyncTask, pollSyncTask, syncTaskIdleView, syncTaskView, throwIfFailedTask } from "./poll-task-D8mG49IN.mjs";
8
+ import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-DxpnK1wW.mjs";
9
9
 
10
10
  //#region src/commands/git-sync/wait.ts
11
11
  const WaitResult = SyncTaskOrIdle;
@@ -45,10 +45,10 @@ var wait_default = defineMetabaseCommand({
45
45
  });
46
46
  if (final === null) {
47
47
  const idle = { status: "idle" };
48
- renderItem(idle, syncTaskIdleView, ctx);
48
+ renderSummary(idle, syncTaskIdleView, "No git-sync task is running.", ctx);
49
49
  return;
50
50
  }
51
- renderItem(final, syncTaskView, ctx);
51
+ renderSummary(final, syncTaskView, formatSyncTask(final), ctx);
52
52
  throwIfFailedTask(final, "task");
53
53
  }
54
54
  });
@@ -1,5 +1,5 @@
1
- import { pollUntil } from "./poll-DHKDpCiq.mjs";
2
- import { Workspace } from "./workspace-BBXJczJK.mjs";
1
+ import { pollUntil } from "./poll-DxpnK1wW.mjs";
2
+ import { Workspace } from "./workspace-D8HtUN0y.mjs";
3
3
 
4
4
  //#region src/commands/workspace/database/wait.ts
5
5
  async function waitForDatabaseProvisioned(client, workspaceId, databaseId, schedule) {
@@ -1,5 +1,5 @@
1
- import { parseId } from "./parse-id-lk_K-CEF.mjs";
2
- import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-DHKDpCiq.mjs";
1
+ import { parseId } from "./parse-id-D1LTTt9L.mjs";
2
+ import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-DxpnK1wW.mjs";
3
3
 
4
4
  //#region src/commands/wait-flags.ts
5
5
  const waitScheduleFlags = {
@@ -0,0 +1,25 @@
1
+ import { defineCommand } from "citty";
2
+
3
+ //#region src/commands/workspace/index.ts
4
+ var workspace_default = defineCommand({
5
+ meta: {
6
+ name: "workspace",
7
+ description: "Manage Metabase workspaces (workspace-manager)"
8
+ },
9
+ subCommands: {
10
+ list: () => import("./list-evetBTcH.mjs").then((mod) => mod.default),
11
+ create: () => import("./create-C8gA-XP2.mjs").then((mod) => mod.default),
12
+ database: () => import("./database-BPT6BrmF.mjs").then((mod) => mod.default),
13
+ start: () => import("./start-B7ByBicB.mjs").then((mod) => mod.default),
14
+ stop: () => import("./stop-Cvexagxh.mjs").then((mod) => mod.default),
15
+ delete: () => import("./delete-CiV6f69N.mjs").then((mod) => mod.default),
16
+ logs: () => import("./logs-jx5b_YDk.mjs").then((mod) => mod.default),
17
+ url: () => import("./url-LMJZRDv4.mjs").then((mod) => mod.default),
18
+ credentials: () => import("./credentials-CFA9iGZG.mjs").then((mod) => mod.default),
19
+ ps: () => import("./ps-CpyHEvv7.mjs").then((mod) => mod.default),
20
+ license: () => import("./license-j0tDQLKI.mjs").then((mod) => mod.default)
21
+ }
22
+ });
23
+
24
+ //#endregion
25
+ export { workspace_default as default };
@@ -1,5 +1,5 @@
1
1
  import { ConfigError } from "./command-augment-BH9qgQ5u.mjs";
2
- import { parseYaml, stringifyYaml } from "./yaml-YTQiYJ9s.mjs";
2
+ import { parseYaml, stringifyYaml } from "./yaml-Gv6wRFMF.mjs";
3
3
  import { z } from "zod";
4
4
  import { randomBytes } from "node:crypto";
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metabase/cli",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Metabase CLI",
5
5
  "license": "AGPL-3.0",
6
6
  "repository": {
@@ -0,0 +1,158 @@
1
+ ---
2
+ name: visualization
3
+ description: Pick the right `display` (chart type) for a card's data and author its `visualization_settings` via the `mb` CLI. Covers which chart fits which data shape, the required and optional settings per chart type, the rule that settings reference OUTPUT columns by name, minimum-viable settings per chart family, and the `column_settings` JSON-string-key footgun. The full per-chart key catalog lives in references. Load whenever choosing or shaping how a card renders — "what chart should I use for this", "create a bar chart", "make this a line chart", "turn this into a pie", "map this by state", "format this column as currency", "set the pie dimension and metric", "the card renders as a table instead of a chart", "add conditional formatting", or any `display` / `visualization_settings` work.
4
+ allowed-tools: Read, Write, Edit, Bash, AskUserQuestion
5
+ ---
6
+
7
+ # Visualization: pick the chart, then set it
8
+
9
+ A card has two presentation fields alongside its `dataset_query`:
10
+
11
+ - **`display`** — the chart type (`bar`, `line`, `pie`, `scalar`, `map`, `table`, …). One closed set; pick from the enum below.
12
+ - **`visualization_settings`** — a map whose keys are **namespaced by `display`** (`graph.*` for bar/line/area/combo, `pie.*` for pie, `table.*` for table, …). The server stores almost anything and **silently ignores keys that don't apply** to the chosen `display`.
13
+
14
+ Nothing validates `visualization_settings` — there is no pre-flight to fail past. A `display` typo or a misnamed key is accepted by the API; the card just renders as a default table or drops the setting. So **the feedback loop is read-back, not pre-flight**: after `card create`/`update`, confirm with `mb card get <id> --full --json` (or open the card) that it rendered as intended.
15
+
16
+ General flag conventions and body-input precedence live in the `core` skill (`mb skills get core`); the `dataset_query` itself is the `mbql` skill's job (`mb skills get mbql`). This skill is only about how the result is displayed.
17
+
18
+ Two steps: **(1) pick the `display` that fits the data**, then **(2) bind the data columns and set options**.
19
+
20
+ ## Step 1 — pick the `display` for your data
21
+
22
+ Decide which relationship in the data matters most, then pick the chart. The shape each one needs is in the per-display table further down.
23
+
24
+ - **Single headline number** → `scalar` (one KPI). `smartscalar` when the story is the change vs the previous period. `gauge`/`progress` for one value against a target/goal.
25
+ - **Compare a measure across categories** → `bar` (vertical). Use `row` (horizontal bar) when labels are long or there are many categories. Sort by value unless the dimension has a natural order.
26
+ - **Change over time / trend** → `line` for a continuous series; `bar`/`area` for a few discrete periods. Two measures on unlike scales → `combo` (line + bar, dual-axis) — only when the metrics are genuinely related.
27
+ - **Part-to-whole, one snapshot** → `pie`, but only for a meaningful whole with **≤5 slices**; beyond that use a sorted `bar`/`row`. Composition over time → stacked `area`/`bar`.
28
+ - **Distribution / spread / outliers** → `boxplot` (especially comparing several groups).
29
+ - **Correlation between two measures** → `scatter` (a third measure → bubble size).
30
+ - **Sequential additive contributions** (start → +/− steps → total) → `waterfall`.
31
+ - **Stage drop-off in an ordered, cumulative funnel** → `funnel`.
32
+ - **Flow volume between nodes** (source → target + weight) → `sankey`.
33
+ - **Geographic** → `map`: region/choropleth (a region dimension + a measure), pin (lat + long), or grid/heat (coordinates + measure).
34
+ - **Precise values, many columns, mixed types, or no chart fits** → `table`; `pivot` for a cross-tab of two dimensions; `object` for a single record's detail.
35
+
36
+ Closed `display` enum (card-level, non-hidden): `table`, `bar`, `line`, `area`, `row`, `pie`, `scalar`, `smartscalar`, `combo`, `pivot`, `funnel`, `map`, `scatter`, `waterfall`, `progress`, `gauge`, `object`, `sankey`, `boxplot`. (`scalar` **is** the "Number" viz — `display: number` is a legacy serialization alias, not a registered visualization; use `scalar`. `list` exists but is hidden — don't pick it. `heading`/`text`/`link`/`iframe`/`action` are dashcard virtuals, not standalone cards — see references.) An unknown `display` is accepted by the API but renders nothing — typos like `bargraph`/`linechart` are the most common "why is my chart blank" cause.
37
+
38
+ ## Step 2 — bind data columns and set options
39
+
40
+ ### Which chart for which data, and what to set
41
+
42
+ **Use for** is the data shape each chart suits. **Required** is the minimum to set for it to render as a chart — omit it and the card falls back to a "which columns?" prompt. Everything else is optional (full keys in references). **Empty `"visualization_settings": {}` is valid**: for a simple aggregate the binding is auto-picked, so set keys only to pin or override.
43
+
44
+ | `display` | Use for | Required |
45
+ | --------------------------- | --------------------------------------------------------- | ---------------------------------------------------------- |
46
+ | `scalar` | 1 row, 1 column | — (`scalar.field` only if >1 column) |
47
+ | `smartscalar` | one value grouped by a single **time** field | — (needs a time breakout; `scalar.field` auto) |
48
+ | `gauge` | 1 row, 1 numeric column | — (`gauge.segments` auto) |
49
+ | `progress` | 1 row, ≥1 numeric column | — (`progress.goal` defaults to 0) |
50
+ | `bar` `line` `area` `combo` | >1 row, ≥2 cols, ≥1 dimension + ≥1 measure | `graph.dimensions`, `graph.metrics` |
51
+ | `row` | as bar; prefer for long/many category labels | `graph.dimensions`, `graph.metrics` |
52
+ | `scatter` | two numeric measures (correlation) | `graph.dimensions`, `graph.metrics` (`scatter.bubble` opt) |
53
+ | `waterfall` | exactly 1 dimension + ≥1 measure; sequential | `graph.dimensions` (1), `graph.metrics` (1) |
54
+ | `boxplot` | ≥3 cols, ≥2 dimensions, ≥1 measure | `graph.dimensions`, `graph.metrics` |
55
+ | `pie` | ≥2 rows, ≥2 cols, ≥1 dimension + ≥1 measure; ≤~5 slices | `pie.dimension`, `pie.metric` |
56
+ | `funnel` | 2 columns (stage + value); ordered stages | `funnel.dimension`, `funnel.metric` |
57
+ | `map` (region) | a string/region dimension + a measure | `map.region`, `map.dimension`, `map.metric` |
58
+ | `map` (pin/grid) | latitude + longitude columns | `map.latitude_column`, `map.longitude_column` |
59
+ | `sankey` | ≥3 cols, ≥2 non-date dimensions, ≥1 measure; acyclic flow | `sankey.source`, `sankey.target`, `sankey.value` |
60
+ | `pivot` | ≥2 cols, all aggregated/breakout | — (`pivot_table.column_split` auto) |
61
+ | `table` `object` | anything (table is the universal fallback) | — (always renders) |
62
+
63
+ ### The rule that trips everyone: settings name **output columns**, by name
64
+
65
+ `graph.dimensions`, `graph.metrics`, `pie.dimension`, `pie.metric`, `scalar.field`, `funnel.metric`, `map.latitude_column`, `sankey.source`, … all take **output column-name strings** — the names the query _produces_, not field ids. A `count` aggregation outputs the column `count`; a breakout on a field outputs that field's name; a named aggregation outputs its `name`. These strings are **identical in the API form and the portable (git-sync) form** — no numeric-vs-name footgun here.
66
+
67
+ So the names you put in `visualization_settings` come from the query's output, not from `mb field`/`mb table`. If you set `name` on an aggregation (see the `mbql` skill), use that same string here.
68
+
69
+ ## Minimum-viable settings per chart family (API form)
70
+
71
+ Each block is the `visualization_settings` to pair with the given `display`. The `dataset_query` is elided — build it per the `mbql` skill. Output columns (`CATEGORY`, `count`, …) are whatever the query's breakout/aggregation produce.
72
+
73
+ **Bar / line / area / combo** — one dimension on the x-axis, one or more metrics (the four share an identical key set; switch `display` freely):
74
+
75
+ ```json
76
+ "display": "bar",
77
+ "visualization_settings": { "graph.dimensions": ["CATEGORY"], "graph.metrics": ["count"] }
78
+ ```
79
+
80
+ (Multiple metrics: `"graph.metrics": ["count","sum"]`. Stacked: add `"stackable.stack_type": "stacked"` — or `"normalized"` for 100%. A second dimension in `graph.dimensions` becomes a series breakout.)
81
+
82
+ **Row** — same keys; axes are visually swapped (horizontal bars).
83
+
84
+ **Pie** — one dimension, one metric:
85
+
86
+ ```json
87
+ "display": "pie",
88
+ "visualization_settings": { "pie.dimension": "CATEGORY", "pie.metric": "count" }
89
+ ```
90
+
91
+ **Scalar** (single big number) — the field to surface (only needed if >1 column):
92
+
93
+ ```json
94
+ "display": "scalar",
95
+ "visualization_settings": { "scalar.field": "count" }
96
+ ```
97
+
98
+ **Map (region/choropleth)** — region map + dimension + metric:
99
+
100
+ ```json
101
+ "display": "map",
102
+ "visualization_settings": { "map.type": "region", "map.region": "us_states", "map.dimension": "STATE", "map.metric": "count" }
103
+ ```
104
+
105
+ **Table** — column order/visibility plus per-column formatting:
106
+
107
+ ```json
108
+ "display": "table",
109
+ "visualization_settings": {
110
+ "table.columns": [ { "name": "CATEGORY", "enabled": true }, { "name": "count", "enabled": true } ],
111
+ "column_settings": { "[\"name\",\"count\"]": { "column_title": "Orders" } }
112
+ }
113
+ ```
114
+
115
+ ## `column_settings`: the JSON-string-key footgun
116
+
117
+ `column_settings` is a map **whose keys are themselves JSON-encoded arrays** — so inside a JSON body the inner quotes must be escaped. The key is a _string_, never an object.
118
+
119
+ - **Prefer the name form:** `["name", "<output column name>"]` → in a JSON body, `"[\"name\",\"count\"]"`. This is the canonical key Metabase writes, and it's **identical in API and portable form**. Use it unless you have a reason not to.
120
+ - **Ref form (legacy order!):** `["ref", ["field", <id>, <opts>]]`. The inner field ref uses the **legacy MBQL-4 order** `["field", id, options]` (id **second**) — _not_ the MBQL-5 order you use in `dataset_query`. In the API form `<id>` is the numeric field id. Because the order differs, this form is easy to get wrong — reach for the name form instead.
121
+
122
+ ```json
123
+ "column_settings": {
124
+ "[\"name\",\"TOTAL\"]": { "number_style": "currency", "currency": "USD", "decimals": 2 },
125
+ "[\"name\",\"CREATED_AT\"]": { "date_style": "MMMM D, YYYY" }
126
+ }
127
+ ```
128
+
129
+ The exhaustive per-column key list (number/date formatting, `view_as`, alignment, mini bars, click behavior) is in the references file.
130
+
131
+ ## Escape hatch: pull a real card instead of authoring from scratch
132
+
133
+ For anything beyond a single dimension + metric — combo charts, conditional formatting, pivot splits, click behavior, series colors — the cheapest **correct** path is to build it once in the Metabase UI and copy the result:
134
+
135
+ ```bash
136
+ mb card get <id> --full --json | jq '.visualization_settings'
137
+ ```
138
+
139
+ Paste that block into your `card create`/`update` body. The server produced it, so it's valid for that `display`. This beats guessing keys from memory, and it's token-cheap.
140
+
141
+ ## Full per-visualization key catalog
142
+
143
+ The body above covers the high-frequency 90%. The complete per-chart key tables — every key with its values and defaults, the data shape each chart suits, the full `column_settings` and `series_settings` vocabularies, conditional formatting, pivot splits, virtual cards (heading/text/link/iframe), and click behavior — live in the references file. Load on demand, not by default:
144
+
145
+ ```bash
146
+ mb skills get visualization --full # appends references/settings.md to this body
147
+ mb skills path visualization # → the skill dir; then Read references/settings.md
148
+ ```
149
+
150
+ ## Don't
151
+
152
+ - Don't invent `display` values (`bargraph`, `linechart`, `histogram`) or use `number`/`list` — use the closed non-hidden enum; the API accepts a typo and renders nothing.
153
+ - Don't put numeric field ids in `graph.dimensions`/`pie.metric`/`scalar.field`/`map.latitude_column` etc. — they take **output column-name strings**.
154
+ - Don't reach for a `pie` with >5 slices, a `combo` of unrelated metrics, or a `pie`/`scalar` to show a trend — see Step 1.
155
+ - Don't write a `column_settings` key as an object — it's a JSON **string** (`"[\"name\",\"COL\"]"`), inner quotes escaped.
156
+ - Don't use the MBQL-5 field-ref order inside a `column_settings` `["ref", …]` key — that key uses the **legacy** `["field", id, opts]` order. Prefer the `["name", …]` form.
157
+ - Don't expect a pre-flight to catch viz mistakes — there is none. Verify by reading the card back.
158
+ - Don't hand-author complex charts when you can pull a working `visualization_settings` from a UI-built card.