@metabase/cli 0.1.12 → 0.1.13

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 (179) hide show
  1. package/README.md +34 -22
  2. package/dist/{add-collection-DEME4IOy.mjs → add-collection-BQsx2Q-S.mjs} +5 -5
  3. package/dist/add-collection-BiBKEHwz.mjs +10 -0
  4. package/dist/{archive-BtDvBsr8.mjs → archive-BP53zrzs.mjs} +6 -6
  5. package/dist/{archive-Dc-FwNZm.mjs → archive-BS4U2_gi.mjs} +7 -7
  6. package/dist/{archive-DUlrUlok.mjs → archive-BrYMa87Z.mjs} +6 -6
  7. package/dist/{archive-CMeTr8jv.mjs → archive-D7qtYihp.mjs} +6 -6
  8. package/dist/{archive-BFk-oupo.mjs → archive-Dt5zuiwu.mjs} +6 -6
  9. package/dist/{archive-BNioNJtG.mjs → archive-FLrOqODN.mjs} +7 -7
  10. package/dist/{archive-MTTQv3wR.mjs → archive-H8wBIt8q.mjs} +7 -7
  11. package/dist/auth-DWA7DSo9.mjs +19 -0
  12. package/dist/{body-89w3r7In.mjs → body-3vzTm8Jj.mjs} +3 -3
  13. package/dist/{branches-DuVKH8Ye.mjs → branches-Lr1cCUdg.mjs} +6 -6
  14. package/dist/{cancel-BEMQKVuR.mjs → cancel-Br3FHyDR.mjs} +5 -5
  15. package/dist/{cancel-task-D2mSPFXO.mjs → cancel-task-BXgeq3MH.mjs} +6 -6
  16. package/dist/{capabilities-7L9GVMd_.mjs → capabilities-BX1rnVuH.mjs} +2 -14
  17. package/dist/card-DQV8WOIa.mjs +20 -0
  18. package/dist/{card-DnIeMmUn.mjs → card-wCPcuKSi.mjs} +1 -1
  19. package/dist/{cards-L9jksUMD.mjs → cards-D-AkjCxr.mjs} +6 -6
  20. package/dist/cli.mjs +25 -25
  21. package/dist/collection-DIUWkVFY.mjs +20 -0
  22. package/dist/{collection-namespace-w26SavJH.mjs → collection-namespace-BQ_ebqOP.mjs} +2 -2
  23. package/dist/{command-augment-BH9qgQ5u.mjs → command-augment-CAur0XOQ.mjs} +13 -2
  24. package/dist/{create-D6QqOX6u.mjs → create-BpAak62U.mjs} +9 -9
  25. package/dist/{create-Dew3rKsR.mjs → create-C1xYECl-.mjs} +8 -8
  26. package/dist/{create-Cxg_h8Kf.mjs → create-CDL9WHiR.mjs} +10 -10
  27. package/dist/{create-8hMjPz7j.mjs → create-CcZEV9xx.mjs} +8 -8
  28. package/dist/{create-DoeqRVmx.mjs → create-DHUhRzcV.mjs} +11 -11
  29. package/dist/{create-Bu9Jayck.mjs → create-DUdkitlQ.mjs} +12 -12
  30. package/dist/{create-zEq4ZJAT.mjs → create-Dx1SDXyQ.mjs} +8 -8
  31. package/dist/{create-branch-C5P2y8U5.mjs → create-branch-BvZKizC4.mjs} +6 -6
  32. package/dist/{create-C3b3MoIN.mjs → create-ux0yPpq1.mjs} +10 -10
  33. package/dist/{create-DCYc032c.mjs → create-y4j2I1aH.mjs} +11 -11
  34. package/dist/{current-task-uD4QO5bM.mjs → current-task-DaWn0DYt.mjs} +6 -6
  35. package/dist/dashboard-CohHWhkV.mjs +21 -0
  36. package/dist/{database-Dsv4QBs0.mjs → database-BmsxuRmO.mjs} +1 -1
  37. package/dist/db-BD8JZUDw.mjs +22 -0
  38. package/dist/{delete-DGaNAFdQ.mjs → delete-CW3cEHlr.mjs} +7 -7
  39. package/dist/{delete-Bftif2R3.mjs → delete-DFWjBpzl.mjs} +7 -7
  40. package/dist/{delete-runtime-CjFc69tS.mjs → delete-runtime-BhZAAvjc.mjs} +3 -3
  41. package/dist/{delete-table-C0qxP6FE.mjs → delete-table-Wa0yRsnM.mjs} +7 -7
  42. package/dist/{dirty-CZZLpWt1.mjs → dirty-CKcGYIpv.mjs} +6 -6
  43. package/dist/document-CRuag6F5.mjs +19 -0
  44. package/dist/{eid-C8xTmR8e.mjs → eid-m44hs7Ul.mjs} +7 -7
  45. package/dist/{error-BGH4gxGN.mjs → error-DR_i1hxJ.mjs} +40 -5
  46. package/dist/{export-DWdjnBKo.mjs → export-8C4F9pYn.mjs} +8 -8
  47. package/dist/field-CuabjsR7.mjs +18 -0
  48. package/dist/{fields-Cq08PQec.mjs → fields-hXrRjf7e.mjs} +7 -7
  49. package/dist/{get-8nAjRL2H.mjs → get-3zFOkcl_.mjs} +7 -7
  50. package/dist/{get-BaKKF50e.mjs → get-8r-_QuSr.mjs} +6 -6
  51. package/dist/{get-ug26gcOI.mjs → get-9MCrsgTf.mjs} +8 -8
  52. package/dist/{get-Bbij6RjC.mjs → get-BjCQctuS.mjs} +6 -6
  53. package/dist/{get-Bcr_5fAb.mjs → get-BlNLGR-F.mjs} +6 -6
  54. package/dist/{get-Rqz7UHv1.mjs → get-BxgSKzca.mjs} +6 -6
  55. package/dist/{get-f5ENeUNw.mjs → get-C7EKJGTP.mjs} +6 -6
  56. package/dist/{get-DHPN1716.mjs → get-Cit5liJv.mjs} +7 -7
  57. package/dist/{get-DzLAmSKd.mjs → get-CqU4xVSg.mjs} +5 -5
  58. package/dist/{get-B2vGW7Aw.mjs → get-CvLECgtm.mjs} +6 -6
  59. package/dist/{get-DtKv-gl3.mjs → get-D7WUNQYY.mjs} +6 -6
  60. package/dist/{get-7IhxPyE_.mjs → get-DWg3riaY.mjs} +6 -6
  61. package/dist/{get-Cr8oz_jr.mjs → get-cjqlMKF5.mjs} +6 -6
  62. package/dist/{get-run-DhbHXaZE.mjs → get-run-CTDPEDcU.mjs} +6 -6
  63. package/dist/{get-B_BJ10pV.mjs → get-xVPjvf7O.mjs} +6 -6
  64. package/dist/git-sync-CKsGGVOm.mjs +28 -0
  65. package/dist/{has-remote-changes-CTLh3WjZ.mjs → has-remote-changes-DYo4PQfC.mjs} +6 -6
  66. package/dist/{import-XakIQfRp.mjs → import-Cwd-_wYv.mjs} +8 -8
  67. package/dist/{input-BZwm4yby.mjs → input-BXWgdKiS.mjs} +1 -1
  68. package/dist/{is-dirty-DkOOyjsZ.mjs → is-dirty-HynZex-f.mjs} +4 -4
  69. package/dist/is-dirty-Mkgi21bq.mjs +9 -0
  70. package/dist/{items-DC985V8K.mjs → items-D4pSBGxR.mjs} +8 -8
  71. package/dist/{key-y4TtxKwU.mjs → key-C8q5oIr5.mjs} +1 -1
  72. package/dist/{list-CEbMS6g3.mjs → list-B2QX8BZ3.mjs} +5 -5
  73. package/dist/{list-CIEI8XK_.mjs → list-Bqy3rN6k.mjs} +5 -5
  74. package/dist/{list-Df4MhR2A.mjs → list-CI1WQ8U3.mjs} +7 -7
  75. package/dist/{list-xfmTxHNu.mjs → list-Ctze3nfU.mjs} +5 -5
  76. package/dist/{list-Cnb9mQdd.mjs → list-D-Ms9fhd.mjs} +7 -7
  77. package/dist/{list-gy64AAWO.mjs → list-D3BBrpoQ.mjs} +5 -5
  78. package/dist/{list-STlBcPs8.mjs → list-D7o0DOZe.mjs} +5 -5
  79. package/dist/{list-CyIgwqFB.mjs → list-DBjOFesD.mjs} +6 -6
  80. package/dist/{list-B83-hnq5.mjs → list-DMZumpNv.mjs} +5 -5
  81. package/dist/{list-PYNFVJGM.mjs → list-De2qX1w8.mjs} +7 -7
  82. package/dist/{list-CtAFlkLe.mjs → list-ET066OdN.mjs} +5 -5
  83. package/dist/{list-BtNboYpZ.mjs → list-F0BQNbaZ.mjs} +25 -18
  84. package/dist/{list-OGkVAG6b.mjs → list-XgdM17ix.mjs} +6 -6
  85. package/dist/{list-DfPwBQrZ.mjs → list-_xdr1WKh.mjs} +5 -5
  86. package/dist/login-BHDdLJzw.mjs +453 -0
  87. package/dist/{logout-BUgUTFol.mjs → logout-ClizU0OL.mjs} +15 -6
  88. package/dist/{manifest-BPHqF5LY.mjs → manifest-DYeLri80.mjs} +2 -2
  89. package/dist/measure-SmyQt9Lg.mjs +19 -0
  90. package/dist/{metadata-Dwkcsa1c.mjs → metadata-D23RdbEZ.mjs} +8 -8
  91. package/dist/{metadata-B1EmV1l5.mjs → metadata-a_N6Sx30.mjs} +7 -7
  92. package/dist/{parse-enum-Dr7ACrTR.mjs → parse-enum-BatHQ-Gs.mjs} +1 -1
  93. package/dist/{parse-id-sKNP6yu5.mjs → parse-id-B1BlAunl.mjs} +1 -1
  94. package/dist/{parse-ref-BiETXmvm.mjs → parse-ref-CZr1bYIl.mjs} +1 -1
  95. package/dist/{path-BZJR7YLR.mjs → path-FSfPscAQ.mjs} +5 -5
  96. package/dist/{poll-Cyw-dQi4.mjs → poll-Dl5Zv4Ed.mjs} +2 -2
  97. package/dist/{poll-task-BG0oVnfZ.mjs → poll-task-BoRK94WQ.mjs} +2 -2
  98. package/dist/{preflight-BjR63JnX.mjs → preflight-CVlo39xa.mjs} +4 -4
  99. package/dist/process-DsGf7Mg5.mjs +73 -0
  100. package/dist/{prompt-u4WhE4T5.mjs → prompt-Bc_bHSD0.mjs} +13 -3
  101. package/dist/{query-C2xqnz24.mjs → query-CSvpJssD.mjs} +8 -8
  102. package/dist/{query-result-B4kTRid7.mjs → query-result-L5_NrwQR.mjs} +1 -1
  103. package/dist/{query-Dk55Wp2p.mjs → query-yZ9HeaGp.mjs} +12 -12
  104. package/dist/{remove-collection-DbVNWGyb.mjs → remove-collection-CV7ssevw.mjs} +8 -8
  105. package/dist/{render-BQHJhSP1.mjs → render-CkuFkWlQ.mjs} +6 -1
  106. package/dist/{rescan-values-CuLQ9UHP.mjs → rescan-values-CMeOv6yx.mjs} +8 -8
  107. package/dist/{run-PDN33QjN.mjs → run-CIJOYXor.mjs} +8 -8
  108. package/dist/{runs-B9T-7lei.mjs → runs--CzbmfPg.mjs} +7 -7
  109. package/dist/{runtime-DgHh4T6t.mjs → runtime-DJTGfiKO.mjs} +591 -123
  110. package/dist/{schema-tables-DjmNwrlT.mjs → schema-tables-BII9pHR8.mjs} +7 -7
  111. package/dist/{schemas-CWL8gv1C.mjs → schemas-BzxVz71I.mjs} +5 -5
  112. package/dist/{search-D7JzmvfR.mjs → search-CjJZdaM0.mjs} +5 -5
  113. package/dist/segment-dkO4Ualw.mjs +19 -0
  114. package/dist/{set-C0dCLnUA.mjs → set-Ds_brNWu.mjs} +8 -8
  115. package/dist/{setting-Licy7ZSs.mjs → setting-YDJRWd1m.mjs} +3 -3
  116. package/dist/{setup-BL4fqxoU.mjs → setup-DJb-NgSM.mjs} +7 -7
  117. package/dist/{skills-CY_FmaPo.mjs → skills-CJ8g8fhQ.mjs} +1 -1
  118. package/dist/{skills-Cn8FMCxG.mjs → skills-Dn-kn8Wj.mjs} +3 -3
  119. package/dist/snippet-DqTiC73e.mjs +19 -0
  120. package/dist/{stash-SGod4B8-.mjs → stash-DGujowmx.mjs} +8 -8
  121. package/dist/{status-CvUuZVvC.mjs → status-3-Tl07gu.mjs} +14 -6
  122. package/dist/{status-BCb5iCsQ.mjs → status-Cx0TIn1I.mjs} +7 -7
  123. package/dist/{summary-qaTPTLWs.mjs → summary-CT-xFvnX.mjs} +6 -6
  124. package/dist/{sync-schema-CjjAYTbO.mjs → sync-schema-BTF7O3FM.mjs} +10 -10
  125. package/dist/table-DNGPtV4P.mjs +19 -0
  126. package/dist/{table-CkWja2UH.mjs → table-qDD2kApF.mjs} +1 -1
  127. package/dist/transform-DEbvouxo.mjs +24 -0
  128. package/dist/transform-job-Du8npb7F.mjs +19 -0
  129. package/dist/{tree-C0MFcweC.mjs → tree-CLUxXw-Z.mjs} +5 -5
  130. package/dist/{update-DCR0wFNl.mjs → update-6IuvkFCk.mjs} +11 -11
  131. package/dist/{update-CHUUY-IB.mjs → update-BeH_S7h9.mjs} +9 -9
  132. package/dist/{update-BqsGGrzx.mjs → update-BfNmqvuN.mjs} +13 -13
  133. package/dist/{update-BImaz9vj.mjs → update-C_Ui5qPU.mjs} +12 -12
  134. package/dist/{update-CJASCsG4.mjs → update-DD5Q37bz.mjs} +9 -9
  135. package/dist/{update-Dty6LvU2.mjs → update-DdqzxPIr.mjs} +12 -12
  136. package/dist/{update-BTzsE8GU.mjs → update-DpCv5Mdo.mjs} +9 -9
  137. package/dist/{update-BUoWwmQV.mjs → update-I0t_6Mni.mjs} +9 -9
  138. package/dist/{update-vk_M0eOR.mjs → update-Z_LMzsiz.mjs} +11 -11
  139. package/dist/{update-dashcard-BkJaVVvf.mjs → update-dashcard-Bl3wbB8-.mjs} +9 -9
  140. package/dist/{update-qoP7hZTg.mjs → update-tQvEYuzD.mjs} +10 -10
  141. package/dist/{upgrade-TdaiAYbH.mjs → upgrade-r2ZlfstE.mjs} +6 -34
  142. package/dist/{uuid-BeUz8VpP.mjs → uuid-BduDonqb.mjs} +4 -4
  143. package/dist/{validate-B62TRDGV.mjs → validate-VawhJ5Sc.mjs} +2 -2
  144. package/dist/{validate-query-BpiN1CFu.mjs → validate-query-CSV-TTnd.mjs} +3 -3
  145. package/dist/{values-DR-3HcK6.mjs → values-DuNE6Jxc.mjs} +6 -6
  146. package/dist/{verify-D2uBlvmt.mjs → verify-D_yq68-R.mjs} +5 -5
  147. package/dist/{wait-FAnqO-LT.mjs → wait-CoDzO37B.mjs} +7 -7
  148. package/dist/{wait-flags-B5BI_xob.mjs → wait-flags-BxUfF5zy.mjs} +2 -2
  149. package/package.json +1 -1
  150. package/dist/add-collection-BPtBMh8Y.mjs +0 -10
  151. package/dist/auth-CjFnuPe9.mjs +0 -19
  152. package/dist/card-DoDpwR4t.mjs +0 -20
  153. package/dist/collection-CF-1RIPY.mjs +0 -20
  154. package/dist/dashboard-C5zTX345.mjs +0 -21
  155. package/dist/db-4y5Z1CQw.mjs +0 -22
  156. package/dist/document-97l9Non_.mjs +0 -19
  157. package/dist/field-BwUTrelF.mjs +0 -18
  158. package/dist/git-sync-JIMEYW-E.mjs +0 -28
  159. package/dist/is-dirty-4gf8ujws.mjs +0 -9
  160. package/dist/login-C0VFlX8y.mjs +0 -180
  161. package/dist/measure-BmcmxRQ3.mjs +0 -19
  162. package/dist/segment-DrZNuxsM.mjs +0 -19
  163. package/dist/snippet-C5_4nPGj.mjs +0 -19
  164. package/dist/table-DK1B8Hzq.mjs +0 -19
  165. package/dist/transform-Dh5746zH.mjs +0 -24
  166. package/dist/transform-job-D0nRGPYN.mjs +0 -19
  167. /package/dist/{body-flags-D78h_-Ua.mjs → body-flags-D7q87Btw.mjs} +0 -0
  168. /package/dist/{collection-BPTlcFw5.mjs → collection-Deiziuu2.mjs} +0 -0
  169. /package/dist/{dashboard-FY5UzJ_Z.mjs → dashboard-B4bn3z6t.mjs} +0 -0
  170. /package/dist/{document-CcfiiV3b.mjs → document-qfwR0r63.mjs} +0 -0
  171. /package/dist/{field-MGxpNQUH.mjs → field-E0IBy4Uw.mjs} +0 -0
  172. /package/dist/{measure-COGAoZpo.mjs → measure-JJAdFoqK.mjs} +0 -0
  173. /package/dist/{paginate-Dfm9eO9A.mjs → paginate-BexjkjbY.mjs} +0 -0
  174. /package/dist/{revision-message-flag-Bo-Kvv6F.mjs → revision-message-flag-C7zBeWEt.mjs} +0 -0
  175. /package/dist/{segment-d-708KKO.mjs → segment-B9SEv9V_.mjs} +0 -0
  176. /package/dist/{setting-CSJvi1-6.mjs → setting-i0pugNHl.mjs} +0 -0
  177. /package/dist/{snippet-BZvo05ua.mjs → snippet-NNzqlksR.mjs} +0 -0
  178. /package/dist/{transform-job-n8W6tLqF.mjs → transform-job-B9pXBOwr.mjs} +0 -0
  179. /package/dist/{transform--dviwMA1.mjs → transform-qczxOAzn.mjs} +0 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # metabase-cli
