Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add app/version useragent for tracking clients in runtime #814

Merged
merged 7 commits into from
Nov 9, 2024
7 changes: 7 additions & 0 deletions src/BaseCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ class BaseCommand extends Command {
await super.init()
// setup a prompt that outputs to stderr
this.prompt = inquirer.createPromptModule({ output: process.stderr })

// set User-Agent for runtime calls
// ex. aio-cli-plugin-app/@adobe/aio-cli/10.3.1 (darwin-arm64; node-v18.20.4; zsh)
const vs = this.config.versionDetails
// some tests might not have this set, so we use ? nullish coalescing
process.env.__OW_USER_AGENT =
`aio-cli-plugin-app/${vs?.cliVersion} (${vs?.architecture}; ${vs?.nodeVersion}; ${vs?.shell})`
}

async getLibConsoleCLI () {
Expand Down