Docs

Examples

The examples are a separate repo you clone and open as a project. Nothing is installed with Tranquil, and nothing is written into your config directory — they’re ordinary files you own and can edit.

Get them

git clone https://github.com/tranquillabs/tranquil-examples.git

Open the folder in Tranquil with File → Open.

Clone it somewhere standalone rather than inside an existing Deno project — see Where automations live for why.

Run one

  1. Open a browser tab on any page (Cmd-T).
  2. Open count-elements/count-elements.ts so it’s the active editor.
  3. Press Cmd-Shift-R.

The first run asks you to approve the permissions the script declares — browser, in this case, because it reads the active page. Approve once and it’s remembered for that script. The result appears as a notification, and the run itself shows up in the Automation Runs panel.

What’s in there

Each example is a folder with the script and a short README.

ExampleWhat it doesWhat it teaches
count-elementsCounts matching elements on the page and notifies.Seven lines — start here.
page-infoScrapes page stats and opens the result in the editor.Writing a file: it lands next to the script, so the example and its output travel together.
highlight-linksOutlines every external link.Changing a live page from tab.evaluate.
page-bannerAdds and removes a banner.A toggle you can re-run — it checks for its own element first.
reader-modeHides clutter and widens the main column.Restyling a page you don’t control.
fetch-titlesVisits several pages at once and collects their titles.The multi-tab patterns: bounded concurrency with pooledMap, and await using so tabs close even when a crawl throws.
slow-countCounts slowly, so a run stays in flight long enough to cancel.Passing context.signal to whatever you wait on, so Cancel stops the script within a second instead of at the next step boundary.
search-to-bookmarksSearches the web, saves each result as a .url, writes a summary.The fullest one: file input, a fetch, scraping, and file output in a single script.
spice-catalogueMaintains a spices.json across runs — create, read, update, delete.The only one that edits a file it already owns. Run it twice and the second run finds nothing to do.
example-bookmarkA .url bookmark, opened as a browser tab.Bookmarks are plain files you can keep in version control.

Next: Preferred Settings — a few settings worth changing.