2
2
 
3
- Command-line client for Metabase. Authenticates against an instance with an API key and stores it securely on your machine.
3
+ Command-line client for Metabase. Logs in to an instance in your browser (OAuth, Metabase v62+) or with an API key, and stores credentials securely on your machine.
4
4
 
5
5
  ## Supported Metabase versions
6
6
 
@@ -11,7 +11,7 @@ Commands that need more than a baseline OSS server declare it — a higher minim
11
11
  - the server is older than the command's minimum version, or
12
12
  - the command needs a premium feature (e.g. `remote_sync`, `transforms`) that isn't enabled.
13
13
 
14
- Plain OSS commands against a v0.58+ server (the majority) carry no elevated requirement and skip the preflight entirely. When a gated command runs but the server version can't be detected (no cached probe), it proceeds with a warning rather than refusing. To bypass the check for a single run, pass `--skip-preflight`; to bypass it process-wide (e.g. in CI), set `METABASE_CLI_SKIP_PREFLIGHT=1`. Both are footguns — only for servers you know are patched.
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 `MB_CLI_SKIP_PREFLIGHT=1`. Both are footguns — only for servers you know are patched.
15
15
 
16
16
  ## Install
17
17
 
@@ -43,25 +43,34 @@ Credentials are stored per-profile. The default profile is named `default`. Use
43
43
 
