-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Describe the feature you'd like to request
I'd like to be able to specify global defaults for the cli.
Describe the solution you'd like
Options like --cache-dir
are best configured globally instead of always setting them in each command that is run. In general, I think it would be good to read these configuration options (with increasing priority):
- From the package.json configuration
- From an environment variable
- From a cli option
Personally, I've adopted this pattern for literally every option in the cli tools that I maintain. There's always a weird edge case where in some environment you want to override one of the options conveniently via a environment variable (e.g. in CI) for instance.
Describe alternatives you've considered
The CLI options are currently very strictly parsed with positional arguments first and options second only. E.g. this is valid:
yarn turbo run build --cache-dir=.turbo
but this isn't:
yarn turbo run --cache-dir=.turbo build
This means that currently it's also not possible to e.g. specify a common base command like
"scripts": {
...
"turbo:run": "turbo run --cache-dir=.turbo"
...
}