This PR refactors the add-chain tool to improve DevX in two ways:
make the .env file optional
does not require flags not needed for a given subcommand
This is achieved by extracting the default action (what happens when the tool is run without a subcommand) into a command in the cmd directory, and adding logic to the app entrypoint to call it if no subcommand is provided. This then allows us to set flags at the subcommand level, which means flags set as required will no longer cause subcommands not needing them to fail if they're not provided. In addition, this simplifies some command's logic by making it unnecessary to manually check if required flags are provided.
Description
This PR refactors the
add-chain
tool to improve DevX in two ways:.env
file optionalThis is achieved by extracting the default action (what happens when the tool is run without a subcommand) into a command in the
cmd
directory, and adding logic to the app entrypoint to call it if no subcommand is provided. This then allows us to set flags at the subcommand level, which means flags set asrequired
will no longer cause subcommands not needing them to fail if they're not provided. In addition, this simplifies some command's logic by making it unnecessary to manually check if required flags are provided.Metadata