From 5a1d5d6a49a8321e8916385a237cc267b843579f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Guti=C3=A9rrez?= <35082514+alezmad@users.noreply.github.com> Date: Sun, 3 May 2026 14:52:50 +0100 Subject: [PATCH] fix(cli): rename syncs local config + picker shows display name After renaming the mesh display name on the server, the launch picker still showed the slug ("flexicar-2") because (a) local config.json was not updated and (b) the picker only printed mesh.slug. Now: rename writes the new name back into config.json on success, and the picker prints "name (slug)" when they differ. Also surfaces a hint that slugs are immutable (today). Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/cli/package.json | 2 +- apps/cli/src/commands/launch.ts | 3 ++- apps/cli/src/commands/rename.ts | 7 +++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/cli/package.json b/apps/cli/package.json index 4ac6ed8..5ecf7c9 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -1,6 +1,6 @@ { "name": "claudemesh-cli", - "version": "1.19.2", + "version": "1.19.3", "description": "Peer mesh for Claude Code sessions — CLI + MCP server.", "keywords": [ "claude-code", diff --git a/apps/cli/src/commands/launch.ts b/apps/cli/src/commands/launch.ts index 1516cf2..32a0bd3 100644 --- a/apps/cli/src/commands/launch.ts +++ b/apps/cli/src/commands/launch.ts @@ -49,7 +49,8 @@ async function pickMesh(meshes: JoinedMesh[]): Promise { console.log("\n Select mesh:"); meshes.forEach((m, i) => { - console.log(` ${i + 1}) ${m.slug}`); + const label = m.name && m.name !== m.slug ? `${m.name} \x1b[2m(${m.slug})\x1b[0m` : m.slug; + console.log(` ${i + 1}) ${label}`); }); console.log(""); diff --git a/apps/cli/src/commands/rename.ts b/apps/cli/src/commands/rename.ts index 6834052..3218b20 100644 --- a/apps/cli/src/commands/rename.ts +++ b/apps/cli/src/commands/rename.ts @@ -1,6 +1,7 @@ import { rename as renameMesh } from "~/services/mesh/facade.js"; import { getStoredToken } from "~/services/auth/facade.js"; import { ApiError } from "~/services/api/facade.js"; +import { readConfig, setMeshConfig } from "~/services/config/facade.js"; import { bold, dim, green, icons } from "~/ui/styles.js"; import { EXIT } from "~/constants/exit-codes.js"; @@ -19,7 +20,13 @@ export async function rename(slug: string, newName: string): Promise { try { await renameMesh(slug, newName); + // Sync the new name into local config so launch / picker + // reflect the change without waiting for the next sync. + const cfg = readConfig(); + const local = cfg.meshes.find((m) => m.slug === slug); + if (local) setMeshConfig(slug, { ...local, name: newName }); console.log(` ${green(icons.check)} Renamed "${slug}" to "${newName}"`); + console.log(` ${dim("(slug stays \"" + slug + "\" — only the display name changed)")}`); return EXIT.SUCCESS; } catch (err) { if (err instanceof ApiError) {