# caravela Drive a Chrome/Chromium browser over the Chrome DevTools Protocol (CDP), optionally inside a managed [Weston](https://gitlab.freedesktop.org/wayland/weston) RDP display, for doing things online — exploring sites, scraping data, filling forms, and clicking through JS-heavy UIs. caravela is both a **library** and a **CLI**. Point it at any state root; it ships with a `browse` skill for agent-driven use. ## How it works - A **session** launches a browser with a CDP remote-debugging port and keeps it alive across many commands. - Each browse verb attaches over CDP, acts, and detaches. - By default the browser renders on a **managed Weston RDP display** so it can run on a headless host while remaining watchable over RDP (`127.0.0.1:3389`). It can also run `--headless` or on the caller's display. - The **browser binary** is either a system Chrome/Chromium (default) or a pinned, checksum-verified [Chrome for Testing] build that caravela downloads and manages (install / upgrade / rollback). [Chrome for Testing]: https://googlechromelabs.github.io/chrome-for-testing/ ## CLI ```bash caravela session start [--headless] [--system-display] [--port N] caravela session stop | status caravela navigate caravela content [--full] [--max-chars N] caravela source | url caravela links [--contains S] [--max N] caravela find [--max N] caravela click caravela type caravela scroll [pixels] caravela eval caravela screenshot [--full-page] caravela wait (--selector | --load) [--timeout MS] caravela cookies export | import | persist [--domain S] [--days N] caravela display start | stop | status caravela browser status | install | upgrade | rollback | reset-profile ``` See [`skills/browse/SKILL.md`](skills/browse/SKILL.md) for the full guide. ## Configuration State lives under the XDG state dir: `$XDG_STATE_HOME/caravela` (default `~/.local/state/caravela`). Override with `--root` or `CARAVELA_ROOT`. Configuration is read from `$XDG_CONFIG_HOME/caravela/config.toml` (default `~/.config/caravela/config.toml`): ```toml # root_dir = "~/somewhere/else" # optional state-root override [browser] mode = "system" # or "bundled" # system_binary_path = "/usr/bin/google-chrome-stable" # bundled_build = 1418433 # 0 = pinned default # user_data_dir = "~/.local/state/caravela/browser/profiles/default" extra_args = [] max_page_chars = 16000 ``` ## Library ```rust use caravela::{CaravelaConfig, BrowserManager, SessionManager, actions}; let config = CaravelaConfig::with_root("/path/to/state"); let browser = BrowserManager::from_config(&config)?; let binary = browser.browser_binary_path()?; let sessions = SessionManager::new(config.browse_dir()); let session = sessions.start(&binary, &config.default_profile_dir(), 9222, &[], &[])?; let text = actions::content(session.port, 16000, false)?; ``` ## Requirements - `weston` and `openssl` (for the managed RDP display) - `unzip`, `sha256sum`/`shasum` (for bundled-browser installs) - a Chrome/Chromium binary (system mode) or network access (bundled mode)