Skip to main content
meridian dev is the everyday command. It opens a local connection to your managed developer database and starts your app’s dev server, and stops both together, so quitting your server closes the connection with it. The connection goes through the Meridian database gateway. On every run the CLI generates a key on your machine, keeps it in memory only, and gets a certificate for your own developer database, valid for 24 hours and renewed while meridian dev keeps running. Nobody else’s certificate reaches your database, and yours reaches no one else’s. Removing you from the organization or the app ends your access within a minute.
The command it runs is resolved in order: whatever you pass after --, then dev_command in .meridian/project.json, then npm run dev. For an app built from Shopify’s template, npm run dev is shopify app dev, which previews your app on a development store. Test there with the same Shopify app you release: see Recommended Shopify app setup. meridian dev also exports MERIDIAN_DEV_DATABASE_ID, so that a shop subscribing from your local app is billed with its session in your developer database, as a Shopify test charge. See Billing from local development. Without --port, the CLI takes 3307 for a MySQL app or 5433 for a PostgreSQL app, or the next free port when that one is busy, so nothing fails because you left yesterday’s session running. An explicit --port is a contract: the CLI uses exactly that port, and stops with Port <port> is already in use. when it is taken. One meridian dev per app at a time: a second one on the same app, from this checkout or another one, stops with the first one’s pid and port. Stop the first one, or run your other process with the DATABASE_URL from .env, which already points at its connection.

Prepare Prisma (once)

Shopify’s app template stores its data in SQLite. Every database command (meridian dev, meridian migrate, meridian db) refuses a Prisma schema that doesn’t read the developer database, before it provisions anything:
Switch the datasource once, to the engine of your app’s database: provider = "mysql" for a MySQL app, provider = "postgresql" for a PostgreSQL app.
prisma/schema.prisma
Before the CLI knows the app’s engine, the check accepts either provider. Once the developer database exists, the provider has to match its engine, and a mismatch is refused the same way.
  • url must read DATABASE_URL, the variable meridian dev sets. A hardcoded URL or another variable name is refused with ... so this command would not touch the managed developer database.
  • shadowDatabaseUrl is what prisma migrate dev needs. Without it, meridian migrate offers to add the line (--yes accepts). In a script without --yes it stops and prints the line to add.
  • The migration history has to match the app’s engine. Migrations generated for SQLite or for the other engine use their own SQL, so meridian migrate refuses them before it starts (... was written for a different database engine and cannot apply to MySQL., or ... PostgreSQL.). Delete prisma/migrations and create a fresh one with meridian migrate --name init. Don’t delete migrations that already ran against a hosted database. --allow-foreign-migrations makes meridian migrate try anyway.
  • skip_datasource_check in .meridian/project.json turns the check off (see Flags and configuration).
The same datasource is what hosting expects, so nothing changes at deploy time.

First run

In a linked project (see Signing in and linking):
  1. Prepare Prisma.
  2. Create the tables: meridian migrate --name init for a new history, or meridian db reset --yes --migrate to apply a history you already have, written for your app’s engine.
  3. Start the app: meridian dev. The first run provisions your developer database, which takes up to five minutes.

From a script or an agent

A coding agent’s shell has no terminal, so nothing can be asked interactively.
  • meridian dev runs in the foreground until your dev server stops. Start it in the background. With --json, its first line on stdout is the JSON summary, followed by the dev server’s own output.
  • npm run dev in the template is shopify app dev, which asks the developer to sign in to Shopify and pick a development store the first time. Leave that step to them.
  • meridian migrate needs --name (Prisma can’t ask for one) and --yes if it has to add shadowDatabaseUrl. A migration that would lose data, or a database that drifted from the history, still needs a person. See Migrations and rollback.
  • meridian db reset asks you to type the database name: pass --yes, with --migrate and --seed for the follow-ups.
  • A production change (meridian deploy or meridian rollback to production, meridian env set or meridian env unset on production or with --all-environments) needs production access, which a person approves in the browser, and --yes for its confirmation. An agent passes --yes only after the person agreed to that change. See AI coding agents.
  • A prompt the CLI can’t show stops the command with Cannot prompt for <question> in a non-interactive shell. and names the flag or variable that answers it. See Errors and exit codes.

