@metabase/cli 0.1.0-alpha.workspaces-commands.818a8f1
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/LICENSE +661 -0
- package/README.md +762 -0
- package/dist/api-key-D9XxErQn.mjs +13 -0
- package/dist/archive-BPG5c88Y.mjs +38 -0
- package/dist/auth--Hpjwlaf.mjs +18 -0
- package/dist/body-DwU2s6Pg.mjs +19 -0
- package/dist/body-flags-7oqLhu5j.mjs +14 -0
- package/dist/branches-BbcoJXfp.mjs +41 -0
- package/dist/cancel-task-BDas45YO.mjs +29 -0
- package/dist/card-C31pGtBZ.mjs +113 -0
- package/dist/card-D4zZSPUb.mjs +19 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +61 -0
- package/dist/command-augment-D9pI9Vbh.mjs +11 -0
- package/dist/create-Bd_U1zWU.mjs +124 -0
- package/dist/create-CCzsCZMm.mjs +47 -0
- package/dist/create-CwVcoq0O.mjs +43 -0
- package/dist/create-DpnjQvPw.mjs +43 -0
- package/dist/create-_UOeEXAj.mjs +39 -0
- package/dist/create-branch-sDttBORB.mjs +54 -0
- package/dist/credentials-C0xKke5D.mjs +84 -0
- package/dist/current-task-BGt1mqaX.mjs +35 -0
- package/dist/database-4V1iiPEx.mjs +17 -0
- package/dist/database-BTX5qbSv.mjs +33 -0
- package/dist/db-Dm2u2ISJ.mjs +17 -0
- package/dist/delete-DRBTgyus.mjs +47 -0
- package/dist/delete-DUC_stoL.mjs +47 -0
- package/dist/delete-runtime-inOVw3IX.mjs +58 -0
- package/dist/delete-table-9Is631O_.mjs +47 -0
- package/dist/deprovision-BAMzZc6f.mjs +60 -0
- package/dist/dirty-CLjHbz6J.mjs +32 -0
- package/dist/docker-QWVMG2gl.mjs +605 -0
- package/dist/eid-BNhutC1U.mjs +13 -0
- package/dist/export-D2Anfu3p.mjs +97 -0
- package/dist/field-Dhs2AND3.mjs +13 -0
- package/dist/field-QwBMAWsq.mjs +76 -0
- package/dist/flag-pair-CWvvzDJ_.mjs +17 -0
- package/dist/get-2po1uv9i.mjs +35 -0
- package/dist/get-BHJA78zg.mjs +35 -0
- package/dist/get-CAPLfawI.mjs +35 -0
- package/dist/get-CAVVmdMX.mjs +49 -0
- package/dist/get-DDWpubE8.mjs +36 -0
- package/dist/get-DhIoNeOp.mjs +35 -0
- package/dist/get-qPOsuTPw.mjs +35 -0
- package/dist/has-remote-changes-DAL5jetW.mjs +63 -0
- package/dist/import-CUMxUfSF.mjs +92 -0
- package/dist/input-BNqSFl38.mjs +33 -0
- package/dist/is-dirty-B10S6MG0.mjs +35 -0
- package/dist/is-dirty-CUuq-aB6.mjs +9 -0
- package/dist/key-CyhOpgWt.mjs +12 -0
- package/dist/license-DtsGJi3l.mjs +17 -0
- package/dist/list-B8s7Qnzk.mjs +31 -0
- package/dist/list-C5MGydGU.mjs +31 -0
- package/dist/list-DeFGwhhJ.mjs +60 -0
- package/dist/list-OBx5B3gd.mjs +39 -0
- package/dist/list-Y7iGsOfE.mjs +31 -0
- package/dist/list-evtQS7jl.mjs +39 -0
- package/dist/list-qetY9OIN.mjs +31 -0
- package/dist/login-Dqw9ZtCx.mjs +172 -0
- package/dist/logout-DwYJ5OUi.mjs +74 -0
- package/dist/logs-B_lrY7Js.mjs +57 -0
- package/dist/manifest-wzEFG0JB.mjs +124 -0
- package/dist/package-t8dKf4m_.mjs +73 -0
- package/dist/parse-id-C1prc9US.mjs +12 -0
- package/dist/poll-D2sXM5rc.mjs +49 -0
- package/dist/poll-task-Byiunmaj.mjs +194 -0
- package/dist/prompt-fXeNtj0M.mjs +40 -0
- package/dist/provision-DC4_HWZD.mjs +80 -0
- package/dist/ps-1bZKIwWh.mjs +9 -0
- package/dist/ps-BiOrecEe.mjs +78 -0
- package/dist/query-BnGVGeM3.mjs +100 -0
- package/dist/remove-Bx48o-0S.mjs +62 -0
- package/dist/remove-DecoZzNd.mjs +97 -0
- package/dist/render-DlBijc5i.mjs +179 -0
- package/dist/run-D4NgvaRh.mjs +87 -0
- package/dist/runtime-DUgFfYkN.mjs +950 -0
- package/dist/search-4wKx5ug2.mjs +171 -0
- package/dist/set-BZnCRL4c.mjs +66 -0
- package/dist/set-DCjrmTFm.mjs +66 -0
- package/dist/setting-C4vQSqer.mjs +18 -0
- package/dist/setting-DM7pm7yh.mjs +55 -0
- package/dist/setup-Dqh9hN6l.mjs +70 -0
- package/dist/start-xXQypG5L.mjs +324 -0
- package/dist/stash-ZZkmW_V7.mjs +106 -0
- package/dist/status-9KAPIpX8.mjs +31 -0
- package/dist/status-DezF-PIM.mjs +63 -0
- package/dist/status-JH6BZppo.mjs +55 -0
- package/dist/stop-br-ZOnve.mjs +80 -0
- package/dist/sync-C7VOWD00.mjs +26 -0
- package/dist/table-BvAr2ixC.mjs +75 -0
- package/dist/table-D-Mb5Nvw.mjs +16 -0
- package/dist/transform-CqxZwhGs.mjs +21 -0
- package/dist/transform-DfVkUttP.mjs +137 -0
- package/dist/transform-job-DuB_OjhO.mjs +91 -0
- package/dist/transform-job-HjbqjEoP.mjs +19 -0
- package/dist/translate-DJxDVAE4.mjs +110 -0
- package/dist/update-CDtm71m2.mjs +50 -0
- package/dist/update-DYVeVjk2.mjs +76 -0
- package/dist/update-DxKlQ0hP.mjs +50 -0
- package/dist/url-DP88YHNo.mjs +53 -0
- package/dist/wait-Cj_8wu4y.mjs +52 -0
- package/dist/wait-DwZN3ZwR.mjs +19 -0
- package/dist/wait-flags-CjW4ogUJ.mjs +35 -0
- package/dist/workspace-CbwR0vX_.mjs +24 -0
- package/dist/workspace-Dr9lWU3D.mjs +72 -0
- package/dist/workspace-credentials-q5RRFMT8.mjs +139 -0
- package/package.json +62 -0
package/README.md
ADDED
|
@@ -0,0 +1,762 @@
|
|
|
1
|
+
# metabase-cli
|
|
2
|
+
|
|
3
|
+
Command-line client for Metabase. Authenticates against an instance with an API key and stores it securely on your machine.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install -g @metabase/cli
|
|
9
|
+
metabase --help
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Or build from source:
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
bun install
|
|
16
|
+
bun run build
|
|
17
|
+
node dist/cli.mjs --help
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The binary is `metabase`. Examples below use that name.
|
|
21
|
+
|
|
22
|
+
## Quick start
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
metabase auth login --url https://metabase.example.com
|
|
26
|
+
metabase auth status
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Authentication
|
|
30
|
+
|
|
31
|
+
Credentials are stored per-profile. The default profile is named `default`. Use `--profile <name>` to manage additional profiles.
|
|
32
|
+
|
|
33
|
+
### `metabase auth login`
|
|
34
|
+
|
|
35
|
+
Save credentials for a profile.
|
|
36
|
+
|
|
37
|
+
| Flag | Description |
|
|
38
|
+
| ------------------- | ---------------------------------------------------------- |
|
|
39
|
+
| `--url <url>` | Metabase URL. Falls back to `METABASE_URL`, then prompts. |
|
|
40
|
+
| `--api-key <value>` | API key. Visible in shell history — pipe on stdin instead. |
|
|
41
|
+
| `--profile <name>` | Profile to write to (default: `default`). |
|
|
42
|
+
| `--skip-verify` | Save without contacting the server. |
|
|
43
|
+
|
|
44
|
+
Resolution order for the API key: `--api-key` → piped stdin → `METABASE_API_KEY` → interactive prompt. Stdin is auto-detected when not a TTY.
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
echo "$MB_KEY" | metabase auth login --url https://m.example.com
|
|
48
|
+
metabase auth login --url https://m.example.com < key.txt
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### `metabase auth status`
|
|
52
|
+
|
|
53
|
+
Show whether a profile is authenticated.
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
metabase auth status
|
|
57
|
+
metabase auth status --json
|
|
58
|
+
metabase auth status --profile staging
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
| Flag | Description |
|
|
62
|
+
| ------------------ | ---------------------------------------- |
|
|
63
|
+
| `--profile <name>` | Profile to inspect (default: `default`). |
|
|
64
|
+
| `--json` | Emit JSON. Auto-enabled on non-TTY. |
|
|
65
|
+
|
|
66
|
+
### `metabase auth logout`
|
|
67
|
+
|
|
68
|
+
Clear stored credentials for a profile.
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
metabase auth logout --yes
|
|
72
|
+
metabase auth logout --profile staging --yes
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
| Flag | Description |
|
|
76
|
+
| ------------------ | --------------------------------------- |
|
|
77
|
+
| `--profile <name>` | Profile to clear (default: `default`). |
|
|
78
|
+
| `--yes` | Skip confirmation. Required on non-TTY. |
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
Manage the Metabase Enterprise license token.
|
|
83
|
+
|
|
84
|
+
### `metabase license set [token]`
|
|
85
|
+
|
|
86
|
+
Store a license token. Resolution order: positional → piped stdin → `METABASE_LICENSE_TOKEN` → interactive prompt. Stdin is auto-detected when not a TTY.
|
|
87
|
+
|
|
88
|
+
Common output flags (`--json`, `--format`, `--detail`, `--fields`, `--max-bytes`) are accepted; the result payload is rendered through the standard output layer.
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
echo "$MB_LICENSE" | metabase license set
|
|
92
|
+
metabase license set < token.txt
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### `metabase license status`
|
|
96
|
+
|
|
97
|
+
Show whether a license is stored. Does not reveal the value.
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
metabase license status
|
|
101
|
+
metabase license status --json
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
| Flag | Description |
|
|
105
|
+
| -------- | ----------------------------------- |
|
|
106
|
+
| `--json` | Emit JSON. Auto-enabled on non-TTY. |
|
|
107
|
+
|
|
108
|
+
### `metabase license remove`
|
|
109
|
+
|
|
110
|
+
Clear the stored license.
|
|
111
|
+
|
|
112
|
+
```sh
|
|
113
|
+
metabase license remove --yes
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
| Flag | Description |
|
|
117
|
+
| ------- | --------------------------------------- |
|
|
118
|
+
| `--yes` | Skip confirmation. Required on non-TTY. |
|
|
119
|
+
|
|
120
|
+
Common output flags (`--json`, `--format`, `--detail`, `--fields`, `--max-bytes`) are accepted; the result payload is rendered through the standard output layer.
|
|
121
|
+
|
|
122
|
+
## Transforms
|
|
123
|
+
|
|
124
|
+
CRUD on `/api/transform`. Bodies for `create` / `update` are JSON; resolution order: `--body` → `--file` → piped stdin (auto-detected when stdin is not a TTY).
|
|
125
|
+
|
|
126
|
+
### `metabase transform list`
|
|
127
|
+
|
|
128
|
+
```sh
|
|
129
|
+
metabase transform list
|
|
130
|
+
metabase transform list --json
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### `metabase transform get <id>`
|
|
134
|
+
|
|
135
|
+
```sh
|
|
136
|
+
metabase transform get 1 --json
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### `metabase transform create`
|
|
140
|
+
|
|
141
|
+
```sh
|
|
142
|
+
cat transform.json | metabase transform create
|
|
143
|
+
metabase transform create --file transform.json
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
| Flag | Description |
|
|
147
|
+
| --------------- | ----------------------- |
|
|
148
|
+
| `--body <json>` | Inline JSON body. |
|
|
149
|
+
| `--file <path>` | Path to JSON body file. |
|
|
150
|
+
|
|
151
|
+
### `metabase transform update <id>`
|
|
152
|
+
|
|
153
|
+
```sh
|
|
154
|
+
metabase transform update 1 --body '{"name":"renamed"}'
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Same `--body` / `--file` resolution as `create`. Stdin is auto-detected when not a TTY.
|
|
158
|
+
|
|
159
|
+
### `metabase transform delete <id>`
|
|
160
|
+
|
|
161
|
+
```sh
|
|
162
|
+
metabase transform delete 1 --yes
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
| Flag | Description |
|
|
166
|
+
| ------- | --------------------------------------- |
|
|
167
|
+
| `--yes` | Skip confirmation. Required on non-TTY. |
|
|
168
|
+
|
|
169
|
+
### `metabase transform run <id>`
|
|
170
|
+
|
|
171
|
+
Trigger a manual run. Returns `{message, run_id}` and exits immediately. Pass `--wait` to poll until the run reaches a terminal status (`succeeded`, `failed`, `timeout`, `canceled`); the `final` field on the result holds the polled run state, and the command exits 1 if the final status is anything but `succeeded`.
|
|
172
|
+
|
|
173
|
+
```sh
|
|
174
|
+
metabase transform run 1
|
|
175
|
+
metabase transform run 1 --wait --json
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
| Flag | Description |
|
|
179
|
+
| ----------------- | ----------------------------------------------------------- |
|
|
180
|
+
| `--wait` | Poll until the run reaches a terminal status. |
|
|
181
|
+
| `--timeout <ms>` | Polling timeout in ms (default 600000). Used with `--wait`. |
|
|
182
|
+
| `--interval <ms>` | Polling interval in ms (default 2000). Used with `--wait`. |
|
|
183
|
+
|
|
184
|
+
## Transform jobs
|
|
185
|
+
|
|
186
|
+
CRUD on `/api/transform-job`. Bodies for `create` / `update` follow the same `--body` / `--file` / stdin pattern as transforms.
|
|
187
|
+
|
|
188
|
+
### `metabase transform-job list`
|
|
189
|
+
|
|
190
|
+
```sh
|
|
191
|
+
metabase transform-job list --json
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### `metabase transform-job get <id>`
|
|
195
|
+
|
|
196
|
+
```sh
|
|
197
|
+
metabase transform-job get 1 --json
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### `metabase transform-job create`
|
|
201
|
+
|
|
202
|
+
```sh
|
|
203
|
+
metabase transform-job create --body '{"name":"daily","schedule":"0 0 0 * * ?"}'
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
| Flag | Description |
|
|
207
|
+
| --------------- | ----------------------- |
|
|
208
|
+
| `--body <json>` | Inline JSON body. |
|
|
209
|
+
| `--file <path>` | Path to JSON body file. |
|
|
210
|
+
|
|
211
|
+
### `metabase transform-job update <id>`
|
|
212
|
+
|
|
213
|
+
```sh
|
|
214
|
+
metabase transform-job update 1 --body '{"schedule":"0 0 6 * * ?"}'
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### `metabase transform-job delete <id>`
|
|
218
|
+
|
|
219
|
+
```sh
|
|
220
|
+
metabase transform-job delete 1 --yes
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
| Flag | Description |
|
|
224
|
+
| ------- | --------------------------------------- |
|
|
225
|
+
| `--yes` | Skip confirmation. Required on non-TTY. |
|
|
226
|
+
|
|
227
|
+
## Cards
|
|
228
|
+
|
|
229
|
+
CRUD plus query execution on `/api/card`. A "card" is a Metabase question, model, or metric. The `query` subcommand runs the card and either returns Metabase's JSON envelope or streams a raw CSV / XLSX export.
|
|
230
|
+
|
|
231
|
+
### `metabase card list`
|
|
232
|
+
|
|
233
|
+
```sh
|
|
234
|
+
metabase card list
|
|
235
|
+
metabase card list --filter archived --json
|
|
236
|
+
metabase card list --filter using_model --model-id 42 --json
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
| Flag | Description |
|
|
240
|
+
| ------------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
241
|
+
| `--filter <preset>` | One of `all` (default), `mine`, `bookmarked`, `database`, `table`, `archived`, `using_model`, `using_segment`. |
|
|
242
|
+
| `--model-id <id>` | Required when `--filter` is `database`, `table`, `using_model`, or `using_segment`. |
|
|
243
|
+
|
|
244
|
+
### `metabase card get <id>`
|
|
245
|
+
|
|
246
|
+
```sh
|
|
247
|
+
metabase card get 1
|
|
248
|
+
metabase card get 1 --json --detail full
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### `metabase card query <id>`
|
|
252
|
+
|
|
253
|
+
Run the card's query. Without `--export-format`, returns the Metabase JSON envelope (`status`, `row_count`, `data: { rows, cols }`, …). With `--export-format csv` or `--export-format xlsx`, the export bytes stream straight to stdout.
|
|
254
|
+
|
|
255
|
+
```sh
|
|
256
|
+
metabase card query 1 --json
|
|
257
|
+
metabase card query 1 --json --limit 20
|
|
258
|
+
metabase card query 1 --export-format csv > export.csv
|
|
259
|
+
metabase card query 1 --export-format xlsx > export.xlsx
|
|
260
|
+
metabase card query 1 --parameters '[{"type":"category","value":"A","target":["variable",["template-tag","c"]]}]'
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
| Flag | Description |
|
|
264
|
+
| ----------------------- | ------------------------------------------------------------------------------------------ |
|
|
265
|
+
| `--export-format <fmt>` | Stream the export instead of the JSON envelope. One of `csv`, `xlsx`. |
|
|
266
|
+
| `--parameters <json>` | JSON array of Metabase parameter objects (the same shape Metabase POSTs from a dashboard). |
|
|
267
|
+
| `--limit <n>` | Cap rows kept in the JSON envelope. No effect on `csv` / `xlsx` exports. |
|
|
268
|
+
|
|
269
|
+
### `metabase card create`
|
|
270
|
+
|
|
271
|
+
```sh
|
|
272
|
+
cat card.json | metabase card create
|
|
273
|
+
metabase card create --file card.json
|
|
274
|
+
metabase card create --body '{"name":"x","display":"table","dataset_query":{...},"visualization_settings":{}}'
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
| Flag | Description |
|
|
278
|
+
| --------------- | ----------------------- |
|
|
279
|
+
| `--body <json>` | Inline JSON body. |
|
|
280
|
+
| `--file <path>` | Path to JSON body file. |
|
|
281
|
+
|
|
282
|
+
### `metabase card archive <id>`
|
|
283
|
+
|
|
284
|
+
Soft-delete a card by setting `archived: true`. The archived card stays available via `card list --filter archived` and `card get <id>` until permanently deleted server-side.
|
|
285
|
+
|
|
286
|
+
```sh
|
|
287
|
+
metabase card archive 1
|
|
288
|
+
metabase card archive 1 --json
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
## Settings
|
|
292
|
+
|
|
293
|
+
Read and write Metabase instance settings via `/api/setting`. Listing all settings requires admin privileges; per-key reads/writes additionally enforce per-setting access. Setting values are always JSON — `"main"` is the string `main`, `42` is a number, `null` deletes the override and resets the value to its default.
|
|
294
|
+
|
|
295
|
+
### `metabase setting list`
|
|
296
|
+
|
|
297
|
+
```sh
|
|
298
|
+
metabase setting list
|
|
299
|
+
metabase setting list --json --max-bytes 0
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
Returns a `ListEnvelope` of compact entries (`key`, `value`, `is_env_setting`, `env_name`). Pass `--full` for the full per-row payload (also includes `description` and `default`). The full payload can exceed the default `--max-bytes` cap; pass `--max-bytes 0` to disable the cap.
|
|
303
|
+
|
|
304
|
+
### `metabase setting get <key>`
|
|
305
|
+
|
|
306
|
+
```sh
|
|
307
|
+
metabase setting get site-name
|
|
308
|
+
metabase setting get remote-sync-branch --json
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
Returns `{ key, value }` for a single setting. Settings whose stored value matches the default — or that come from an env var — surface as `value: null`.
|
|
312
|
+
|
|
313
|
+
### `metabase setting set <key> [value]`
|
|
314
|
+
|
|
315
|
+
Set or delete a setting. The value is parsed strictly as JSON: pass `'"main"'` for the string `main`, `true`/`42` for booleans/numbers, `null` to delete the stored override (resets to default).
|
|
316
|
+
|
|
317
|
+
```sh
|
|
318
|
+
metabase setting set remote-sync-branch '"main"'
|
|
319
|
+
metabase setting set anon-tracking-enabled true
|
|
320
|
+
echo '"main"' | metabase setting set remote-sync-branch
|
|
321
|
+
metabase setting set remote-sync-branch --file value.json
|
|
322
|
+
metabase setting set remote-sync-branch null
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
| Flag | Description |
|
|
326
|
+
| --------------- | ------------------------------------------------------------------------ |
|
|
327
|
+
| `--file <path>` | Read the JSON value from a file (alternative to the positional / stdin). |
|
|
328
|
+
|
|
329
|
+
Sources are resolved in this order: positional, `--file`, piped stdin. Provide exactly one; an unparseable value or a missing source fails fast with a `ConfigError`.
|
|
330
|
+
|
|
331
|
+
## Search
|
|
332
|
+
|
|
333
|
+
### `metabase search [query]`
|
|
334
|
+
|
|
335
|
+
Search Metabase content (cards, dashboards, collections, tables, …). Returns a `ListEnvelope` of compact search results by default; pass `--detail full` for the full per-row payload.
|
|
336
|
+
|
|
337
|
+
```sh
|
|
338
|
+
metabase search orders
|
|
339
|
+
metabase search --models card,dashboard --limit 10 --json
|
|
340
|
+
metabase search products --archived
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
| Flag | Description |
|
|
344
|
+
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
345
|
+
| `--models`, `-m` | Comma-separated model filter: `card,dataset,metric,dashboard,collection,database,table,segment,measure,snippet,document,action,transform,indexed-entity`. |
|
|
346
|
+
| `--archived` | Include archived items only. |
|
|
347
|
+
| `--limit` | Max results to return (default `20`). |
|
|
348
|
+
| `--table-db-id` | Restrict to items on a given database id. |
|
|
349
|
+
| `--verified` | Only verified content. |
|
|
350
|
+
|
|
351
|
+
## Sync
|
|
352
|
+
|
|
353
|
+
Drive Metabase Enterprise Remote Sync (`/api/ee/remote-sync`) — import / export Metabase content against a configured git remote, inspect dirty state, and manage branches. All sync commands require an active EE token and superuser credentials.
|
|
354
|
+
|
|
355
|
+
### `metabase sync status`
|
|
356
|
+
|
|
357
|
+
Roll up the current sync state in one call: configured branch, dirty flag, and the most recent sync task (or `null` if none has ever run).
|
|
358
|
+
|
|
359
|
+
```sh
|
|
360
|
+
metabase sync status
|
|
361
|
+
metabase sync status --json
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
### `metabase sync is-dirty`
|
|
365
|
+
|
|
366
|
+
Boolean check for whether any synced collection has unsynced local changes.
|
|
367
|
+
|
|
368
|
+
```sh
|
|
369
|
+
metabase sync is-dirty --json
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
### `metabase sync has-remote-changes`
|
|
373
|
+
|
|
374
|
+
Compare the latest version on the remote branch against the version Metabase last imported. Cached for a short TTL server-side; pass `--force-refresh` to bypass.
|
|
375
|
+
|
|
376
|
+
```sh
|
|
377
|
+
metabase sync has-remote-changes
|
|
378
|
+
metabase sync has-remote-changes --force-refresh --json
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
| Flag | Description |
|
|
382
|
+
| ----------------- | --------------------------------------------------- |
|
|
383
|
+
| `--force-refresh` | Bypass the in-memory cache and re-check the remote. |
|
|
384
|
+
|
|
385
|
+
### `metabase sync dirty`
|
|
386
|
+
|
|
387
|
+
List every object that has unsynced local changes (compact list envelope; `--full` for the per-row payload).
|
|
388
|
+
|
|
389
|
+
```sh
|
|
390
|
+
metabase sync dirty
|
|
391
|
+
metabase sync dirty --json
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
### `metabase sync current-task`
|
|
395
|
+
|
|
396
|
+
Fetch the most recent sync task. Renders `{ status: "idle" }` when no task has ever run, otherwise the full task with its hydrated `status`.
|
|
397
|
+
|
|
398
|
+
```sh
|
|
399
|
+
metabase sync current-task
|
|
400
|
+
metabase sync current-task --json
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### `metabase sync cancel-task`
|
|
404
|
+
|
|
405
|
+
Cancel the currently running sync task. Fails with HTTP 400 if no task is running.
|
|
406
|
+
|
|
407
|
+
```sh
|
|
408
|
+
metabase sync cancel-task --json
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
### `metabase sync wait`
|
|
412
|
+
|
|
413
|
+
Poll `/current-task` until it reaches a terminal status (`successful`, `errored`, `cancelled`, `timed-out`, `conflict`). Exits 0 on `successful` or `cancelled`; exits 1 on `errored` / `timed-out` / `conflict`. Returns immediately with `{ status: "idle" }` if no task is running.
|
|
414
|
+
|
|
415
|
+
```sh
|
|
416
|
+
metabase sync wait
|
|
417
|
+
metabase sync wait --timeout 300000 --json
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
| Flag | Description |
|
|
421
|
+
| ----------------- | --------------------------------------- |
|
|
422
|
+
| `--timeout <ms>` | Polling timeout in ms (default 600000). |
|
|
423
|
+
| `--interval <ms>` | Polling interval in ms (default 2000). |
|
|
424
|
+
|
|
425
|
+
### `metabase sync import`
|
|
426
|
+
|
|
427
|
+
Import content from the configured git remote into Metabase (repo → Metabase). Auto-polls until the resulting task reaches a terminal status; pass `--no-wait` to return immediately after kickoff.
|
|
428
|
+
|
|
429
|
+
```sh
|
|
430
|
+
metabase sync import
|
|
431
|
+
metabase sync import --branch main --json
|
|
432
|
+
metabase sync import --force --no-wait
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
| Flag | Description |
|
|
436
|
+
| ----------------------- | --------------------------------------------------------------------- |
|
|
437
|
+
| `--branch <name>`, `-b` | Branch to import from (defaults to the `remote-sync-branch` setting). |
|
|
438
|
+
| `--force` | Discard local Metabase-side dirty changes before importing (LOSSY). |
|
|
439
|
+
| `--wait` / `--no-wait` | Poll until the task reaches a terminal status (default: wait). |
|
|
440
|
+
| `--timeout <ms>` | Polling timeout in ms (default 600000). Used with `--wait`. |
|
|
441
|
+
| `--interval <ms>` | Polling interval in ms (default 2000). Used with `--wait`. |
|
|
442
|
+
|
|
443
|
+
### `metabase sync export`
|
|
444
|
+
|
|
445
|
+
Export Metabase changes back to the configured git remote (Metabase → repo). Auto-polls by default.
|
|
446
|
+
|
|
447
|
+
```sh
|
|
448
|
+
metabase sync export -m "update dashboards"
|
|
449
|
+
metabase sync export --branch main --json
|
|
450
|
+
metabase sync export --no-wait
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
| Flag | Description |
|
|
454
|
+
| ----------------------- | ------------------------------------------------------------------- |
|
|
455
|
+
| `--branch <name>`, `-b` | Branch to export to (defaults to the `remote-sync-branch` setting). |
|
|
456
|
+
| `--message <msg>`, `-m` | Commit message for the export. |
|
|
457
|
+
| `--force` | Force-push / overwrite the remote branch. |
|
|
458
|
+
| `--wait` / `--no-wait` | Poll until the task reaches a terminal status (default: wait). |
|
|
459
|
+
| `--timeout <ms>` | Polling timeout in ms (default 600000). Used with `--wait`. |
|
|
460
|
+
| `--interval <ms>` | Polling interval in ms (default 2000). Used with `--wait`. |
|
|
461
|
+
|
|
462
|
+
### `metabase sync stash`
|
|
463
|
+
|
|
464
|
+
Export the current Metabase state to a NEW branch on the remote and switch sync to it. Requires `remote-sync-type` to be `read-write`.
|
|
465
|
+
|
|
466
|
+
```sh
|
|
467
|
+
metabase sync stash --new-branch wip
|
|
468
|
+
metabase sync stash --new-branch wip -m "work in progress" --json
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
| Flag | Description |
|
|
472
|
+
| ----------------------- | -------------------------------------------------------------- |
|
|
473
|
+
| `--new-branch <name>` | Required. Branch to create and export to. |
|
|
474
|
+
| `--message <msg>`, `-m` | Commit message (default `Stashed from metabase CLI`). |
|
|
475
|
+
| `--wait` / `--no-wait` | Poll until the task reaches a terminal status (default: wait). |
|
|
476
|
+
| `--timeout <ms>` | Polling timeout in ms. Used with `--wait`. |
|
|
477
|
+
| `--interval <ms>` | Polling interval in ms. Used with `--wait`. |
|
|
478
|
+
|
|
479
|
+
### `metabase sync branches`
|
|
480
|
+
|
|
481
|
+
List branches available on the configured git remote.
|
|
482
|
+
|
|
483
|
+
```sh
|
|
484
|
+
metabase sync branches --json
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
### `metabase sync create-branch <name>`
|
|
488
|
+
|
|
489
|
+
Create a new branch on the git remote (from the last imported version) and switch sync to it.
|
|
490
|
+
|
|
491
|
+
```sh
|
|
492
|
+
metabase sync create-branch feat/dashboards
|
|
493
|
+
metabase sync create-branch feat/x --json
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
## Workspaces
|
|
497
|
+
|
|
498
|
+
CRUD on `/api/ee/workspace-manager`. Run against the workspace-manager parent instance.
|
|
499
|
+
|
|
500
|
+
### `metabase workspace list`
|
|
501
|
+
|
|
502
|
+
```sh
|
|
503
|
+
metabase workspace list
|
|
504
|
+
metabase workspace list --json
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
### `metabase workspace create`
|
|
508
|
+
|
|
509
|
+
```sh
|
|
510
|
+
metabase workspace create --name analytics
|
|
511
|
+
echo '{"name":"analytics"}' | metabase workspace create
|
|
512
|
+
metabase workspace create --file workspace.json
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
| Flag | Description |
|
|
516
|
+
| --------------- | ------------------------------------------------------- |
|
|
517
|
+
| `--name <name>` | Workspace name. Shortcut for `--body '{"name":"<n>"}'`. |
|
|
518
|
+
| `--body <json>` | Inline JSON body. |
|
|
519
|
+
| `--file <path>` | Path to JSON body file. |
|
|
520
|
+
|
|
521
|
+
### `metabase workspace database provision <workspace-id>`
|
|
522
|
+
|
|
523
|
+
Provision a database into a workspace. The backend kicks off the work asynchronously and returns the workspace with the new entry in `status: "provisioning"`. Pass `--wait` to poll until the entry reaches `status: "provisioned"` and surface the polled state instead of the initial response.
|
|
524
|
+
|
|
525
|
+
```sh
|
|
526
|
+
metabase workspace database provision 1 --database-id 5 --schemas analytics,github
|
|
527
|
+
metabase workspace database provision 1 --database-id 5 --schemas analytics --wait
|
|
528
|
+
metabase workspace database provision 1 --file provision.json
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
| Flag | Description |
|
|
532
|
+
| -------------------- | -------------------------------------------------------------- |
|
|
533
|
+
| `--database-id <id>` | Database id (used with `--schemas`). |
|
|
534
|
+
| `--schemas <csv>` | Comma-separated input schemas (used with `--database-id`). |
|
|
535
|
+
| `--body <json>` | Inline JSON body. |
|
|
536
|
+
| `--file <path>` | Path to JSON body file. |
|
|
537
|
+
| `--wait` | Poll until the database entry reaches `status: "provisioned"`. |
|
|
538
|
+
| `--timeout <ms>` | Polling timeout in ms (default 600000). Used with `--wait`. |
|
|
539
|
+
| `--interval <ms>` | Polling interval in ms (default 2000). Used with `--wait`. |
|
|
540
|
+
|
|
541
|
+
### `metabase workspace database update <workspace-id> <db-id>`
|
|
542
|
+
|
|
543
|
+
Update a workspace's provisioned database (server-side this is deprovision + provision). Body accepts only `input_schemas` — the database id comes from the URL.
|
|
544
|
+
|
|
545
|
+
```sh
|
|
546
|
+
metabase workspace database update 1 5 --schemas analytics,github
|
|
547
|
+
metabase workspace database update 1 5 --schemas analytics --wait
|
|
548
|
+
metabase workspace database update 1 5 --file update.json
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
| Flag | Description |
|
|
552
|
+
| ----------------- | ----------------------------------------------------------------- |
|
|
553
|
+
| `--schemas <csv>` | Comma-separated input schemas. Shortcut for body. |
|
|
554
|
+
| `--body <json>` | Inline JSON body (`{"input_schemas":[...]}`). |
|
|
555
|
+
| `--file <path>` | Path to JSON body file. |
|
|
556
|
+
| `--wait` | Poll until the database entry returns to `status: "provisioned"`. |
|
|
557
|
+
| `--timeout <ms>` | Polling timeout in ms (default 600000). Used with `--wait`. |
|
|
558
|
+
| `--interval <ms>` | Polling interval in ms (default 2000). Used with `--wait`. |
|
|
559
|
+
|
|
560
|
+
### `metabase workspace database deprovision <workspace-id> <db-id>`
|
|
561
|
+
|
|
562
|
+
```sh
|
|
563
|
+
metabase workspace database deprovision 1 5 --yes
|
|
564
|
+
metabase workspace database deprovision 1 5 --yes --wait
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
| Flag | Description |
|
|
568
|
+
| ----------------- | ------------------------------------------------------------ |
|
|
569
|
+
| `--yes` | Skip confirmation. Required on non-TTY. |
|
|
570
|
+
| `--wait` | Poll until the database entry is removed from the workspace. |
|
|
571
|
+
| `--timeout <ms>` | Polling timeout in ms (default 600000). Used with `--wait`. |
|
|
572
|
+
| `--interval <ms>` | Polling interval in ms (default 2000). Used with `--wait`. |
|
|
573
|
+
|
|
574
|
+
### Local runtime
|
|
575
|
+
|
|
576
|
+
These commands manage a Docker container that serves as the workspace's child Metabase instance. State lives in Docker labels and a named volume — there is no per-workspace local state directory. The container is named `metabase-workspace-<id>`; the app-db volume is `metabase-workspace-<id>-appdb`.
|
|
577
|
+
|
|
578
|
+
### `metabase workspace start <id>`
|
|
579
|
+
|
|
580
|
+
```sh
|
|
581
|
+
metabase workspace start 1
|
|
582
|
+
metabase workspace start 1 --wait
|
|
583
|
+
metabase workspace start 1 --port 3100
|
|
584
|
+
metabase workspace start 1 --image metabase/metabase-dev:feature-workspaces-v2 --no-pull
|
|
585
|
+
metabase workspace start 1 --force
|
|
586
|
+
metabase workspace start 1 --repo /path/to/sync-repo --wait
|
|
587
|
+
metabase workspace start 1 --repo /path/to/sync-repo --repo-branch dev --repo-mode read-only
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
Resolves the parent via the active profile (or `--profile`/`--url`/`--api-key`) and the EE license via `resolveLicenseToken` (the same path `metabase license set` writes to). Refuses to start if the workspace has any database that isn't `status: "provisioned"`.
|
|
591
|
+
|
|
592
|
+
The boot bundle (`config.yml`, `credentials.json`, optional `metadata.json`) is built in process memory and tar-streamed into the container's `/mw-config/` directory through `docker cp -`; no host-disk artifact is created. The CLI generates a per-workspace admin user + API key, injects them into the YAML before shipping, and stores the same values in `credentials.json` for later retrieval via `metabase workspace credentials`. Once the child logs that it has read `config.yml`, the CLI scrubs the in-container copy (`docker exec rm /mw-config/config.yml`) so the warehouse credentials in `details.password` no longer linger; `credentials.json` stays.
|
|
593
|
+
|
|
594
|
+
By default `start` returns once the bundle has been consumed by the child (`state: "starting"`); pass `--wait` to also block until `/api/health` reports ready and the response reports `state: "running"`.
|
|
595
|
+
|
|
596
|
+
When `--repo <host-path>` is passed, the CLI bind-mounts the host directory at `/mnt/repo` inside the container and injects three settings into the workspace's `config.yml` so the child boots already wired to the repo: `remote-sync-url=file:///mnt/repo`, `remote-sync-branch=<branch>` (defaults to the current branch of the host repo, read via `git -C <path> symbolic-ref --short HEAD`; override with `--repo-branch`), and `remote-sync-type=<mode>` (defaults to `read-write`; override with `--repo-mode read-only`, which also makes the bind mount read-only). The bind mount is set at container-create time only — to add or change it after the fact, run `start --force` again with the new flags. The host path must be an existing directory; the CLI does not create or `git init` it for you.
|
|
597
|
+
|
|
598
|
+
| Flag | Description |
|
|
599
|
+
| ---------------------- | --------------------------------------------------------------------------------------------------------- |
|
|
600
|
+
| `--port <n>` | Host port (default: 3000; auto-shifts up to 100 ports if taken). |
|
|
601
|
+
| `--image <ref>` | Docker image (default: `metabase/metabase-dev:feature-workspaces-v2`). |
|
|
602
|
+
| `--wait` | Block until `/api/health` is ready. Default: return as soon as consumed. |
|
|
603
|
+
| `--timeout <ms>` | Health check deadline (default: 180000). Used with `--wait`. |
|
|
604
|
+
| `--no-pull` | Skip `docker pull` (useful if the image is already present). |
|
|
605
|
+
| `--no-metadata` | Skip the warehouse metadata export. |
|
|
606
|
+
| `--force` | If a container for this workspace already exists, remove it before starting. |
|
|
607
|
+
| `--repo <host-path>` | Bind-mount a host directory at `/mnt/repo` and set `remote-sync-url=file:///mnt/repo` in `config.yml`. |
|
|
608
|
+
| `--repo-branch <name>` | `remote-sync-branch` value (default: current branch of the host repo). |
|
|
609
|
+
| `--repo-mode <mode>` | `remote-sync-type`: `read-write` (default) or `read-only`. Read-only also makes the bind mount read-only. |
|
|
610
|
+
|
|
611
|
+
### `metabase workspace stop <id>`
|
|
612
|
+
|
|
613
|
+
```sh
|
|
614
|
+
metabase workspace stop 1
|
|
615
|
+
metabase workspace stop 1 --json
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
Stops the running container; no-ops if it's already exited or missing. Reports the prior state.
|
|
619
|
+
|
|
620
|
+
### `metabase workspace remove <id>`
|
|
621
|
+
|
|
622
|
+
```sh
|
|
623
|
+
metabase workspace remove 1 --yes
|
|
624
|
+
metabase workspace remove 1 --keep-volume --yes
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
Stops and removes the container. By default, also removes the app-db volume — pass `--keep-volume` to preserve it across rebuilds. **Does not affect the remote workspace** on the parent.
|
|
628
|
+
|
|
629
|
+
| Flag | Description |
|
|
630
|
+
| --------------- | ------------------------------------------------------------- |
|
|
631
|
+
| `--yes` | Skip confirmation. Required on non-TTY. |
|
|
632
|
+
| `--keep-volume` | Preserve the app-db volume (`metabase-workspace-<id>-appdb`). |
|
|
633
|
+
|
|
634
|
+
### `metabase workspace logs <id>`
|
|
635
|
+
|
|
636
|
+
```sh
|
|
637
|
+
metabase workspace logs 1
|
|
638
|
+
metabase workspace logs 1 --follow
|
|
639
|
+
metabase workspace logs 1 --tail 500
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
Passthrough to `docker logs`. Output streams directly to your terminal; Ctrl-C terminates a follow.
|
|
643
|
+
|
|
644
|
+
| Flag | Description |
|
|
645
|
+
| -------------- | --------------------------------------------- |
|
|
646
|
+
| `--follow, -f` | Stream indefinitely. |
|
|
647
|
+
| `--tail <n>` | Lines from the end of the logs (default 200). |
|
|
648
|
+
|
|
649
|
+
### `metabase workspace url <id>`
|
|
650
|
+
|
|
651
|
+
```sh
|
|
652
|
+
metabase workspace url 1
|
|
653
|
+
metabase workspace url 1 --json
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
Prints `http://localhost:<port>` for the workspace's container. Reads the host port from the container's `com.metabase.workspace.host-port` label.
|
|
657
|
+
|
|
658
|
+
### `metabase workspace credentials <id>`
|
|
659
|
+
|
|
660
|
+
```sh
|
|
661
|
+
metabase workspace credentials 1
|
|
662
|
+
metabase workspace credentials 1 --json
|
|
663
|
+
```
|
|
664
|
+
|
|
665
|
+
Reads the workspace child's admin credentials (email, password, admin API key) from `/mw-config/credentials.json` inside the container. The file is written by `workspace start` from CLI-generated, per-workspace values; the same values are injected into `config.yml`'s `:users` and `:api-keys` sections so they take effect on the child's first boot. Works against running and stopped containers (uses `docker cp`); errors clearly if no container exists for the given workspace id. Removing the container destroys the file — recover by `workspace start <id> --force`.
|
|
666
|
+
|
|
667
|
+
### `metabase workspace ps`
|
|
668
|
+
|
|
669
|
+
```sh
|
|
670
|
+
metabase workspace ps
|
|
671
|
+
metabase workspace ps --json
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
Lists every container that carries the `com.metabase.workspace.id` label, running or stopped. The `--json` envelope is the canonical agent-facing shape and contains only `workspace_id`, `workspace_name`, `state`, and `url`; `--full --json` emits the wider record (image, profile, parent URL, container name, status string, host port).
|
|
675
|
+
|
|
676
|
+
## Instance setup
|
|
677
|
+
|
|
678
|
+
Operations against a workspace-instance Metabase. The setup wizard and API key creation are distinct endpoints — there is no shared body schema.
|
|
679
|
+
|
|
680
|
+
### `metabase setup`
|
|
681
|
+
|
|
682
|
+
Complete the initial setup wizard (`POST /api/setup`). The body must include the setup token, the default user, and the `prefs` block (with `site_name`).
|
|
683
|
+
|
|
684
|
+
```sh
|
|
685
|
+
cat setup.json | metabase setup
|
|
686
|
+
metabase setup --file setup.json
|
|
687
|
+
metabase setup --body '{"token":"<setup-token>","user":{"email":"a@b.c","password":"..."},"prefs":{"site_name":"Acme"}}'
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
| Flag | Description |
|
|
691
|
+
| --------------- | ----------------------- |
|
|
692
|
+
| `--body <json>` | Inline JSON body. |
|
|
693
|
+
| `--file <path>` | Path to JSON body file. |
|
|
694
|
+
|
|
695
|
+
### `metabase api-key create`
|
|
696
|
+
|
|
697
|
+
Create a new API key (`POST /api/api-key`). The unmasked key is returned on creation only; capture it from the output.
|
|
698
|
+
|
|
699
|
+
```sh
|
|
700
|
+
metabase api-key create --name deploy-bot --group-id 2
|
|
701
|
+
echo '{"name":"k","group_id":2}' | metabase api-key create
|
|
702
|
+
metabase api-key create --file key.json
|
|
703
|
+
```
|
|
704
|
+
|
|
705
|
+
| Flag | Description |
|
|
706
|
+
| ----------------- | ----------------------------------------- |
|
|
707
|
+
| `--name <name>` | API key name (used with `--group-id`). |
|
|
708
|
+
| `--group-id <id>` | Permission group id (used with `--name`). |
|
|
709
|
+
| `--body <json>` | Inline JSON body. |
|
|
710
|
+
| `--file <path>` | Path to JSON body file. |
|
|
711
|
+
|
|
712
|
+
## Agent helpers
|
|
713
|
+
|
|
714
|
+
Endpoints commonly used by agents driving the instance. `card query` and `transform run` are documented in their own sections; the helper below covers entity-id translation.
|
|
715
|
+
|
|
716
|
+
### `metabase eid translate`
|
|
717
|
+
|
|
718
|
+
Translate string entity ids (EIDs) to numeric ids (`POST /api/eid-translation/translate`).
|
|
719
|
+
|
|
720
|
+
```sh
|
|
721
|
+
metabase eid translate --model card --eids abc123XYZ,def456ABC
|
|
722
|
+
metabase eid translate --file translate.json
|
|
723
|
+
metabase eid translate --body '{"entity_ids":{"card":["abc123XYZ"]}}'
|
|
724
|
+
```
|
|
725
|
+
|
|
726
|
+
| Flag | Description |
|
|
727
|
+
| ---------------- | ------------------------------------------------------------------------------------------------ |
|
|
728
|
+
| `--model <name>` | Entity model for the shortcut form (e.g. `card`, `dashboard`, `collection`). Used with `--eids`. |
|
|
729
|
+
| `--eids <csv>` | Comma-separated EIDs. Used with `--model`. |
|
|
730
|
+
| `--body <json>` | Inline JSON body. |
|
|
731
|
+
| `--file <path>` | Path to JSON body file. |
|
|
732
|
+
|
|
733
|
+
## Environment variables
|
|
734
|
+
|
|
735
|
+
| Variable | Effect |
|
|
736
|
+
| ------------------------ | ------------------------------------------------------------------------------ |
|
|
737
|
+
| `METABASE_URL` | Default URL for `auth login` and config resolution. |
|
|
738
|
+
| `METABASE_API_KEY` | Default API key (overrides interactive prompt; not stored). |
|
|
739
|
+
| `METABASE_PROFILE` | Default profile when `--profile` is omitted. Falls back to `default`. |
|
|
740
|
+
| `METABASE_LICENSE_TOKEN` | Default license token for `license set`. |
|
|
741
|
+
| `METABASE_VERBOSE` | When set to `1`, prints structured developer-detail JSON to stderr on failure. |
|
|
742
|
+
|
|
743
|
+
## Agent integration
|
|
744
|
+
|
|
745
|
+
### `metabase __manifest`
|
|
746
|
+
|
|
747
|
+
Hidden command that emits a machine-readable JSON manifest of every leaf command — name, description, examples, citty args, and the output Zod schema rendered as JSON Schema. Intended for agents that need typed capability discovery instead of scraping `--help`.
|
|
748
|
+
|
|
749
|
+
```sh
|
|
750
|
+
metabase __manifest | jq '.commands[].command'
|
|
751
|
+
```
|
|
752
|
+
|
|
753
|
+
The manifest schema (`Manifest`) is exported from `src/runtime/manifest.ts`.
|
|
754
|
+
|
|
755
|
+
## Exit codes
|
|
756
|
+
|
|
757
|
+
| Code | Meaning |
|
|
758
|
+
| ----- | ------------------------------------------------------ |
|
|
759
|
+
| `0` | Success. |
|
|
760
|
+
| `1` | Verification or operation failed. |
|
|
761
|
+
| `2` | Configuration error (invalid flag, missing TTY, etc.). |
|
|
762
|
+
| `130` | Interactive prompt cancelled (Ctrl+C). |
|