← All projects

supabase-stateful

An open-source CLI that makes local Supabase remember. Stop it and your test users, data and relationships are saved; start it again and they're all back, with new migrations applied on top.

Developer tools, Automation

View on npm ↗
Type
My product
Status
Live
Year
2026
Built with
Node.js, Supabase CLI, PostgreSQL, Docker, GitHub Actions, npm

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