There is a small inconsistency in getsby-cli. Global installed one shows version of gatsby-cli but local one (from projects node_modules/) shows version of gatsby package instead.

This is because gatsby-cli uses default yargs --version command implementation which is trying to find out who calls the script and find it's package.json to extract version from. In local installed version it finds node_modules/gatsby/package.json instead of node_modules/gatsby-cli/package.json
yarn global add gatsby-cli for examplegatsby new hello-world https://github.com/gatsbyjs/gatsby-starter-hello-world && cd hello-worldgatsby --versionyarn gatsby --versionBoth CLI --version commands returns CLI package version.
Global CLI returns gatsby-cli version. Local CLI from hello-world returns version of gatsby package.
System:
OS: macOS 10.14.3
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
Yarn: 1.10.1 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.15.3/bin/npm
Languages:
Python: 2.7.15 - /usr/local/bin/python
Browsers:
Chrome: 73.0.3683.86
Firefox: 66.0.2
Safari: 12.0.3
npmPackages:
gatsby: 2.3.3 => 2.3.3
gatsby-image: ^2.0.35 => 2.0.36
gatsby-plugin-manifest: ^2.0.25 => 2.0.26
gatsby-plugin-offline: ^2.0.25 => 2.0.25
gatsby-plugin-react-helmet: ^3.0.11 => 3.0.11
gatsby-plugin-sharp: ^2.0.32 => 2.0.32
gatsby-plugin-typescript: ^2.0.11 => 2.0.11
gatsby-source-filesystem: ^2.0.28 => 2.0.28
gatsby-source-graphql: ^2.0.15 => 2.0.15
gatsby-transformer-sharp: ^2.1.17 => 2.1.17
what I think would be best is to implement custom --version handler and for both cases report:
gatsby-cli version (if installed),gatsby version (if we are in gatsby project directory)I'm not sure if there is much value in reporting local gatsby-cli version?
Hi, I understand this issue. Would like to work on it but where do we implement the custom version? Thanks!
I'm not sure if there is much value in reporting local
gatsby-cliversion?
Disagree. When you have "build": "gatsby build", in your package.json, you are actually using local gatsby-cli package so it would be nice to know what version this CLI is.
other CLI that I use here,graphql-cli, is consistent:

Hi, I understand this issue. Would like to work on it but where do we implement the custom version? Thanks!
gatsby-cli/create-cli.js I guess. It implements yargs handlers and it seems it already knows it's package version https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-cli/src/create-cli.js#L325
Can I please be assigned to this issue? Would love to take a closer look and take a shot at it over the weekend?
@hassan3095 I can't directly assign you but I've setup the label. Please let us know if we can assist with anything.
I have something to propose to resolve this issue if @hassan3095 doesn't have time to work on it.
@pyaillet Yes please, I took a shot at it but wasn't successful.
Fix published in [email protected]