44
44
  ### `mb auth login`
45
45
 
46
- Save credentials for a profile. On success the server is probed once — the rendered output shows the API-key user, role (`Admin`/`User`), and Metabase version, and the same values are cached in `<configDir>/profiles.json` so later commands skip re-probing. Failure of either the auth probe (`/api/user/current`) or the server probe (`/api/session/properties`) rejects the login; an existing profile keeps its last-known-good `apiKey`/`url`/`lastProbe` and gains a `lastFailure` entry.
46
+ Log in to a Metabase instance and save the credential to a profile. Interactive login offers two methods:
47
47
 
48
- | Flag | Description |
49
- | ------------------------ | ---------------------------------------------------------- |
50
- | `--url <url>` | Metabase URL. Falls back to `METABASE_URL`, then prompts. |
51
- | `--api-key <value>` | API key. Visible in shell history — pipe on stdin instead. |
52
- | `--profile <name>`, `-p` | Profile to write to (default: `default`). |
53
- | `--skip-verify` | Save without contacting the server (no probe, no cache). |
48
+ - **In your browser** (recommended; requires Metabase v62 or newer) — the CLI opens Metabase, you sign in with your password or SSO and approve the CLI, and a short-lived access token plus a rotating refresh token are stored. Tokens refresh automatically; you never paste a secret.
49
+ - **With an API key** — paste a key from Admin settings → Authentication → API keys.
54
50
 
