Skip to main content
Libretto is an AI-powered browser automation toolkit built on Playwright. It gives your coding agent a live browser and a token-efficient CLI to inspect live pages, capture network traffic, record user actions, and debug broken workflows — all against the real site.

Quick Start

Install Libretto and run your first browser automation in minutes.

CLI Reference

Every command, flag, and option — from open to run to network.

Library API

TypeScript APIs for workflows, extraction, recovery, and instrumentation.

Guides

Real-world use cases and automation concepts explained in depth.

What Libretto does

1

Inspect live pages

Run npx libretto snapshot to capture a screenshot and HTML of any open page, analyzed by an LLM to identify selectors, interactive elements, and page state — without flooding your agent’s context window.
2

Capture network traffic

Libretto records every network request during browser sessions. Use npx libretto network to view them, then reverse-engineer site APIs to build direct, faster integrations.
3

Record and replay actions

Perform a workflow yourself in the browser — Libretto records every click, fill, and navigation as structured action logs. Ask your agent to turn those actions into a reusable automation script.
4

Debug broken workflows

When a script fails, Libretto keeps the browser open. Use snapshot and exec to inspect the exact failed state, fix the code, and re-run to verify — all without restarting from scratch.

Use cases

One-shot script generation

Ask your agent to explore a site and generate a complete automation script from scratch.

Interactive script building

Show Libretto a workflow by doing it yourself, then let your agent turn your actions into code.

Convert to network requests

Convert brittle UI automations into direct API calls that are faster and more reliable.

Debugging workflows

Reproduce failures, inspect live page state, and fix broken selectors interactively.

Key concepts

Automation approaches

Playwright UI, passive interception, in-browser fetch, or direct HTTP — when to use each.

Bot detection

Understand how sites detect automation and how to choose approaches that minimize risk.

Sessions and profiles

Manage named browser sessions and persist authenticated state across runs.

Build docs developers (and LLMs) love