@metabase/cli 0.1.12 → 0.1.14
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.
- package/README.md +109 -22
- package/dist/add-collection-Cdhj6DJb.mjs +10 -0
- package/dist/{add-collection-DEME4IOy.mjs → add-collection-Cubho2HN.mjs} +5 -5
- package/dist/{archive-CMeTr8jv.mjs → archive-BBboJ-z3.mjs} +6 -6
- package/dist/{archive-DUlrUlok.mjs → archive-BrzOTxSA.mjs} +6 -6
- package/dist/{archive-BNioNJtG.mjs → archive-C8G0KIPI.mjs} +7 -7
- package/dist/{archive-BtDvBsr8.mjs → archive-D6eMYNI5.mjs} +6 -6
- package/dist/{archive-BFk-oupo.mjs → archive-DCIwtfv0.mjs} +6 -6
- package/dist/{archive-MTTQv3wR.mjs → archive-DTN6Anme.mjs} +7 -7
- package/dist/{archive-Dc-FwNZm.mjs → archive-F2g-bAXf.mjs} +7 -7
- package/dist/auth-D4cXDeiH.mjs +19 -0
- package/dist/{body-89w3r7In.mjs → body-CXpIB6hY.mjs} +3 -3
- package/dist/{branches-DuVKH8Ye.mjs → branches-r9SVJIV5.mjs} +6 -6
- package/dist/{cancel-BEMQKVuR.mjs → cancel-BbLZsVYQ.mjs} +5 -5
- package/dist/{cancel-task-D2mSPFXO.mjs → cancel-task-CojB-8XX.mjs} +6 -6
- package/dist/{capabilities-7L9GVMd_.mjs → capabilities-BX1rnVuH.mjs} +2 -14
- package/dist/card-BMN-mcxn.mjs +20 -0
- package/dist/{card-DnIeMmUn.mjs → card-wCPcuKSi.mjs} +1 -1
- package/dist/{cards-L9jksUMD.mjs → cards-e9Wgnbnq.mjs} +6 -6
- package/dist/cli.mjs +26 -25
- package/dist/collection-DZnA3zXr.mjs +20 -0
- package/dist/{collection-namespace-w26SavJH.mjs → collection-namespace-DmKMqLr0.mjs} +2 -2
- package/dist/{command-augment-BH9qgQ5u.mjs → command-augment-CAur0XOQ.mjs} +13 -2
- package/dist/{create-Cxg_h8Kf.mjs → create-Bbe2EM9f.mjs} +10 -10
- package/dist/{create-8hMjPz7j.mjs → create-Bu9edPBn.mjs} +8 -8
- package/dist/create-Bz4hf7W0.mjs +44 -0
- package/dist/{create-Bu9Jayck.mjs → create-BzKW27Hh.mjs} +12 -12
- package/dist/{create-Dew3rKsR.mjs → create-C4G_z8qO.mjs} +8 -8
- package/dist/{create-DoeqRVmx.mjs → create-C5-JhEUc.mjs} +11 -11
- package/dist/{create-zEq4ZJAT.mjs → create-Cq-ay6cJ.mjs} +8 -8
- package/dist/{create-D6QqOX6u.mjs → create-DFMpgUvH.mjs} +9 -9
- package/dist/{create-C3b3MoIN.mjs → create-UzeYyGq6.mjs} +10 -10
- package/dist/{create-branch-C5P2y8U5.mjs → create-branch--GJ_RxIN.mjs} +6 -6
- package/dist/{create-DCYc032c.mjs → create-onFRzFwS.mjs} +11 -11
- package/dist/{current-task-uD4QO5bM.mjs → current-task-C0mMBzdB.mjs} +6 -6
- package/dist/dashboard-PB_c3Irl.mjs +21 -0
- package/dist/{database-Dsv4QBs0.mjs → database-BmsxuRmO.mjs} +1 -1
- package/dist/db-q0lYg3k8.mjs +22 -0
- package/dist/{delete-DGaNAFdQ.mjs → delete-CGw1hwGZ.mjs} +7 -7
- package/dist/{delete-Bftif2R3.mjs → delete-CxTPHzom.mjs} +7 -7
- package/dist/delete-Dbzs51x3.mjs +50 -0
- package/dist/{delete-runtime-CjFc69tS.mjs → delete-runtime-BhZAAvjc.mjs} +3 -3
- package/dist/{delete-table-C0qxP6FE.mjs → delete-table-B6obSpLU.mjs} +7 -7
- package/dist/dependencies-DfkbJqzQ.mjs +40 -0
- package/dist/{dirty-CZZLpWt1.mjs → dirty-BqL_DE6p.mjs} +6 -6
- package/dist/document-4TwzGwl3.mjs +19 -0
- package/dist/{eid-C8xTmR8e.mjs → eid-C31VGHAM.mjs} +7 -7
- package/dist/{error-BGH4gxGN.mjs → error-BOi_ux9O.mjs} +40 -5
- package/dist/{export-DWdjnBKo.mjs → export--_0e40xU.mjs} +8 -8
- package/dist/field-Bi_O_Sdg.mjs +18 -0
- package/dist/{fields-Cq08PQec.mjs → fields-BRiL6KEF.mjs} +7 -7
- package/dist/{get-Bbij6RjC.mjs → get--bNbxDkk.mjs} +6 -6
- package/dist/{get-DHPN1716.mjs → get-B-phl324.mjs} +7 -7
- package/dist/{get-DtKv-gl3.mjs → get-B2-RLrYJ.mjs} +6 -6
- package/dist/{get-ug26gcOI.mjs → get-B_TdMKu-.mjs} +8 -8
- package/dist/{get-f5ENeUNw.mjs → get-C-o2-vnf.mjs} +6 -6
- package/dist/{get-BaKKF50e.mjs → get-C6njgZmF.mjs} +6 -6
- package/dist/{get-B_BJ10pV.mjs → get-CCyfx_AY.mjs} +6 -6
- package/dist/{get-Cr8oz_jr.mjs → get-CcGU3YaY.mjs} +6 -6
- package/dist/{get-8nAjRL2H.mjs → get-Cs7a7s2Z.mjs} +7 -7
- package/dist/{get-B2vGW7Aw.mjs → get-DGZw_U0s.mjs} +6 -6
- package/dist/{get-DzLAmSKd.mjs → get-DMeF2FLQ.mjs} +5 -5
- package/dist/{get-7IhxPyE_.mjs → get-DQOvqH9P.mjs} +6 -6
- package/dist/{get-Bcr_5fAb.mjs → get-LJam7ZQ-.mjs} +6 -6
- package/dist/{get-Rqz7UHv1.mjs → get-ev4Zw3Gj.mjs} +6 -6
- package/dist/{get-run-DhbHXaZE.mjs → get-run-Cp7ATZPQ.mjs} +6 -6
- package/dist/git-sync-BOZdFF09.mjs +28 -0
- package/dist/{has-remote-changes-CTLh3WjZ.mjs → has-remote-changes-Bw_Xp9Ii.mjs} +6 -6
- package/dist/{import-XakIQfRp.mjs → import-BmoC0ECq.mjs} +8 -8
- package/dist/{input-BZwm4yby.mjs → input-BXWgdKiS.mjs} +1 -1
- package/dist/is-dirty-B6usK-aU.mjs +9 -0
- package/dist/{is-dirty-DkOOyjsZ.mjs → is-dirty-BDmXm34E.mjs} +4 -4
- package/dist/{items-DC985V8K.mjs → items-BI-O48Sc.mjs} +8 -8
- package/dist/{key-y4TtxKwU.mjs → key-C8q5oIr5.mjs} +1 -1
- package/dist/{list-DfPwBQrZ.mjs → list-B7g2c9K7.mjs} +5 -5
- package/dist/{list-CEbMS6g3.mjs → list-BE3wVc-a.mjs} +5 -5
- package/dist/{list-CtAFlkLe.mjs → list-BcSjOiK1.mjs} +5 -5
- package/dist/{list-CIEI8XK_.mjs → list-BkEFHJe8.mjs} +5 -5
- package/dist/{list-STlBcPs8.mjs → list-CNeaMSjy.mjs} +5 -5
- package/dist/{list-BtNboYpZ.mjs → list-CRUjh592.mjs} +25 -18
- package/dist/{list-PYNFVJGM.mjs → list-CTfCgMTk.mjs} +7 -7
- package/dist/{list-OGkVAG6b.mjs → list-Cju3N2kB.mjs} +6 -6
- package/dist/{list-Df4MhR2A.mjs → list-Cqvt6gpK.mjs} +7 -7
- package/dist/{list-CyIgwqFB.mjs → list-Cz_2UyGV.mjs} +6 -6
- package/dist/{list-B83-hnq5.mjs → list-DIFjjwBV.mjs} +5 -5
- package/dist/list-DM-Oa-oB.mjs +32 -0
- package/dist/{list-Cnb9mQdd.mjs → list-DhWVjE6U.mjs} +7 -7
- package/dist/{list-xfmTxHNu.mjs → list-JCMQ06wX.mjs} +5 -5
- package/dist/{list-gy64AAWO.mjs → list-RC1HQ2dg.mjs} +5 -5
- package/dist/login-BF6LkxPI.mjs +453 -0
- package/dist/{logout-BUgUTFol.mjs → logout-Cg8Z_XD_.mjs} +15 -6
- package/dist/{manifest-BPHqF5LY.mjs → manifest-DYeLri80.mjs} +2 -2
- package/dist/measure-BRzkMY5y.mjs +19 -0
- package/dist/{metadata-B1EmV1l5.mjs → metadata-B15u_YYT.mjs} +7 -7
- package/dist/{metadata-Dwkcsa1c.mjs → metadata-CmvvOpKI.mjs} +8 -8
- package/dist/{parse-enum-Dr7ACrTR.mjs → parse-enum-BatHQ-Gs.mjs} +1 -1
- package/dist/{parse-id-sKNP6yu5.mjs → parse-id-DMs04KM3.mjs} +1 -1
- package/dist/{parse-ref-BiETXmvm.mjs → parse-ref-CZr1bYIl.mjs} +1 -1
- package/dist/{path-BZJR7YLR.mjs → path-YsfpMb_h.mjs} +5 -5
- package/dist/{poll-Cyw-dQi4.mjs → poll-13tgWrN_.mjs} +2 -2
- package/dist/{poll-task-BG0oVnfZ.mjs → poll-task-BuAHsDEK.mjs} +2 -2
- package/dist/{preflight-BjR63JnX.mjs → preflight-wCSgVqbX.mjs} +4 -4
- package/dist/process-DsGf7Mg5.mjs +73 -0
- package/dist/{prompt-u4WhE4T5.mjs → prompt-Bc_bHSD0.mjs} +13 -3
- package/dist/{query-Dk55Wp2p.mjs → query-DnYdI0fl.mjs} +12 -12
- package/dist/{query-result-B4kTRid7.mjs → query-result-L5_NrwQR.mjs} +1 -1
- package/dist/{query-C2xqnz24.mjs → query-x6g6unDt.mjs} +8 -8
- package/dist/{remove-collection-DbVNWGyb.mjs → remove-collection-CLTqx7ys.mjs} +8 -8
- package/dist/{render-BQHJhSP1.mjs → render-CkuFkWlQ.mjs} +6 -1
- package/dist/{rescan-values-CuLQ9UHP.mjs → rescan-values-C7b78yA2.mjs} +8 -8
- package/dist/{run-PDN33QjN.mjs → run-CsYI4Sqv.mjs} +8 -8
- package/dist/run-DR5O1_EU.mjs +59 -0
- package/dist/{runs-B9T-7lei.mjs → runs-DWbtqOyw.mjs} +7 -7
- package/dist/{runtime-DgHh4T6t.mjs → runtime-7JTC-usO.mjs} +591 -123
- package/dist/{schema-tables-DjmNwrlT.mjs → schema-tables-Cte09dhE.mjs} +7 -7
- package/dist/{schemas-CWL8gv1C.mjs → schemas-DAmSPGiC.mjs} +5 -5
- package/dist/{search-D7JzmvfR.mjs → search-Di-SFcZm.mjs} +5 -5
- package/dist/segment-DiHHHk2a.mjs +19 -0
- package/dist/{set-C0dCLnUA.mjs → set-C1rIETEg.mjs} +8 -8
- package/dist/set-active-CJ1VaxEC.mjs +56 -0
- package/dist/{setting-Licy7ZSs.mjs → setting-6WqN3L3F.mjs} +3 -3
- package/dist/{setup-BL4fqxoU.mjs → setup-DbXhTopr.mjs} +7 -7
- package/dist/{skills-CY_FmaPo.mjs → skills-CJ8g8fhQ.mjs} +1 -1
- package/dist/{skills-Cn8FMCxG.mjs → skills-CfWrH-1L.mjs} +3 -3
- package/dist/snippet-B-anQo6y.mjs +19 -0
- package/dist/{stash-SGod4B8-.mjs → stash-BCNSzoYQ.mjs} +8 -8
- package/dist/{status-CvUuZVvC.mjs → status-BocNdqNq.mjs} +14 -6
- package/dist/{status-BCb5iCsQ.mjs → status-CG3Lbl5_.mjs} +7 -7
- package/dist/{summary-qaTPTLWs.mjs → summary-TApK2JbW.mjs} +6 -6
- package/dist/{sync-schema-CjjAYTbO.mjs → sync-schema-COA-OlO3.mjs} +10 -10
- package/dist/table-Bnj8IBKx.mjs +19 -0
- package/dist/{table-CkWja2UH.mjs → table-qDD2kApF.mjs} +1 -1
- package/dist/transform-QCDItglq.mjs +25 -0
- package/dist/transform-job-Dawm4Lag.mjs +22 -0
- package/dist/transform-tag-BLAbrywB.mjs +36 -0
- package/dist/transform-tag-CN-bTSne.mjs +18 -0
- package/dist/transforms-Bo4u0YqS.mjs +40 -0
- package/dist/{tree-C0MFcweC.mjs → tree-CGh-ZG4n.mjs} +5 -5
- package/dist/{update-BqsGGrzx.mjs → update-Bob7lvnr.mjs} +13 -13
- package/dist/{update-BUoWwmQV.mjs → update-Br_cd74H.mjs} +9 -9
- package/dist/{update-vk_M0eOR.mjs → update-BuJjTYAx.mjs} +11 -11
- package/dist/{update-CJASCsG4.mjs → update-CCIkTuxz.mjs} +9 -9
- package/dist/{update-Dty6LvU2.mjs → update-Co4WLVkK.mjs} +12 -12
- package/dist/update-DCvTlxUK.mjs +51 -0
- package/dist/{update-qoP7hZTg.mjs → update-DLQygCXg.mjs} +10 -10
- package/dist/{update-BTzsE8GU.mjs → update-DtUhmJar.mjs} +9 -9
- package/dist/{update-DCR0wFNl.mjs → update-ETzjZl17.mjs} +11 -11
- package/dist/{update-BImaz9vj.mjs → update-ZPsCSWR6.mjs} +12 -12
- package/dist/{update-dashcard-BkJaVVvf.mjs → update-dashcard-Du-h_8oY.mjs} +9 -9
- package/dist/{update-CHUUY-IB.mjs → update-ysNL-mE-.mjs} +9 -9
- package/dist/{upgrade-TdaiAYbH.mjs → upgrade-CavKMkQ4.mjs} +6 -34
- package/dist/{uuid-BeUz8VpP.mjs → uuid-BL33x41p.mjs} +4 -4
- package/dist/{validate-B62TRDGV.mjs → validate-VawhJ5Sc.mjs} +2 -2
- package/dist/{validate-query-BpiN1CFu.mjs → validate-query-CSV-TTnd.mjs} +3 -3
- package/dist/{values-DR-3HcK6.mjs → values-DVu97Fcd.mjs} +6 -6
- package/dist/{verify-D2uBlvmt.mjs → verify-BLUei79N.mjs} +5 -5
- package/dist/{wait-FAnqO-LT.mjs → wait-C0P8Qt37.mjs} +7 -7
- package/dist/{wait-flags-B5BI_xob.mjs → wait-flags-Z_JC7x4L.mjs} +2 -2
- package/package.json +1 -1
- package/skill-data/core/SKILL.md +1 -1
- package/skill-data/transform/SKILL.md +17 -3
- package/dist/add-collection-BPtBMh8Y.mjs +0 -10
- package/dist/auth-CjFnuPe9.mjs +0 -19
- package/dist/card-DoDpwR4t.mjs +0 -20
- package/dist/collection-CF-1RIPY.mjs +0 -20
- package/dist/dashboard-C5zTX345.mjs +0 -21
- package/dist/db-4y5Z1CQw.mjs +0 -22
- package/dist/document-97l9Non_.mjs +0 -19
- package/dist/field-BwUTrelF.mjs +0 -18
- package/dist/git-sync-JIMEYW-E.mjs +0 -28
- package/dist/is-dirty-4gf8ujws.mjs +0 -9
- package/dist/login-C0VFlX8y.mjs +0 -180
- package/dist/measure-BmcmxRQ3.mjs +0 -19
- package/dist/segment-DrZNuxsM.mjs +0 -19
- package/dist/snippet-C5_4nPGj.mjs +0 -19
- package/dist/table-DK1B8Hzq.mjs +0 -19
- package/dist/transform-Dh5746zH.mjs +0 -24
- package/dist/transform-job-D0nRGPYN.mjs +0 -19
- /package/dist/{body-flags-D78h_-Ua.mjs → body-flags-D7q87Btw.mjs} +0 -0
- /package/dist/{collection-BPTlcFw5.mjs → collection-Deiziuu2.mjs} +0 -0
- /package/dist/{dashboard-FY5UzJ_Z.mjs → dashboard-B4bn3z6t.mjs} +0 -0
- /package/dist/{document-CcfiiV3b.mjs → document-qfwR0r63.mjs} +0 -0
- /package/dist/{field-MGxpNQUH.mjs → field-E0IBy4Uw.mjs} +0 -0
- /package/dist/{measure-COGAoZpo.mjs → measure-JJAdFoqK.mjs} +0 -0
- /package/dist/{paginate-Dfm9eO9A.mjs → paginate-BexjkjbY.mjs} +0 -0
- /package/dist/{revision-message-flag-Bo-Kvv6F.mjs → revision-message-flag-C7zBeWEt.mjs} +0 -0
- /package/dist/{segment-d-708KKO.mjs → segment-B9SEv9V_.mjs} +0 -0
- /package/dist/{setting-CSJvi1-6.mjs → setting-i0pugNHl.mjs} +0 -0
- /package/dist/{snippet-BZvo05ua.mjs → snippet-NNzqlksR.mjs} +0 -0
- /package/dist/{transform-job-n8W6tLqF.mjs → transform-job-B9pXBOwr.mjs} +0 -0
- /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.
|
|
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 `
|
|
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
|
-
|
|
46
|
+
Log in to a Metabase instance and save the credential to a profile. Interactive login offers two methods:
|
|
47
47
|
|
|
48
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
@@ -120,6 +129,14 @@ mb transform list --json
|
|
|
120
129
|
mb transform get 1 --json
|
|
121
130
|
```
|
|
122
131
|
|
|
132
|
+
### `mb transform dependencies <id>`
|
|
133
|
+
|
|
134
|
+
List the upstream transforms this transform depends on (the ones that must run before it). The positional id is a transform id.
|
|
135
|
+
|
|
136
|
+
```sh
|
|
137
|
+
mb transform dependencies 1 --json
|
|
138
|
+
```
|
|
139
|
+
|
|
123
140
|
### `mb transform create`
|
|
124
141
|
|
|
125
142
|
```sh
|
|
@@ -242,6 +259,73 @@ mb transform-job delete 1 --yes
|
|
|
242
259
|
| ------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
243
260
|
| `--yes` | Skip the interactive confirmation prompt. In non-TTY contexts the prompt is skipped automatically (kubectl/gh/docker convention). |
|
|
244
261
|
|
|
262
|
+
### `mb transform-job run <id>`
|
|
263
|
+
|
|
264
|
+
Trigger a job manually and return immediately. The job runs every transform carrying one of the job's tags, plus those transforms' dependencies.
|
|
265
|
+
|
|
266
|
+
```sh
|
|
267
|
+
mb transform-job run 1
|
|
268
|
+
mb transform-job run 1 --force-refresh --json
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
| Flag | Description |
|
|
272
|
+
| ----------------- | --------------------------------------------------------------------------------------------------- |
|
|
273
|
+
| `--force-refresh` | Re-run the whole plan, including dependency transforms that are already fresh (skipped by default). |
|
|
274
|
+
|
|
275
|
+
### `mb transform-job transforms <id>`
|
|
276
|
+
|
|
277
|
+
List the transforms a job would run, resolved by the job's tags. The positional id is a job id.
|
|
278
|
+
|
|
279
|
+
```sh
|
|
280
|
+
mb transform-job transforms 1 --json
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### `mb transform-job set-active <true|false>`
|
|
284
|
+
|
|
285
|
+
Activate or deactivate every transform job at once (admin only). Inactive jobs do not run on schedule; manual runs ignore the flag.
|
|
286
|
+
|
|
287
|
+
```sh
|
|
288
|
+
mb transform-job set-active false
|
|
289
|
+
mb transform-job set-active true --json
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
## Transform tags
|
|
293
|
+
|
|
294
|
+
CRUD on `/api/transform-tag`. Tags group transforms and jobs; reference them by id via the `tag_ids` field on a transform or job. The four built-in tags (`hourly`, `daily`, `weekly`, `monthly`) drive the built-in jobs. There is no get-by-id endpoint — use `list`.
|
|
295
|
+
|
|
296
|
+
### `mb transform-tag list`
|
|
297
|
+
|
|
298
|
+
```sh
|
|
299
|
+
mb transform-tag list --json
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### `mb transform-tag create`
|
|
303
|
+
|
|
304
|
+
```sh
|
|
305
|
+
mb transform-tag create --body '{"name":"nightly"}'
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
| Flag | Description |
|
|
309
|
+
| --------------- | ----------------------- |
|
|
310
|
+
| `--body <json>` | Inline JSON body. |
|
|
311
|
+
| `--file <path>` | Path to JSON body file. |
|
|
312
|
+
|
|
313
|
+
### `mb transform-tag update <id>`
|
|
314
|
+
|
|
315
|
+
```sh
|
|
316
|
+
mb transform-tag update 5 --body '{"name":"renamed"}'
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### `mb transform-tag delete <id>`
|
|
320
|
+
|
|
321
|
+
```sh
|
|
322
|
+
mb transform-tag delete 5 --yes
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
| Flag | Description |
|
|
326
|
+
| ------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
327
|
+
| `--yes` | Skip the interactive confirmation prompt. In non-TTY contexts the prompt is skipped automatically (kubectl/gh/docker convention). |
|
|
328
|
+
|
|
245
329
|
## Databases
|
|
246
330
|
|
|
247
331
|
Read warehouse metadata from `/api/database`. The `db` group exposes the full database list, the per-database record, schema and table inspection, the two manual-sync triggers, and (rarely useful) full-warehouse rollup endpoints.
|
|
@@ -1357,14 +1441,17 @@ Exit codes: `0` success, `2` `ConfigError` (missing name, unknown name, `MB_SKIL
|
|
|
1357
1441
|
|
|
1358
1442
|
## Environment variables
|
|
1359
1443
|
|
|
1360
|
-
| Variable
|
|
1361
|
-
|
|
|
1362
|
-
| `
|
|
1363
|
-
| `
|
|
1364
|
-
| `
|
|
1365
|
-
| `
|
|
1366
|
-
| `
|
|
1367
|
-
| `
|
|
1444
|
+
| Variable | Effect |
|
|
1445
|
+
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1446
|
+
| `MB_URL` | Default URL for `auth login` and config resolution. |
|
|
1447
|
+
| `MB_API_KEY` | Default API key (makes `auth login` non-interactive, skipping the browser flow; not stored). |
|
|
1448
|
+
| `MB_PROFILE` | Default profile when `--profile` is omitted. Falls back to `default`. |
|
|
1449
|
+
| `MB_VERBOSE` | When set to `1`, prints structured developer-detail JSON to stderr on failure. |
|
|
1450
|
+
| `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. |
|
|
1451
|
+
| `MB_CLI_DISABLE_KEYRING` | When set to `1`, skips the OS keychain and stores credentials as plaintext in the profiles file. |
|
|
1452
|
+
| `MB_SKILLS_DIR` | Override the directory `mb skills` scans (dev/test only; defaults to the CLI's bundled `skills` + `skill-data` trees). |
|
|
1453
|
+
|
|
1454
|
+
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
1455
|
|
|
1369
1456
|
## Agent integration
|
|
1370
1457
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import "./error-BOi_ux9O.mjs";
|
|
3
|
+
import "./runtime-7JTC-usO.mjs";
|
|
4
|
+
import "./capabilities-BX1rnVuH.mjs";
|
|
5
|
+
import "./parse-id-DMs04KM3.mjs";
|
|
6
|
+
import "./poll-13tgWrN_.mjs";
|
|
7
|
+
import "./poll-task-BuAHsDEK.mjs";
|
|
8
|
+
import { SyncSettingsUpdateResult, add_collection_default, setCollectionRemoteSynced, syncSettingsUpdateView } from "./add-collection-Cubho2HN.mjs";
|
|
9
|
+
|
|
10
|
+
export { add_collection_default as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
2
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
3
|
-
import { renderSummary } from "./capabilities-
|
|
4
|
-
import { parseId } from "./parse-id-
|
|
5
|
-
import { REMOTE_SYNC_PATHS } from "./poll-task-
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BOi_ux9O.mjs";
|
|
2
|
+
import { defineMetabaseCommand } from "./runtime-7JTC-usO.mjs";
|
|
3
|
+
import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
|
|
4
|
+
import { parseId } from "./parse-id-DMs04KM3.mjs";
|
|
5
|
+
import { REMOTE_SYNC_PATHS } from "./poll-task-BuAHsDEK.mjs";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
|
|
8
8
|
//#region src/commands/git-sync/add-collection.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./command-augment-
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { renderSummary } from "./capabilities-
|
|
5
|
-
import { parseId } from "./parse-id-
|
|
6
|
-
import { Dashboard, dashboardView } from "./dashboard-
|
|
1
|
+
import "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BOi_ux9O.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-7JTC-usO.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-DMs04KM3.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-
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { renderSummary } from "./capabilities-
|
|
5
|
-
import { parseId } from "./parse-id-
|
|
6
|
-
import { Snippet, snippetView } from "./snippet-
|
|
1
|
+
import "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BOi_ux9O.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-7JTC-usO.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-DMs04KM3.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,10 +1,10 @@
|
|
|
1
|
-
import "./command-augment-
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { renderSummary } from "./capabilities-
|
|
5
|
-
import "./field-
|
|
6
|
-
import { Card, cardView } from "./card-
|
|
7
|
-
import { parseId } from "./parse-id-
|
|
1
|
+
import "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BOi_ux9O.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-7JTC-usO.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-DMs04KM3.mjs";
|
|
8
8
|
|
|
9
9
|
//#region src/commands/card/archive.ts
|
|
10
10
|
var archive_default = defineMetabaseCommand({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./command-augment-
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { renderSummary } from "./capabilities-
|
|
5
|
-
import { parseId } from "./parse-id-
|
|
6
|
-
import { Collection, collectionView } from "./collection-
|
|
1
|
+
import "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BOi_ux9O.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-7JTC-usO.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-DMs04KM3.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,9 +1,9 @@
|
|
|
1
|
-
import "./command-augment-
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { renderSummary } from "./capabilities-
|
|
5
|
-
import { parseId } from "./parse-id-
|
|
6
|
-
import { Document, documentView } from "./document-
|
|
1
|
+
import "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BOi_ux9O.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-7JTC-usO.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-DMs04KM3.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-
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { renderSummary } from "./capabilities-
|
|
5
|
-
import { parseId } from "./parse-id-
|
|
6
|
-
import { Measure, measureView } from "./measure-
|
|
7
|
-
import { revisionMessageFlag } from "./revision-message-flag-
|
|
1
|
+
import "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BOi_ux9O.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-7JTC-usO.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-DMs04KM3.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({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./command-augment-
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { renderSummary } from "./capabilities-
|
|
5
|
-
import { parseId } from "./parse-id-
|
|
6
|
-
import { revisionMessageFlag } from "./revision-message-flag-
|
|
7
|
-
import { Segment, segmentView } from "./segment-
|
|
1
|
+
import "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BOi_ux9O.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-7JTC-usO.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-DMs04KM3.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({
|
|
@@ -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-BF6LkxPI.mjs").then((m) => m.default),
|
|
12
|
+
status: () => import("./status-BocNdqNq.mjs").then((m) => m.default),
|
|
13
|
+
list: () => import("./list-CRUjh592.mjs").then((m) => m.default),
|
|
14
|
+
logout: () => import("./logout-Cg8Z_XD_.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-
|
|
2
|
-
import { parseJson } from "./runtime-
|
|
3
|
-
import { DEFAULT_FLAG_NAME, readInput } from "./input-
|
|
1
|
+
import { ConfigError } from "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { parseJson } from "./runtime-7JTC-usO.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-
|
|
2
|
-
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, wrapList } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { renderList } from "./capabilities-
|
|
5
|
-
import "./poll-
|
|
6
|
-
import { REMOTE_SYNC_PATHS } from "./poll-task-
|
|
1
|
+
import "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, wrapList } from "./error-BOi_ux9O.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-7JTC-usO.mjs";
|
|
4
|
+
import { renderList } from "./capabilities-BX1rnVuH.mjs";
|
|
5
|
+
import "./poll-13tgWrN_.mjs";
|
|
6
|
+
import { REMOTE_SYNC_PATHS } from "./poll-task-BuAHsDEK.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-
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { renderSummary } from "./capabilities-
|
|
5
|
-
import { parseId } from "./parse-id-
|
|
1
|
+
import "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BOi_ux9O.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-7JTC-usO.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-DMs04KM3.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-
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { renderSummary } from "./capabilities-
|
|
5
|
-
import "./poll-
|
|
6
|
-
import { REMOTE_SYNC_PATHS, SyncTask, syncTaskView } from "./poll-task-
|
|
1
|
+
import "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BOi_ux9O.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-7JTC-usO.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
|
|
5
|
+
import "./poll-13tgWrN_.mjs";
|
|
6
|
+
import { REMOTE_SYNC_PATHS, SyncTask, syncTaskView } from "./poll-task-BuAHsDEK.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-
|
|
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,
|
|
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-Cqvt6gpK.mjs").then((mod) => mod.default),
|
|
11
|
+
get: () => import("./get-Cs7a7s2Z.mjs").then((mod) => mod.default),
|
|
12
|
+
query: () => import("./query-x6g6unDt.mjs").then((mod) => mod.default),
|
|
13
|
+
create: () => import("./create-C5-JhEUc.mjs").then((mod) => mod.default),
|
|
14
|
+
update: () => import("./update-Co4WLVkK.mjs").then((mod) => mod.default),
|
|
15
|
+
archive: () => import("./archive-C8G0KIPI.mjs").then((mod) => mod.default)
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { card_default as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./command-augment-
|
|
2
|
-
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, wrapList } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { renderList } from "./capabilities-
|
|
5
|
-
import { parseId } from "./parse-id-
|
|
6
|
-
import { DashboardDetail, DashcardCompact, dashcardView } from "./dashboard-
|
|
1
|
+
import "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, wrapList } from "./error-BOi_ux9O.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-7JTC-usO.mjs";
|
|
4
|
+
import { renderList } from "./capabilities-BX1rnVuH.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-DMs04KM3.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-
|
|
3
|
-
import { connectionFlags, outputFlags, package_default, profileFlag, reportError } from "./error-
|
|
2
|
+
import { ConfigError, flagConsumesValue, getMetabaseAugment, normalizeFlag, resolveCitty, toAliasArray } from "./command-augment-CAur0XOQ.mjs";
|
|
3
|
+
import { connectionFlags, outputFlags, package_default, profileFlag, reportError } from "./error-BOi_ux9O.mjs";
|
|
4
4
|
import { defineCommand, renderUsage, runMain } from "citty";
|
|
5
5
|
|
|
6
6
|
//#region src/commands/global-flags.ts
|
|
@@ -58,29 +58,30 @@ const main = defineCommand({
|
|
|
58
58
|
description: package_default.description
|
|
59
59
|
},
|
|
60
60
|
subCommands: {
|
|
61
|
-
auth: () => import("./auth-
|
|
62
|
-
db: () => import("./db-
|
|
63
|
-
table: () => import("./table-
|
|
64
|
-
field: () => import("./field-
|
|
65
|
-
card: () => import("./card-
|
|
66
|
-
dashboard: () => import("./dashboard-
|
|
67
|
-
collection: () => import("./collection-
|
|
68
|
-
document: () => import("./document-
|
|
69
|
-
transform: () => import("./transform-
|
|
70
|
-
"transform-job": () => import("./transform-job-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
61
|
+
auth: () => import("./auth-D4cXDeiH.mjs").then((mod) => mod.default),
|
|
62
|
+
db: () => import("./db-q0lYg3k8.mjs").then((mod) => mod.default),
|
|
63
|
+
table: () => import("./table-Bnj8IBKx.mjs").then((mod) => mod.default),
|
|
64
|
+
field: () => import("./field-Bi_O_Sdg.mjs").then((mod) => mod.default),
|
|
65
|
+
card: () => import("./card-BMN-mcxn.mjs").then((mod) => mod.default),
|
|
66
|
+
dashboard: () => import("./dashboard-PB_c3Irl.mjs").then((mod) => mod.default),
|
|
67
|
+
collection: () => import("./collection-DZnA3zXr.mjs").then((mod) => mod.default),
|
|
68
|
+
document: () => import("./document-4TwzGwl3.mjs").then((mod) => mod.default),
|
|
69
|
+
transform: () => import("./transform-QCDItglq.mjs").then((mod) => mod.default),
|
|
70
|
+
"transform-job": () => import("./transform-job-Dawm4Lag.mjs").then((mod) => mod.default),
|
|
71
|
+
"transform-tag": () => import("./transform-tag-CN-bTSne.mjs").then((mod) => mod.default),
|
|
72
|
+
setting: () => import("./setting-6WqN3L3F.mjs").then((mod) => mod.default),
|
|
73
|
+
search: () => import("./search-Di-SFcZm.mjs").then((mod) => mod.default),
|
|
74
|
+
"git-sync": () => import("./git-sync-BOZdFF09.mjs").then((mod) => mod.default),
|
|
75
|
+
setup: () => import("./setup-DbXhTopr.mjs").then((mod) => mod.default),
|
|
76
|
+
snippet: () => import("./snippet-B-anQo6y.mjs").then((mod) => mod.default),
|
|
77
|
+
segment: () => import("./segment-DiHHHk2a.mjs").then((mod) => mod.default),
|
|
78
|
+
measure: () => import("./measure-BRzkMY5y.mjs").then((mod) => mod.default),
|
|
79
|
+
eid: () => import("./eid-C31VGHAM.mjs").then((mod) => mod.default),
|
|
80
|
+
query: () => import("./query-DnYdI0fl.mjs").then((mod) => mod.default),
|
|
81
|
+
uuid: () => import("./uuid-BL33x41p.mjs").then((mod) => mod.default),
|
|
82
|
+
upgrade: () => import("./upgrade-CavKMkQ4.mjs").then((mod) => mod.default),
|
|
83
|
+
skills: () => import("./skills-CfWrH-1L.mjs").then((mod) => mod.default),
|
|
84
|
+
__manifest: () => import("./manifest-DYeLri80.mjs").then((mod) => mod.createManifestCommand(main))
|
|
84
85
|
}
|
|
85
86
|
});
|
|
86
87
|
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-Cz_2UyGV.mjs").then((mod) => mod.default),
|
|
11
|
+
get: () => import("./get-LJam7ZQ-.mjs").then((mod) => mod.default),
|
|
12
|
+
items: () => import("./items-BI-O48Sc.mjs").then((mod) => mod.default),
|
|
13
|
+
tree: () => import("./tree-CGh-ZG4n.mjs").then((mod) => mod.default),
|
|
14
|
+
create: () => import("./create-DFMpgUvH.mjs").then((mod) => mod.default),
|
|
15
|
+
archive: () => import("./archive-D6eMYNI5.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-
|
|
2
|
-
import { HttpError } from "./runtime-
|
|
1
|
+
import { ConfigError } from "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { HttpError } from "./runtime-7JTC-usO.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.";
|