This PR updates the CLI to look for NEXMO_API_KEY and NEXMO_API_SECRET environment variables to load the configuration before looking to see if a .nexmorc file has been created.
The motivation for this was in utilizing the CLI in automation tasks (such as GH Actions) required calling:
I was originally going to look into --api-key and --api-secret flags, but I wasn't sure how to add those globally. If there's an easier way to go about doing it, please feel free to reject the PR and I will look into the alternatives.
Other Information
I chose to allow the environment to override the file. This is also useful when testing things using multiple accounts because the environment can be changed at runtime without needing to use a local .nexmorc or modifying an existing .nexmorc.
Summary
This PR updates the CLI to look for
NEXMO_API_KEY
andNEXMO_API_SECRET
environment variables to load the configuration before looking to see if a.nexmorc
file has been created.The motivation for this was in utilizing the CLI in automation tasks (such as GH Actions) required calling:
This allows for the environment to be used as follows:
I was originally going to look into
--api-key
and--api-secret
flags, but I wasn't sure how to add those globally. If there's an easier way to go about doing it, please feel free to reject the PR and I will look into the alternatives.Other Information
I chose to allow the environment to override the file. This is also useful when testing things using multiple accounts because the environment can be changed at runtime without needing to use a local
.nexmorc
or modifying an existing.nexmorc
.