When the developer database is not there

Each developer database takes at most 10 connections at a time through the gateway, shared by meridian dev and the commands that reuse its connection. Prisma’s default pool grows with your CPU cores, so on a large machine lower it with connection_limit in the database URL when connections are refused.

The database URL

Before starting your dev command, meridian dev writes two lines into .env:
On a PostgreSQL app the same two lines use the postgresql scheme, port 5433 on 127.0.0.1 and sslmode=disable, because the local leg is plain TCP and the TLS runs from the CLI to the gateway:
  • SHADOW_DATABASE_URL is a second database prisma migrate dev needs; it’s dropped with your developer database.
  • Every other line in the file (comments, order, quoting) is preserved, and the first change saves a one-time .env.backup.
  • Credentials are short-lived and rotate, and the port changes when 3307 (5433 on a PostgreSQL app) is busy, so treat the line as a cache rather than a secret to share, and keep .env out of git.
  • Your dev command gets both variables in its environment either way, so --no-env still works for a process that reads the environment rather than the file.
  • Only meridian dev writes these lines. meridian migrate and the meridian db commands pass the URL to the process they run and leave .env as it is.
Use --env-file when your framework reads something other than .env, such as .env.local or .env.development. The path is relative to the project root, not to your shell.
--env-file matters here only. meridian migrate and the meridian db commands still accept it, but they no longer write any .env file, and say so.

SDK credentials

The SDK needs MERIDIAN_APP_ID, MERIDIAN_API_KEY and MERIDIAN_API_URL. meridian dev asks Meridian for a dev SDK key for you, limited to dev stores, and gives your dev server all three in its environment. There is nothing to paste into .env. Each run mints a new key, and the previous one stops working. Deleting your developer database revokes it too. MERIDIAN_WEBHOOK_SECRET is not set: a local app does not receive forwarded webhooks. The summary shows SDK: dev key …abcd injected with the last four characters. The key itself is never written to .env, to the summary or to --json, which carries sdk.source and sdk.key_last_four. You win. If MERIDIAN_APP_ID or MERIDIAN_API_KEY already comes from your shell or from your env file (--env-file, default .env), meridian dev injects nothing, mints no key and says where the value comes from (from your shell, from .env). It reads the file even with --no-env. An empty value counts as not set, as it does in the SDK.
  • It is all or nothing: the app ID and the key are never mixed with yours.
  • MERIDIAN_API_URL is injected only together with the pair, and only when you do not set it. If your env file sets one that points to another API than the CLI’s, nothing is injected and the summary says so.
  • An empty MERIDIAN_API_KEY= line in your env file does not block the injection. Remove the line anyway, because some tools reload the file over the environment.
  • If the key cannot be minted (no rights on the app, an older API, no network), you get a one-line warning and your app starts without the credentials.
This is the opposite of DATABASE_URL, which meridian dev always sets. On staging, the CLI uses the API URL Meridian returns, so a CLI logged in on staging gives the SDK the staging API, not production.

Migrations while it runs

While meridian dev runs, it records its connection in ~/.meridian/sessions/, in a file only you can read, and deletes it when it stops. meridian migrate, meridian db seed, meridian db shell and the follow-ups of meridian db reset find it and use the same connection:
Opening a connection of their own would rotate your database password and replace your gateway certificate, which cuts off the dev server until you restart it. Reusing it means your app keeps serving through any number of migrations. The file is found by app, not by folder, so a migration run from a worktree or a second clone of the same app uses it too. Their --port only applies when no meridian dev runs.
Last modified on November 17, 2026