55
- Resolution order for the API key: `--api-key` → piped stdin → `METABASE_API_KEY` → interactive prompt. Stdin is auto-detected when not a TTY.
51
+ Against a server older than v62 the CLI detects the missing OAuth support and falls back to the API key prompt automatically. Supplying an API key (flag, env, or stdin) always skips the browser flow, so CI and scripts behave exactly as before.
52
+
53
+ On success the server is probed once — the rendered output shows the user, role (`Admin`/`User`), and Metabase version, and the same values are cached in `<configDir>/profiles.json` so later commands skip re-probing. Failure of either the auth probe (`/api/user/current`) or the server probe (`/api/session/properties`) rejects the login; an existing profile keeps its last-known-good credential and gains a `lastFailure` entry.
54
+
55
+ | Flag | Description |
56
+ | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
57
+ | `--url <url>` | Metabase URL, including any subpath if the instance is hosted under one (`https://my.org.com/metabase`). Falls back to `MB_URL`, then prompts. |
58
+ | `--api-key <value>` | API key. Skips the browser flow. Visible in shell history — pipe on stdin instead. |
59
+ | `--client-id <id>` | Pre-registered OAuth client id (only needed when dynamic client registration is disabled on the server). |
60
+ | `--profile <name>`, `-p` | Profile to write to (default: `default`). |
61
+ | `--skip-verify` | Save without contacting the server (no probe, no cache). |
62
+
63
+ Non-interactive (non-TTY) login requires an API key; resolution order: `--api-key` → piped stdin → `MB_API_KEY` (first non-empty wins). Without one, non-interactive login fails rather than prompting.
56
64
 
57
65
  ```sh
66
+ mb auth login # interactive: browser or API key
58
67
  echo "$MB_KEY" | mb auth login --url https://m.example.com
59
68
  mb auth login --url https://m.example.com < key.txt
60
69
  ```
61
70
 
62
71
  ### `mb auth status`
63
72
 
64
- Show whether a profile is authenticated.
73
+ Show whether a profile is authenticated. The output includes the auth method (`OAuth` or `API key`) alongside the cached user, role, and server version.
65
74
 
66
75
  ```sh
67
76
  mb auth status
@@ -76,9 +85,9 @@ mb auth status --profile staging
76
85
 
77
86
  ### `mb auth list`
78
87
 
79
- List configured authentication profiles. All profile metadata (URL, last successful probe, last failure) lives in `<configDir>/profiles.json` at mode `0600`; the API key sits in the OS keychain when available, or inline in the same file when the keychain is unavailable.
88
+ List configured authentication profiles. All profile metadata (URL, auth method, last successful probe, last failure) lives in `<configDir>/profiles.json` at mode `0600`; the secrets (API key, or OAuth access/refresh tokens) sit in the OS keychain when available, or inline in the same file when the keychain is unavailable.
80
89
 
81
- `auth list` re-probes every profile in parallel — on success it refreshes `lastProbe` (Metabase version, token features, API-key user identity) and clears `lastFailure`; on failure it updates `lastFailure` and leaves the prior `lastProbe`/`url`/`apiKey` untouched. Rendered columns: `Profile | URL | Status | Role | Version | Last probed`. Failed rows append a one-line footer pointing at `mb auth login --profile <name>`.
90
+ `auth list` re-probes every profile, one at a time — a probe can refresh and rewrite an expired OAuth token, so probes are serialized to avoid racing on the shared `profiles.json`. On success it refreshes `lastProbe` (Metabase version, token features, user identity) and clears `lastFailure`; on failure it updates `lastFailure` and leaves the prior `lastProbe`/`url`/credential untouched. Rendered columns: `Profile | URL | Auth | Status | Role | Version | Last probed`. Failed rows append a one-line footer pointing at `mb auth login --profile <name>`.
82
91
 
83
92
  ```sh
84
93
  mb auth list
@@ -91,7 +100,7 @@ mb auth list --json
91
100
 
92
101
  ### `mb auth logout`
93
102
 
94
- Clear stored credentials for a profile.
103
+ Clear stored credentials for a profile. For an OAuth profile the refresh token is also revoked server-side, best-effort: local credentials are cleared first and a revocation failure only warns, so a slow or offline server never blocks the logout.
95
104
 
96
105
  ```sh
97
106
  mb auth logout --yes
@@ -1357,14 +1366,17 @@ Exit codes: `0` success, `2` `ConfigError` (missing name, unknown name, `MB_SKIL
1357
1366
 
1358
1367
  ## Environment variables
