MCPcopy Create free account
hub / github.com/ForestHubAI/edge-agents / openCommand

Function openCommand

ts/workflow-cli/cli/open.ts:25–41  ·  view source on GitHub ↗
(args: string[])

Source from the content-addressed store, hash-verified

23 * directory.
24 */
25export async function openCommand(args: string[]): Promise<void> {
26 const filePath = args.find((a) => !a.startsWith("-"));
27 const mode = resolveOpenMode(args, process.env);
28
29 let resolvedFile: string | undefined;
30 let allowRoot: string | undefined;
31 if (filePath) {
32 resolvedFile = path.resolve(process.cwd(), filePath);
33 allowRoot = path.dirname(resolvedFile);
34 }
35
36 if (mode === "static") {
37 await openStatic(resolvedFile, allowRoot);
38 } else {
39 await openDev(resolvedFile, allowRoot);
40 }
41}
42
43/**
44 * STATIC: serve the bundled SPA (`<pkg>/dist`, a sibling of this file's `dist-cli`)

Callers 1

index.tsFile · 0.90

Calls 3

resolveOpenModeFunction · 0.90
openStaticFunction · 0.85
openDevFunction · 0.85

Tested by

no test coverage detected