← 返回命令列表

Linux command

libretto 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Scaffold a new Libretto project

npm create libretto@latest

Install Libretto

npm install libretto && npx libretto setup

Open a URL

npx libretto open [https://example.com]

Take a snapshot

npx libretto snapshot --objective "[find the login form]"

Execute Playwright TypeScript

npx libretto exec "[await page.click('button.submit')]"

Run a saved workflow file

npx libretto run [src/workflows/scrape-page.ts]

Target a named session

npx libretto snapshot --session [checkout] --objective "[verify total]"

说明

Libretto is a CLI and coding-agent skill built on Playwright that helps engineers author and maintain browser automations for systems with no proper API. Instead of hand-writing selectors, the developer points Libretto at a live page and asks the LLM for "token-efficient" summaries, network traces, and DOM excerpts that can be pasted into an agent prompt. A typical workflow is: open a page with libretto open, capture context with libretto snapshot, iterate with libretto exec, and finally commit the steps to a TypeScript file that can be replayed with libretto run. All state is kept in a per-project _.libretto/_ directory (sessions, profiles, captured traffic).

参数

--session _NAME_
Target a named browser session so that parallel workflows do not interfere.
--objective _TEXT_
Natural-language goal passed to the model during a snapshot.
--headless
Run Chromium without a visible window.
--model _NAME_
Override the LLM used to analyze snapshots.

FAQ

What is the libretto command used for?

Libretto is a CLI and coding-agent skill built on Playwright that helps engineers author and maintain browser automations for systems with no proper API. Instead of hand-writing selectors, the developer points Libretto at a live page and asks the LLM for "token-efficient" summaries, network traces, and DOM excerpts that can be pasted into an agent prompt. A typical workflow is: open a page with libretto open, capture context with libretto snapshot, iterate with libretto exec, and finally commit the steps to a TypeScript file that can be replayed with libretto run. All state is kept in a per-project _.libretto/_ directory (sessions, profiles, captured traffic).

How do I run a basic libretto example?

Run `npm create libretto@latest` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --session _NAME_ do in libretto?

Target a named browser session so that parallel workflows do not interfere.