| name | metabase |
| description | This skill should be used when the user asks to "check metabase status", "inspect metabase", "find duplicate cards", "diagnose metabase issues", "backup metabase", "restore metabase backup", "create metabase card", "create metabase dashboard", "add card to dashboard", "run metabase query", mentions "metabase dashboards", "metabase cards", or needs to manage Metabase content via CLI. |
Metabase CLI
CLI: scripts/metabase-cli.py
Note: All script paths are relative to the skill directory (scripts/ folder inside the skill root).
Quick Start
python scripts/metabase-cli.py inspect
python scripts/metabase-cli.py diag
python scripts/metabase-cli.py backup -f backup.zip
Commands
System
inspect
diag
backup [-f FILE]
restore -f FILE [--db ID]
Cards
card list
card get <id>
card create --name N --sql S
card update <id> [--sql] [--name]
card delete <id>
Dashboards
dashboard list
dashboard get <id>
dashboard create --name N
dashboard add-card <dash> <card> [--row R --col C --size-x W --size-y H]
dashboard delete <id>
Query
query "SELECT * FROM tracks LIMIT 5"
Options
--json — Machine-readable JSON output (no colors, no UI messages)
Exit Codes
0 — Success, no issues found
1 — Issues found (duplicates, broken links, etc.) or error occurred
python scripts/metabase-cli.py --json card list
python scripts/metabase-cli.py --json inspect
Display Types
table, bar, line, pie, area, scalar, row, funnel, progress, gauge
Key Tables
| Table | Content |
|---|
agg_by_track | Revenue/royalty per track |
agg_by_licensee | Revenue/royalty per licensee |
agg_by_platform | Revenue/royalty per platform |
agg_by_artist | Revenue/royalty per artist |
agg_by_territory | Revenue/royalty per territory |
Columns: period_code, total_net, total_royalty, cp_royalty, stream_count
Workflow: New Dashboard
python scripts/metabase-cli.py card create \
--name "Total Revenue" \
--sql "SELECT SUM(total_net) FROM agg_by_licensee" \
--display scalar
python scripts/metabase-cli.py card create \
--name "Revenue Trend" \
--sql "SELECT period_code, SUM(total_net) FROM agg_by_track GROUP BY 1 ORDER BY 1" \
--display line
python scripts/metabase-cli.py dashboard create --name "Overview"
python scripts/metabase-cli.py dashboard add-card 8 170 --row 0 --col 0 --size-x 6 --size-y 4
python scripts/metabase-cli.py dashboard add-card 8 171 --row 0 --col 6 --size-x 18 --size-y 8
Advanced
See reference.md for API nuances: dependency resolution, bulk updates, negative IDs.