mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-11 00:06:06 +00:00
feat(cli): add Claude CLI/Desktop detection hints in wmill flow new
Show contextual instructions for previewing flows based on available tools. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
3272c29c2e
commit
8009960ab1
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user