Skip to content

fix(connect): suggest a serve command that matches how you ran connect - #4897

Merged
t3dotgg merged 2 commits into
mainfrom
t3code/connect-runner-aware-copy
Jul 30, 2026
Merged

fix(connect): suggest a serve command that matches how you ran connect#4897
t3dotgg merged 2 commits into
mainfrom
t3code/connect-runner-aware-copy

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Jul 30, 2026

Copy link
Copy Markdown
Member

Problem

npx t3@nightly connect ends with:

Next
Start the server with t3 serve to make this machine reachable.

Copy/pasting that fails on any machine without a global t3 install — which is exactly the machine that just ran connect through npx. Same story for bunx and pnpm dlx.

Solution

Detect how the CLI was launched from its entry path (npx / pnpm dlx / bunx caches each have a distinctive layout) and re-derive the channel from the running version, then render the suggestion to match:

  • npx t3@nightly connectStart the server with `npx t3@nightly serve`
  • bunx t3 connectStart the server with `bunx t3 serve`
  • t3 connect (global install / repo checkout) → Start the server with `t3 serve`

Detection is best-effort and fails closed to plain t3 serve. The suggestion is only shown when the user did not opt into the background service — that path keeps its existing "Background service ready" copy. Applies to both t3 connect and t3 connect link.


Change made by Claude Fable 5 via Claude Code.


Note

Low Risk
CLI messaging and small pure helpers with unit tests; no auth, networking, or persistence changes.

Overview
Connect success copy no longer hardcodes t3 serve. It now suggests a copy-pasteable command that mirrors how the user launched the CLI (npx, pnpm dlx, bunx, or plain t3), including t3@nightly when the running build is nightly.

New invocation.ts helpers infer the package runner from the process entry path, derive the package spec from package.json version, and resolveCliCommand wires that into Effect via host process args. connect link and the main connect flow use it; the background-service success path still shows the existing message and returns early without a serve hint.

Reviewed by Cursor Bugbot for commit 43f87e8. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix connect CLI to suggest a serve command matching the actual invocation context

  • Adds resolveCliCommand in invocation.ts, an Effect-based helper that detects the package runner (npx, pnpm dlx, bunx) and build channel (nightly vs stable) from the process entry path and formats a matching CLI suggestion.
  • Updates connectLinkCommand and connectCommand in connect.ts to use resolveCliCommand instead of the hardcoded string 't3 serve' in their success/next-step messages.
  • Adds unit tests in invocation.test.ts covering runner detection, package spec selection, and command formatting across runners and versions.

Macroscope summarized 43f87e8.

