chore: update CONTRIBUTING.md with arguments usage section (#1120)

This commit is contained in:
Andrew Tatomyr
2023-06-06 17:07:23 +03:00
committed by GitHub
parent a32fb19b6e
commit 43178790d6

View File

@@ -129,3 +129,20 @@ It only checks links within the local docs (it can't check links to other docs s
- **`packages/core/src/typings`**: contains the common Typescript typings.
- **`resources`**: contains some example API definitions and configuration files that might be useful for testing.
## Arguments usage
There are three ways of providing arguments to the CLI: environment variables, command line arguments, and Redocly configuration file.
### Environment variables
Environment variables should be used to provide some arguments that are common for all the commands.
Please avoid using environment variables if possible, as they may lead to ambiguous results. They should not affect the **core** package logic.
### Command line arguments
Use them to provide some arguments that are specific to a certain command. Think of them as modifiers. They should not affect the **core** package logic.
### Configuration file
The **redocly.yaml** file is the most flexible way of providing arguments. Please use it to provide arguments that are common for all the commands, for a specific command, or for a specific API. It could be used for providing arguments for both **cli** and **core** packages. Please refer to the [configuration file](https://redocly.com/docs/cli/configuration/) documentation for more details.