From b0dc5381193777ecf2ab3881b610a62914b9ca6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Guti=C3=A9rrez?= <35082514+alezmad@users.noreply.github.com> Date: Tue, 7 Apr 2026 23:49:37 +0100 Subject: [PATCH] feat(cli): nudge user to join a mesh when install finds none After MCP registration and hooks setup, `claudemesh install` now checks the config for joined meshes. If empty, it prints actionable guidance (join command + dashboard URL) instead of the generic "Next:" line. Co-Authored-By: Claude Sonnet 4.6 --- apps/cli/src/commands/install.ts | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/apps/cli/src/commands/install.ts b/apps/cli/src/commands/install.ts index 59ac6af..b27d3f7 100644 --- a/apps/cli/src/commands/install.ts +++ b/apps/cli/src/commands/install.ts @@ -29,6 +29,7 @@ import { homedir, platform } from "node:os"; import { dirname, join, resolve } from "node:path"; import { fileURLToPath } from "node:url"; import { spawnSync } from "node:child_process"; +import { loadConfig } from "../state/config"; const MCP_NAME = "claudemesh"; const CLAUDE_CONFIG = join(homedir(), ".claude.json"); @@ -451,12 +452,35 @@ export function runInstall(args: string[] = []): void { console.log(dim("· Hooks skipped (--no-hooks)")); } + // Check if user has any meshes joined — nudge them if not. + let hasMeshes = false; + try { + const meshConfig = loadConfig(); + hasMeshes = meshConfig.meshes.length > 0; + } catch { + // Config missing or corrupt — treat as no meshes. + } + console.log(""); console.log(yellow(bold("⚠ RESTART CLAUDE CODE")) + yellow(" for MCP tools to appear.")); - console.log(""); - console.log( - `Next: ${bold("claudemesh join https://claudemesh.com/join/")}`, - ); + + if (!hasMeshes) { + console.log(""); + console.log(yellow("No meshes joined.") + " To connect with peers:"); + console.log( + ` ${bold("claudemesh join ")}` + + dim(" — join an existing mesh"), + ); + console.log( + ` ${dim("Create one at")} ${bold("https://claudemesh.com/dashboard")}`, + ); + } else { + console.log(""); + console.log( + `Next: ${bold("claudemesh join https://claudemesh.com/join/")}`, + ); + } + console.log(""); console.log( yellow("⚠ For real-time push messages from peers, launch with:"),