1359
1368
 
1360
- | Variable | Effect |
1361
- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1362
- | `METABASE_URL` | Default URL for `auth login` and config resolution. |
1363
- | `METABASE_API_KEY` | Default API key (overrides interactive prompt; not stored). |
1364
- | `METABASE_PROFILE` | Default profile when `--profile` is omitted. Falls back to `default`. |
1365
- | `METABASE_VERBOSE` | When set to `1`, prints structured developer-detail JSON to stderr on failure. |
1366
- | `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. |
1367
- | `MB_SKILLS_DIR` | Override the directory `mb skills` scans (dev/test only; defaults to the CLI's bundled `skills` + `skill-data` trees). |
1369
+ | Variable | Effect |
1370
+ | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1371
+ | `MB_URL` | Default URL for `auth login` and config resolution. |
1372
+ | `MB_API_KEY` | Default API key (makes `auth login` non-interactive, skipping the browser flow; not stored). |
1373
+ | `MB_PROFILE` | Default profile when `--profile` is omitted. Falls back to `default`. |
1374
+ | `MB_VERBOSE` | When set to `1`, prints structured developer-detail JSON to stderr on failure. |
1375
+ | `MB_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. |
1376
+ | `MB_CLI_DISABLE_KEYRING` | When set to `1`, skips the OS keychain and stores credentials as plaintext in the profiles file. |
1377
+ | `MB_SKILLS_DIR` | Override the directory `mb skills` scans (dev/test only; defaults to the CLI's bundled `skills` + `skill-data` trees). |
1378
+
1379
+ The former `METABASE_`-prefixed names (`METABASE_URL`, `METABASE_API_KEY`, `METABASE_PROFILE`, `METABASE_VERBOSE`, `METABASE_CLI_SKIP_PREFLIGHT`, `METABASE_CLI_DISABLE_KEYRING`) are deprecated but still honored; the CLI prints a one-line warning to stderr when it falls back to one. Switch to the `MB_`-prefixed names.
1368
1380
 
1369
1381
  ## Agent integration
1370
1382
 
@@ -1,8 +1,8 @@
1
- import { connectionFlags, outputFlags, profileFlag } from "./error-BGH4gxGN.mjs";
2
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.mjs";
3
- import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
4
- import { parseId } from "./parse-id-sKNP6yu5.mjs";
5
- import { REMOTE_SYNC_PATHS } from "./poll-task-BG0oVnfZ.mjs";
1
+ import { connectionFlags, outputFlags, profileFlag } from "./error-DR_i1hxJ.mjs";
2
+ import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
3
+ import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
4
+ import { parseId } from "./parse-id-B1BlAunl.mjs";
5
+ import { REMOTE_SYNC_PATHS } from "./poll-task-BoRK94WQ.mjs";
6
6
  import { z } from "zod";
7
7
 
8
8
  //#region src/commands/git-sync/add-collection.ts
@@ -0,0 +1,10 @@
1
+ import "./command-augment-CAur0XOQ.mjs";
2
+ import "./error-DR_i1hxJ.mjs";
3
+ import "./runtime-DJTGfiKO.mjs";
4
+ import "./capabilities-BX1rnVuH.mjs";
5
+ import "./parse-id-B1BlAunl.mjs";
6
+ import "./poll-Dl5Zv4Ed.mjs";
7
+ import "./poll-task-BoRK94WQ.mjs";
8
+ import { SyncSettingsUpdateResult, add_collection_default, setCollectionRemoteSynced, syncSettingsUpdateView } from "./add-collection-BQsx2Q-S.mjs";
9
+
10
+ export { add_collection_default as default };
@@ -1,9 +1,9 @@
1
- import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.mjs";
4
- import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
- import { parseId } from "./parse-id-sKNP6yu5.mjs";
6
- import { Collection, collectionView } from "./collection-BPTlcFw5.mjs";
1
+ import "./command-augment-CAur0XOQ.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-DR_i1hxJ.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
4
+ import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
5
+ import { parseId } from "./parse-id-B1BlAunl.mjs";
6
+ import { Collection, collectionView } from "./collection-Deiziuu2.mjs";
7
7
 
8
8
  //#region src/commands/collection/archive.ts
9
9
  var archive_default = defineMetabaseCommand({
@@ -1,10 +1,10 @@
1
- import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.mjs";
4
- import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
- import { parseId } from "./parse-id-sKNP6yu5.mjs";
6
- import { revisionMessageFlag } from "./revision-message-flag-Bo-Kvv6F.mjs";
7
- import { Segment, segmentView } from "./segment-d-708KKO.mjs";
1
+ import "./command-augment-CAur0XOQ.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-DR_i1hxJ.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
4
+ import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
5
+ import { parseId } from "./parse-id-B1BlAunl.mjs";
6
+ import { revisionMessageFlag } from "./revision-message-flag-C7zBeWEt.mjs";
7
+ import { Segment, segmentView } from "./segment-B9SEv9V_.mjs";
8
8
 
9
9
  //#region src/commands/segment/archive.ts
10
10
  var archive_default = defineMetabaseCommand({
@@ -1,9 +1,9 @@
1
- import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.mjs";
4
- import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
- import { parseId } from "./parse-id-sKNP6yu5.mjs";
6
- import { Snippet, snippetView } from "./snippet-BZvo05ua.mjs";
1
+ import "./command-augment-CAur0XOQ.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-DR_i1hxJ.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
4
+ import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
5
+ import { parseId } from "./parse-id-B1BlAunl.mjs";
6
+ import { Snippet, snippetView } from "./snippet-NNzqlksR.mjs";
7
7
 
8
8
  //#region src/commands/snippet/archive.ts
9
9
  var archive_default = defineMetabaseCommand({
@@ -1,9 +1,9 @@
1
- import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.mjs";
4
- import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
- import { parseId } from "./parse-id-sKNP6yu5.mjs";
6
- import { Dashboard, dashboardView } from "./dashboard-FY5UzJ_Z.mjs";
1
+ import "./command-augment-CAur0XOQ.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-DR_i1hxJ.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
4
+ import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
5
+ import { parseId } from "./parse-id-B1BlAunl.mjs";
6
+ import { Dashboard, dashboardView } from "./dashboard-B4bn3z6t.mjs";
7
7
 
8
8
  //#region src/commands/dashboard/archive.ts
9
9
  var archive_default = defineMetabaseCommand({
@@ -1,9 +1,9 @@
1
- import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.mjs";
4
- import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
- import { parseId } from "./parse-id-sKNP6yu5.mjs";
6
- import { Document, documentView } from "./document-CcfiiV3b.mjs";
1
+ import "./command-augment-CAur0XOQ.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-DR_i1hxJ.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
4
+ import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
5
+ import { parseId } from "./parse-id-B1BlAunl.mjs";
6
+ import { Document, documentView } from "./document-qfwR0r63.mjs";
7
7
 
8
8
  //#region src/commands/document/archive.ts
9
9
  var archive_default = defineMetabaseCommand({
@@ -1,10 +1,10 @@
1
- import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.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-sKNP6yu5.mjs";
1
+ import "./command-augment-CAur0XOQ.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-DR_i1hxJ.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
4
+ import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
5
+ import "./field-E0IBy4Uw.mjs";
6
+ import { Card, cardView } from "./card-wCPcuKSi.mjs";
7
+ import { parseId } from "./parse-id-B1BlAunl.mjs";
8
8
 
9
9
  //#region src/commands/card/archive.ts
10
10
  var archive_default = defineMetabaseCommand({
@@ -1,10 +1,10 @@
1
- import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.mjs";
4
- import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
- import { parseId } from "./parse-id-sKNP6yu5.mjs";
6
- import { Measure, measureView } from "./measure-COGAoZpo.mjs";
7
- import { revisionMessageFlag } from "./revision-message-flag-Bo-Kvv6F.mjs";
1
+ import "./command-augment-CAur0XOQ.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-DR_i1hxJ.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
4
+ import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
5
+ import { parseId } from "./parse-id-B1BlAunl.mjs";
6
+ import { Measure, measureView } from "./measure-JJAdFoqK.mjs";
7
+ import { revisionMessageFlag } from "./revision-message-flag-C7zBeWEt.mjs";
8
8
 
9
9
  //#region src/commands/measure/archive.ts
10
10
  var archive_default = defineMetabaseCommand({
@@ -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-BHDdLJzw.mjs").then((m) => m.default),
12
+ status: () => import("./status-3-Tl07gu.mjs").then((m) => m.default),
13
+ list: () => import("./list-F0BQNbaZ.mjs").then((m) => m.default),
14
+ logout: () => import("./logout-ClizU0OL.mjs").then((m) => m.default)
15
+ }
16
+ });
17
+
18
+ //#endregion
19
+ export { auth_default as default };
@@ -1,6 +1,6 @@
1
- import { ConfigError } from "./command-augment-BH9qgQ5u.mjs";
2
- import { parseJson } from "./runtime-DgHh4T6t.mjs";
3
- import { DEFAULT_FLAG_NAME, readInput } from "./input-BZwm4yby.mjs";
1
+ import { ConfigError } from "./command-augment-CAur0XOQ.mjs";
2
+ import { parseJson } from "./runtime-DJTGfiKO.mjs";
3
+ import { DEFAULT_FLAG_NAME, readInput } from "./input-BXWgdKiS.mjs";
4
4
 
5
5
  //#region src/runtime/body.ts
6
6
  async function readBody(sources, schema) {
@@ -1,9 +1,9 @@
1
- import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, wrapList } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.mjs";
4
- import { renderList } from "./capabilities-7L9GVMd_.mjs";
5
- import "./poll-Cyw-dQi4.mjs";
6
- import { REMOTE_SYNC_PATHS } from "./poll-task-BG0oVnfZ.mjs";
1
+ import "./command-augment-CAur0XOQ.mjs";
2
+ import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, wrapList } from "./error-DR_i1hxJ.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
4
+ import { renderList } from "./capabilities-BX1rnVuH.mjs";
5
+ import "./poll-Dl5Zv4Ed.mjs";
6
+ import { REMOTE_SYNC_PATHS } from "./poll-task-BoRK94WQ.mjs";
7
7
  import { z } from "zod";
8
8
 
9
9
  //#region src/commands/git-sync/branches.ts
@@ -1,8 +1,8 @@
1
- import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.mjs";
4
- import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
- import { parseId } from "./parse-id-sKNP6yu5.mjs";
1
+ import "./command-augment-CAur0XOQ.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-DR_i1hxJ.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
4
+ import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
5
+ import { parseId } from "./parse-id-B1BlAunl.mjs";
6
6
  import { z } from "zod";
7
7
 
8
8
  //#region src/commands/transform/cancel.ts
@@ -1,9 +1,9 @@
1
- import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.mjs";
4
- import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
- import "./poll-Cyw-dQi4.mjs";
6
- import { REMOTE_SYNC_PATHS, SyncTask, syncTaskView } from "./poll-task-BG0oVnfZ.mjs";
1
+ import "./command-augment-CAur0XOQ.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-DR_i1hxJ.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
4
+ import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
5
+ import "./poll-Dl5Zv4Ed.mjs";
6
+ import { REMOTE_SYNC_PATHS, SyncTask, syncTaskView } from "./poll-task-BoRK94WQ.mjs";
7
7
 
8
8
  //#region src/commands/git-sync/cancel-task.ts
9
9
  var cancel_task_default = defineMetabaseCommand({
@@ -1,4 +1,4 @@
1
- import { ConfigError } from "./command-augment-BH9qgQ5u.mjs";
1
+ import { ConfigError, itemOversizeMessage, listTruncationNotice, warn } from "./command-augment-CAur0XOQ.mjs";
2
2
  import { z } from "zod";
3
3
  import Table from "cli-table3";
4
4
 
@@ -7,18 +7,6 @@ function isPlainObject(value) {
7
7
  return typeof value === "object" && value !== null && !Array.isArray(value);
8
8
  }
9
9
 
10
- //#endregion
11
- //#region src/output/notice.ts
12
- function warn(message) {
13
- process.stderr.write(message + "\n");
14
- }
15
- function listTruncationNotice(bytes) {
16
- return `… cut at ${bytes} bytes; rerun with --max-bytes 0`;
17
- }
18
- function itemOversizeMessage(bytes, maxBytes) {
19
- return `output is ${bytes} bytes, over the ${maxBytes}-byte --max-bytes cap; narrow with --fields, or pass --max-bytes 0 to disable`;
20
- }
21
-
22
10
  //#endregion
23
11
  //#region src/output/cap.ts
24
12
  function capListEnvelope(envelope, maxBytes) {
@@ -248,4 +236,4 @@ const Capabilities = z.object({
248
236
  const BASELINE_CAPABILITIES = Object.freeze({ minVersion: 58 });
249
237
 
250
238
  //#endregion
251
- export { BASELINE_CAPABILITIES, Capabilities, formatScalar, isPlainObject, renderItem, renderList, renderRows, renderSummary, warn, writeJson, writeText };
239
+ export { BASELINE_CAPABILITIES, Capabilities, formatScalar, isPlainObject, renderItem, renderList, renderRows, renderSummary, writeJson, writeText };
@@ -0,0 +1,20 @@
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-CI1WQ8U3.mjs").then((mod) => mod.default),
11
+ get: () => import("./get-3zFOkcl_.mjs").then((mod) => mod.default),
12
+ query: () => import("./query-CSvpJssD.mjs").then((mod) => mod.default),
13
+ create: () => import("./create-DHUhRzcV.mjs").then((mod) => mod.default),
14
+ update: () => import("./update-DdqzxPIr.mjs").then((mod) => mod.default),
15
+ archive: () => import("./archive-FLrOqODN.mjs").then((mod) => mod.default)
16
+ }
17
+ });
18
+
19
+ //#endregion
20
+ export { card_default as default };
@@ -1,4 +1,4 @@
1
- import { FieldBaseType, FieldSemanticType } from "./field-MGxpNQUH.mjs";
1
+ import { FieldBaseType, FieldSemanticType } from "./field-E0IBy4Uw.mjs";
2
2
  import { z } from "zod";
3
3
 
4
4
  //#region src/domain/card.ts
@@ -1,9 +1,9 @@
1
- import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, wrapList } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.mjs";
4
- import { renderList } from "./capabilities-7L9GVMd_.mjs";
5
- import { parseId } from "./parse-id-sKNP6yu5.mjs";
6
- import { DashboardDetail, DashcardCompact, dashcardView } from "./dashboard-FY5UzJ_Z.mjs";
1
+ import "./command-augment-CAur0XOQ.mjs";
2
+ import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, wrapList } from "./error-DR_i1hxJ.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
4
+ import { renderList } from "./capabilities-BX1rnVuH.mjs";
5
+ import { parseId } from "./parse-id-B1BlAunl.mjs";
6
+ import { DashboardDetail, DashcardCompact, dashcardView } from "./dashboard-B4bn3z6t.mjs";
7
7
 
8
8
  //#region src/commands/dashboard/cards.ts
9
9
  const DashcardListEnvelope = listEnvelopeSchema(DashcardCompact);
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { ConfigError, flagConsumesValue, getMetabaseAugment, normalizeFlag, resolveCitty, toAliasArray } from "./command-augment-BH9qgQ5u.mjs";
3
- import { connectionFlags, outputFlags, package_default, profileFlag, reportError } from "./error-BGH4gxGN.mjs";
2
+ import { ConfigError, flagConsumesValue, getMetabaseAugment, normalizeFlag, resolveCitty, toAliasArray } from "./command-augment-CAur0XOQ.mjs";
3
+ import { connectionFlags, outputFlags, package_default, profileFlag, reportError } from "./error-DR_i1hxJ.mjs";
4
4
  import { defineCommand, renderUsage, runMain } from "citty";
5
5
 
6
6
  //#region src/commands/global-flags.ts
@@ -58,29 +58,29 @@ const main = defineCommand({
58
58
  description: package_default.description
59
59
  },
60
60
  subCommands: {
61
- auth: () => import("./auth-CjFnuPe9.mjs").then((mod) => mod.default),
62
- db: () => import("./db-4y5Z1CQw.mjs").then((mod) => mod.default),
63
- table: () => import("./table-DK1B8Hzq.mjs").then((mod) => mod.default),
64
- field: () => import("./field-BwUTrelF.mjs").then((mod) => mod.default),
65
- card: () => import("./card-DoDpwR4t.mjs").then((mod) => mod.default),
66
- dashboard: () => import("./dashboard-C5zTX345.mjs").then((mod) => mod.default),
67
- collection: () => import("./collection-CF-1RIPY.mjs").then((mod) => mod.default),
68
- document: () => import("./document-97l9Non_.mjs").then((mod) => mod.default),
69
- transform: () => import("./transform-Dh5746zH.mjs").then((mod) => mod.default),
70
- "transform-job": () => import("./transform-job-D0nRGPYN.mjs").then((mod) => mod.default),
71
- setting: () => import("./setting-Licy7ZSs.mjs").then((mod) => mod.default),
72
- search: () => import("./search-D7JzmvfR.mjs").then((mod) => mod.default),
73
- "git-sync": () => import("./git-sync-JIMEYW-E.mjs").then((mod) => mod.default),
74
- setup: () => import("./setup-BL4fqxoU.mjs").then((mod) => mod.default),
75
- snippet: () => import("./snippet-C5_4nPGj.mjs").then((mod) => mod.default),
76
- segment: () => import("./segment-DrZNuxsM.mjs").then((mod) => mod.default),
77
- measure: () => import("./measure-BmcmxRQ3.mjs").then((mod) => mod.default),
78
- eid: () => import("./eid-C8xTmR8e.mjs").then((mod) => mod.default),
79
- query: () => import("./query-Dk55Wp2p.mjs").then((mod) => mod.default),
80
- uuid: () => import("./uuid-BeUz8VpP.mjs").then((mod) => mod.default),
81
- upgrade: () => import("./upgrade-TdaiAYbH.mjs").then((mod) => mod.default),
82
- skills: () => import("./skills-Cn8FMCxG.mjs").then((mod) => mod.default),
83
- __manifest: () => import("./manifest-BPHqF5LY.mjs").then((mod) => mod.createManifestCommand(main))
61
+ auth: () => import("./auth-DWA7DSo9.mjs").then((mod) => mod.default),
62
+ db: () => import("./db-BD8JZUDw.mjs").then((mod) => mod.default),
63
+ table: () => import("./table-DNGPtV4P.mjs").then((mod) => mod.default),
64
+ field: () => import("./field-CuabjsR7.mjs").then((mod) => mod.default),
65
+ card: () => import("./card-DQV8WOIa.mjs").then((mod) => mod.default),
66
+ dashboard: () => import("./dashboard-CohHWhkV.mjs").then((mod) => mod.default),
67
+ collection: () => import("./collection-DIUWkVFY.mjs").then((mod) => mod.default),
68
+ document: () => import("./document-CRuag6F5.mjs").then((mod) => mod.default),
69
+ transform: () => import("./transform-DEbvouxo.mjs").then((mod) => mod.default),
70
+ "transform-job": () => import("./transform-job-Du8npb7F.mjs").then((mod) => mod.default),
71
+ setting: () => import("./setting-YDJRWd1m.mjs").then((mod) => mod.default),
72
+ search: () => import("./search-CjJZdaM0.mjs").then((mod) => mod.default),
73
+ "git-sync": () => import("./git-sync-CKsGGVOm.mjs").then((mod) => mod.default),
74
+ setup: () => import("./setup-DJb-NgSM.mjs").then((mod) => mod.default),
75
+ snippet: () => import("./snippet-DqTiC73e.mjs").then((mod) => mod.default),
76
+ segment: () => import("./segment-dkO4Ualw.mjs").then((mod) => mod.default),
77
+ measure: () => import("./measure-SmyQt9Lg.mjs").then((mod) => mod.default),
78
+ eid: () => import("./eid-m44hs7Ul.mjs").then((mod) => mod.default),
79
+ query: () => import("./query-yZ9HeaGp.mjs").then((mod) => mod.default),
80
+ uuid: () => import("./uuid-BduDonqb.mjs").then((mod) => mod.default),
81
+ upgrade: () => import("./upgrade-r2ZlfstE.mjs").then((mod) => mod.default),
82
+ skills: () => import("./skills-Dn-kn8Wj.mjs").then((mod) => mod.default),
83
+ __manifest: () => import("./manifest-DYeLri80.mjs").then((mod) => mod.createManifestCommand(main))
84
84
  }
85
85
  });
86
86
  var main_default = main;
@@ -0,0 +1,20 @@
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: "Manage Metabase collections"
8
+ },
9
+ subCommands: {
10
+ list: () => import("./list-DBjOFesD.mjs").then((mod) => mod.default),
11
+ get: () => import("./get-BlNLGR-F.mjs").then((mod) => mod.default),
12
+ items: () => import("./items-D4pSBGxR.mjs").then((mod) => mod.default),
13
+ tree: () => import("./tree-CLUxXw-Z.mjs").then((mod) => mod.default),
14
+ create: () => import("./create-BpAak62U.mjs").then((mod) => mod.default),
15
+ archive: () => import("./archive-BP53zrzs.mjs").then((mod) => mod.default)
16
+ }
17
+ });
18
+
19
+ //#endregion
20
+ export { collection_default as default };
@@ -1,5 +1,5 @@
1
- import { ConfigError } from "./command-augment-BH9qgQ5u.mjs";
2
- import { HttpError } from "./runtime-DgHh4T6t.mjs";
1
+ import { ConfigError } from "./command-augment-CAur0XOQ.mjs";
2
+ import { HttpError } from "./runtime-DJTGfiKO.mjs";
3
3
 
4
4
  //#region src/commands/transform/collection-namespace.ts
5
5
  const TRANSFORMS_NAMESPACE_HINT = "transforms can only be filed in a :transforms-namespace collection. Create one with `mb collection create --body '{\"name\":\"…\"}' --namespace transforms` and pass its id as collection_id, or omit collection_id to leave the transform uncollected.";
@@ -35,7 +35,6 @@ function escapeJsonPointerSegment(key) {
35
35
 
36
36
  //#endregion
37
37
  //#region src/core/errors.ts
38
- const VERBOSE_ENV = "METABASE_VERBOSE";
39
38
  var MetabaseError = class extends Error {
40
39
  get userMessage() {
41
40
  return this.message;
@@ -191,6 +190,18 @@ function errorMessage(value) {
191
190
  return value instanceof Error ? value.message : String(value);
192
191
  }
193
192
 
193
+ //#endregion
194
+ //#region src/output/notice.ts
195
+ function warn(message) {
196
+ process.stderr.write(message + "\n");
197
+ }
198
+ function listTruncationNotice(bytes) {
199
+ return `… cut at ${bytes} bytes; rerun with --max-bytes 0`;
200
+ }
201
+ function itemOversizeMessage(bytes, maxBytes) {
202
+ return `output is ${bytes} bytes, over the ${maxBytes}-byte --max-bytes cap; narrow with --fields, or pass --max-bytes 0 to disable`;
203
+ }
204
+
194
205
  //#endregion
195
206
  //#region src/runtime/command-augment.ts
196
207
  const augments = new WeakMap();
@@ -202,4 +213,4 @@ function getMetabaseAugment(cmd) {
202
213
  }
203
214
 
204
215
  //#endregion
205
- export { AbortError, ChainedRequestError, ConfigError, MetabaseError, NetworkError, ResponseShapeError, TimeoutError, UnknownError, VERBOSE_ENV, ValidationError, errorMessage, escapeJsonPointerSegment, flagConsumesValue, getMetabaseAugment, isNotFoundError, normalizeFlag, resolveCitty, setMetabaseAugment, toAliasArray, toMetabaseError };
216
+ export { AbortError, ChainedRequestError, ConfigError, MetabaseError, NetworkError, ResponseShapeError, TimeoutError, UnknownError, ValidationError, errorMessage, escapeJsonPointerSegment, flagConsumesValue, getMetabaseAugment, isNotFoundError, itemOversizeMessage, listTruncationNotice, normalizeFlag, resolveCitty, setMetabaseAugment, toAliasArray, toMetabaseError, warn };
@@ -1,12 +1,12 @@
1
- import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.mjs";
4
- import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
- import "./input-BZwm4yby.mjs";
6
- import { readBody } from "./body-89w3r7In.mjs";
7
- import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
8
- import { parseEnumFlag } from "./parse-enum-Dr7ACrTR.mjs";
9
- import { Collection, CollectionCreateInput, CollectionNamespace, collectionView } from "./collection-BPTlcFw5.mjs";
1
+ import "./command-augment-CAur0XOQ.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-DR_i1hxJ.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
4
+ import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
5
+ import "./input-BXWgdKiS.mjs";
6
+ import { readBody } from "./body-3vzTm8Jj.mjs";
7
+ import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
8
+ import { parseEnumFlag } from "./parse-enum-BatHQ-Gs.mjs";
9
+ import { Collection, CollectionCreateInput, CollectionNamespace, collectionView } from "./collection-Deiziuu2.mjs";
10
10
 
11
11
  //#region src/commands/collection/create.ts
12
12
  var create_default = defineMetabaseCommand({
@@ -1,11 +1,11 @@
1
- import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.mjs";
4
- import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
- import "./input-BZwm4yby.mjs";
6
- import { readBody } from "./body-89w3r7In.mjs";
7
- import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
8
- import { TransformJob, TransformJobCreateInput, transformJobView } from "./transform-job-n8W6tLqF.mjs";
1
+ import "./command-augment-CAur0XOQ.mjs";
2
+ import { connectionFlags, outputFlags, profileFlag } from "./error-DR_i1hxJ.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
4
+ import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
5
+ import "./input-BXWgdKiS.mjs";
6
+ import { readBody } from "./body-3vzTm8Jj.mjs";
7
+ import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
8
+ import { TransformJob, TransformJobCreateInput, transformJobView } from "./transform-job-B9pXBOwr.mjs";
9
9
 
10
10
  //#region src/commands/transform-job/create.ts
11
11
  var create_default = defineMetabaseCommand({