You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: allow customization of the supabase root directory name and config paths #2139
Is your feature request related to a problem? Please describe.
I have a monorepo that has a very specific naming structure with /apps and /libs folders. The option for --workdir is great when initializing a new project, however I would love to specify the name of the root directory alongside this.
Describe the solution you'd like
Having a cli flag for --rootname <folder name> would be great.
Describe alternatives you've considered
The alternative is to place a parent folder with the desired name before initializing a project. Eg: apps/testproject/supabase.
Something like this is required for multiple projects to exist within a monorepo.
Additional context
This appears to currently be hardcoded in internal/utils/misc.go.
I am unsure whether other considerations are needed such as an indicator for what is a supabase directory or not. Maybe the CLI can automatically detect this based off --workdir or the contents of the cwd.
Reacted by Thomas, Seok Chan Sean Ahn, Tadeusz Makuch, zda, Gildas Garcia, Jose Torres, szTheory, Tobias Hassebrock, Mathieu Urstein, Christian Pannwitz and 4 more
changed the title [-]Allow customization of the supabase root directory name[/-][+]feat: Allow customization of the supabase root directory name[/+]on Apr 10, 2024
Do you mean to customize like apps/testproject/custom-supabase? That wouldn't be possible because a lot of our platform's GitHub integrations depend on a directory named supabase.
If you mean apps/testproject/supabase, I think it's already supported with supabase init --workdir apps/testproject flag.
Yes I mean apps/testpropject/custom-supabase - this would be great. Maybe this can be accomplished by having the directory name specified in the config.toml instead of assumed to be supabase always?
project_id already exists in the config.toml, I assume to combat some of these issues already. Why not allow root_name or something similar as well?
@sweatybridge I'm also interested in the possibility to place Supabase directories anywhere I want in my project.
Next.JS docs encourage a structure where everything is in the src or app folder, and the root directory is only used for config files.
I can imagine a supabase.config.toml, or supabase.config.ts, or a .supabase directory in the root (personally prefer the first solution) where you would provide the paths of supabase stuff!
This could indeed be handy. I using a monorepo for multiple identical apps with the same supabase setup and would like to have separate config (with different project_id) for each project, but use the same migrations/seed etc. This would probably do the job.
changed the title [-]feat: Allow customization of the supabase root directory name[/-][+]feat: allow customization of the supabase root directory name and config paths[/+]on Oct 30, 2024
I would like to have a feature in which I can simply reset my local database once with my declarative schemas, e.g. instead of diffing it, just apply all declared schemas (sql files) as migrations once.
I think that would be a handy option keep sql code of early projects organized.
Something like db reset --use-schemas or db apply or db apply schemas.
This is unexpected, I have a monorepo as well and the need for multiple supabase dbs in the same project, I was wondering why I'm seeing all these errors in my failing CI flow, after renaming supabase/ to customer-db/.
Really expected this to be working, how else can I have multiple db's in one project?
@madsem 100%, would've done the same if separation was not sensible for us
if you use supabase CLI it should also recognize that you have 2 projects, you can set both locally \w docker, just make sure you use different ports so both work back to back locally
good luck!
Activity
[-]Allow customization of the supabase root directory name[/-][+]feat: Allow customization of the supabase root directory name[/+]sweatybridge commentedon Apr 10, 2024
Do you mean to customize like
apps/testproject/custom-supabase? That wouldn't be possible because a lot of our platform's GitHub integrations depend on a directory namedsupabase.If you mean
apps/testproject/supabase, I think it's already supported withsupabase init --workdir apps/testprojectflag.Bowbee commentedon Apr 10, 2024
Yes I mean
apps/testpropject/custom-supabase- this would be great. Maybe this can be accomplished by having the directory name specified in theconfig.tomlinstead of assumed to besupabasealways?project_idalready exists in theconfig.toml, I assume to combat some of these issues already. Why not allowroot_nameor something similar as well?sweatybridge commentedon Apr 10, 2024
config.tomllives insidesupabasedirectory though. How would you suggest we find the right config.toml file if we supportcustom-supabasedirectory?tomx-sh commentedon Apr 10, 2024
@sweatybridge I'm also interested in the possibility to place Supabase directories anywhere I want in my project.
Next.JS docs encourage a structure where everything is in the
srcorappfolder, and the root directory is only used for config files.I can imagine a
supabase.config.toml, orsupabase.config.ts, or a.supabasedirectory in the root (personally prefer the first solution) where you would provide the paths of supabase stuff!sweatybridge commentedon Apr 15, 2024
I see, so perhaps a
--config <path-to-toml>flag that can be passed to CLI to override the default location ofsupabase/config.toml.Within
config.toml, users can declare path overrides for other directories relative to the location ofconfig.toml. For eg.baffioso commentedon Aug 1, 2024
This could indeed be handy. I using a monorepo for multiple identical apps with the same supabase setup and would like to have separate config (with different
project_id) for each project, but use the same migrations/seed etc. This would probably do the job.djhi commentedon Oct 16, 2024
This would also be handy to have separate containers and volumes for running e2e tests without touching your development instances.
[-]feat: Allow customization of the supabase root directory name[/-][+]feat: allow customization of the supabase root directory name and config paths[/+]Donnerstagnacht commentedon Apr 26, 2025
I would like to have a feature in which I can simply reset my local database once with my declarative schemas, e.g. instead of diffing it, just apply all declared schemas (sql files) as migrations once.
I think that would be a handy option keep sql code of early projects organized.
Something like db reset --use-schemas or db apply or db apply schemas.
IdanDavidAviv commentedon May 24, 2025
what about changing this dir's name to
.supabaseas the dir name?git cursor and pycharm use it
madsem commentedon Jul 5, 2025
This is unexpected, I have a monorepo as well and the need for multiple supabase dbs in the same project, I was wondering why I'm seeing all these errors in my failing CI flow, after renaming
supabase/tocustomer-db/.Really expected this to be working, how else can I have multiple db's in one project?
IdanDavidAviv commentedon Jul 5, 2025
@madsem what i ended up doing is creating a git project for each db. might be a little hassle to migrate, but it was worth it in my case.
madsem commentedon Jul 5, 2025
That could def be an option, sadly not for our use case. Currently thinking of just going the route of least resistance, and just nest one more level:
etc.
IdanDavidAviv commentedon Jul 5, 2025
@madsem 100%, would've done the same if separation was not sensible for us
if you use supabase CLI it should also recognize that you have 2 projects, you can set both locally \w docker, just make sure you use different ports so both work back to back locally
good luck!
imtreydp commentedon Jun 7, 2026
@sweatybridge can we please get this added? you seem to have already agreed to adding this functionality and there's an open PR that implements it.
could you take a look and give an update? thanks in advance!
leen-neel commentedon Aug 24, 2026
@sweatybridge I'd like to take this if the design is still the one you sketched here.
First slice, matching your comments:
--config <path>so the CLI isn't hardcoded tosupabase/config.tomlsupabase/layout as the defaultCould this get
open-for-contributionso a PR won't be auto-closed? Happy to wait if the scope should be smaller.