diff --git a/cli/src/commands/flow/flow.ts b/cli/src/commands/flow/flow.ts index e0d651ff0c..35cc684bf7 100644 --- a/cli/src/commands/flow/flow.ts +++ b/cli/src/commands/flow/flow.ts @@ -4,7 +4,8 @@ import { Command } from "@cliffy/command"; import { Confirm } from "@cliffy/prompt/confirm"; import { Table } from "@cliffy/table"; import * as log from "../../core/log.ts"; -import { sep as SEP, join as pathJoin } from "node:path"; +import { sep as SEP, join as pathJoin, resolve as pathResolve } from "node:path"; +import { execSync } from "node:child_process"; import { stringify as yamlStringify } from "yaml"; import { yamlParseFile } from "../../utils/yaml.ts"; import * as wmill from "../../../gen/services.gen.ts"; @@ -555,6 +556,36 @@ export function bootstrap( JSON.stringify(launchJson, null, 2) + "\n", "utf-8", ); + + log.info(colors.green(`Created flow at ${flowDirFullPath}`)); + + // Detect Claude CLI and Claude Desktop + let hasClaudeCli = false; + let hasClaudeDesktop = false; + try { + execSync("which claude", { stdio: "ignore" }); + hasClaudeCli = true; + } catch {} + try { + execSync("ls /Applications/Claude.app", { stdio: "ignore" }); + hasClaudeDesktop = true; + } catch {} + + if (hasClaudeCli && hasClaudeDesktop) { + log.info(""); + log.info(colors.bold("To develop this flow with Claude Desktop:")); + log.info(colors.gray(` 1. cd ${flowDirFullPath} && claude`)); + log.info(colors.gray(` 2. Type /desktop to open the session in Claude Desktop`)); + } else if (hasClaudeCli) { + log.info(""); + log.info(colors.bold("To preview this flow:")); + log.info(colors.gray(` wmill dev --path ${flowPath}`)); + } else if (hasClaudeDesktop) { + const absFlowDir = pathResolve(flowDirFullPath); + log.info(""); + log.info(colors.bold("To develop this flow with Claude Desktop:")); + log.info(colors.gray(` Open Claude Desktop with "${absFlowDir}" as root folder`)); + } } const command = new Command()