function shouldUse
shouldUse(): boolean

True iff a live daemon socket exists and the invocation can use it. The cli's primary dispatch check.

import * as Client from './client.ts';

// Defined, not invoked: checks env, argv and the on-disk sentinel for process.cwd().
function daemonAvailable() {
  return Client.shouldUse(); // true only when eligible and a daemon info file exists
}

Return Type

boolean

Usage

import { shouldUse } from "lib/commands/daemon/client.ts";