Expand description
Shared helpers for the tail-fin CLI and daemon.
This crate holds the CLI-adjacent plumbing that both the standalone
tail-fin binary and the tfd daemon need: building a BrowserSession
from a --connect host, resolving cookie file paths, and emitting
JSON/list responses. Site-specific logic does not live here — each
adapter crate owns its own Site impl + command handlers.
Structs§
- Ctx
- Connection-mode context shared across CLI subcommands and the REPL.
Functions§
- auto_
launch_ stealth - Auto-launch a stealth browser session when no connection mode is specified. Adapters that support browser-only mode use this as their fallback path. Emits a stderr notice before launching.
- browser_
session - Connect to an existing Chrome instance via CDP at
ws://{host}. - default_
cookies_ path - Default cookies path for a given site:
~/.tail-fin/<site>-cookies.txt. - launch_
browser - Launch a fresh headless (or headed) browser — no existing Chrome required.
- launch_
stealth_ session - Launch a stealth browser navigated to
urlwith anti-detection. - no_
mode_ error - Build a user-facing error for missing connection mode.
- print_
json - Print a serializable value as pretty JSON to stdout.
- print_
list - Print a list result as
{ "<key>": items, "count": N }JSON. - require_
browser - Require
--connectand return the host, or a friendly error pointing at the correct invocation. - require_
browser_ session - Browser-only adapter: reject
--cookies, require--connect, return a ready-to-useBrowserSession. - resolve_
cookies_ path - Resolve the cookies file path from the
--cookiesflag value."auto"expands todefault_cookies_path; anything else is verbatim.