Local Supabase is stateless by default. Stop it and everything's gone: the test users you signed up, the data you clicked together, the relationships between them. Start it again and you're back to an empty database, or chasing duplicate key errors from half-restored seed data.
I build most of my apps on Supabase, so I was losing that state every single day. supabase-stateful fixes it with two commands. It's small, but I haven't seen anything else that does it.
Impact
- Downloads a week on npm
- 50+
- CLI commands, from setup to cloud sync
- 10
It's open source under the MIT licence, and the code is on GitHub.
How it works
When you stop Supabase, it exports your local database state, clears stale auth tokens and shuts down cleanly. When you start it again, it restores that state first, then applies any pending migrations on top of your existing data rather than an empty database.
That order is the point. Your schema keeps moving forward while your test data stays put, which is how development actually works.
It also handles the awkward cases. If a Supabase CLI update needs a newer PostgreSQL version, it exports your data with the old version, rebuilds the database and restores everything. If a branch switch or rebase leaves a migration out of order, it retries safely against the local database.
Beyond start and stop
- A setup wizard that installs dependencies, adds the npm scripts and creates Next.js Supabase clients that switch between local and production.
- One
dev:localcommand that starts Supabase alongside the other services an app needs, like Inngest, ngrok or the Stripe CLI, and saves state when you press Ctrl+C. - Cloud sync and export, to pull real data down into a local database or turn it into a seed file.
- A GitHub Actions workflow that applies migrations to production on every push to main, then deploys to Vercel.
