I have multiple sanity projects in my account. How can I switch to a particular account/project in my sanity cli for deploying the schema to correct project ?
Asked
Active
Viewed 533 times
0
-
1What commands are you using? Usually the CLI is run in the folder of the sanity project. If you want a different project, why not try and change the folder? – evolutionxbox Feb 03 '22 at 14:46
-
Yes, I using it in folder of sanity project. It seems currently sanity CLI does not provide a way to deploy to particular project id. – user9040429 Feb 04 '22 at 13:37
1 Answers
0
Currently sanity CLI does not provide a direct way to deploy schema to particular projectID. But it can be done in to ways:
- Type
sanity init
in your sanity project and then select your project id. - Just change the projectID in sanity.json.

user9040429
- 690
- 1
- 8
- 29
-
2Why would it? Sanity projects are contained within different folders? I'm a little confused why you'd need this? Would you explain? – evolutionxbox Feb 04 '22 at 13:48
-
I was just replicating a sanity project. Just wanted to deploy to another account with same content. – user9040429 Feb 14 '22 at 13:07
-
@evolutionxbox perhaps if you were creating a whitelabel site for another client, different "project" same source code. – jfgilmore Dec 19 '22 at 00:57
-
@jfgilmore a solution could be to copy white-label template, and run the commands from that folder? – evolutionxbox Dec 19 '22 at 01:00