Analytics as code means your semantic layer, questions and dashboards live as files in a Git repository you own, versioned, diffable and reviewable before they reach production. In Metabase, Remote sync enables managing dashboards as code. It stores the dashboards, questions and models of the collections you choose, plus the Library and transforms, as YAML files in Git. Your semantic layer holds the tables and metrics people should use, with their measures, segments and glossary terms. Metrics, measures, segments and the glossary work on every plan, including the free open-source edition. On Pro and Enterprise, the Library gathers your published tables, with their measures and segments, your official metrics and the glossary. You curate the Library in Data Studio, where you also build transforms.
A development Metabase pushes your changes to a Git branch, your team reviews them in a pull request, and a read-only production Metabase pulls the merged result. Remote sync is part of the Pro and Enterprise plans, both self-hosted and on Metabase Cloud. Pro costs $575 a month with 10 users included, and you can start with a 14-day free trial on Metabase Cloud (checked on November 12, 2026).
How do I keep Metabase dashboards in Git?
Turn on Remote sync in a development Metabase on version 65.4 or later, and choose the collections that hold your dashboards. Each dashboard, question and model in those collections then becomes a YAML file under version control, in your repository on GitHub, GitLab or Bitbucket. Here is the flow that the Remote sync docs describe:
- In the development Metabase, publish a table or create a metric in the Library, or build a dashboard in a synced collection.
- Push the change to a Git branch, and open a pull request so your team can review it.
- Merge the pull request into the main branch, and let the production Metabase pull in the change.
You can build the dashboard in the query builder, in the SQL editor or with a coding agent.
What does Remote sync store in Git, and what stays out?
Remote sync stores YAML files that describe your analytics content, and your data stays in your databases. It syncs three kinds of content:
- The Library: published tables with their segments and measures, metrics, data apps, SQL snippets, data actions and the glossary.
- Transforms, with their tags, tests, folders and Python libraries, including the transform tests that are new in Metabase 65.
- The other collections you choose, with their questions, models, dashboards, documents, timelines and events.
Some things stay out of Git, and each Metabase keeps its own:
- Users, groups, permissions, alerts, subscriptions and database connections.
- Transform jobs, built-in transform tags, the default
common.py, personal collections and any collection you don’t choose to sync. - Table metadata, such as table names, column types, descriptions and visibility settings.
- A data app’s live or draft status, and its group access.
If you need to version table metadata, the Remote sync docs point you to serialization instead. The first push creates a collections folder with the Library and a databases folder with your published tables. Each published table, metric, transform and item in a synced collection becomes its own YAML file. Remote sync uses the serialization format, so a file takes the item’s name in lowercase, with underscores for special characters, like products_by_week.yaml, and questions sit inside their parent collection’s folder.
Synced content must be self-contained, so everything a dashboard or question needs must be in a synced collection. That includes a dashboard’s questions, its click behaviors and filters that take their values from other questions. A Library metric must be built on a table, because the Library can’t hold questions or models.
How does a change go from a branch to production?
Remote sync has two modes, one for development and one for production. In Read-write mode, a development Metabase creates and edits content, and it pushes and pulls changes. In Read-only mode, a production Metabase only pulls, usually from the main branch, and nobody can edit the Library, synced collections or transforms there, so every change goes through Git.
Both Metabases need version 65.4 or later, the current release (checked on November 12, 2026). An admin sets it up in six steps:
- Create a new repository on GitHub, GitLab or Bitbucket, and initialize it with a
README.md. - Create a token with read and write access for the development Metabase.
- In the development Metabase, go to Admin > Settings > Remote sync and enter the repository’s
httpsURL. Select Read-write mode, paste the token, click Test connection, choose the collections to sync and save. - Push your changes from the branch menu at the top of the Data Studio sidebar.
- Create a token with read-only access for the production Metabase.
- In the production Metabase, open the same settings page, enter the same URL and select Read-only mode. Paste the read-only token, click Pull changes now and turn on Auto-sync with git.
Each Git provider names the token permissions in its own way:
| Git provider | Token for the development Metabase (Read-write) | Token for the production Metabase (Read-only) |
|---|---|---|
| GitHub | Fine-grained personal access token with Contents: Read and write, and Metadata: Read-only | Contents: Read-only, and Metadata: Read-only |
| GitLab | Personal access token with the read_repository and write_repository scopes | The read_repository scope only |
| Bitbucket | Repository access token with Repositories: Read and Write, and Pull requests: Read and Write | Repositories: Read, and Pull requests: Read |
Metabase encrypts each token before storing it, and GitLab tokens expire.
Under Collections to sync, Metabase turns on the Library and Transforms for you, and you turn on Sync for each top-level collection that holds dashboards. With Auto-sync with git on, production pulls from the main branch every five minutes.
An admin creates and switches branches under Sync branch on the same settings page, and branches created in Git show up there too. The branch applies to everyone on the same Metabase, so for parallel work you set up one development Metabase per branch.
What does a pull request show for a new metric and its dashboard?
Say your dbt project builds a fct_orders table with a net_revenue column, and you want an official Net revenue metric on a dashboard that charts it by month. The steps below follow the example workflow in the Remote sync docs:
- In the development Metabase, go to Admin > Settings > Remote sync and create a branch such as
feature/net-revenue, and Metabase switches to it. - In Data Studio, open the semantic layer and publish
fct_ordersto the Library with + New > Published table. Then create a Net revenue metric that sumsnet_revenuewith + New > Metric. - Start a new question from the Net revenue metric, group it by month, save it in a synced collection and add it to a new Revenue dashboard there.
- Click the branch name at the top of the Data Studio sidebar, select Push changes and describe the change.
- Open a pull request from
feature/net-revenuetomain.
The pull request adds YAML files for the new items. The published table goes in the databases folder, the metric goes in the Library under collections, and the question and the dashboard go in the synced collection’s folder. The metric, the question and the dashboard each carry an entity_id, a stable ID that stays the same across Metabases. Databases, tables and fields appear by name instead, so reviewers can read which table each item queries. The serialization docs show two keys that name a database:
database_id: Sample PostgreSQL
---
dataset_query:
database: Sample PostgreSQL
Because synced content points to a database by its display name, give your warehouse connection the same name on both Metabases. Before approving, a reviewer can pull the branch into a development Metabase to see the changes live. Once someone approves and merges the pull request, auto-sync brings the table, the metric and the dashboard into production within five minutes, as read-only content.
The files follow the Metabase Representation Format, and Metabase publishes its spec with a schema for each entity type and an npm package that validates the files. You can check every pull request with it, for example in a CI job:
# Run from the root of the repository that Remote sync writes to.
npx @metabase/representations validate-schema --folder .
The command exits with an error when a file fails, so the CI check fails too.
How does Remote sync fit with a dbt project?
dbt builds the tables, and Metabase reads them. Metabase connects to your warehouse, such as Snowflake, not to the dbt project, so it works the same with dbt Core or the dbt platform. A new mart shows up after the next schema sync, every hour by default. To see a new mart right after a dbt build, call the sync endpoint at the end of the CI job. The Metabase on dbt article shows the call, with an API key from the Administrators group:
# Run after `dbt build` succeeds.
curl -X POST "$METABASE_URL/api/database/$METABASE_DATABASE_ID/sync_schema" \
-H "X-API-Key: $METABASE_API_KEY"
Then publish the marts to the Library and define the numbers people use as Library metrics and measures. Keep the row-level logic in dbt and the aggregation in one Metabase metric. In the example above, dbt computes and tests net_revenue per order in fct_orders, and the Net revenue metric sums it. The semantic layer lives in Metabase, and Remote sync keeps its definitions in Git, so a metric change gets the same pull request review as a dbt model change.
The Remote sync setup starts with a new repository for your Metabase content, and your dbt project keeps its own. Remote sync leaves out table descriptions, which are table metadata, so copy your dbt descriptions with the Metabase API after each dbt build, as the Metabase on dbt article explains.
Can a coding agent build the dashboard with the Metabase CLI?
Yes. The Metabase CLI, mb, lets you or an AI agent read and write questions, dashboards, collections and transforms over the Metabase API. Metabase’s agent-driven development workflow pairs it with Remote sync on Pro and Enterprise (checked on November 12, 2026). The agent builds in a development Metabase, you check the result there, and the change reaches production through a pull request. The CLI needs Node.js 20.6 or later and Metabase 58 or later, and these commands from the docs install it, sign it in and add the agent skill:
npm install -g @metabase/cli
mb auth login --url https://metabase.example.com
npx skills add metabase/agent-skills --skill metabase-cli -a claude-code
The CLI signs in through your browser on Metabase 63 and later, and a script or CI job can give it an API key in the MB_API_KEY environment variable. Sign the agent in as an admin, so it can create content and work with Remote sync. Then describe what you want, as in this example prompt from the docs:
/metabase-cli Create a new dashboard called "Support overview". Add questions showing total ticket volume, open tickets, and average satisfaction rating.
Ask the agent to save its work in a synced collection, check the dashboard in the development Metabase, and then push, open a pull request and merge. The CLI’s git-sync commands, such as mb git-sync export and mb git-sync import, also push and pull from the terminal. To undo an agent’s work, revert to an earlier commit and pull it, or edit or archive the content and push again.
How do I keep production safe?
Treat write access to the repository like admin access. A Metabase loads the YAML files on its branch without checking who wrote them, and with auto-sync, a merged change shows up within minutes. Limit who can push to the branch that production pulls, and turn on branch protection to require approvals before merging, as Metabase’s Git workflow tutorial suggests.
Keep production in Read-only mode with a read-only token, so every change goes through Git. Users, groups and permissions don’t sync, so the repository can’t change them. But a merged pull request can still affect what people see. A collection that a pull creates gets the same permissions as its parent, and a newly published table gives query access to groups with view access to its database. Review new collections and published tables in each pull request.
If you use transforms, connect the two Metabases to separate databases with identical schemas, because dev transforms would otherwise change production data. If a pull brings content for a database that production doesn’t have, Metabase adds a placeholder marked Stubbed. Questions and transforms that use it start working once an admin enters the connection details.
Which Metabase plan do I need for Remote sync?
Remote sync, serialization and the Library are part of the Pro and Enterprise plans, self-hosted and on Metabase Cloud. Pro costs $575 a month with 10 users included and $12 a month for each extra user, and Enterprise starts at $20,000 a year. Pro on Metabase Cloud comes with a 14-day free trial, and more dashboards, queries or data sources don’t change the price (checked on November 12, 2026).
After your trial and first payment, you can add a development instance to Pro or Enterprise for $100 a month, with no charge per user (checked on November 12, 2026). On the free open-source edition, you can already define metrics, measures, segments and the glossary, and create questions and dashboards from scripts with the Metabase API. Pro and Enterprise add the Library and the Git workflow.
When is Lightdash the natural fit?
Lightdash is the natural fit when your team wants the dbt project to hold the whole semantic layer and to edit charts as files. Lightdash reads a connected dbt project and builds its semantic layer from it, and you define metrics in dbt YAML under meta, on a column or a model. Its CLI downloads charts and dashboards as .yml files into a lightdash folder, which its docs call content as code. In its Git-managed workflow, the repository is the single source of truth, the interface is read-only for managed content, and a CI job calls lightdash deploy and lightdash upload --force after each merge.
Metabase fits when one semantic layer should serve AI answers, self-service and code review. Metabot, the AI assistant in Metabase, answers questions from the same tables and metrics, on every plan. People across the company explore them in the query builder without writing YAML. You can host Metabase on your own servers or use Metabase Cloud, and production pulls each merged change by itself within five minutes.