Skip to main content

Crate tail_fin_cli_core

Crate tail_fin_cli_core 

Source
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 url with anti-detection. Returns (profile_dir, session); see launch_browser for the drop-order rationale.
launch_stealth_session_blocking_cf
Like launch_stealth_session but blocks until Cloudflare clears (or the timeout elapses). Use this from long-running services (e.g. the tfd daemon’s --host auto path) 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 --connect and 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-use BrowserSession.
resolve_cookies_path
Resolve the cookies file path from the --cookies flag value. "auto" expands to default_cookies_path; anything else is verbatim.