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
- Open a browser tab on any page (
Cmd-T). - Open
count-elements/count-elements.tsso it’s the active editor. - 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.
| Example | What it does | What it teaches |
|---|---|---|
count-elements | Counts matching elements on the page and notifies. | Seven lines — start here. |
page-info | Scrapes 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-links | Outlines every external link. | Changing a live page from tab.evaluate. |
page-banner | Adds and removes a banner. | A toggle you can re-run — it checks for its own element first. |
reader-mode | Hides clutter and widens the main column. | Restyling a page you don’t control. |
fetch-titles | Visits 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-count | Counts 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-bookmarks | Searches 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-catalogue | Maintains 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-bookmark | A .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.