Allow `.env.local` file for the CLI

Currently you can only get the token from .env specifically. In most of our projects we use env.local.

The only solution I managed to make work, when running the generator via a package.json script was:

dotenv -e .env.local -- bash -c 'npx --package=@datocms/cli@latest datocms schema:generate src/schema.ts --api-token $DATOCMS_API_TOKEN'

I would like to be able to specify which .env file to load.

Fixed: https://github.com/datocms/cli/issues/42#issuecomment-3571166962

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed. If you need help with a similar issue, please start a new topic instead.