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: optionally building a browser
session 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.
Browser session helpers are gated behind the browser feature.
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. - default_
creds_ path - Default JSON credentials path for a given site:
~/.tail-fin/<site>-creds.json. - 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. Returns(profile_dir, session); seelaunch_browserfor the drop-order rationale. - launch_
stealth_ session_ blocking_ cf - Like
launch_stealth_sessionbut blocks until Cloudflare clears (or the timeout elapses). Use this from long-running services (e.g. thetfddaemon’s--host autopath) where the next request hits the network immediately and must not race the CF interstitial. - 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. - reap_
stale_ default_ profile_ lock - Unlink a stale chromiumoxide default-profile SingletonLock if it points to a dead PID. No-op if the lock doesn’t exist, points to a live process, or is on a platform we don’t need to handle.
- 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.