`npx t3@nightly connect` used to end with "Start the server with `t3
serve`" — a command that fails on machines without a global install.
Detect the package runner (npx / pnpm dlx / bunx) from the CLI entry
path and the nightly channel from the running version, and render the
suggestion to match: `npx t3@nightly serve`, `bunx t3 serve`, or plain
`t3 serve` for stable installs. Detection fails closed to `t3 serve`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b6392f90-85ee-4971-8ce3-9f6dc2a46a94

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jul 30, 2026
Comment thread apps/server/src/cli/invocation.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4ecb6fc. Configure here.

Comment thread apps/server/src/cli/invocation.ts Outdated
Comment thread apps/server/src/cli/invocation.ts
@macroscopeapp

macroscopeapp Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved 43f87e8

This PR adds pure utility functions to format CLI command suggestions matching the user's invocation method (npx, bunx, pnpm dlx). Changes only affect displayed help text, are well-tested, and have no runtime behavior impact beyond UX messaging.

You can customize Macroscope's approvability policy. Learn more.

Review bots correctly flagged that pnpm dlx and bunx entry paths use
backslashes on Windows and would fall back to the bare `t3` suggestion.
Normalize separators once and match forward-slash segments, and add the
Windows pnpm-cache/dlx layout.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@t3dotgg
t3dotgg merged commit 6ab2f16 into main Jul 30, 2026
17 checks passed
@t3dotgg
t3dotgg deleted the t3code/connect-runner-aware-copy branch July 30, 2026 08:46
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Jul 30, 2026
## What's Changed
* fix(connect): suggest a serve command that matches how you ran connect by @t3dotgg in pingdotgg/t3code#4897
* fix(mobile): stop shared content errors in Personal Team builds by @t3dotgg in pingdotgg/t3code#4943
* perf(mobile): sends respond instantly, thread opens stop freezing by @t3dotgg in pingdotgg/t3code#4882
* fix(web): show Codex fast mode as a bolt by @t3dotgg in pingdotgg/t3code#4947
* docs: seed worktrees with a copy of real userdata instead of banning it by @t3dotgg in pingdotgg/t3code#4949


**Full Changelog**: pingdotgg/t3code@v0.0.32-nightly.20260730.954...v0.0.32-nightly.20260730.955

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.32-nightly.20260730.955
tarik02 added a commit to tarik02-org/t3code that referenced this pull request Jul 30, 2026
* fix(desktop): restore T3 Connect sign-in (pingdotgg#4809)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* Simplify files panel header (pingdotgg#4828)

* build(desktop): reduce installed app size by ~300MB (pingdotgg#4824)

* Update model version from claude-opus-4-8 to claude-opus-5 (pingdotgg#4832)

* Preserve the thread shell while detail loads (pingdotgg#4830)

* Reduce idle work and disk churn with native resource diagnostics (pingdotgg#2679)

Co-authored-by: codex <codex@users.noreply.github.com>

* fix(server): detect repositories after initialization (pingdotgg#4848)

* perf(server): merge separate staged/unstaged numstat calls into single diff HEAD --numstat (pingdotgg#4843)

* fix(git): disable external diff for review diff previews (pingdotgg#4854)

* Fix editable file focus and live syntax highlighting (pingdotgg#3979)

* fix(web): remember the rendered-markdown choice across threads (pingdotgg#4853)

Co-authored-by: Simon Doba <simon.doba@orbit.de>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

* chore(release): prepare v0.0.31

* fix(mobile): reduce thread feed scroll jank (pingdotgg#4874)

* fix(web): restore sidebar v2 thread actions and terminal icon (pingdotgg#4712)

* fix(web): settle button now works on hover, not just right-click (pingdotgg#4905)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(clients): disable add project while disconnected (pingdotgg#4834)

* fix(composer): hide default Codex service tier (pingdotgg#4784)

* docs: link iOS and Android app store downloads (pingdotgg#4902)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(web): align remote server update action (pingdotgg#4731)

* fix(connect): suggest a serve command that matches how you ran connect (pingdotgg#4897)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(mobile): stop shared content errors in Personal Team builds (pingdotgg#4943)

* perf(mobile): sends respond instantly, thread opens stop freezing (pingdotgg#4882)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(web): show Codex fast mode as a bolt (pingdotgg#4947)

* docs: seed worktrees with a copy of real userdata instead of banning it (pingdotgg#4949)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(mobile): support dragged images in the composer (pingdotgg#4953)

* fix(mobile): stop long iOS threads from jumping while scrolling up (pingdotgg#4867)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(web): keep worktree default when switching a draft's machine (pingdotgg#4964)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* perf(mobile): reconnect environments immediately on resume (pingdotgg#4878)

* feat(web): pasting a huge screenshot now compresses it instead of erroring (pingdotgg#4967)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* feat(web): regenerate thread titles from sidebar (pingdotgg#4810)

* fix(web): show server update progress through reconnect (pingdotgg#4903)

---------

Co-authored-by: Alex <me@pixp.cc>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: wukko <me@wukko.me>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Wout Stiens <71498452+StiensWout@users.noreply.github.com>
Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com>
Co-authored-by: ohbentos <72638975+ohbentos@users.noreply.github.com>
Co-authored-by: Jake Leventhal <jakeleventhal@me.com>
Co-authored-by: Simon Doba <simon.doba@hotmail.de>
Co-authored-by: Simon Doba <simon.doba@orbit.de>
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
Co-authored-by: Gabriel De Andrade <30420087+gabrielelpidio@users.noreply.github.com>
Co-authored-by: Jono Kemball <Noojuno@users.noreply.github.com>
Co-authored-by: Theo Browne <me@t3.gg>
Co-authored-by: Max Katz <me@maxkatz.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant