Pipes for your tabs
Commands pass tabs, links and lines along with |. Find them, filter them, then close, pin, mute, group or save them.
history --since today | grep recipe | openThe scripting language of the Fruit Bat browser
Roost is a command line and a scripting language built into Fruit Bat. Tidy a hundred tabs in one line, click through a site while you get coffee, or keep a script that runs every morning. It works on the browser, never on your files.
Already have Fruit Bat? Press Ctrl ` and type help.
You're in Fruit Bat . Press Ctrl ` and type help to try it now.
roost:~$ tabs --dupes | close
Closed 6 tabs.
roost:~$ tabs --site youtube.com | mute
Muted 3 tabs.
roost:~$ links | grep -i pdf | head 3 | open
Opened 3 tabs.
roost:~$ page --css ".price" | ask "which is cheapest?"
Echo (on this computer)
The 2-pack at $18.99 is the cheapest per item.Write the way you think. Roost Basic reads like a shell. Roost Script looks like JavaScript. Both run the same commands with the same limits and the same safety rules, and you can switch a script between them in the editor.
# tidy: close old YouTube tabs, group the bat tabs
tabs --site youtube.com --older 3d | close
set bats = $(tabs | grep -i bat)
if count($bats) > 1
$bats | group "Bats" --color green
end
print "Done: ${tabcount()} tabs left"// roost script
// tidy: close old YouTube tabs, group the bat tabs
close(tabs({ site: 'youtube.com', older: '3d' }))
const bats = tabs().grep(/bat/i)
if (bats.length > 1) {
group(bats, 'Bats', { color: 'green' })
}
print(`Done: ${tabCount()} tabs left`)Commands pass tabs, links and lines along with |. Find them, filter them, then close, pin, mute, group or save them.
history --since today | grep recipe | openclick, fill, press, type, wait-for and scroll work by the words you can see, not fragile selectors.
fill "Email" "me@example.com"
click "Next"
wait-for "Welcome"Page checks like has(), exists() and read() let a script look before it clicks.
if (exists("Accept all")) click("Accept all")
const price = read(".price")Save a script and run it from a shortcut, when Fruit Bat opens, or on a timer. watch tells you when part of a page changes.
every 1h tabs --dupes | close --yes
watch --css ".price" --every 10m --reloadAsk Fruit Bat's AI to do something and it looks around by itself, then answers with a Roost script on a card. Every line is checked, and nothing that changes anything runs until you press Run. Ask it to run code and it does, in a sandbox.
script export tidy saves tidy.roost. Double-click it and Fruit Bat shows it in Roost, checked line by line, and asks before it runs.
Words after a script's name arrive in args, and remember / recall() keep values for next time. Pin a script to the toolbar to run it with one click.
const n = recall(site(), 0) + 1
remember(site(), n)
notify(`Visit ${n}`)Roost Script has classes with extends and super, a bigger Math (sum, avg, median, format…) and md5 / sha256 checksums.
const now = sha256(read('#terms'))
if (recall('terms', now) !== now) notify('The terms changed')
remember('terms', now)Every setting, every Fruit Bat page and every side panel: config, about, panel, plus downloads, add-ons, updates, logs, video and windows. It never shows a saved password or card.
config set tabLayout side
about tasks
panel echo
translate --page --to spanishspeak reads words, piped text or the selection with your computer's voice. Highlight text on any page and press Ctrl+Shift+U.
page --css "article" | speaksave and screenshot --save, which go to Downloads and ask first.wallet send only prepares a payment, and only when you type it. Nothing is sent until you press Approve.eval. It's a small language that can only reach Roost's commands.There's nothing to install separately. Open Fruit Bat, press Ctrl ` (or the >_ Roost button), and type help.