Repository navigation
feat(cli): make first-run hints runnable and announce newer versions - #187
Merged
Merged
Conversation
Server spans said which MCP method ran but not which client called it, so a deployment couldn't tell which CLI or editor versions are still in use. Each request span now carries mcp.client.name and mcp.client.version from the client's clientInfo: from the request's _meta on protocol 2026-07-28, or, on older protocols, from initialize, kept for the rest of the transport's requests. The client reports these values itself, so each is cut to 128 characters, and a missing or empty value adds no attribute.
Run through npx, the CLI ended sign-in with "Try telemetry traces", a command that isn't on PATH after npx exits. Every printed command, usage line, and JSON hint now starts with the command that started the CLI: npx, pnpm dlx, or bunx @telemetry-dev/cli, detected from the script's path, or telemetry otherwise. A runner start also gets one line saying how to install the CLI. Hints never print npx telemetry, which runs an unrelated npm package. On a terminal, the CLI asks npm's dist-tags for the latest version at most once a day, alongside the command, and drops the request when the command finishes first, so no command waits for it. A newer stable version gets one line on stderr with the update command for how the CLI was installed. It never installs anything. A project's dependency, CI, --json, and TELEMETRY_DEV_NO_UPDATE_CHECK or NO_UPDATE_NOTIFIER skip the check. status --json and login --json report cli_version and the cached latest_cli_version. Other fixes to first-run and everyday use: - A new sign-in keeps the default project when the workspace still has it. Before, every re-login dropped it, so the next command asked for a project. - status checks the saved sign-in with one call. A refused sign-in exits 4 with signed_in false. A check that can't run, such as offline or a token endpoint that fails, keeps the saved sign-in, says so on stderr, and sets sign_in_verified false. A refresh that gets no answer is now a retryable server_error rather than an expired sign-in. - An empty unfiltered traces search points to the quickstart, and says experiment runs need --env experiment. The home screen leads with setting a default project when none is set. - Network errors name the configured server, and a proxy that Node.js ignores is named with the setting or version that would use it. - login also takes the pasted callback address while it waits for the browser. Ctrl-D stops only the prompt, or cancels without a browser. - On Windows, printed commands use double quotes, and a command that no quoting keeps as typed isn't printed. - Options before the command get the reordered command as the hint. Messages don't wrap commands in backticks, which a shell would run. An empty sessions search suggests only wider ranges. Failed spans in trace show their id for payload. -v prints the version.
…any prefix Hints said telemetry under yarn dlx and under pnpm dlx with a moved cache directory, where nothing puts telemetry on PATH. Both are now recognized from where they unpack the package. bunx is recognized only from its bunx-<uid>- cache folder, so a project folder named bunx-demo is no longer taken for it. npm's global folder was recognized only by its usual names, so a global install under a custom prefix, nvm-windows, fnm, or Scoop got no update notice. It is now recognized by npm's layout: lib/node_modules on macOS and Linux, or the telemetry.cmd shim npm writes on Windows. Any other node_modules stays a project's dependency, which covers Yarn Plug'n'Play's global cache, pnpm's global virtual store, and Deno. Windows' Yarn and Volta folders and pnpm globals under any PNPM_HOME get their own update command.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Run through npx, the CLI ended sign-in with "Try telemetry traces", but npx leaves no
telemetryon PATH, so the suggested command failed withcommand not found. Every printed command, usage line, and JSONhintnow starts with the command that started the CLI:npx @telemetry-dev/cli,pnpm dlx @telemetry-dev/cli,yarn dlx @telemetry-dev/cli, orbunx @telemetry-dev/cli, andtelemetryotherwise. The runner is detected from the folder it unpacked the package into, including a pnpm cache directory that was moved. A runner start also prints one line on how to install the CLI. No hint printsnpx telemetry, because that name runs an unrelated npm package.The CLI had no way to tell people about new versions. On a terminal, it now asks npm's dist-tags for the latest version at most once a day. The request runs alongside the command and is dropped if the command finishes first, so no command waits for it. A newer stable version gets one stderr line with the update command for how the CLI was installed: npm's global folder under any prefix (recognized by
lib/node_modules, or by thetelemetry.cmdnpm writes on Windows), pnpm, bun, Yarn classic, or Volta. Any othernode_modulesis a project's dependency, including Yarn Plug'n'Play's cache, and gets no check. The CLI never installs anything itself. There is no check in CI, with--json, or whenTELEMETRY_DEV_NO_UPDATE_CHECKorNO_UPDATE_NOTIFIERis set.status --jsonandlogin --jsonreportcli_versionand the cachedlatest_cli_version.On the server side,
@telemetry-dev/mcpnow recordsmcp.client.nameandmcp.client.versionfrom the client'sclientInfoon each request span, cut to 128 characters. telemetry.dev records them after this package is released andapps/webmoves to that version.Other first-run and everyday fixes:
statuschecks the saved sign-in with onelist_projectscall. A refused sign-in exits 4 withsigned_in: false. When the check can't run, for example offline or while the token endpoint fails, it keeps the saved sign-in, says so on stderr, and setssign_in_verified: false. A refresh that gets no answer is now a retryableserver_error, notsign_in_expired.tracespoints to the quickstart, and says that experiment runs need--env experiment. With no default project set, the home screen says how to set one.HTTPS_PROXYis set but Node.js ignores it, the error says which setting or Node.js version would use it.loginalso accepts the pasted callback address while it waits for the browser, for a browser on another device or one that never opened.sessionssearch suggests only wider ranges. Failed spans intraceshow the span id thatpayloadtakes.-vprints the version.Not covered yet: bun and Yarn classic global folders moved to a custom location are taken for project dependencies, so they get no update notice.
Tests run:
vp test runinpackages/cli(46 passed) andpackages/mcp(33 passed), andvp check. Each new assertion fails when the code it covers is removed.