Launch a browser session or attach to an existing Chrome DevTools Protocol endpoint.
open command launches a browser and navigates to a URL, creating a new named session. It is the starting point for any interactive workflow: once a session is open, exec, snapshot, and pages all work against it.12npx libretto open https://example.com npx libretto open https://example.com --headless --session debug-example
open--headed).path urlstringrequiredpath --headedbooleanpath --headlessbooleanpath --sessionstringpath --viewportstringWIDTHxHEIGHT format, for example 1920x1080. Falls back to
the value in .libretto/config.json, then 1366x768.path --provider, -pstringlocal, kernel, browserbase, steel, or libretto-cloud. Defaults to local.--provider flag → LIBRETTO_PROVIDER env var → provider field in .libretto/config.json → "local".open automatically
loads it, injecting the saved cookies and localStorage into the new session
before navigating. You can override this by passing --auth-profile
explicitly, or skip profile loading by not having a saved profile for that
domain.12345678910111213# Open in headed mode (default) npx libretto open https://example.com --headed # Open in headless mode with an explicit session name npx libretto open https://example.com --headless --session debug-example # Open with a custom viewport npx libretto open https://example.com --viewport 1440x900 --session my-session # Open for a manual login flow, then save the session npx libretto open https://linkedin.com --headed --session app-login # ... user logs in ... npx libretto save linkedin.com --session app-login
open launches a local Chromium instance. You can instead run the browser in the cloud using the --provider flag (or LIBRETTO_PROVIDER env var, or provider in .libretto/config.json).| Provider | Value | Required environment variables |
| Local Chromium (default) | local | None |
| Kernel | kernel | KERNEL_API_KEY |
| Browserbase | browserbase | BROWSERBASE_API_KEY, BROWSERBASE_PROJECT_ID |
| Steel | steel | STEEL_API_KEY |
| Libretto Cloud | libretto-cloud | LIBRETTO_API_KEY |
--provider kernel (or -p kernel)LIBRETTO_PROVIDER=kernel"provider": "kernel" to .libretto/config.jsonlocal.1234567891011121314151617181920# Open with Kernel cloud browser export KERNEL_API_KEY="your-key" npx libretto open https://example.com --provider kernel # Open with Browserbase export BROWSERBASE_API_KEY="your-key" export BROWSERBASE_PROJECT_ID="your-project-id" npx libretto open https://example.com -p browserbase # Open with Steel export STEEL_API_KEY="your-key" npx libretto open https://example.com --provider steel # Open with Libretto Cloud export LIBRETTO_API_KEY="your-key" npx libretto open https://example.com --provider libretto-cloud # Set provider via config so you don't need the flag every time # .libretto/config.json: { "version": 1, "provider": "kernel" } npx libretto open https://example.com
--headed / --headless and --viewport flags since
the browser runs remotely. The session is always headless from the local
machine's perspective.connect command attaches to an existing Chrome DevTools Protocol (CDP) endpoint rather than launching a new browser. Use it to drive a browser that is already running, for example one started with --remote-debugging-port, an Electron application, or any other CDP-compatible target.12npx libretto connect http://127.0.0.1:9222 --session my-session npx libretto connect ws://127.0.0.1:9223 --session another-session
connectworkflow() file against that same CDP endpoint without an interactive session first, use run --cdp instead.path cdp-urlstringrequiredhttp://127.0.0.1:9222.path --sessionstringconnect so
you can reference it later.exec: run Playwright TypeScript codesnapshot: capture a screenshot and compact accessibility treepages: list open pagesnpx libretto close --session <name> clears the Libretto session record but does not terminate the remote browser or Electron app.12345678# Attach to a Chrome instance started with --remote-debugging-port npx libretto connect http://127.0.0.1:9222 --session chrome-debug # Inspect the attached page npx libretto snapshot --session chrome-debug # Run code against it npx libretto exec --session chrome-debug "await page.url()"