When using sanity CLI commands, NODE_ENV does not appear to be set.
My usecase was to customize the basePath in sanity.cli.ts based on the NODE_ENV.
To verify:
- clone the official Next.js starter: https://github.com/sanity-io/sanity-template-nextjs-clean
- add
console.log(process.env) to sanity.cli.ts
- try to run
npx sanity dev for instance, observe NODE_ENV not being among the variables