@metabase/cli 0.1.11 → 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.
- package/README.md +34 -22
- package/dist/{add-collection-DKULSPwT.mjs → add-collection-BQsx2Q-S.mjs} +5 -5
- package/dist/add-collection-BiBKEHwz.mjs +10 -0
- package/dist/{archive-y-_m3XID.mjs → archive-BP53zrzs.mjs} +6 -6
- package/dist/{archive-BLbaqc-5.mjs → archive-BS4U2_gi.mjs} +7 -7
- package/dist/{archive-BL_0fXhf.mjs → archive-BrYMa87Z.mjs} +6 -6
- package/dist/{archive-ibJVYsBC.mjs → archive-D7qtYihp.mjs} +6 -6
- package/dist/{archive-BLxX3J6I.mjs → archive-Dt5zuiwu.mjs} +6 -6
- package/dist/{archive-BJ6uL3hh.mjs → archive-FLrOqODN.mjs} +7 -7
- package/dist/{archive-DQsV2uwy.mjs → archive-H8wBIt8q.mjs} +7 -7
- package/dist/auth-DWA7DSo9.mjs +19 -0
- package/dist/{body-DCQg78AF.mjs → body-3vzTm8Jj.mjs} +3 -3
- package/dist/{branches-CJVscsZe.mjs → branches-Lr1cCUdg.mjs} +6 -6
- package/dist/{cancel-C8W0sPix.mjs → cancel-Br3FHyDR.mjs} +5 -5
- package/dist/{cancel-task-dDgQDswT.mjs → cancel-task-BXgeq3MH.mjs} +6 -6
- package/dist/{capabilities-7L9GVMd_.mjs → capabilities-BX1rnVuH.mjs} +2 -14
- package/dist/card-DQV8WOIa.mjs +20 -0
- package/dist/{card-DnIeMmUn.mjs → card-wCPcuKSi.mjs} +1 -1
- package/dist/{cards-B7HE8BT6.mjs → cards-D-AkjCxr.mjs} +6 -6
- package/dist/cli.mjs +25 -25
- package/dist/collection-DIUWkVFY.mjs +20 -0
- package/dist/{collection-namespace-CBCApZJf.mjs → collection-namespace-BQ_ebqOP.mjs} +2 -2
- package/dist/{command-augment-BH9qgQ5u.mjs → command-augment-CAur0XOQ.mjs} +13 -2
- package/dist/{create-84jcfY4N.mjs → create-BpAak62U.mjs} +9 -9
- package/dist/{create-VjvMdgM5.mjs → create-C1xYECl-.mjs} +8 -8
- package/dist/{create-vNcD4jfq.mjs → create-CDL9WHiR.mjs} +10 -10
- package/dist/{create-Di9NY7kK.mjs → create-CcZEV9xx.mjs} +8 -8
- package/dist/{create-DN8us8si.mjs → create-DHUhRzcV.mjs} +11 -11
- package/dist/{create-BQA6nM5n.mjs → create-DUdkitlQ.mjs} +12 -12
- package/dist/{create-B6mzc8UK.mjs → create-Dx1SDXyQ.mjs} +8 -8
- package/dist/{create-branch-CCoDX2Qf.mjs → create-branch-BvZKizC4.mjs} +6 -6
- package/dist/{create-BWaBYzhC.mjs → create-ux0yPpq1.mjs} +10 -10
- package/dist/{create-DPASPFGi.mjs → create-y4j2I1aH.mjs} +11 -11
- package/dist/{current-task-QdxA3mSX.mjs → current-task-DaWn0DYt.mjs} +6 -6
- package/dist/dashboard-CohHWhkV.mjs +21 -0
- package/dist/{database-Dsv4QBs0.mjs → database-BmsxuRmO.mjs} +1 -1
- package/dist/db-BD8JZUDw.mjs +22 -0
- package/dist/{delete-CE_Jfjni.mjs → delete-CW3cEHlr.mjs} +7 -7
- package/dist/{delete-ByJ6guaH.mjs → delete-DFWjBpzl.mjs} +7 -7
- package/dist/{delete-runtime-CjFc69tS.mjs → delete-runtime-BhZAAvjc.mjs} +3 -3
- package/dist/{delete-table-D5LDUkOk.mjs → delete-table-Wa0yRsnM.mjs} +7 -7
- package/dist/{dirty-C6yzkIPn.mjs → dirty-CKcGYIpv.mjs} +6 -6
- package/dist/document-CRuag6F5.mjs +19 -0
- package/dist/{eid-ZOyix96k.mjs → eid-m44hs7Ul.mjs} +7 -7
- package/dist/{error-C1bUYXn7.mjs → error-DR_i1hxJ.mjs} +40 -5
- package/dist/{export-BhbBX-pl.mjs → export-8C4F9pYn.mjs} +8 -8
- package/dist/field-CuabjsR7.mjs +18 -0
- package/dist/{fields-CZ6IK8Qf.mjs → fields-hXrRjf7e.mjs} +7 -7
- package/dist/{get-D49EdHgH.mjs → get-3zFOkcl_.mjs} +7 -7
- package/dist/{get-CqKttHWW.mjs → get-8r-_QuSr.mjs} +6 -6
- package/dist/{get-DlzC0xCg.mjs → get-9MCrsgTf.mjs} +8 -8
- package/dist/{get-B03gdAun.mjs → get-BjCQctuS.mjs} +6 -6
- package/dist/{get-C0emTO1r.mjs → get-BlNLGR-F.mjs} +6 -6
- package/dist/{get-9b0ZEWh1.mjs → get-BxgSKzca.mjs} +6 -6
- package/dist/{get-mR01pCNG.mjs → get-C7EKJGTP.mjs} +6 -6
- package/dist/{get-Bbo2Y-aL.mjs → get-Cit5liJv.mjs} +7 -7
- package/dist/{get-BtqQ98nb.mjs → get-CqU4xVSg.mjs} +5 -5
- package/dist/{get-157SWRte.mjs → get-CvLECgtm.mjs} +6 -6
- package/dist/{get-nl41R-2q.mjs → get-D7WUNQYY.mjs} +6 -6
- package/dist/{get-BKWZA_22.mjs → get-DWg3riaY.mjs} +6 -6
- package/dist/{get-DIyv2a7h.mjs → get-cjqlMKF5.mjs} +6 -6
- package/dist/{get-run-_dlMCGp5.mjs → get-run-CTDPEDcU.mjs} +6 -6
- package/dist/{get-DclzgC5G.mjs → get-xVPjvf7O.mjs} +6 -6
- package/dist/git-sync-CKsGGVOm.mjs +28 -0
- package/dist/{has-remote-changes-CToITRyl.mjs → has-remote-changes-DYo4PQfC.mjs} +6 -6
- package/dist/{import-xnYHb4QX.mjs → import-Cwd-_wYv.mjs} +8 -8
- package/dist/{input-xewHccej.mjs → input-BXWgdKiS.mjs} +26 -4
- package/dist/{is-dirty-BHyMmUVV.mjs → is-dirty-HynZex-f.mjs} +4 -4
- package/dist/is-dirty-Mkgi21bq.mjs +9 -0
- package/dist/{items-D3AmbIOO.mjs → items-D4pSBGxR.mjs} +8 -8
- package/dist/{key-y4TtxKwU.mjs → key-C8q5oIr5.mjs} +1 -1
- package/dist/{list-CIu1zfpU.mjs → list-B2QX8BZ3.mjs} +5 -5
- package/dist/{list-D7Np4fwk.mjs → list-Bqy3rN6k.mjs} +5 -5
- package/dist/{list-BhZYkbc9.mjs → list-CI1WQ8U3.mjs} +7 -7
- package/dist/{list-DKPhFATP.mjs → list-Ctze3nfU.mjs} +5 -5
- package/dist/{list-BtTRJyrR.mjs → list-D-Ms9fhd.mjs} +7 -7
- package/dist/{list-BdStkg8G.mjs → list-D3BBrpoQ.mjs} +5 -5
- package/dist/{list-BkzrFyJO.mjs → list-D7o0DOZe.mjs} +5 -5
- package/dist/{list-DSJwMHXB.mjs → list-DBjOFesD.mjs} +6 -6
- package/dist/{list-C5NywUBH.mjs → list-DMZumpNv.mjs} +5 -5
- package/dist/{list-Byn-dRW4.mjs → list-De2qX1w8.mjs} +7 -7
- package/dist/{list-CA6MlByL.mjs → list-ET066OdN.mjs} +5 -5
- package/dist/{list-C_d7ppOJ.mjs → list-F0BQNbaZ.mjs} +25 -18
- package/dist/{list-BHCVZh7Q.mjs → list-XgdM17ix.mjs} +6 -6
- package/dist/{list-5ZZfaOzm.mjs → list-_xdr1WKh.mjs} +5 -5
- package/dist/login-BHDdLJzw.mjs +453 -0
- package/dist/{logout-Bltlsm6u.mjs → logout-ClizU0OL.mjs} +15 -6
- package/dist/{manifest-BPHqF5LY.mjs → manifest-DYeLri80.mjs} +2 -2
- package/dist/measure-SmyQt9Lg.mjs +19 -0
- package/dist/{metadata-BKcyjsoA.mjs → metadata-D23RdbEZ.mjs} +8 -8
- package/dist/{metadata-Bf2TfG8F.mjs → metadata-a_N6Sx30.mjs} +7 -7
- package/dist/{parse-enum-Dr7ACrTR.mjs → parse-enum-BatHQ-Gs.mjs} +1 -1
- package/dist/{parse-id-CWRJlQVK.mjs → parse-id-B1BlAunl.mjs} +1 -1
- package/dist/{parse-ref-BiETXmvm.mjs → parse-ref-CZr1bYIl.mjs} +1 -1
- package/dist/{path-Djw9IARu.mjs → path-FSfPscAQ.mjs} +5 -5
- package/dist/{poll-hJrV0cPm.mjs → poll-Dl5Zv4Ed.mjs} +2 -2
- package/dist/{poll-task-DK6X9Juu.mjs → poll-task-BoRK94WQ.mjs} +2 -2
- package/dist/{preflight-DjSPp3Ct.mjs → preflight-CVlo39xa.mjs} +4 -4
- package/dist/process-DsGf7Mg5.mjs +73 -0
- package/dist/{prompt-u4WhE4T5.mjs → prompt-Bc_bHSD0.mjs} +13 -3
- package/dist/{query-Cc-9oPsW.mjs → query-CSvpJssD.mjs} +8 -8
- package/dist/{query-result-B4kTRid7.mjs → query-result-L5_NrwQR.mjs} +1 -1
- package/dist/{query-Do5n5SZc.mjs → query-yZ9HeaGp.mjs} +12 -12
- package/dist/{remove-collection-DVvnmU06.mjs → remove-collection-CV7ssevw.mjs} +8 -8
- package/dist/{render-BQHJhSP1.mjs → render-CkuFkWlQ.mjs} +6 -1
- package/dist/{rescan-values-CHluR3JC.mjs → rescan-values-CMeOv6yx.mjs} +8 -8
- package/dist/{run-CcJbcaw8.mjs → run-CIJOYXor.mjs} +8 -8
- package/dist/{runs-Dc8qZBhl.mjs → runs--CzbmfPg.mjs} +7 -7
- package/dist/{runtime-jWkzCPlL.mjs → runtime-DJTGfiKO.mjs} +591 -123
- package/dist/{schema-tables-CZ6EMHUZ.mjs → schema-tables-BII9pHR8.mjs} +7 -7
- package/dist/{schemas-Br1cpOZc.mjs → schemas-BzxVz71I.mjs} +5 -5
- package/dist/{search-DB2joPgt.mjs → search-CjJZdaM0.mjs} +5 -5
- package/dist/segment-dkO4Ualw.mjs +19 -0
- package/dist/{set-BRhVzEWd.mjs → set-Ds_brNWu.mjs} +8 -8
- package/dist/{setting-CuxO4T1n.mjs → setting-YDJRWd1m.mjs} +3 -3
- package/dist/{setup-Bn4jwxdl.mjs → setup-DJb-NgSM.mjs} +7 -7
- package/dist/{skills-CY_FmaPo.mjs → skills-CJ8g8fhQ.mjs} +1 -1
- package/dist/{skills-Db1r65S5.mjs → skills-Dn-kn8Wj.mjs} +3 -3
- package/dist/snippet-DqTiC73e.mjs +19 -0
- package/dist/{stash-Dp2JFgmp.mjs → stash-DGujowmx.mjs} +8 -8
- package/dist/{status-BxGBwALE.mjs → status-3-Tl07gu.mjs} +14 -6
- package/dist/{status-j09luNai.mjs → status-Cx0TIn1I.mjs} +7 -7
- package/dist/{summary-DVrj7DSa.mjs → summary-CT-xFvnX.mjs} +6 -6
- package/dist/{sync-schema-BVHvjzGX.mjs → sync-schema-BTF7O3FM.mjs} +10 -10
- package/dist/table-DNGPtV4P.mjs +19 -0
- package/dist/{table-CkWja2UH.mjs → table-qDD2kApF.mjs} +1 -1
- package/dist/transform-DEbvouxo.mjs +24 -0
- package/dist/transform-job-Du8npb7F.mjs +19 -0
- package/dist/{tree-BEPw6xbY.mjs → tree-CLUxXw-Z.mjs} +5 -5
- package/dist/{update-CAoOJRwz.mjs → update-6IuvkFCk.mjs} +11 -11
- package/dist/{update-DiG6SSGm.mjs → update-BeH_S7h9.mjs} +9 -9
- package/dist/{update-Bd0ASKUG.mjs → update-BfNmqvuN.mjs} +13 -13
- package/dist/{update-B5VBJFU9.mjs → update-C_Ui5qPU.mjs} +12 -12
- package/dist/{update-BXaT0Faw.mjs → update-DD5Q37bz.mjs} +9 -9
- package/dist/{update-DzKPxRBE.mjs → update-DdqzxPIr.mjs} +12 -12
- package/dist/{update-fVqLtZ_t.mjs → update-DpCv5Mdo.mjs} +9 -9
- package/dist/{update-C5vlBTII.mjs → update-I0t_6Mni.mjs} +9 -9
- package/dist/{update-C875_WGf.mjs → update-Z_LMzsiz.mjs} +11 -11
- package/dist/{update-dashcard-7bZtw04E.mjs → update-dashcard-Bl3wbB8-.mjs} +9 -9
- package/dist/{update-Bn5wUyTQ.mjs → update-tQvEYuzD.mjs} +10 -10
- package/dist/{upgrade-DdCxE9Ml.mjs → upgrade-r2ZlfstE.mjs} +6 -34
- package/dist/{uuid-DywghRXO.mjs → uuid-BduDonqb.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-DSul3siC.mjs → values-DuNE6Jxc.mjs} +6 -6
- package/dist/{verify-DzDyKXOa.mjs → verify-D_yq68-R.mjs} +5 -5
- package/dist/{wait-CacFZI5Y.mjs → wait-CoDzO37B.mjs} +7 -7
- package/dist/{wait-flags-DV419apK.mjs → wait-flags-BxUfF5zy.mjs} +2 -2
- package/package.json +1 -1
- package/dist/add-collection-DyEe_xRO.mjs +0 -10
- package/dist/auth-BKaQjcmP.mjs +0 -19
- package/dist/card-CGBvUmCW.mjs +0 -20
- package/dist/collection-Ch7pPKHD.mjs +0 -20
- package/dist/dashboard-BDb2krMr.mjs +0 -21
- package/dist/db-CoVdkdVm.mjs +0 -22
- package/dist/document-BA2S1ev3.mjs +0 -19
- package/dist/field-B5bptFqL.mjs +0 -18
- package/dist/git-sync-DqJmONiB.mjs +0 -28
- package/dist/is-dirty-BvA3yzRc.mjs +0 -9
- package/dist/login-jWvDDvEm.mjs +0 -180
- package/dist/measure-DBX4k13t.mjs +0 -19
- package/dist/segment-BWcyA1P-.mjs +0 -19
- package/dist/snippet-C9UM6NwC.mjs +0 -19
- package/dist/table-DYI8K12W.mjs +0 -19
- package/dist/transform-CvbMbJtI.mjs +0 -24
- package/dist/transform-job-CtzgvccZ.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
|
|
@@ -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
|
|
1361
|
-
|
|
|
1362
|
-
| `
|
|
1363
|
-
| `
|
|
1364
|
-
| `
|
|
1365
|
-
| `
|
|
1366
|
-
| `
|
|
1367
|
-
| `
|
|
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-
|
|
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-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-
|
|
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-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-
|
|
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-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-
|
|
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-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-
|
|
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-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-
|
|
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-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-
|
|
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-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-
|
|
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-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-
|
|
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-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-
|
|
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-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-
|
|
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-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-
|
|
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-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-
|
|
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-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,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-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-
|
|
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-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-
|
|
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
|
-
setting: () => import("./setting-
|
|
72
|
-
search: () => import("./search-
|
|
73
|
-
"git-sync": () => import("./git-sync-
|
|
74
|
-
setup: () => import("./setup-
|
|
75
|
-
snippet: () => import("./snippet-
|
|
76
|
-
segment: () => import("./segment-
|
|
77
|
-
measure: () => import("./measure-
|
|
78
|
-
eid: () => import("./eid-
|
|
79
|
-
query: () => import("./query-
|
|
80
|
-
uuid: () => import("./uuid-
|
|
81
|
-
upgrade: () => import("./upgrade-
|
|
82
|
-
skills: () => import("./skills-
|
|
83
|
-
__manifest: () => import("./manifest-
|
|
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-
|
|
2
|
-
import { HttpError } from "./runtime-
|
|
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,
|
|
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-
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { renderSummary } from "./capabilities-
|
|
5
|
-
import "./input-
|
|
6
|
-
import { readBody } from "./body-
|
|
7
|
-
import { bodyInputFlags } from "./body-flags-
|
|
8
|
-
import { parseEnumFlag } from "./parse-enum-
|
|
9
|
-
import { Collection, CollectionCreateInput, CollectionNamespace, collectionView } from "./collection-
|
|
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-
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { renderSummary } from "./capabilities-
|
|
5
|
-
import "./input-
|
|
6
|
-
import { readBody } from "./body-
|
|
7
|
-
import { bodyInputFlags } from "./body-flags-
|
|
8
|
-
import { TransformJob, TransformJobCreateInput, transformJobView } from "./transform-job-
|
|
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({
|