@devries-cameron20 / t3code Mirror · read-only / commits / df2dfde0ee
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 05:45 UTC

fix(cli): t3 up's pairing hint keeps --base-dir (#29684)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Alex Southwell committed Nov 3, 2026 at 23:16 UTC df2dfde0ee8f8a2273e9dfccf964c2df8cecdd3b
2 files changed +12 -5
apps/server/src/cli/up.test.ts
+2 -1
@@ -182,6 +182,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer, NetService.layer))
182 },
183 {
184 label: "the local network opens",
185 + prints: "Run `t3 pair --base-dir <baseDir>`.",
186 installed: true,
187 env: "T3CODE_LAN=false\n",
188 args: ["--lan"],
@@ -337,7 +338,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer, NetService.layer))
338 ),
339 );
340 if (input.prints !== undefined) {
340 - expect(lines.join("\n")).toContain(input.prints);
341 + expect(lines.join("\n")).toContain(input.prints.replace("<baseDir>", baseDir));
342 }
343 expect(exit._tag).toBe(input.restartFails === true ? "Failure" : "Success");
344 expect({ installs, restarts }).toEqual({
apps/server/src/cli/up.ts
+10 -4
@@ -171,12 +171,12 @@ const formatSetup = (setup: Setup) => {
171 ].join("\n");
172 };
173
174 -const formatNextSteps = (routes: Routes, serviceInstalled: boolean) =>
174 +const formatNextSteps = (routes: Routes, serviceInstalled: boolean, pairCommand: string) =>
175 [
176 ...(routes.connect
177 ? ["On your other device, sign in to T3 Connect with the same account."]
178 : []),
179 - ...(routes.lan ? ["Run `t3 pair`. Use the code on your other device."] : []),
179 + ...(routes.lan ? [`Run \`${pairCommand}\`. Use the code on your other device.`] : []),
180 ...(routes.connect || routes.lan
181 ? []
182 : [
@@ -197,6 +197,11 @@ const setUp = Effect.fn("cli.up")(function* (flags: {
197 }) {
198 const { baseDir } = yield* ServerConfig.ServerConfig;
199 const service = yield* BootService.BootService;
200 + const baseDirArgs = Option.match(flags.baseDir, {
201 + onNone: () => [],
202 + onSome: (dir) => ["--base-dir", dir],
203 + });
204 + const { command: pairCommand } = yield* resolveHostCliCommand("pair", baseDirArgs);
205 const before = yield* readSetup();
206 if (before.connect === null && Option.getOrElse(flags.connect, () => false)) {
207 return yield* new CliError.UserError({
@@ -252,7 +257,7 @@ const setUp = Effect.fn("cli.up")(function* (flags: {
257 yield* disconnectCloud({ clearAuthorization: false });
258 }
259 if (current.lan) yield* CliService.writeServiceEnv(baseDir, { T3CODE_LAN: "false" });
255 - return yield* Console.log(formatNextSteps(routes, false));
260 + return yield* Console.log(formatNextSteps(routes, false, pairCommand));
261 }
262 const { installedVersion } = before.service;
263 const newer =
@@ -327,7 +332,7 @@ const setUp = Effect.fn("cli.up")(function* (flags: {
332
333 const printServeCommand = Effect.fn(function* (reason: string) {
334 const { command } = yield* resolveHostCliCommand("serve", [
330 - ...Option.match(flags.baseDir, { onNone: () => [], onSome: (dir) => ["--base-dir", dir] }),
335 + ...baseDirArgs,
336 // Explicit either way, so a T3CODE_LAN in the shell cannot override the choice.
337 routes.lan ? "--lan" : "--no-lan",
338 ]);
@@ -408,6 +413,7 @@ const setUp = Effect.fn("cli.up")(function* (flags: {
413 `\nThis machine\n${formatSetup(after)}\n\n${formatNextSteps(
414 { connect: after.connect === true, lan: after.lan },
415 after.service.installed,
416 + pairCommand,
417 )}`,
418 );
419 });