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: 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 url with 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 --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.