diff --git a/packages/cli/src/index.js b/packages/cli/src/index.js index cd2dc2502650..e91c0b3d8d03 100644 --- a/packages/cli/src/index.js +++ b/packages/cli/src/index.js @@ -227,6 +227,10 @@ async function runYargs() { // Load any CLI plugins await loadPlugins(yarg) + // We explicitly set the version here so that it's always available + const pkgJson = require('../package.json') + yarg.version(pkgJson['version']) + // Run await yarg.parse(process.argv.slice(2), {}, (err, _argv, output) => { // Configuring yargs with `strict` makes it error on unknown args;