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:"),