MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / openRunningLocalWebApp

Function openRunningLocalWebApp

apps/cli/src/main.ts:3142–3158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3140};
3141
3142const openRunningLocalWebApp = (): Effect.Effect<
3143 void,
3144 never,
3145 FileSystem.FileSystem | PlatformPath.Path
3146> =>
3147 Effect.gen(function* () {
3148 const manifest = yield* readActiveLocalServerManifest().pipe(Effect.orElseSucceed(() => null));
3149 if (!manifest) {
3150 printNoRunningLocalWebApp();
3151 return;
3152 }
3153 const { origin, auth } = manifest.connection;
3154 const token = auth?.kind === "bearer" ? auth.token : undefined;
3155 const url = token ? `${origin}/?_token=${token}` : origin;
3156 console.log(`Opening ${url}`);
3157 yield* openInBrowser(url);
3158 });
3159
3160/**
3161 * `executor open` — the friendly way back in. Reads the running local server's

Callers 1

main.tsFile · 0.85

Calls 3

openInBrowserFunction · 0.85
logMethod · 0.80

Tested by

no test coverage detected