I built a web automation CLI to make repeated browser tasks cheaper and more stable

I’ve been building a local-first web automation CLI for AI agents.

The basic idea is simple: if a browser task is already known and repeatable, the agent should not have to inspect the page, reason about every button, and spend tokens on every klick.

For example, instead of asking a model to:

open page -> inspect DOM -> find input -> type query -> search -> wait -> read results

I can wrap that workflow as a command like:

search.hot
get.detail
post.feed
account.health

The agent decides what it wants to do. The CLI executes the actual browser flow locally through a browser/CDP runtime and site-specific plugins.

This makes the most sense for fixed workflows:

  • searching a known site
  • reading a list
  • opening detail pages
  • submitting forms
  • posting content
  • checking account status
  • replaying a previous workflow

For those cases, token usage during execution can get close to zero, because the model is no longer involved in every page-level decision. It only calls a semantic command and gets structured results back.

It also makes the workflow more stable. Instead of hiding site knowledge inside prompts, the selectors, fallbacks, login checks, pop-up handling, and output schema live in versioned plugins that can be tested and reused.

I don’t think this replaces general browser agents. If the site is unknown or the task is exploratory, a normal browser agent is still more flexible.

But once a workflow is known, I think it should become something closer to an API call.

Would this be useful to anyone here? Curious if other people are running into the same problem with browser agents and repeated web tasks.

u/Kevin-yz — 1 month ago

I stopped asking agents to browse Hacker News

I use Hacker News as a weak signal detector.

What are people arguing about today? Which database keeps showing up? Is a framework actually gaining attention, or did one launch post just do well?

An LLM can help answer that. A browser agent is the wrong shape.

The expensive version is:

open HN
inspect page
click story
read comments
go back
search topic
repeat tomorrow

That burns tokens on navigation. HN already has a stable set of data patterns: top, best, new, Ask HN, Show HN, jobs, search, comments, user profiles.

So I put those behind MediaUse site commands:

hackernews.get.top
hackernews.get.best
hackernews.get.ask
hackernews.get.new
hackernews.get.show
hackernews.get.jobs
hackernews.search.stories
hackernews.read.item

The agent asks for structured data. MediaUse handles the site.

Daily tech radar

A daily run can be simple:

hackernews.get.top(limit=30)
hackernews.get.best(limit=30)
hackernews.get.show(limit=20)
hackernews.get.ask(limit=20)

Then the agent groups the results into topics: AI infra, databases, languages, browsers, security, hardware, jobs.

For stories that matter:

hackernews.read.item(id=..., depth=3, replies=5, max_length=12000)

I do not want "summarize Hacker News." I want:

- repeated topics
- projects getting unusual attention
- threads with strong disagreement
- links worth reading later
- weak signals to check tomorrow

Tracking a technology

The better use case is tracking change over time.

hackernews.search.stories(query="sqlite", limit=20, sort="date")
hackernews.search.stories(query="webgpu", limit=20, sort="date")
hackernews.search.stories(query="bun runtime", limit=20, sort="date")

Then read the comments and extract:

- what broke in production
- which alternatives people mention
- whether users or tourists dominate the thread

HN is noisy. I would not treat it as truth. But it is a decent early warning layer for technical shifts.

Why this is cheaper

A browser agent spends tokens asking:

where am I?
what should I click?
which text is a story?
which text is a comment?
should I expand more?

The Hacker News plugin skips that loop. Execution runs through the site plugin. The model spends tokens on clustering, comparison, and explanation.

That is the split I want:

MediaUse:
  fetch records
  read threads
  return structured data

Agent:
  group topics
  compare with previous runs
  explain what changed

The token target for plugin execution is zero. The agent still uses tokens to write the report. That is where the tokens belong.

For unknown pages, let the agent explore.

For repeat sources like Hacker News, give it a site plugin.

reddit.com
u/Kevin-yz — 2 months ago