-
Go to
https://api.sanity.io/v1/auth/login/github?type=token&origin=http://localhost
Exchange
github
forgoogle
if you prefer that. You don't need anything running on localhost. -
Pick out the value of the sid param in the return url trying to load on localhost.
-
Load
https://api.sanity.io/v1/auth/fetch?sid=xxxx
using thesid
value from above. -
Pick out the token from the result.
Create on the remote server in the home directory for the user running the CLI:
~/.config/sanity/config.json
Set the contents to this, replacing "yyyy" with the token value from above:
{
"authToken": "yyyy",
"authType": "normal"
}