u/alexriley12345

[Python] opendot - a terminal AI coding agent where every action is snapshotted first, so you can fully undo what it did

[Python] opendot - a terminal AI coding agent where every action is snapshotted first, so you can fully undo what it did

Letting an AI agent loose on my real files always made me nervous: it runs a dozen tool calls, edits files, runs shell commands, and if one is wrong there's no clean way back. Git only covers tracked files, not the untracked mess or the shell side effects. So I built opendot around fixing that.

The core idea is reversibility. Before every file write or shell command, opendot snapshots the working directory into a content-addressed store (each file stored once, so it's cheap) and logs it to an append-only ledger. Then opendot undo walks it back exactly, opendot redo re-applies if you went too far, and opendot diff <id> shows which files an undo would change before you commit. Files and shell commands, not just in-repo edits.

The part I care most about is being honest about what can't be undone. A classifier separates workspace-contained commands (auto-run, undoable) from escaping ones (network, sudo, git push, deleting outside the workspace), which get flagged and confirmed first with a plain note that they aren't reversible. When it's unsure, it asks.

One thing I learned: "just undo" isn't enough to actually trust an agent, you need to see the state. So opendot log shows a timeline with a "you are here" cursor, so you can tell at a glance what's applied and what you've undone but could still redo.

The rest: model-agnostic via LiteLLM (OpenAI, Anthropic, Google, DeepSeek, local Ollama), budget caps (--usd 0.50 stops the run at 50 cents), a permission policy (--yes plus --allow/--deny) for unattended/CI runs, MCP client + Composio for 1000+ app tools, and session resume.

MIT, and I actively review PRs (good-first-issues if anyone wants to jump in).

pip install opendot

Repo: https://github.com/vedaant00/opendot

Happy to answer anything about the reversibility approach.

u/alexriley12345 — 1 day ago

[Python] PyScrappy — a web scraping toolkit whose selectors heal themselves when a site changes its HTML (+ MCP server for AI agents)

Every scraper I've ever written eventually breaks the same way: the site tweaks its markup, my CSS selector silently returns nothing, and I don't find out until the data's been empty for a week. So I built PyScrappy around fixing that.

The headline feature is adaptive (self-healing) selectors. You scrape an element once and it saves a fingerprint of it. Later, if your selector matches nothing, it relocates the element by structural + textual similarity instead of returning empty. The part I'm proudest of is the scoring: I weight signals by how stable they are (a data-testid/id hook counts way more than a sibling-tag list), make it anchor-relative so it survives layout reshuffles, and down-weight volatile text (prices, dates, counts) so healing stays reliable on exactly the fields that change most. It returns a confidence score so you can tell a clean match from a coin-flip.

One thing I learned building it: a naive "just compare everything and average it" matcher gets fooled constantly — an unchanged price string will drag a wrong element to the top. Weighting by signal stability is what actually makes it work; I have a test that shows the weighted scorer beating a uniform one on exactly that trap.

The rest of it:

  • 24 built-in scrapers — Wikipedia, Yahoo Finance, news feeds, GitHub, Hacker News, Amazon/IKEA, YouTube, and more. Each returns typed, LLM-ready JSON.
  • MCP server — expose the scrapers as tools so Claude/Cursor/agents can pull structured web data directly. It's on the Official MCP Registry.
  • Stealth — TLS-fingerprint impersonation (impersonate="chrome") to get past anti-bot filters that block plain clients, no headless browser needed.
  • Proxy rotation, retry/backoff, robots.txt politeness, response caching, native async, a pyscrappy extract <url> out.md CLI, and a chainable CSS/XPath Selector.

It's MIT, ~50k downloads on PyPI so far, and I actively review PRs (there are good-first-issues if anyone wants to jump in).

pip install pyscrappy

Repo: https://github.com/mldsveda/PyScrappy
Docs: https://pyscrappy.vercel.app

Happy to answer anything about the self-healing approach, that's the interesting bit.

u/alexriley12345 — 11 days ago