Headless & CLI
Egg ships two command-line binaries. egg launches the browser (with or without a window) and runs short headless tasks like screenshots, PDF rendering, and data exports. egg-daemon manages the persistent gateway service: start, stop, inspect status, pin a port for development.
Headless mode runs the full browser engine without showing a window. You get the same rendering, cookies, sessions, extensions, and privacy posture an interactive Egg session has, just without the UI. That makes it useful for scripted automation: capture a full-page screenshot from a CI job, render a styled invoice to PDF, dump the rendered DOM after JavaScript runs, or pull a reader-mode extraction of an article. Each task flag implies --headless and exits when the task finishes, so the binary works as a one-shot in shell pipelines.
Both binaries accept Chrome-style flags, and unrecognized --* flags forward to the underlying engine. Most existing Chromium tooling and command-line patterns work without changes; the differences are documented inline.
egg
Open a URL, run a headless task, or export data.
# Open a URL (positional or --url=)
egg https://eggbrowser.com/
egg --url=https://eggbrowser.com/
# Open as a chromeless app window
egg --app=https://eggbrowser.com/
# Help / version
egg --help
egg --version
General
| Flag | Description |
| -h, --help | Show help and exit. |
| -V, --version | Show version and exit. |
| --url=<url> | Initial URL. Equivalent to a positional argument; explicit form wins on conflict. |
| --no-restore | Skip tab restoration on this launch. |
| --new-window | Chrome-compat. No-op; every launch is a new window. |
| --restore-last-session | Chrome-compat. No-op; restoration is the default. |
Window
| Flag | Description |
| --start-maximized | Start maximized. |
| --start-fullscreen | Start fullscreen. Overrides --start-maximized. |
| --window-size=WxH | Initial logical window size, e.g. 1920x1080. Sets the hidden-window size in headless mode. |
| --window-position=X,Y | Initial window position in screen pixels. |
| --app=<url> | Open as a chromeless window pointed at <url>. No tab strip or sidebar. Mutually exclusive with --headless. |
Privacy & sessions
| Flag | Description |
| --incognito, --inprivate, --guest | First tab opens in incognito. Aliases for Chrome / Edge compat. |
| --user-data-dir=<path> | Override the engine’s data directory (WebView2 on Windows, WKWebView on macOS) for browser-side state: cookies, web storage, HTTP cache. Applies to default-profile tabs only; named profiles and incognito tabs use their own data stores. Does not redirect Egg’s own database or settings. Chrome-compatible. |
| --profile-directory=<name> | Sub-profile within --user-data-dir. Without --user-data-dir, maps to one of Egg’s named profiles by id. |
| --user-agent=<string> | Override the per-tab user agent. |
Headless tasks
Each task flag implies --headless. Default timeout is 30000 ms; exit code 124 on timeout.
| Flag | Description |
| --headless | Boot with the main window hidden. |
| --screenshot=<path> | Capture full-page PNG to <path> after the URL loads. |
| --print-to-pdf=<path> | Render the page to PDF. |
| --dump-dom | Print rendered document.documentElement.outerHTML to stdout. |
| --extract-page | Reader-mode extraction; main article text to stdout. |
| --export-bookmarks=<path> | Dump bookmarks. JSON by default; CSV based on extension. |
| --export-history=<path> | Dump browsing history. JSON or CSV. |
| --export-passwords=<path> | Dump decrypted passwords. Master password from EGG_VAULT_PASSWORD, never from a flag. |
| --timeout=<ms> | Maximum wait for the task. Default 30000. |
Automation
| Flag | Description |
| --remote-debugging-port=<n> | Forwarded to WebView2. Exposes the underlying Chromium DevTools server on <n>. Attach Playwright, Puppeteer, or any CDP client. |
Advanced
| Flag | Description |
| --strict-flags | Reject unknown --* flags (exit 2) instead of forwarding to Chromium. |
Recipes
# Full-page screenshot
egg --screenshot=out.png https://eggbrowser.com/
# PDF render with a custom viewport
egg --print-to-pdf=invoice.pdf --window-size=1280x1600 https://invoices.example.com/
# Pipe rendered HTML into another tool
egg --dump-dom https://news.ycombinator.com/ | htmlq '.athing'
# Reader-mode extraction
egg --extract-page https://en.wikipedia.org/wiki/Browser
# Export data
egg --export-bookmarks=bookmarks.json
egg --export-history=history.csv
EGG_VAULT_PASSWORD="..." egg --export-passwords=secrets.csv
# Open as a focused PWA window
egg --app=https://app.example.com/ --window-size=1100x800
# Attach a CDP client
egg --remote-debugging-port=9222 https://example.com/
curl http://127.0.0.1:9222/json/version
Chromium passthrough
Unknown --* flags forward to the underlying engine via WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS. Pass --strict-flags to reject unknowns instead.
# Forwarded to Chromium
egg --proxy-server=socks5://127.0.0.1:1080 https://example.com/
egg --lang=en-US --disable-features=Translate
# Strict mode rejects unknowns
egg --strict-flags --bogus-flag
# → exit 2: unknown flag --bogus-flag
- If a passthrough flag conflicts with Egg’s privacy hardening, the user’s flag wins. A WARN is written to the log.
- Vault passwords and similar secrets are read from environment variables, never flags. Process listings and shell history would leak them otherwise.
egg-daemon
The persistent gateway service. The browser auto-launches it; you can also run it directly to inspect state, terminate it, or pin port + token for development.
# Boot in foreground (logs to stdout)
egg-daemon
# JSON status of the running instance
egg-daemon --status
# Terminate the running daemon
egg-daemon --kill
# Pin port + token
egg-daemon --port=19999 --token=devtoken
Lifecycle
| Flag | Description |
| -h, --help | Show help and exit. |
| -V, --version | Show version and exit. |
| --port=<n> | Bind the API server to this port. Default: random. |
| --token=<t> | Bearer token for the API. Default: random UUID per start. |
| --info-file=<path> | Write the discovery file (daemon_info.json) to a custom path. |
| --no-info-file | Don’t write a discovery file. Useful for sandboxes and tests. |
| --foreground | Don’t detach. Currently the default; the flag exists for service-supervisor scripts. |
Status & control
| Flag | Description |
| --status | Read the discovery file, probe the PID, print JSON status, exit. Exit 0 if running, 1 otherwise. |
| --kill | Read the discovery file, terminate the running daemon, exit. |