Skip to content

connect-to-cdp

Programmatic helper to launch (or attach to) a CDP-enabled Obsidian instance with the runtime helper namespace bootstrapped, for ad-hoc real-app debugging.

A single connectToCdp call resolves the owned-instance config, opens a vault, and bootstraps window.__obsidianIntegrationTesting (so evalWrapper, the base lib helpers, errorToString, getObsidianModule, … are available), then hands back a disposable CdpConnection exposing the chosen CDP port, a raw CdpConnection.invoke and the rich CdpConnection.evalInObsidian.

InterfaceDescription
CdpConnectionA live connection to a CDP-enabled Obsidian instance with the runtime helper namespace bootstrapped. Implements AsyncDisposable, so await using conn = await connectToCdp(…) disposes it (killing an owned instance and — for a throw-away temp vault — removing its directory) automatically.
ConnectToCdpOptionsOptions for connectToCdp.
FunctionDescription
connectToCdpLaunches (or attaches to) a CDP-enabled Obsidian instance, opens a vault, and bootstraps the runtime helper namespace, returning a disposable connection.