nimbella / nimbella-cli

Your cloud. Beautiful.
https://nimbella.com
Apache License 2.0
10 stars 12 forks source link

Make the user agent string tailorable via the process environment #243

Closed joshuaauerbachwatson closed 2 years ago

joshuaauerbachwatson commented 2 years ago

When using Nimbella CLI or Nimbella Deployer via library interfaces, there is an opportunity to set the user agent string on the initializeAPI call. But, when invoking the CLI at a terminal, the initializeAPI call has so far used a hard-coded constant so there is no opportunity to tailor the user agent string by context.

This change introduces the environment variable NIM_USER_AGENT which can be used to set an alternative user agent string. If the environment variable is unset (or set to the empty string), then the hard-coded constant is used as before.

The change is motivated by the fact that nim is often used in a context where it is embedded in something else and the generic user agent string is not informative enough.