What Agents Can Do

Teach by Demonstration

Some flows are easier to show than to describe. Do the flow once by hand in Chrome and chrome-use writes it down as a chrome-use script (or a site adapter) that replays it with no model in the loop: the same steps, the same waits, every time, in one command.

From the terminal

chrome-use open https://shop.example/cart          # the page the flow starts on
chrome-use teach start --name checkout             # now do the flow by hand in that tab
chrome-use teach stop                              # writes ~/.chrome-use/teach/checkout.json and lists the steps
chrome-use teach replay ~/.chrome-use/teach/checkout.json --arg-env password=SHOP_PW

Clicks, typing, selects, checkboxes and radios, Enter and Escape, uploads and page changes are recorded. Keystrokes become one fill; a click that only put the cursor in a field is dropped; a click that opened a new page is followed by a wait for that page. Scrolls are kept only when they made the page load more. teach status shows what was captured so far and teach cancel throws it away.

teach replay is chrome-use script: it runs in one round trip, exits 1 on the first step that fails and names it, and ends by checking it reached the page you finished on. Read the steps teach stop prints before relying on the script; the file is a normal JSON op-list you can edit.

How it finds elements again

Each step leads with what a person reads (the field's label, or a role and name such as button β€œPlace order”) and keeps CSS selectors as alternatives in "or". An alternative runs only when the step before it found nothing to act on, so nothing is ever done twice.

{"do": "getbylabel", "label": "Email", "subaction": "fill", "value": "ada@example.com",
 "or": [{"do": "getbyrole", "role": "textbox", "name": "Email", "subaction": "fill", "value": "ada@example.com"},
        {"do": "fill", "selector": "#email", "value": "ada@example.com"}]}

Passwords and files

What you type into password, card and one-time-code fields is never recorded: the recorder only notes that a secret was typed. It becomes a parameter, and the script refuses to start without it. Pass it from an environment variable so it stays out of shell history: --arg-env password=SHOP_PW. An upload becomes --arg file=./invoice.pdf. If a form puts the password in the next page's address, it is blanked in the recording too.

As a site adapter

chrome-use teach stop --adapter                     # ~/.chrome-use/my-sites/<site>/<flow>.js
chrome-use site add ~/.chrome-use/my-sites && chrome-use site update
chrome-use site <site>/<flow> --until-done

The skeleton types and clicks through args.ui (real input) and does one page per run, so run it with --until-done. What you typed becomes optional arguments (--text1 …) with the recorded value as default. Review it like any adapter.

From the side panel

The side panel has a Record button next to Pick. Press it, do the flow in that tab, press it again: the panel lists the steps, lets you rename the flow and edit the script, and saves it to ~/.chrome-use/teach/ with the command that runs it.

What the page can see

Nothing new. The recorder runs in an isolated world made for the recording (the panel uses the extension's content-script world), and the CLI hears from it through a binding added only to that world, never to the page's own. No global, element, attribute or listener appears in the page, and stopping removes the recorder and the binding. This holds with stealth mode on.

One trade-off follows. Chrome only carries a binding into a new page when Runtime.enable is on, which pages can detect, so chrome-use installs the recorder again after each page change instead. An action in the first instant of a new page can be missed; the step list shows what was captured. An older extension refuses the binding in stealth mode; the recorder then polls and teach start says so.

Measured

On a Mac, Chrome for Testing 155, recorded with real (trusted) input and replayed in a new browser with a new profile:

FlowStepsScript replayAdapter replay
httpbin.org order form (text, radio, checkboxes, textarea, submit)10passed, 2.4 spassed
Wikipedia search, then open a result6passed, 2.8 spassed
Sauce Demo: log in, add to cart, three-step checkout (password as a parameter)17passed, 2.3 spassed