Global Options
Global Options are options that Hardhat can receive and are available across all of its functionality.
They are different from Hardhat Task options and arguments in that they are meant to control the functionality of Hardhat itself, and not that of a single task.
For example, --network is a global option that controls the default value that network.connect() uses when no network config name is provided.
Plugins can define their own Global Options, so the complete list depends on your setup. To see all available options, run:
npx hardhat --helppnpm hardhat --helpyarn hardhat --helpGlobal Options and environment variables
Section titled “Global Options and environment variables”Global Options can also be provided using environment variables formatted like HARDHAT_<SCREAMING_SNAKE_CASE>. For example, you can run:
HARDHAT_NETWORK=localhost npx hardhat run script/my-script.tsHARDHAT_NETWORK=localhost pnpm hardhat run script/my-script.tsHARDHAT_NETWORK=localhost yarn hardhat run script/my-script.tsIf both the environment variable and the command line argument are provided, the latter takes precedence.