Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/cli/src/daemon-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { fileURLToPath } from "node:url";
import { dirname, resolve } from "node:path";
import { existsSync } from "node:fs";
import { ensureCdpConnection } from "./cdp-client.js";
import { discoverCdpPort } from "./cdp-discovery.js";
import { isManagedBrowserRunning } from "./cdp-discovery.js";

export function getDaemonPath(): string {
const currentFile = fileURLToPath(import.meta.url);
Expand All @@ -19,7 +19,7 @@ export function getDaemonPath(): string {
}

export async function isDaemonRunning(): Promise<boolean> {
return (await discoverCdpPort()) !== null;
return await isManagedBrowserRunning();
}

export async function stopDaemon(): Promise<boolean> {
Expand All @@ -41,4 +41,3 @@ export async function ensureDaemonRunning(): Promise<void> {
throw error;
}
}

6 changes: 6 additions & 0 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { traceCommand } from "./commands/trace.js";
import { fetchCommand } from "./commands/fetch.js";
import { siteCommand } from "./commands/site.js";
import { historyCommand } from "./commands/history.js";
import { statusCommand } from "./commands/daemon.js";
import { setJqExpression } from "./client.js";

declare const __BB_BROWSER_VERSION__: string;
Expand Down Expand Up @@ -479,6 +480,11 @@ async function main(): Promise<void> {
break;
}

case "status": {
await statusCommand({ json: parsed.flags.json });
break;
}

case "frame": {
const selectorOrMain = parsed.args[0];
if (!selectorOrMain) {
Expand Down