# Legato docs, in one file
Source: https://legatobar.com/docs/ · Index: https://legatobar.com/llms.txt · Schema: https://legatobar.com/schemas/page.schema.json
# Legato docs
Legato is a menu bar app for your Mac that shows **pages**: small dashboards your agents, your scripts and Legato itself keep up to date. Click the Legato icon and the panel opens, with your pages in a sidebar and the one you chose beside it.
```bash
# An agent does this through MCP; from a shell it's one command.
echo '{"title": "Hello", "icon": "hand.wave",
"cards": [{"id": "hi", "type": "text", "body": "Written from Terminal."}]}' |
/Applications/Legato.app/Contents/Helpers/legato set hello
```
Everything happens on the Mac. Pages are files on it, the data they fetch stays on it, and there's no account or cloud service to send pages through. Legato's own servers only hear from it about its [trial and license](https://legatobar.com/docs/license.md) and to check for updates, never about your pages.
The panel's sidebar lets a little of your desktop show through, and its pages sit on a solid background, light or dark as your Mac is set. Pages and their buttons also appear in Spotlight: type a page's name to open it, or a button's name to press it. In Shortcuts, actions open a page, press a button, or read a page's summary or a card's value.
## What a page is
A page is a JSON file in `~/Library/Application Support/Legato/Pages`, named after its id: the page `budget` is `budget.json`. It has a `title`, an SF Symbol `icon`, and a list of **cards**: numbers, lists, tables, progress bars, status cards, calendars and more. See [Pages](https://legatobar.com/docs/pages.md) and [Cards](https://legatobar.com/docs/cards.md).
Legato watches the folder and shows a page as soon as its file is written. A file with a mistake still shows, as a page that says what's wrong, so nothing disappears silently.
A page can also fetch its own data. Its **sources** name an API on the internet or on your home network, or this Mac's Calendar or Reminders; Legato fetches them on a schedule and fills the cards in. Cards can have buttons that call an API, and credentials stay in the Mac's Keychain. See [Sources](https://legatobar.com/docs/sources.md) and [Buttons](https://legatobar.com/docs/buttons.md).
## Three ways to write a page
| | Use it when | Start here |
| --- | --- | --- |
| **An agent, over MCP** | Claude Code, Codex, Claude Desktop or another MCP client on this Mac makes or updates the page for you. | [Connect an agent](https://legatobar.com/docs/connect-agent.md) |
| **A script, with `legato set`** | A shell script, Python, launchd or cron job writes the page from data it gathers. | [Your first page from a shell](https://legatobar.com/docs/cli.md#your-first-page-from-a-shell) |
| **Any program, writing the file** | Something that can't run a command saves JSON into the Pages folder. | [Writing and versions](https://legatobar.com/docs/page-writing.md#any-program-writing-the-file) |
The first two use the same `legato` tool, which comes inside the app. It checks the page, writes the file whole, opens Legato if it isn't running, and waits for Legato to load the page. If something in the page is wrong, nothing is written: the old page stays as it was, and the error says what to fix.
Agents have to run on this Mac. A chat app in a browser can't reach Legato.
## Pages in these docs
### Get started
Install Legato, write a first page and connect the agent that will keep it current.
- Get started
- [Overview](https://legatobar.com/docs/index.md)
- [Quickstart](https://legatobar.com/docs/quickstart.md)
- [Connect an agent](https://legatobar.com/docs/connect-agent.md)
- [Add a page from a template](https://legatobar.com/docs/templates.md)
- On your Mac
- [Notifications](https://legatobar.com/docs/notifications.md)
- [Settings](https://legatobar.com/docs/settings.md)
- [Trial and license](https://legatobar.com/docs/license.md)
### Pages & cards
What goes in a page file, the cards it can show, and how to design one that reads at a glance.
- Pages
- [Pages](https://legatobar.com/docs/pages.md)
- [Writing and versions](https://legatobar.com/docs/page-writing.md)
- [Loading and status files](https://legatobar.com/docs/page-loading.md)
- [Page behavior](https://legatobar.com/docs/page-behavior.md)
- Arranging pages
- [Periods](https://legatobar.com/docs/periods.md)
- [Detail pages and params](https://legatobar.com/docs/detail-pages.md)
- [Sections and collections](https://legatobar.com/docs/sections.md)
- Cards
- [Cards](https://legatobar.com/docs/cards.md)
- [Shared fields and links](https://legatobar.com/docs/card-fields.md)
- [Numbers](https://legatobar.com/docs/card-numbers.md)
- [Lists and rows](https://legatobar.com/docs/card-lists.md)
- [Time](https://legatobar.com/docs/card-time.md)
- [Text and layout](https://legatobar.com/docs/card-text.md)
- Design
- [Page design](https://legatobar.com/docs/design.md)
- [Icons](https://legatobar.com/docs/icons.md)
### Sources & buttons
Pages that fetch their own data from an API, and buttons that send something back.
- Sources
- [Sources](https://legatobar.com/docs/sources.md)
- [Try an API and preview](https://legatobar.com/docs/source-preview.md)
- [Source fields and loading](https://legatobar.com/docs/source-reference.md)
- [Signing in and requests](https://legatobar.com/docs/source-requests.md)
- [Polling and failures](https://legatobar.com/docs/source-polling.md)
- [Calendar and Reminders](https://legatobar.com/docs/source-calendar.md)
- [Worked examples](https://legatobar.com/docs/source-examples.md)
- [Troubleshooting](https://legatobar.com/docs/source-troubleshooting.md)
- Mapping
- [Mapping](https://legatobar.com/docs/mapping.md)
- [Names and tables](https://legatobar.com/docs/mapping-tables.md)
- [Expiry and slices of time](https://legatobar.com/docs/mapping-expiry.md)
- [Conditions](https://legatobar.com/docs/mapping-conditions.md)
- [Sparkline readings](https://legatobar.com/docs/mapping-sparklines.md)
- Buttons
- [Buttons](https://legatobar.com/docs/buttons.md)
- [Tasks and asking first](https://legatobar.com/docs/button-tasks.md)
- [Text input](https://legatobar.com/docs/button-input.md)
- [Rows and checklists](https://legatobar.com/docs/button-rows.md)
- Secrets and lists
- [Secrets](https://legatobar.com/docs/secrets.md)
- [1Password](https://legatobar.com/docs/1password.md)
- [Lists](https://legatobar.com/docs/lists.md)
### History
Keep what a service forgets, and read it back on any page.
- History
- [History](https://legatobar.com/docs/history.md)
- [Collect and samples](https://legatobar.com/docs/history-collect.md)
- [Reading](https://legatobar.com/docs/history-reading.md)
- [Dates and retention](https://legatobar.com/docs/history-dates.md)
- [Accounts and readers](https://legatobar.com/docs/history-accounts.md)
- [Rows from outside](https://legatobar.com/docs/history-rows.md)
- [Coverage and local storage](https://legatobar.com/docs/history-coverage.md)
- Examples
- [Parcel example](https://legatobar.com/docs/history-parcel.md)
### Agents & CLI
The MCP tools an agent uses and the legato command a script uses.
- Agents
- [Agents and scripts](https://legatobar.com/docs/mcp.md)
- [MCP tools](https://legatobar.com/docs/mcp-tools.md)
- [Scripts](https://legatobar.com/docs/scripts.md)
- Command line
- [CLI](https://legatobar.com/docs/cli.md)
- [Pages](https://legatobar.com/docs/cli-pages.md)
- [Sidebar](https://legatobar.com/docs/cli-sidebar.md)
- [Templates and install](https://legatobar.com/docs/cli-templates.md)
- [History and rows](https://legatobar.com/docs/cli-history.md)
- [Lists](https://legatobar.com/docs/cli-lists.md)
- [legato mcp](https://legatobar.com/docs/cli-mcp.md)
- [Legato secret](https://legatobar.com/docs/cli-secret.md)
### Reference
Sizes Legato holds a page to, and what each error means.
- Reference
- [Limits](https://legatobar.com/docs/limits.md)
- [Errors](https://legatobar.com/docs/errors.md)
- For agents
- [Page schema ↗](https://legatobar.com/schemas/page.schema.json)
- [llms.txt ↗](https://legatobar.com/llms.txt)
You can also browse [Features](https://legatobar.com/features), which pairs an illustrated preview of each card and page template with a prompt for your agent and its JSON.
## For agents
Every docs page is also plain Markdown: add `.md` to its URL (this page is [/docs/index.md](https://legatobar.com/docs/index.md)), or send `Accept: text/markdown`. [/llms.txt](https://legatobar.com/llms.txt) lists them all, and [/llms-full.txt](https://legatobar.com/llms-full.txt) is every page in one file.
The page format is a JSON Schema. Legato installs it in the Pages folder as `.schemas/page.schema.json`, the site publishes it at [`https://legatobar.com/schemas/page.schema.json`](https://legatobar.com/schemas/page.schema.json), and `legato schema` or the `get_page_schema` tool gives any part of it. When the docs and the schema disagree, the schema wins.
---
# Quickstart
Legato needs a Mac with macOS 26 or later. There's no account to make.
## 1. Install Legato
1. [Download Legato](https://downloads.legatobar.com/mac/Legato.zip) and unzip it.
2. Move **Legato** to your **Applications** folder. The commands on this page expect it there.
3. Open it. Its icon appears in the menu bar: click it to open the panel.
The panel opens on **Welcome to Legato**, with guides to the rest of the app.
The first time it opens, Legato starts a **14-day trial** with every feature. It asks Legato's licensing server once, so it needs the internet then; there's no sign-in and no card. After 14 days, pages lock until you add a license in **Settings → License**. See [Trial and license](https://legatobar.com/docs/license.md).
## 2. Add a page from a template
The quickest first page needs no agent. Open the collection chevron in the panel's sidebar and choose **New from Template…**. **Service status** and **RSS Feeds** need no account and no key:
- **Service status** follows the status pages of services you rely on. Its **List** step suggests some to pick, such as GitHub's and Claude's.
- **RSS Feeds** shows the newest posts from the feeds you add.
Work down the steps and choose **Install**. The page appears in the sidebar and keeps itself up to date.
Every other service with a template, such as Pi-hole, Plex or YNAB, is in the same window. See [Add a page from a template](https://legatobar.com/docs/templates.md) and [Services](https://legatobar.com/services/).
## 3. Or ask your agent
Legato comes with an MCP server, so Claude Code, Codex and other agents on this Mac can make and change pages. Add it to yours in Terminal:
**Claude Code**
```bash
claude mcp add --scope user legato -- /Applications/Legato.app/Contents/Helpers/legato mcp
```
**Codex**
```bash
codex mcp add legato -- /Applications/Legato.app/Contents/Helpers/legato mcp
```
Claude Desktop and other apps are in [Connect an agent](https://legatobar.com/docs/connect-agent.md). The agent has to run on this Mac: a chat app in a browser can't reach Legato.
Then start a new conversation, so the agent sees Legato's tools, and ask in plain words:
> Make me a Legato page with the 2.4 release checklist.
The page appears in the panel's sidebar as soon as the agent writes it. Legato checks every page first: if something's wrong, the agent gets the error and can fix it.
For pages that look like ours, add the page design skill. Your agent then reads Legato's [design guide](https://legatobar.com/docs/design.md) before it designs a page:
```bash
npx skills add https://legatobar.com
```
## 4. Keep it up to date
A page with [sources](https://legatobar.com/docs/sources.md) keeps itself current: Legato fetches the data on a schedule, as both templates above do. For anything sources can't reach, an agent can rewrite the page every morning or every hour, and a script can do the same without an agent. See [Scripts](https://legatobar.com/docs/scripts.md).
## Next
- The panel's own guides: **Navigating Legato** for pages, sections and collections, and **Notifications** for when Legato tells you to look. Both are on Welcome to Legato.
- [Cards](https://legatobar.com/docs/cards.md): every card a page can use.
- [The legato command](https://legatobar.com/docs/cli.md#the-legato-command): write pages from a shell, with no agent.
---
# Connect an agent
Legato comes with `legato`, a command-line tool inside the app at `/Applications/Legato.app/Contents/Helpers/legato`. `legato mcp` runs it as a [Model Context Protocol](https://modelcontextprotocol.io) server, so an agent can write pages through tool calls. There's nothing else to install and nothing to sign in to: the server reads and writes the page files in `~/Library/Application Support/Legato/Pages`.
The server runs on your Mac, started by the agent's app over stdio. That means the agent has to run on the same Mac: Claude Code, Codex, Claude Desktop, or any other client that starts a local command. Chat apps that only take a remote connector URL, such as claude.ai or ChatGPT in a browser, can't reach it.
## Claude Code
```bash
claude mcp add legato -- /Applications/Legato.app/Contents/Helpers/legato mcp
```
That adds Legato for the project you're in. To have it in every project, add it for your user instead:
```bash
claude mcp add --scope user legato -- /Applications/Legato.app/Contents/Helpers/legato mcp
```
Check the connection with `claude mcp list`, or `/mcp` inside a session.
To share the setup with a project, put it in the project's `.mcp.json`:
```json
{
"mcpServers": {
"legato": {
"type": "stdio",
"command": "/Applications/Legato.app/Contents/Helpers/legato",
"args": ["mcp"]
}
}
}
```
There's no key to keep out of the file.
## Codex
```bash
codex mcp add legato -- /Applications/Legato.app/Contents/Helpers/legato mcp
```
`codex mcp list` shows it. Start a new session to pick it up.
## Claude Desktop
[Download the Legato extension](https://legatobar.com/legato.mcpb) and open it. Claude Desktop asks before installing it; click **Install**, then start a new chat.
The extension has no server of its own. It starts `legato mcp` from Legato.app, so it always matches the Legato you have, and it won't start until Legato is installed. It shows in **Settings → Extensions**, where you can turn it off or remove it.
To add Legato by hand instead, open **Settings → Developer → Edit Config**. That opens `~/Library/Application Support/Claude/claude_desktop_config.json`. Add Legato under `mcpServers`:
```json
{
"mcpServers": {
"legato": {
"command": "/Applications/Legato.app/Contents/Helpers/legato",
"args": ["mcp"]
}
}
}
```
If the file already has other servers, add the `legato` entry beside them. Quit and reopen Claude Desktop, and start a new chat; Legato's tools are listed among its tools.
## Other MCP clients
Any client that runs a local MCP server over stdio can connect. Most take a JSON config like Claude Desktop's; fill in its settings like this:
| Setting | Value |
| --- | --- |
| Name | `legato` |
| Type or transport | stdio (sometimes called "command" or "local") |
| Command | `/Applications/Legato.app/Contents/Helpers/legato` |
| Arguments | `mcp` |
| Environment, URL, headers | None |
The server speaks JSON-RPC, one message per line, and accepts protocol versions `2024-11-05` through `2025-11-25`; a client asking for another version gets the newest. It offers tools only (no resources or prompts), and answers requests one at a time, in order. When Settings → Agent Access changes after the client listed the tools, it sends `notifications/tools/list_changed` before its next answer.
When it connects, the client should list Legato's twenty-three tools: five for pages (`set_page`, `get_page`, `list_pages`, `delete_page` and `get_page_schema`), six for the sidebar, four for [History](https://legatobar.com/docs/history-rows.md#rows-from-outside-legato), three for [Lists](https://legatobar.com/docs/mcp-tools.md#lists-and-history), three for [secrets](https://legatobar.com/docs/mcp-tools.md#secrets) and two for [templates](https://legatobar.com/docs/mcp-tools.md#templates), fewer if some are off in Settings → Agent Access.
Anything that can run the command can read and write every page, as you. There are no keys and no per-page permissions. Settings → [Agent Access](https://legatobar.com/docs/settings.md#agent-access) chooses which tools the MCP server offers, such as leaving out `delete_page`; the `legato` command and the Pages folder stay open to anything on the Mac.
## After you update Legato
An agent keeps the tools Legato gave it when it connected, so a session that was open before an update doesn't know about new card types or fields. Start a new session after you update. In Claude Code, `/mcp` can reconnect `legato` in the session you're in; Claude Desktop needs quitting and reopening.
## A prompt that works
Once the agent is connected, ask it in plain words. Something like this, in Claude Code, Codex or Claude Desktop:
> Keep a Legato page called "budget" current. Work out this month's spending so far, my monthly target ($3,200), the fraction of the month that has passed, and the largest charges this week. Then call `set_page` with page_id "budget": title "Budget", icon "dollarsign.circle", a `pacing` card for the month, a `list` of the largest charges ("Costco · $212"), and a one-sentence `text` note, tone "warning" if anything is over pace. Always send the whole page. If you get an error, fix what its message names and try again.
Add Legato's [page design skill](https://legatobar.com/docs/design.md#the-page-design-skill), and the agent checks each page against the design guide before it writes one.
For data that changes on its own, such as a service's API or your calendar, the agent can give the page [sources](https://legatobar.com/docs/sources.md) instead: Legato then fetches the data on a schedule, and the page stays current without the agent. For the rest, [A scheduled agent](https://legatobar.com/docs/scripts.md#a-scheduled-agent) shows how to run the agent on a schedule.
---
# Add a page from a template
## Templates
To add a bundled service, open the collection chevron and choose **New from
Template…** beside **New Collection**. The install window adds pages to that
collection. Choose a service, then work down the steps in its sidebar: **Connect**
(or **Place**) for its address or location, **Sign in** for its token, **List** when
its pages read one, and **Review**. Each service shows only the steps it needs.
**Continue** checks the step you're leaving; a step with something to fix gets a dot
in the sidebar, and you can click any step to go back to it.
**Review** shows the hosts the pages will contact, the pages it adds, how often they
check, and the server buttons; **Requests** lists each button's method and path.
Nothing is sent before you continue from **Sign in** or click **Install**.
Each secret is required: keep the one already saved, give a 1Password reference, or
paste a token. **Continue** on **Sign in** checks the service with it, and **Install**
checks again and writes no page if the service refuses it or can't be reached. Tokens
go to the Keychain, bound to the displayed host, after the pages are written. You can
also manage these in **Settings → Secrets**.
A list the pages read is optional. Pick one from **Settings → Lists**, make a new
one, or leave **No list**. Add or remove its names right there, or click a suggested
name; changes are saved to the list when you click **Install**.
Install opens the first sidebar page. If pages already exist, the window names
them and offers to open them without replacing them.
A service that adds two or more pages to the sidebar, such as YNAB or Lunch Money,
puts them in a section named after the service, in the order the service lists
them. If that collection already has a section with the name, the pages go at its
end. Detail pages never count toward the two and stay out of the sidebar. With no
collections, the pages are ungrouped as before. If Legato can't make the section,
nothing is installed, and you can try again.
A `legato://install/` link opens this same window on that service's
**Review** step, with the steps still to fill marked, using the
default collection, or ungrouped when there are no collections. A service page with a
template has one as its **Install in Legato** button. A link may also carry answers
(`?url=…`), but the site's buttons don't: Legato asks for them.
A link never installs by itself. Invalid links show a short error and do nothing.
---
# Notifications
Legato posts a macOS notification when a `status`, `gauge` or `fleet` card moves up to warning or critical. A page can also ask for one of its own with [`notify`](#the-notify-field): a deploy finished, a backup failed, a price dropped.
Legato posts them itself, on your Mac. Nothing goes through Apple's push service or any server.
```
Deploys Deploys
Production Deploy finished
Critical: 502s from api-3 v2.15 is live on all 6 hosts.
a status change a page's notify
```
A notification has the page's title as its title.
Notifications post while Legato is showing pages: during the [trial](https://legatobar.com/docs/license.md) or with a license. Once every page locks, nothing posts, since a locked page has no cards to follow.
## What notifies
### What Legato follows
Status notifications follow each card on its own, so a second card moving to critical on a page that already has one still notifies:
| Card | Followed | Level |
| --- | --- | --- |
| `status` | the card | its `state` |
| `gauge` with `bands` | the card | the `state` of the band its value is in |
| `fleet` | each item, by `name` | the item's `state` |
The levels are ok, warning and critical, and `off` counts as ok. `unknown`, and a gauge value outside every band, say nothing either way: the card keeps the last level it had. A card still waiting for its source's first answer doesn't count as a change either. A page that shows [Can't read this page](https://legatobar.com/docs/errors.md#the-whole-page) has nothing to follow.
Nothing else notifies: not `text` tones, not a stat going up, not a new row in a list. A page that wants to tell someone something uses [`notify`](#the-notify-field).
### Status changes
| From | To | Notifies |
| --- | --- | --- |
| ok | warning or critical | Yes, with a sound |
| warning | critical | Yes, with a sound |
| critical | warning | No: it still needs attention, and less of it |
| warning or critical | ok | Only for pages set to **All Status Changes**, without a sound |
The notification's subtitle is the card's label, and its body is the level with what the card says: `Critical: 502s from api-3` for a status card's detail, `Critical: 93.5 %` for a gauge's reading and unit, `Critical: db-1 · disk full` for a fleet item's name and detail. A card with nothing more to say gives just `Critical` or `Warning`. A recovery says `Back to OK`, with a fleet item's name: `Back to OK: db-1`.
A card's newer status notification replaces its older one in Notification Center, so a card that flaps updates one notification rather than piling up. `notify` notifications stack. All of a page's notifications are grouped together.
macOS keeps the notifications in Notification Center, with what the card said, until you clear them. When a page has been gone from the Pages folder for five minutes, Legato removes its notifications too.
### What doesn't notify
- A card's first level on this Mac. The first time Legato reads the Pages folder, and whenever a new page, card or fleet item appears after that, it records the level without notifying, even if it's critical.
- A page whose file was removed and written again: Legato forgot it when it went, so it starts over.
- A page set to **Off**, a muted page, a page in a muted collection, and the page the panel has open.
- The welcome pages that come with Legato.
- Anything at all while **Show notifications** is off.
A change that doesn't notify for one of these reasons isn't saved for later.
## The notify field
`notify` asks Legato to show one notification of the page's own. It's an optional top-level field in the page file, written with the rest of the page:
```json
{
"title": "Deploys",
"icon": "shippingbox",
"cards": [
{ "id": "prod", "type": "status", "label": "Production", "state": "ok", "detail": "v2.15 since 14:02" }
],
"notify": { "id": "deploy-142", "title": "Deploy finished", "body": "v2.15 is live on all 6 hosts." }
}
```
| Field | | |
| --- | --- | --- |
| `id` | required | 1–64 characters: letters, digits, `.`, `_`, `:` and `-`, starting with a letter or digit, like `deploy-142`. |
| `title` | optional | 1–60 characters. Shown under the page's name. |
| `body` | required | 1–200 characters. |
No other keys are allowed. A `notify` that breaks these rules (a `sound` key, say, or a body over 200 characters) stops the whole file loading: the page shows [Can't read this page](https://legatobar.com/docs/errors.md#the-whole-page), and `set_page` answers `invalid_page`.
- **Once per id.** Each Mac shows each id once per page. Writing the page again with the same id shows nothing more, so an agent or script that writes on a schedule can leave its last `notify` in place. To notify again, use a new id. Legato remembers the last 50 ids on each page, and forgets a page's ids when its file is removed.
- **Only the latest file counts.** `notify` is part of the page, not a queue. If the file is written again before Legato reads it, only the newer `notify` is seen, and the replaced one is never shown.
- **24 hours.** A `notify` in a file last modified more than 24 hours before Legato sees it is skipped.
- **It stays in the file.** `get_page` returns it with the rest of the page, until a write changes or removes it.
A `notify` on a page that's new to your Mac does show. Only the pages already there the first time Legato read the Pages folder have their ids recorded without notifying.
`notify` follows the same per-page setting as status changes: **Off** silences it, and **Needs Attention** and **All Status Changes** both show it. It's shown with a sound.
## Each page's setting
Right-click a page in the panel's sidebar and choose **Notifications**:
| Setting | Notifies |
| --- | --- |
| **Needs Attention** | A card moving up to warning or critical, and `notify`. The default. |
| **All Status Changes** | The same, plus a card going back to OK. |
| **Off** | Nothing, `notify` included. |
The setting is stored on this Mac, not in the page file, so writing the page can't change it. The page's [Details](https://legatobar.com/docs/page-behavior.md#page-info) shows it under Settings, with the time a mute ends.
## The Dock badge
Legato's icon in the Dock carries a red badge with the number of pages that need attention now: a `status`, `gauge` or `fleet` card at warning or critical. It updates as cards change and goes away when none do. A page whose notifications are **Off** isn't counted, and a page with [params](https://legatobar.com/docs/detail-pages.md) counts its home item, the one its defaults show. macOS shows the badge only while it allows Legato's notifications; Legato asks the first time it has a notification to post.
## Mute for 1 Hour
Every notification about a page has a **Mute for 1 Hour** action, and the page's right-click menu has the same item. While a page is muted, it doesn't notify, and its right-click menu shows **Unmute** with the time the mute ends. A mute ends on its own after an hour. It's stored on this Mac, like the page's setting. The menu item is greyed out for a page set to Off.
## Muting a collection
Right-click a collection's icon and choose **Mute Notifications**, and none of its pages notify until you choose **Unmute Notifications** there. Unlike a page's mute, it doesn't end on its own. It covers the pages its sidebar lists; a detail page follows its own setting. Lights, Details and each page's own setting stay as they are. It's stored on this Mac.
## Turning notifications off
**Settings → General → Notifications → Show notifications** turns every notification off, on this Mac. It's on to begin with. See [Settings](https://legatobar.com/docs/settings.md#notifications).
macOS asks whether Legato may send notifications the first time Legato has one to post, not at launch. If you don't allow it, that notification is lost, and so is any later one, until you allow Legato in **System Settings → Notifications**.
While macOS has Legato's notifications off, Settings → General says so, with an **Open System Settings…** button. How they look (banners or alerts, sounds, Focus) is up to macOS's settings for Legato.
## After launch and wake
For 30 seconds after Legato starts and after your Mac wakes from sleep, no status or `notify` notification posts while pages catch up. A wake during that time starts the 30 seconds again. At the end, Legato compares each card with where it was when the 30 seconds began. After launch, that's where it was when Legato last ran, so a card that moved to critical while Legato was quit still notifies.
- A card that's now at a higher level than it was posts a notification. A card that moved up and came back meanwhile posts nothing.
- Recoveries are dropped, even for pages set to All Status Changes.
- A `notify` with a new id that arrived meanwhile is shown, if its file was modified in the last 24 hours.
If only one thing happened, it posts as itself. If several did, Legato posts one summary instead: **Legato**, then a line like `2 pages need attention, 1 new notification`, then the pages' names. A page with several cards at warning or critical counts once.
## Rate limits
On each Mac, Legato posts at most 4 notifications per page, and 20 in all, in any 10 minutes. Notifications over either limit are dropped, not delayed. A page whose cards flap between ok and critical every few seconds notifies four times, then not again until the 10 minutes have passed.
## Clicking a notification
Clicking a notification opens the panel on its page. Clicking a summary opens the panel. Dismissing one does nothing else.
## Buttons on notifications
A status notification about a card also carries that card's [buttons](https://legatobar.com/docs/sources.md) (for a fleet, the fleet card's), so you can act on it from the notification. It shows up to three, before Mute for 1 Hour. A button goes on the notification only if it:
- runs without asking: a `"kind": "open"` button, or an `http` button with a `success` check and no [`confirm`](https://legatobar.com/docs/button-tasks.md#buttons-that-ask-first). An `http` button without a `success` check is one Legato asks about before pressing it from Shortcuts, and a notification can't ask, so that button stays in the panel. `add-event` buttons open a form, so they stay in the panel too;
- is on offer when the notification is posted: its source has answered, its `when` condition holds, and it isn't already running.
Pressing a button on a notification runs it without opening the panel. If it's no longer on offer, or the service says it failed, Legato posts another notification saying why.
Recoveries, `notify` notifications and summaries carry no buttons.
---
# Settings
Click the gear at the foot of the sidebar, or press ⌘,. Settings opens in the window in a page's place, and the sidebar lists its panes; **Pages** at the top of the sidebar, a page, or the gear again goes back. These settings belong to the person using this Mac. They aren't in any page file, and an agent can't read or change them through the `legato` tool. An agent can refer to the names on this page when suggesting a change, such as "turn on **Show update times** in Settings → General".
The sidebar has eleven panes: Appearance, Pages, Assistants, Agent Access, Notifications, Updates, License, Secrets, Certificates, Lists and History. Longer panes scroll.
Some settings are per page, not in Settings: right-click a page in the sidebar for **Edit…** (name and icon), **Show Update Time**, **Show Icon in Title**, **Home Page** and [**Notifications**](https://legatobar.com/docs/notifications.md#each-pages-setting).
Explanations appear beneath the controls. Switching panes keeps unfinished License and Secrets input. Going back to the pages clears that input; saved preferences and credentials remain.
## General
### Appearance
| Setting | Default | What it does |
| --- | --- | --- |
| **Look** | System | Light, Dark, or as the Mac is set. |
| **Theme** | Standard | The page, the sidebar and the colour charts draw in: **Standard** (a cool grey), **Paper** (warm, brown charts) or **Mist** (cool, slate-blue charts). Colours that mean something, such as a state, a move up or down, or a colour a page names, stay the same in every theme. |
| **Accent color** | Indigo | Buttons, switches and what's turned on. Click the swatch to pick any colour: drag in the square and along the hue strip, type red, green and blue values, or take a colour from the screen with the eyedropper. The arrow beside it goes back to indigo. If white text on your colour would be hard to read, Legato draws it a little darker; in Dark it uses a deeper shade of the same hue. Selected rows and tabs stay grey. |
| **Show in menu bar** | On | An icon in the menu bar that brings Legato's window forward. |
| **Animate sidebar** | On | Slides the page over the sidebar when it's hidden, and off it when it's shown. Off, the sidebar appears and disappears at once. Reduce Motion in System Settings turns it off either way. |
| **Load icons from the web** | On | Lets cards show [item icons](https://legatobar.com/docs/card-fields.md#item-icons) from the web: Simple Icons, Dashboard Icons and Material Design Icons logos (loaded from jsDelivr), and websites' own icons. Each is downloaded once and kept on this Mac. Off, rows show only SF Symbols and nothing is downloaded. Posters and covers on media rows ([images on rows](https://legatobar.com/docs/card-numbers.md#images-on-rows)) don't follow it: they come from the service a card is connected to. |
| **Show logos in one colour** | On | Draws those logos in the text's colour, backgrounds taken out, so a card of logos looks like one set. Off, each keeps its brand's colours, on a tile. Needs **Load icons from the web**. |
| **Show update times** | On | "Updated 2 min ago" in each page's footer. A page's **Show Update Time** (right-click it) can override this: Always, after an hour, a day, two days or a week without updates, or Never. With it off, pages have no footer. |
### Pages
| Setting | Default | What it does |
| --- | --- | --- |
| **Open on** | Last page viewed | The page the window opens on: **Last page viewed**, or one page, its home page (also set by right-clicking a page and choosing **Home Page**). Spotlight, Shortcuts and notifications still open the page they're about. A renamed page stays home. If the home page's file goes away (deleted, renamed or moved out of the Pages folder), the window opens on the last page viewed and this shows the page as not found; it's home again if the file comes back. Deleting the page with **Delete Page…** clears the setting. |
| **New pages go to** | Original collection | Choose the collection for newly discovered sidebar pages. Existing pages keep their placement. This appears when collections exist. |
| **Recent activity** | On | Keeps each card's level changes (OK, Warning, Critical) for 7 days, shown in the Recent activity of a page's Details during the trial or with a license. Legato keeps only each card's id, its levels and the time, on this Mac. For a fleet card the id includes the item's name, such as a host. Off clears it. |
| **Open the page when you press a button from Spotlight** | On | A button run from Spotlight opens Legato's window on its page. Off, it runs and the window stays as it was. |
### Assistants
The AI apps Legato offers for talking about a page or a card: **Claude**, **Codex** and **Grok Bot**, each on or off. They're what **Discuss in…** lists when someone right-clicks a card or opens a page's menu or its Details, and what the Ask buttons on the welcome pages offer.
An app that isn't installed shows as "Not installed" and can't be turned on; one installed later is offered until it's turned off. All installed apps are on by default.
### Agent Access
**In short:** choose what agents can do through Legato's MCP server. Everything is on until you turn something off.
| Setting | What it covers |
| --- | --- |
| **MCP server** | Every tool. Off, the server offers agents no tools. |
| **Read pages and data** | `get_page`, `list_pages`, `preview_page`, `get_sidebar`, `list_rows`, `get_history` and `get_lists` |
| **Write pages** | `set_page` and `install_template` |
| **Delete pages** | `delete_page` |
| **Arrange the sidebar** | `set_collection`, `delete_collection`, `set_section`, `delete_section` and `move_page` |
| **Change History and lists** | `add_rows`, `delete_rows`, `set_list` and `delete_list` |
| **Manage secrets** | `get_secrets`, `set_secret_expiry` and `delete_secret`. None of them reads or saves a value. |
`get_page_schema` and `get_templates` stay on while the server is. They describe the page format and the templates, which an agent needs to write a page.
A change applies to agents already connected, from their next call. A tool that's off is left out of the tool list, and calling it anyway gets a `turned_off` error naming the switch. Legato tells the agent's app when the list changes, with its next answer.
The switches keep an agent to the work you want from it, but they don't lock anything: the `legato` command still does everything, and anything that can open the Pages folder can change the files. Write tools still answer with what they changed, such as the sidebar after a move, with **Read pages and data** off.
### Notifications
**Show notifications** (on by default) turns all of Legato's notifications on or off on this Mac. Each page has its own setting too, from right-clicking it in the sidebar: **Needs Attention**, **All Status Changes** or **Off**, and **Mute for 1 Hour**. If macOS has Legato's notifications turned off, this section says "macOS has notifications off for Legato", with an **Open System Settings…** button. See [Notifications](https://legatobar.com/docs/notifications.md).
### Updates
The version, **Check for updates automatically**, **About Legato** and **Check for Updates…**. Legato looks for a new version once a day and asks before installing anything. What changed in each version is on the [changelog](https://legatobar.com/changelog/).
## License
The trial or the license, adding a license, and the Macs a license is on. See [License](https://legatobar.com/docs/license.md) for how the trial and licenses work.
### Status
The top of the pane says where this Mac stands:
| Shows | Means |
| --- | --- |
| **Trial** · Ends in … | The 14-day trial is running. Every feature works. |
| **Trial** · Not started | Legato starts the trial with the licensing server the first time it can reach it. Connect to the internet, then **Try Again**. |
| **Trial** · Ended | Every page is locked until a license is added. The page files are kept as they are. |
| **License** · Legato Pro (yearly) or Lifetime | Licensed. Also shows **Licensed to** (the purchase email), **Paid through** for a yearly license, and **Last checked**. |
| **License** · Ended (date) | The yearly license has ended. Renew it, then **Try Again**. |
| **License** · Needs checking | Legato hasn't reached the licensing server for too long. Connect to the internet, then **Try Again**. |
| **License** · Legato (number) | The license is for an earlier major version of Legato. |
| **This Mac** · Not identified | macOS didn't give Legato the Mac's hardware id, which the license is tied to. This can happen in some virtual machines; write to support@legatobar.com. |
**Try Again** appears when an answer from the licensing server would change things. **Buy a License…** opens [legatobar.com's pricing](https://legatobar.com/#pricing).
### Adding a license
Without a license on this Mac, the pane shows both ways to add one, one above the other:
- **Sign in with your purchase email.** Type the address you bought Legato with into **Email** and choose **Send Code**. Legato emails a 6-digit code that works for 10 minutes; type it into **Code** and choose **Sign In**. **Send Again** sends a new code, and **Use Another Email** starts over.
- **Add your license key.** Paste the key from the purchase email into **License key** and choose **Activate**.
If the license is already on 5 Macs, the tab lists them, each with **Release**, so one can make room for this Mac.
### Macs
With a license on this Mac, **Show the Macs Using This License** lists each Mac on it with when it was last checked. **Release** takes another Mac off the license so its place goes to a new one. **Release This Mac** takes this one off; Legato stops showing pages here until the license is added again.
## Secrets
You can also give a template's secret in its install window: Legato checks it with the service before writing any page.
Passwords, tokens and API keys for pages' [sources](https://legatobar.com/docs/sources.md), each saved under a name and a host (`pihole`, `192.168.1.2`). Each is kept in this Mac's Keychain and sent only to its host, from this Mac. Page files name a secret; they never hold its value, and the `legato` tool never sees it.
At the top, **1Password**'s button reads **Set Up…** until a service account is saved, then **Configure…**; either opens the service account's sheet, which also says what reads 1Password. Below it, a search field (⌘F) finds secrets by name, host or the page that uses them, and a menu shows **All**, those that **Need attention**, those from **1Password** or those in the **Keychain**.
The list shows every saved secret and every one a page names that isn't saved yet, one per line: its name, the host it's sent to, where its value is kept and its status. Those that need something come first:
| Status | Means |
| --- | --- |
| Ready | Saved for this host, in the Keychain or as a 1Password reference that reads. |
| Not set | A page's source names it, and nothing is saved. Choose **Set…**. |
| Needs attention | Something else to do: it was saved by another build of Legato that this one can't read (**Replace…** and type it again); it's saved for a different host than the page names (**Set for HOST…**: Legato never sends a secret to a host it wasn't saved for); or it's a 1Password reference with no service account, or in a copy of Legato that can't read 1Password; or its expiry date is 14 days away or less, or has passed (**Replace…** with a new token). |
Hover over a secret for its full status. Double-click it (or press Return) for the one thing that sets it right: **Set…**, **Replace…** or **Set for HOST…**. Right-click it for those, **Set Expiry…** (change or clear only its expiry date), **Check Now** (a 1Password secret: reads it once and shows **Read just now** in its status, or what 1Password said, never the value), **Copy Name**, **Copy Reference** (**Copy References** for a secret in two fields) and **Remove…**.
- **+** (⌘N) opens **Add Secret**: **Name** (1–48 lowercase letters, digits and hyphens, such as `pihole`), **Host** (a host name or IP address, such as `pi.hole`, `192.168.1.2` or `fd00::1`, without `https://` or a port), **Value from**, the value, and **Expires**: tick it and pick the day for a token that stops working on a set day ([Expiry dates](https://legatobar.com/docs/secrets.md#expiry-dates)). **Value from** starts on 1Password once a service account is saved or any secret comes from 1Password. **Save** stores it, and every card waiting on it tries again at once.
- **1Password:** type the item's **Reference**, such as `op://Legato/Pi-hole/password` ([Get secret references](https://www.1password.dev/cli/secret-reference-syntax#get-secret-references) shows where 1Password gives it). Saving reads it once, so a wrong reference shows in the sheet, not on a card. For a secret in two fields, such as a client ID and secret, choose **Two** under **Fields** and fill in **First** and **Second** ([A secret in two fields](https://legatobar.com/docs/1password.md#a-secret-in-two-fields)).
- **Keychain:** type the secret into **Value**. It's never shown again.
- **Set…** opens the same sheet with the name and host a page asked for. **Replace…** keeps the secret's name and host, so a typo can't add a second secret; a 1Password secret's reference is filled in to change, a Keychain value never is.
- **−**, **Remove…** or the Delete key removes the selected secrets after asking: a Keychain value is deleted from this Mac and can't be recovered; a 1Password item stays in 1Password.
The **1Password** sheet holds the service account Legato reads 1Password secrets with: paste its token (it starts with `ops_`) and choose **Save**, or **Remove…** a saved one. Legato reads each value when a source needs it, keeps it in memory and reads it again every hour. See [Secrets from 1Password](https://legatobar.com/docs/1password.md).
A script or an agent can save a secret without the window, through the app itself, reading the value from standard input so it never appears in a command line:
```
op read 'op://Private/Pi-hole/password' | /Applications/Legato.app/Contents/MacOS/Legato secret set pihole
```
`Legato secret set NAME` takes `--host HOST` (by default, the host of the page that names it), `--replace` to overwrite a saved one, and `--1password REFERENCE` (twice for a secret in two fields) to link a 1Password item, which works only when the caller's `OP_SERVICE_ACCOUNT_TOKEN` is the token saved in Legato. `--expires DATE` saves the token's expiry date with it, and `Legato secret expires NAME DATE` changes only the date. `Legato secret list` lists saved secrets and those pages still need, and `Legato secret delete NAME` removes one. `Legato secret token set` saves the 1Password service account token from standard input, and `token delete` removes it. See [Secrets](https://legatobar.com/docs/secrets.md#from-the-command-line-or-an-agent) in the sources guide.
Saved 1Password references use the service account token saved now. With no token, choose **Set Up 1Password…**. A CLI link requires the same token saved in Legato; a different account must be linked here.
When collections exist, General also offers **New pages go to**. Choose where newly discovered sidebar pages belong. Existing pages stay where they are; detail pages remain outside collections.
## Certificates
**In short:** a server with a self-signed certificate, such as Proxmox or Pi-hole at an IP address, works once you trust its certificate here or on a template's Sign in.
Legato trusts one certificate per server, by its address and port (`192.168.1.2:8006`), and then accepts only that certificate from it. If the server's certificate changes, its pages stop and say so until you trust the new one; that holds even for a certificate macOS would accept. Only a server at an IP address or a `.local` name can be trusted this way, because macOS doesn't let apps make this choice for other names. Those need a certificate macOS trusts.
The table shows each trusted certificate, and any that Legato turned down since it started: the server, the certificate's name, when it expires and its status (**Trusted**, **Not trusted** or **Changed**).
- **Trust…**, or a double-click, shows the certificate first. Compare its fingerprint with the one the server shows before you choose **Trust**.
- **−**, **Remove…** or the Delete key stops trusting the selected certificate, after asking. Pages that read that server stop until you trust it again.
- Trusted certificates are kept in this Mac's Keychain. A page file, a template, an install link, the `legato` tool or an agent can't trust one.
## Lists
**In short:** a list holds words, places or symbols, such as your delivery area or a stock watchlist, that pages use by name. It's kept on this Mac, not in the page file, so the page can be shared as it is.
A page checks a list with an [`in_list`](https://legatobar.com/docs/lists.md#lists) condition, or [sends its entries](https://legatobar.com/docs/lists.md#sending-a-list) to a service. The table shows each list's entries, the pages that use it, and its status. **Used by** also names the services a page sends the list to: "Stocks · sent to finnhub.io". A list a page names but you haven't added yet says **Not set**.
- **+** (⌘N) adds a list, and **−** deletes the selected one. A name is 1–48 characters, `a–z`, `0–9` and `-`, starting with a letter or digit.
- **Edit…**, or a double-click, opens the list's entries one per row. Return adds a row, pasting several lines adds several, and **Done** saves.
- **Rename…** changes the name. Pages that use the old name show a note until they use the new one.
- A value matches an entry when it contains it as whole words, whatever the case, accents or punctuation: "Hill" matches "Hill, ST" but not "Hillside". Entries are plain text, never patterns.
- A list that's missing or empty makes its conditions false, sends nothing, and the page says to add it here.
- An agent can read and set lists with `get_lists` and `set_list`. A list it sets shows here at once.
## History
**In short:** everything pages keep on this Mac, in one list: each page's history and each page's sparkline readings. None of it syncs between Macs, and it leaves the Mac only when you export it.
The row at the top shows how much space History uses. The table lists each page with what it keeps, its size and its status, with anything that needs you first. **Show** narrows it to histories, sparkline readings or what needs attention.
- Select a row to see when it started, when it last collected, which pages read it, and any gaps. If it's paused, the fix is there too, such as **Continue this history** or **Start new history**.
- **Export…** saves the selection as JSON, and **Delete…** removes it from this Mac. Deleting can't be undone.
- **Details…** shows the readers, with **Grant…** and **Revoke**, each older history, and what was left out.
- An agent can see what this pane says, without the rows, with `get_history` or `legato history`.
See [History](https://legatobar.com/docs/history.md) for how pages collect and read a history.
---
# Trial and license
Legato works in full for 14 days after you install it. After that it needs a license: **Legato Pro**, $20 a year, or **Lifetime**, $80 once. Both include every feature; there are no other plans.
## The trial
The trial starts the first time Legato opens. There's no account, no sign-in and no card. Every feature works: every page, sources, buttons, notifications, and agents over MCP.
The trial belongs to the Mac, not to an account. Legato's licensing server counts it from the first time it saw this Mac, so reinstalling Legato or deleting its preferences doesn't start a new one. **Settings → License** shows when it ends.
Starting the trial needs the internet. Legato checks again about once a day while online. You can quit and reopen Legato offline without resetting its clock. After restarting your Mac, the trial needs one successful online check before showing pages. An ended trial stays locked and stops checking automatically.
When the trial ends, every page locks until you add a license. A locked page shows its title and a note, "Legato needs a license", instead of its cards. Nothing is deleted: the page files stay in the Pages folder as they are, and agents and scripts can still write them. `set_page` and `legato set` save the page and say it isn't shown yet. Once you add a license, every page shows again.
## Buying a license
| | Legato Pro | Lifetime |
| --- | --- | --- |
| Price | $20 a year | $80, once |
| Renews | Every year, until you cancel | Never |
| Macs | Up to 5 at a time | Up to 5 at a time |
Buy from the site: [Legato Pro, yearly](https://legatobar.com/buy/yearly) or [Lifetime](https://legatobar.com/buy/lifetime), or choose **Buy a License…** in **Settings → License**. Payment goes through Stripe Checkout. Afterwards, the page you land on shows your license key, and the same key is emailed to the address you paid with. Keep that email: the key is how support finds your license.
Buying makes an account from the purchase email. It's used for one thing: signing in to add the license to a Mac. You never need it to use Legato.
## Adding the license to a Mac
Open **Settings → License** on the Mac. It shows two ways in, one above the other:
**Sign in with your purchase email.** Enter the address you bought Legato with and choose **Send Code**. Legato emails a 6-digit code, which works for 10 minutes. Enter it and choose **Sign In**. Legato activates this Mac on that address's license and keeps the key; it doesn't stay signed in.
**Paste the key.** Paste the key from your email into **License key** and choose **Activate**.
Either way, Settings then shows the license, who it's licensed to, for Legato Pro the date it's paid through, and when it was last checked. Pages show again at once.
## Up to 5 Macs
One license runs on up to 5 Macs at a time. Each Mac you add it to takes one of the five; adding it on a sixth is refused, and Settings lists the five so you can release one there and then.
On a Mac that has the license, **Settings → License** has **Show the Macs Using This License**: each Mac by name, with when it was last checked. **Release** frees a Mac's place for another. **Release This Mac** frees the one you're on; Legato stops showing pages there until you add the license again.
A Mac keeps its place through reinstalls and new user accounts: adding the license again on the same Mac doesn't take another of the five.
## Checking and offline use
While online, Legato checks Pro about every three days and Lifetime about once a week. Trials check about once a day. Checks are spread out slightly to avoid everyone asking at once. Between checks it works offline. Pages, sources on your network, buttons, agents and scripts all run on the Mac and don't need Legato's server.
- **Legato Pro** keeps working for 30 days after its last check, plus 7 more if the server can't be reached. After that, pages lock until Legato can check again; **Try Again** in Settings checks at once. A yearly license also stops at the end of the period you paid for, with 3 days' grace while Stripe retries a renewal that didn't go through.
- **Lifetime** doesn't need to check in. Once it's activated on a Mac, it keeps working there for good, even if the licensing server is never reached again.
While the server can be reached, the scheduled check is also how a change reaches the Mac: a refund, or a Mac released from another Mac, ends the license on that Mac at its next check. A cancelled subscription doesn't end it early: it runs to the end of the year you paid for.
Legato keeps its activation and clock history in the Keychain. Restoring an old preferences file cannot restore a released license or an expired trial. The trusted clock keeps counting through sleep and app restarts during the same Mac session, even if the wall clock moves back. After a Mac restart, a trial needs fresh server time; a license keeps running offline. Missing authorization data requires an online check; Lifetime continues offline while its protected activation and purchase key are intact. If the purchase key is missing, sign in or enter it again; the cached activation alone cannot disable license checks.
After upgrading from a version that kept tokens in preferences, Legato needs one successful online check to create the protected record. If the purchase key is missing too, sign in with your purchase email or enter the key again. Your pages are kept.
If the server cannot be reached, automatic retries wait about 5 minutes, then 30 minutes, 2 hours and up to 6 hours. Quitting and reopening Legato does not reset that wait; restarting the Mac checks again at once. A server-requested delay may be longer. **Try Again** requests an immediate check when the Mac has a network connection; server rate limits still apply.
## Cancelling and refunds
Cancel Legato Pro at [link.com](https://link.com) (sign in with your purchase email), from the link in your receipt email, or by emailing support. Cancelling stops the next renewal. The license keeps working until the end of the year you paid for, then pages lock until you buy again.
A full refund revokes the license (and cancels a Legato Pro subscription), and it stops on every Mac at their next check. Refunds are given within 14 days of any charge. For refunds, cancellations and anything else about a purchase, email [support@legatobar.com](mailto:support@legatobar.com), or reply to your license email. The [terms](https://legatobar.com/terms) say when a refund is due.
## What Legato keeps about a buyer
The licensing server keeps:
- **Your purchase email**, for sending your key and for signing in to add a Mac.
- **Each Mac's hardware id, hashed.** Legato hashes the Mac's hardware id on the Mac, and only the hash is sent, so the id itself never leaves the Mac. It's how the server knows a Mac's trial and its place on a license.
- **Each Mac's name**, as in **System Settings → General → About**, so you can tell your Macs apart when releasing one.
Stripe handles the payment; Legato never sees your card. Your pages, the data they fetch, and your secrets never leave the Mac. See the [privacy policy](https://legatobar.com/privacy).
---
# Pages
A page is one screen of the panel: a title, an optional icon and up to 24 [cards](https://legatobar.com/docs/cards.md). Most pages have a row in the sidebar, and a [detail page](https://legatobar.com/docs/detail-pages.md) sits behind a card's link. Each page is a JSON file on your Mac, named after its id, so the page `budget` is `budget.json` in `~/Library/Application Support/Legato/Pages`.
Whatever writes the file decides what the page says. That can be an agent over [MCP](https://legatobar.com/docs/mcp.md), a script with `legato set`, or any program that saves JSON into the folder. A page can also name [sources](https://legatobar.com/docs/sources.md), and Legato then fetches its data on a schedule.
Legato watches the folder and loads a page within a second of a save. A file with a mistake stays in the sidebar as a page that says what's wrong.
## Write a page
- [Writing and versions](https://legatobar.com/docs/page-writing.md): The page id, the three ways to write the file, and versions for when two writers share a page.
- [Loading and status files](https://legatobar.com/docs/page-loading.md): How Legato picks up a saved file, and the status file that says whether it loaded.
## In the panel
- [Page behavior](https://legatobar.com/docs/page-behavior.md): The updated time in the footer, pinning the panel open, Shortcuts actions and a page's Details.
## Arranging pages
- [Periods](https://legatobar.com/docs/periods.md): A row for choosing Week, Month or Year, which the page's cards follow.
- [Detail pages and params](https://legatobar.com/docs/detail-pages.md): Pages behind a card's link, and one page file that serves every item of a list.
- [Sections and collections](https://legatobar.com/docs/sections.md): Grouping pages in the sidebar, and separate sets of them.
## Design
- [Page design](https://legatobar.com/docs/design.md): The design language Legato's own service pages follow.
- [Icons](https://legatobar.com/docs/icons.md): Page icons are SF Symbols, and where to find names.
---
# Writing and versions
A page is one row in the Legato panel's sidebar: a title, an optional icon and an ordered list of [cards](https://legatobar.com/docs/cards.md). Each page is a JSON file on your Mac, in `~/Library/Application Support/Legato/Pages`. An agent writes it through Legato's [MCP server](https://legatobar.com/docs/mcp.md), a script writes it with the `legato` command, or any program writes the file itself. Legato shows it as soon as the file is saved. Pages and their data never leave the Mac.
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "Homelab",
"icon": "server.rack",
"cards": [
{ "id": "nas", "type": "status", "label": "NAS", "state": "ok", "detail": "41% used" },
{ "id": "wan", "type": "stat", "label": "WAN down", "value": 912, "unit": "Mbps" }
]
}
```
| Key | | |
| --- | --- | --- |
| `title` | required | 1–60 characters. The page's name in the sidebar. |
| `title_from` | optional | A name for the panel's title row from a source's answer, such as the item a page with params shows: `{ "ref": "kuma", "value": rule }`. `title` stays the page's name, and shows until the source answers. See [Titled by its item](https://legatobar.com/docs/detail-pages.md#titled-by-its-item). |
| `cards` | required | 1 to 24 cards, top to bottom. A [`tabs`](https://legatobar.com/docs/card-text.md#tabs) card counts as one, and the cards in its tabs don't, up to 120 cards on the page in all. Each needs a unique `id` and a `type`. |
| `icon` | optional | An SF Symbol name, like `server.rack`. Lowercase words separated by dots, up to 64 characters. A name the Mac doesn't have shows a generic icon; see [Icons](https://legatobar.com/docs/icons.md) for where to find names. |
| `sources` | optional | Named sources Legato fetches on a schedule to fill cards: an API on the internet or your network, this Mac's calendars or reminders. See [Sources](https://legatobar.com/docs/sources.md) and [Buttons](https://legatobar.com/docs/buttons.md). |
| `notify` | optional | A macOS notification from this page: `{ "id": "deploy-142", "title": "Deploy finished", "body": "v2.15 is live." }`. Each `id` shows once; write a new one to notify again. See [Notifications](https://legatobar.com/docs/notifications.md#the-notify-field). |
| `sidebar` | optional | `false` makes it a [detail page](https://legatobar.com/docs/detail-pages.md#detail-pages), reached from other pages' links rather than the sidebar. Default `true`. |
| `$schema` | optional | Where an editor finds the page schema, for suggestions and checking as you type. See [The schema](https://legatobar.com/docs/page-writing.md#the-schema). |
| `schema_version` | optional | `1`, or left out. |
Any other top-level key, `light` included, stops the page loading, and Legato shows what's wrong in its place. A file is at most 1 MB.
## The page id
A page's id is its file name without `.json`: `homelab.json` is the page `homelab`. A new page's id is 1–64 lowercase letters, digits and hyphens, starting with a letter or digit (`budget`, `deals-electronics`). Card ids may also use `_`; page ids may not.
Legato loads every file in the folder whose name ends in `.json` and doesn't start with a dot, so a file you named some other way still shows, and the `legato` tools can still read, replace and delete it. Renaming the file changes the page's id.
## Writing a page
Every write replaces the whole page. There's no partial update: a card you leave out is gone. Build the whole page from your current data each time and write it.
There are three ways to write one, and they all end in the same file.
### From an agent, over MCP
The `legato` command inside the app is also an MCP server: `legato mcp`. [Connect an agent](https://legatobar.com/docs/connect-agent.md) to it, and the agent writes pages with these tools:
| Tool | Does |
| --- | --- |
| `set_page` | Creates or replaces a whole page. Its arguments are `page_id`, the page's keys (`title`, `icon`, `cards`, `sources`, `notify`) and an optional `if_match`. |
| `get_page` | One page, with its version and whether Legato loaded it. |
| `list_pages` | Every page in the folder, without its cards. |
| `delete_page` | Moves a page's file to the Trash. Takes `if_match`. |
| `get_page_schema` | The JSON Schema for `page`, `sources`, `notify`, one card type, or the shared `rules` and `actions`. With no part, the list of parts and every card type's fields. |
### From a script, with `legato`
The same tool is a command for scripts, at `/Applications/Legato.app/Contents/Helpers/legato`:
```bash
legato set homelab homelab.json # or pipe the page in: … | legato set homelab
legato get homelab
legato list
legato delete homelab
legato schema stat # page, sources, period, params, notify, title_from or a card type
```
`--if-match ` on `set` or `delete` acts only if the page is still at that version; see [Versions and if-match](https://legatobar.com/docs/page-writing.md#versions-and-if-match). Answers are JSON on standard output. A refusal is `{"error": {"code", "message", "details"}}` with exit status 1.
### What `set` and `set_page` do
1. Check the id and validate the complete page with Legato's file parser, without opening the panel or running sources: the page itself, and each card's source and buttons. An invalid page returns `invalid_page` before any file changes.
2. Write the file whole: to a temporary file in the folder, then renamed into place, so Legato never reads half a page. The tool writes the page in its own layout, keys in a fixed order and pretty-printed, with its own `$schema` line first.
3. Open Legato in the background if it isn't running.
4. Wait for Legato to load the page: up to 4 seconds, or 10 if Legato had to be opened.
5. Report whether Legato loaded those exact bytes. If a different running build rejects them, return `load_failed` with `saved: "true"`; the tool never rolls back over another save.
The answer says what happened:
```json
{
"id": "homelab",
"version": "3f9c2a7b1d0e4c58",
"changed": true,
"created": false,
"loaded": { "ok": true, "loaded_at": "2026-10-27T21:15:02.118Z" }
}
```
`changed` is `false` when the page is exactly what was there. Writing the same page again is harmless: the file is saved again, so the page's [update time](https://legatobar.com/docs/page-behavior.md#how-old-a-page-is) moves on, and nothing else changes. So a script can write on a schedule without checking whether anything changed.
`loaded` is `null` when Legato didn't confirm in time, with a `note`: "Legato hasn't confirmed loading it yet; get_page shows its status", or, when Legato isn't running, "it loads the page when it opens". When the trial has ended and there's no license, the page is saved but not shown, and `loaded.plan` is `"locked"`; see [Trial and license](https://legatobar.com/docs/license.md).
A refused write looks like this; the page stays as it was:
```json
{ "error": { "code": "invalid_page", "message": "homelab.json: /cards/1: a stat card needs label",
"details": { "page": "homelab", "saved": "false" } } }
```
### Any program, writing the file
A page is only a file, so anything that can write JSON can make one. Write to a temporary file in the Pages folder whose name starts with a dot or doesn't end in `.json` (`.homelab.json.tmp`, `homelab.json.tmp`), then rename it to `homelab.json`. Legato ignores the temporary file and loads the renamed one once. Writing the final name directly works too, but Legato may read it half-written and show an error until the next save.
To find out whether Legato took it, read its [status file](https://legatobar.com/docs/page-loading.md#status-files).
## Layout in the window
Without one, a page's cards flow down columns: a column for every 376 points of window, the cards in order down the first and on into the next. A page that wants its cards in a particular place, such as a home page with a wide chart and a table across the bottom, says where in `layout`:
```json
"layout": { "type": "grid", "max_width": 1600, "rows": [
{ "cells": [ { "cards": ["worth"], "weight": 2 }, { "cards": ["month", "pace"] } ] },
{ "cells": [ { "cards": ["attention"] }, { "cards": ["review"] }, { "cards": ["upcoming"] } ] },
{ "cells": [ { "cards": ["recent"] } ] } ] }
```
- **Rows** of 1 to 4 **cells**, up to 12 rows. A cell holds 1 to 6 cards, one under another, and its `weight` (1–4, default 1) is its share of the row: `2` beside `1` is two thirds.
- **Every card** the page draws is placed exactly once. Cards in a [tab](https://legatobar.com/docs/card-text.md#tabs) stay in their tab, and cards in Details stay there. A page with a layout has no [headings](https://legatobar.com/docs/sections.md).
- **`cards` stays the reading order.** A window too narrow for two cells side by side shows the cards in that order, one under another, so put them in the order you'd read them on a laptop.
- **Narrower windows:** a row whose cells can't each have their least width (about 300 points for most cards and for a columns chart, 420 for other charts, maps, heat maps and tiles, and 600 for a table) breaks into pairs, then one cell to a line.
- **A card that isn't showing** (its source's `when`) leaves its cell, and the cells left share the row.
- **`max_width`** (600–4000, default 1600) is the widest the cards get; a wider window centres them.
- **`look`**: `cards` (the default) draws each card on its own surface. `sheet` draws the page as one plain sheet with no card surfaces. The page's name is large at the top, each card's name is bold over a thin rule, money in has a + sign instead of green, and only an amount over budget is red. On a sheet, a list whose rows have buttons shows a box before each of those rows. Clicking the row opens it where it is, with its buttons underneath.
## Cards or a sheet
Without a layout, the window draws a page on cards or as a sheet. A page that's mostly lists goes on a sheet: more than half the cards drawn on the page are lists, checklists, agendas, timelines or tables, or tabs that hold only those. Headings and Details's cards don't count. Any other page goes on cards. `"look": "cards"` or `"look": "sheet"` on the page decides it instead, and a layout's own `look` wins over both. On a sheet, a card with a `fill` or a `tone` keeps its own coloured surface.
## The sidebar's count
`"sidebar_count": "todo"` names one of the page's cards. The sidebar then shows how many rows that card has beside the page's name, as Things counts a list: a list's items, a checklist's items still to do (all of them for a switch list), a table's rows, or an agenda's, timeline's or fleet's items. The count is grey, takes the page's status colour while the page lights, and isn't shown at 0 or while the card is hidden.
## Versions and if-match
Every page has a `version`: the first 16 hex characters of the SHA-256 of the file's bytes, such as `3f9c2a7b1d0e4c58`. `set`, `get` and `list` report it. A page that hasn't changed keeps its version; any edit, by an agent, a script or a person in an editor, gives it a new one.
To write only if the page is still at the version you last read, pass that version: `if_match` in the MCP tools, `--if-match` on the command line. If the file has changed since, the write is refused and nothing is saved:
```json
{ "error": { "code": "version_mismatch",
"message": "The page has changed since that version; read it again before replacing it.",
"details": { "current_version": "a01d77e9c3b2f640" } } }
```
`current_version` is `"none"` when the page no longer exists. Read the page again, rebuild it, and retry with the new version. `delete` takes it too.
To create a page only if there's no page with that id yet, pass `none` as the version. A script that adds pages then can't replace one someone made in the meantime.
Most agents don't need this: one agent owns a page and rewrites it whole. It matters when two runs might overlap, or when a person edits the file by hand and an agent shouldn't undo that.
## Reading pages back
`get_page` (`legato get`) returns the page as it is on disk, without its `$schema` line, with its version, when the file was last modified, and its load status:
```json
{
"id": "homelab",
"version": "3f9c2a7b1d0e4c58",
"modified": "2026-10-27T21:15:02.104Z",
"page": { "title": "Homelab", "icon": "server.rack", "cards": [ … ] },
"status": { "ok": true, "loaded_at": "2026-10-27T21:15:02.118Z" }
}
```
A file that isn't valid JSON comes back as `text` instead of `page`, so you can see what's in it. `status` is `null` when Legato hasn't loaded the file yet.
`list_pages` (`legato list`) lists the folder in Legato's order, by file name:
```json
{
"folder": "/Users/you/Library/Application Support/Legato/Pages",
"pages": [
{ "id": "homelab", "name": "Uptime", "title": "Homelab", "version": "3f9c2a7b1d0e4c58",
"modified": "2026-10-27T21:15:02.104Z", "ok": true }
]
}
```
`name` is the page's name in the sidebar: the one you gave it there, or its `title` (never a [`title_from`](https://legatobar.com/docs/detail-pages.md#titled-by-its-item) name, which changes with the answer). A page Legato couldn't use has `ok: false` and its `error`; a page that's locked has `plan: "locked"`.
## Deleting a page
`delete_page` (`legato delete`) moves the page's file to the Trash, and the panel drops it at once. Put it back from the Trash to restore it.
```json
{ "id": "deals-tv", "deleted": true, "note": "Moved to the Trash; put it back from there to restore it." }
```
A page that isn't there gets `not_found`. Deleting the file any other way does the same.
You don't need to delete a page because nothing has updated it lately; its footer already shows how long ago that was. Delete pages that no longer mean anything, like a deal that ended.
The person at the Mac has the last word. Right-clicking a page in the sidebar offers **Delete Page…**, which moves its file to the Trash too, with any detail pages (`"sidebar": false`) that only it leads to, so none is left stranded. The question names them. A page in the sidebar is never deleted along with another, and neither is a detail page another page still links to. `legato delete` and `delete_page` delete only the page they name. An agent that writes the page again creates it again: if someone keeps deleting your page, stop writing it. Renaming a page in the sidebar, moving it into a section or turning its notifications off doesn't change the file.
## The schema
The page schema is JSON Schema (draft-07) for a whole page: its keys, its sources and every card type, with each field's limits. Legato installs it in the Pages folder, at `.schemas/page.schema.json`, each time it starts, so an editor that supports JSON Schema (VS Code, for one) gives suggestions and flags mistakes as you type, offline. Point a page at it with:
```json
"$schema": "./.schemas/page.schema.json"
```
Older pages that say `./.schemas/local-page.schema.json` still work. The same schema is published at [legatobar.com/schemas/page.schema.json](https://legatobar.com/schemas/page.schema.json), and `get_page_schema` (`legato schema`) serves it in parts. For a page you keep elsewhere, download it and point `$schema` at your copy.
The schema can't know what an API answers, so it can't tell whether a source's mapping picks the right data; the [Source Preview](https://legatobar.com/docs/source-preview.md#preview-before-polling) can.
## Errors
The tools refuse with these codes, in the same `{"error": {"code", "message", "details"}}` shape:
| Code | Means |
| --- | --- |
| `invalid_page` | The page has a key it can't, no `title` or no cards, isn't a JSON object, or Legato's parser found a mistake. The message says which. Nothing was written. |
| `load_failed` | The page was saved, but the running Legato, from a different build than the tool, couldn't load it. Reopen Legato. |
| `validation_unavailable` | The tool couldn't run Legato's page check; nothing was written. Reinstall Legato. |
| `invalid_page_id` | The id isn't a page id, or a new page's id isn't lowercase letters, digits and hyphens. |
| `too_large` | The page is larger than 1 MB. |
| `version_mismatch` | The page isn't at the `if_match` version. `details.current_version` says where it is. |
| `not_found` | There's no page with that id. |
| `write_failed`, `delete_failed` | The file couldn't be saved or moved to the Trash; the message says why. |
| `schema_unavailable` | The schema isn't installed yet. Open Legato once. |
| `unknown_part` | `get_page_schema` was asked for a part it doesn't have; the message lists them. |
| `invalid_arguments` | A command was missing its page id or file, or `--if-match` its version. |
See [Errors](https://legatobar.com/docs/errors.md) for handling them in an agent.
---
# Loading and status files
## How Legato loads a page
Legato watches the Pages folder and loads a page within a second of a change: a new file, a save, a rename or a removal. It also looks over the folder every 15 seconds, in case a change notice never arrives. Hidden files, and names that don't end in `.json`, are ignored.
Legato checks each page when it loads it. A page with a mistake is never dropped quietly: it stays in the sidebar, titled with its file name and a warning icon, with one card, **Can't read this page**, that says what's wrong, such as `homelab.json: not valid JSON` or `homelab.json: cards must list 1 to 24 cards`. Fix the file and save it, and the page comes back.
A mistake inside one card's [source](https://legatobar.com/docs/sources.md) or [buttons](https://legatobar.com/docs/buttons.md) is smaller: that card alone shows a warning that says what's wrong, and the rest of the page works.
Legato checks what it needs to draw each card: its type, its required fields and the kind of each value. It doesn't check every limit the [schema](https://legatobar.com/docs/page-writing.md#the-schema) sets, such as a label's length, or catch a misspelled optional field, which it ignores. Use the schema in an editor, or `get_page_schema`, to catch those.
## Status files
Each time it reads a page file, Legato writes that page's status to `Pages/.status/.json`, so a script that writes a page file can tell whether Legato accepted it. `get_page` and `list_pages` read the same files.
```json
{ "error": null, "loadedAt": "2026-10-27T21:15:02.118Z", "ok": true, "page": "local:homelab", "version": "3f2a9c41d07be815" }
```
| Field | Meaning |
| --- | --- |
| `ok` | `true` when the page loaded. `false` when Legato can't use the file; the panel then shows **Can't read this page**. |
| `error` | `null`, or why the file can't be used: the same message the panel shows. |
| `loadedAt` | When Legato last read this page's file, in ISO 8601 UTC with milliseconds. A status is written again when its file changes, when a trial or license starts or ends, or after Legato couldn't write it or read its file. A file that can't be read keeps its last good read and is tried again at each check. |
| `version` | Which bytes the status is about: the first 16 hex characters of the SHA-256 of the file Legato read, the same version `legato get` reports. Wait for the `version` of what you wrote before reading `ok`; a different one means another save came after yours. |
| `page` | Legato's own name for the page: `local:` and the page id. |
| `plan` | Only when the trial has ended without a license: `"locked"`. The page loaded, and shows again once there's a license. |
`ok` describes the page as a whole: a card whose source or buttons are wrong still has its own warning in the panel. A status is removed with its page file. Statuses are written only while Legato is running. The `.status` folder is readable only by your user account, and Legato never writes through a symbolic link in it.
---
# Page behavior
## How old a page is
Every page's footer says when it was last updated: "Updated 3 minutes ago". For a page with sources, that's the newest answer any of its sources gave; otherwise it's when its file was last saved. Pages never expire or grey out. If whatever writes a page stops, the footer simply keeps counting, so a page that says "updated 2 days ago" tells you its writer has gone quiet.
Every write counts, changed or not, so an agent that writes the same page on a schedule keeps the footer current. `get_page` and `list_pages` report the file's `modified` time.
**Show update times** in Settings → General hides the time, and pointing at the footer still shows it. Each page can also set its own: right-click it → **Show Update Time** → **Always**, **Never**, or only after 1 hour, 1 day, 2 days or 1 week without an update, so a page that's gone quiet says so and a busy one stays tidy.
## Keeping the panel open
The panel closes when you click another app, as a menu does. To keep a page in view while you work, click the pin at the top right of the panel (⌘P). Pinned, the panel stays open when you click elsewhere, floating over other windows, and opens pinned next time. Clicking Legato's menu bar icon or pressing Escape still closes it. Click the pin again to go back to closing like a menu.
On a page with sources, the arrow left of the pin reads them all again now (⌘R). A service that asked Legato to wait before its next request still gets that wait.
## Shortcuts
Legato adds four actions to the Shortcuts app. Search the action list for Legato to find them. They reach every page in the panel, detail pages included, and every button under a card.
- **Open Page** opens the panel on a page, as choosing the page in Spotlight does.
- **Page Summary** returns one line built from the page's cards, up to six of them. Charts, links and other cards without a value are left out.
- **Get Card Value** takes a page and one of its cards, and returns the card's value: a number where the card has one, and its text, with the unit and any detail (a pacing card's target, for example). It works on stat, gauge, pacing, breakdown, flow, sparkline, status, countdown and window cards; a flow card's value is everything that flows. A status card gives its state as text (`ok`, `warning`, `critical`, `unknown` or `off`) and no number. A countdown gives the seconds until its moment, negative once it has passed, and a window the seconds until it ends or starts. When a card has no value at the moment, the action stops and says what the card shows instead.
- **Press Button** presses a button as the panel does and returns its result. A button without a [`success`](https://legatobar.com/docs/buttons.md#buttons) check asks before it runs. An [`add-event`](https://legatobar.com/docs/source-calendar.md#calendar-sources) button adds its event without the form.
Open Page brings the panel up; the other three run without it. Siri runs them through a shortcut: ask for the shortcut by its name.
This shortcut opens Packages when something is out for delivery: **Get the value of** Out for delivery **on** Packages, then **If** Card Value **is greater than** 0, **Open** Packages.
## Details
Click the Details button (a bulleted list) at the right of a page's title, beside Refresh (⌘I), or choose **Details** from the page's menu. A card slides in over the page with what the Mac knows about it, and stays until you close it with the same button, ⌘I, Escape or a click outside. Long lists show their first five rows and **Show more**.
The button is always the same grey list: problems reach you as [notifications](https://legatobar.com/docs/notifications.md) and the [Dock badge](https://legatobar.com/docs/notifications.md#the-dock-badge).
- **Health:** the page's [health cards](https://legatobar.com/docs/card-lists.md#in-page-info), first, with all they say: each status card's state and detail, and every item of a fleet under its group. A row with a link opens it. Two switches sit at each card's right. The bell has three settings, and a click moves to the next: plain, the card follows the page's **Notify about**; filled, it notifies about every change, a pause or a switch turned off included; crossed out, it's muted, so it doesn't notify, log activity or count in the Dock badge. The line lets it show in the line under the page's title.
- **Settings:** one list. **Notify about** (Problems, Every change or Nothing), **Mute** (for 1 hour or until tomorrow morning), **Dock badge**, **Line under the title**, **Update time**, **Icon in title** and **Home page**.
- **Sources**, **Buttons pressed** and **Rules** fold to one line each with a count: each source's host (or Calendar or Reminders), how often it fetches, and when it last answered with the secret it uses (by name, never the value), or what went wrong; each button pressed on this Mac and how many times; each rule and when it last ran.
- **Recent activity**, below, open to begin with.
- Last, when the page file changed, with icons that show it in Finder and copy the page as a prompt.
With the Claude desktop app, ChatGPT's Codex or Grok Bot installed, **Discuss in Claude**, **Discuss in Codex** and **Discuss in Grok Bot** in the same menu open a chat about the page, its message box filled with a prompt that names the page and its file. Codex opens the Pages folder as the chat's workspace, and asks you to trust it the first time. Grok Bot puts the prompt in its main chat (keeping a message you haven't sent) and takes up to 1,000 characters, so a card's prompt there names the card rather than carrying its data.
Nothing is sent until you send it. **Assistants** in Settings → General turns off the ones you don't use, here and in every Discuss menu.
To talk about one card, right-click it: in Claude and Codex, the prompt carries the page and its file, the card in a line, its current data as Legato has it, and the source that fills it and any problem with it. A section title brings the cards under it. It's all in the message box to read and change before you send it.
**Copy as Prompt**, beside them in a card's right-click menu and the page's menu, and the copy icon at the bottom of the Details card, puts the same prompt on the clipboard instead, with the card's data whichever app you paste it into. It's there even when none of these apps is installed.
## Recent activity
Near the bottom of a page's [Details](https://legatobar.com/docs/page-behavior.md#page-info) is **Recent activity**: each time one of the page's cards went from one level to another over the last 7 days, newest first. The cards counted are the ones [notifications](https://legatobar.com/docs/notifications.md) follow: a `status` card's `state`, the band a `gauge`'s value is in, and each `fleet` item. An entry looks like "API · Warning → Critical · 2:14 PM". `unknown`, and a gauge value outside every band, don't count. The first level Legato sees for a card isn't a change, so a page starts with no activity.
The Mac records this itself, whatever the page's notification setting: only each card's `id` and levels and the time, up to 50 changes per page. **Recent activity** in Settings → General turns it off, which also clears it. Keep a card's `id` the same from write to write, or its history starts over.
## Welcome pages
Legato comes with starter pages, in a **Welcome** section of the sidebar. **Welcome to Legato** comes first and links to the others, and to a playlist to listen to while you look around. The rest open only from its lists, not the sidebar: **Your first page** adds Service status or RSS Feeds from a template (neither needs a key), shows the command that connects Claude Code or Codex, what an agent can do, and how a page stays up to date. **Navigating Legato** shows pages, sections, collections and how to get around, with a short moving picture for each. **Notifications** explains notifications and muting a collection. **Secrets and lists** shows where keys and passwords are kept (the Keychain or 1Password), their expiry dates, and lists of your own places and names that pages check. **Cards** shows every card a page can use, with made-up numbers, grouped into sections you open one at a time, so you know what to ask for. **Prompt Library** has things to ask your assistant, grouped by work, home, money, health, travel and development, each with a button that opens it in Claude or Codex, and the templates that already do some of them.
Legato opens on Welcome to Legato the first time. The starter pages are built into the app: they aren't files in the Pages folder, and they don't count as your pages.
To remove one, choose **Delete Page…** from its right-click menu. It's gone for good on this Mac: it isn't in the Trash, and updates don't bring it back. Its entry on the Welcome page goes too. The Welcome section is an ordinary one, so you can rename, move or delete it. A starter page added in a later version joins the Welcome section, unless you've deleted the section.
---
# Periods
A page can have a period under its title for choosing the span of time its cards show: Week, Month and Year, or Last 7 days and Last 30 days. It's one capsule, **This month Oct 1 – 21**, that names the choice and its days; click it for the choices as pills and a calendar. The cards that read that span follow the choice together. [Spending by period](https://legatobar.com/features#spending) on Features is such a page, with figures an agent wrote; its row works there.
```json
"period": {
"choices": [
{ "id": "month", "label": "Month", "span": "month" },
{ "id": "week", "label": "Week", "span": "week" },
{ "id": "30d", "label": "Last 30 days", "last_days": 30 }
]
}
```
- **A choice says what it means.** `span` is this calendar `day`, `week`, `month` or `year`; weeks start on the Mac's first day of the week. `last_days` is today and the days before it, so `30` is today and the 29 days before. `last_hours` is the last whole hours, this one included: `24` ends with the current hour, so a chart of its hours is always full and its last column is Now. Legato works out the dates each time a request goes out.
- **The first choice is the default.** Each Mac remembers the one picked on each page. Two to six choices, shown as pills at the top of the capsule's calendar.
- **A card follows the period when its source asks for it**, with `{period.start}` and `{period.end}` in a request where it would have written `{date.month_start}` and `{date.month_end}` (see [Dates in requests](https://legatobar.com/docs/source-requests.md#dates-in-requests)). Cards whose sources don't, such as an account balance, stay as they are; put them under a [heading](https://legatobar.com/docs/card-text.md#heading) that says so, like **Current balances**.
- **Choose a view by the selected choice.** In a source, `{period.id}` becomes its choice id, such as `today` or `week`. A derived value `{ "name": "shown", "value": { "template": "{period.id}" } }` lets a card use `when: { "path": "shown", "equals": "today" }`. The id stays the same while stepping. It is available in sources, not card text, and there is no `{compare.id}`. Do not infer the choice from the number of readings: a week may have none or one.
- **A choice can change more than the dates.** Some services keep the same readings at different steps: UniFi's ISP metrics come every 5 minutes for the last day and hourly for 30 days, at different paths. Give each choice `values`, short words its requests take as `{period.}`:
```json
"period": { "choices": [
{ "id": "today", "label": "Today", "last_days": 1, "values": { "interval": "5m" } },
{ "id": "month", "label": "30 days", "last_days": 30, "values": { "interval": "1h" } } ] },
"sources": { "metrics": { "url": "https://api.ui.com", "secret": "unifi", "auth": { "type": "header", "name": "X-API-Key" },
"requests": { "metrics": "/v1/isp-metrics/{period.interval}?beginTimestamp={period.start_at}" } } }
```
Every choice names the same ones, up to 4, and each value is 1 to 64 letters, digits, `.`, `_`, `~` and `-`. A name can't be one of the period's own (`start`, `id` and the rest). Like `{period.id}`, they're for sources, not card text, and have no `{compare.…}`.
- **Looking at another period changes nothing else.** Status, gauge and fleet cards always use the default choice, so the page's status and [notifications](https://legatobar.com/docs/notifications.md) don't move when you look at last year, and a sparkline's [`history` rule](https://legatobar.com/docs/mapping-sparklines.md#sparkline-readings) can't follow a period.
- **Step back through the calendar.** With `"step": true`, arrows at the start of the capsule step a `span` choice back a day, week, month or year at a time: **‹ September ›**, or **‹ Tue, Oct 20 ›** for a day. The calendar inside goes straight to any day (or week, month or year): up to a year of days back, or 59 weeks, months or years. **This month** (or week, or year, or **Today**) appears in grey beside the capsule to come back, and ⌘← and ⌘→ step and ⌘T comes back from the keyboard. A page that steps can have a single choice, and `"future": true` lets the arrows go ahead as far, for plans and forecasts. A `last_hours` choice steps back that many hours at a time, **‹ 11 AM – 10 AM ›** with **Now** to come back, and one of 24 takes the calendar too: a day picked there is the 24 hours ending at this hour on that day. Rolling days don't step: there's no "one back" for the last 30 days. A window of hours is for sources that take moments (`{period.start_unix}`, `{period.end_unix}`): History datasets and figures an agent writes for the period still go by whole days. A stepped page comes back to now the next day, and when Legato opens.
```json
"period": { "step": true, "choices": [ { "id": "month", "label": "Month", "span": "month" } ] }
```
- **Mark the days that have something.** `marks` puts a dot under each day of the calendar that has rows, a bigger one for a bigger total, so a busy day stands out before it's picked. `ref` names one of the page's sources and `value` is a rule giving rows of `at` (Unix seconds, an ISO 8601 moment or a `YYYY-MM-DD` day) and an optional number `value`. The calendar shows months outside the period, so that source reads a window of its own and can't use `{period.…}`. Drives marks each day by its miles:
```json
"period": { "step": true, "choices": [ … ],
"marks": { "ref": "car-days", "value": { "each": "results", "fields": { "at": "started_at", "value": "odometer_distance" } } } }
```
- **One item of the period.** A page that shows one thing from the period's list, such as the drive on a map, can name it with a param whose `default` is the period's end, `"{period.end_unix}"`, on an integer param. A row's link sets it (`legato://page/tesla-trips?at=1795500000`); while the value falls inside the period shown it stays, and once the period moves past it the default comes back, so the page shows the newest item of the new span. Such a param is for sources only.
- **Compare with the period before.** `"compare": "previous"` adds `{compare.start}` and `{compare.end}` (and their `_at` moments) for a second request: the same stretch of the period before, so October so far, Oct 1 – 21, is compared with Sep 1 – 21, not all of September. A whole span compares with the whole one before, and the last 30 days with the 30 days before them. The capsule is followed by **vs Sep 1 – 21** when there's room. A card's own text can name the days too, with `{period.dates}` and `{compare.dates}`:
```json
"requests": {
"now": "/v2/summary?start_date={period.start}&end_date={period.through}",
"before": "/v2/summary?start_date={compare.start}&end_date={compare.end}"
}
```
```json
{ "id": "spent", "type": "stat", "label": "Spent", "unit": "USD",
"source": { "ref": "money", "map": { "value": "now.total", "delta": "change" } } }
```
Work out `change` with a [derived value](https://legatobar.com/docs/mapping.md#derived-values) that subtracts `before.total` from `now.total`. While the period is still going, `{period.end}` is still its last day (Nov 30); a service that returns rows dated ahead, such as scheduled transactions, counts those against a comparison that stops at today's date last month. Use `{period.through}`, today while the period is going, for a like-for-like pair.
- **Written by an agent.** A card without a source can follow the period too, since the page has to carry its figures: whoever wrote them isn't there when someone picks another choice. One value a day, with `daily`, suits anything that adds up, such as spending or steps. Legato works out the period's figure from it, a sparkline's points, and columns by day, week or month. Longer rolling ranges group adjacent months to keep the whole range in the chart; each bucket is labelled with its first month and year. A current chart counts readings only through today. `aggregate` is `sum` (the default), `mean`, `last` (a balance), `min` or `max`, and with the period's `compare`, `"compare": true` makes a stat's delta the change from the stretch before.
```json
{ "id": "spent", "type": "stat", "label": "Spent", "unit": "USD",
"daily": { "values": [["2026-10-01", 62], ["2026-10-02", 148]], "aggregate": "sum", "compare": true } }
```
Figures that don't add up, such as an average or a count of distinct things, go in `periods`: the card's values for each choice, each entry saying which days it covers. The entry whose `from` is the first day showing is used, so stepping back finds September if it was written. With nothing for the days showing, the card says so rather than show another period's numbers; on the 1st of a month not yet written, last month's entry shows with **Covers Oct 1 – 31** under it until it's replaced. A rolling choice's days move every day, so its entry matches only on the day it's written, and shows with **Covers …** after that until it's written again. Every entry is checked when the page is read, whichever choice shows.
```json
{ "id": "avg", "type": "stat", "label": "Average order", "unit": "USD", "periods": [
{ "choice": "month", "from": "2026-10-01", "to": "2026-10-21", "updated": "2026-10-21T09:40:00-05:00", "value": 38.2 },
{ "choice": "week", "from": "2026-10-18", "to": "2026-10-21", "value": 41.5 } ] }
```
- **A link carries the period.** Following a card's [link](https://legatobar.com/docs/card-fields.md#links-to-other-pages) to another page with a period opens it on the same kind of choice, stepped as far back: Week on Oct 18 – 24 on Health opens Steps on Week, Oct 18 – 24. Choices match by what they mean (`"span": "week"`, `"last_days": 7`), not by their ids or labels. If the page can't step that far it goes as far as it can, and a page with no choice of that kind keeps its own. It only goes forward: Back returns to the first page as you left it, and a page opened from the sidebar, Spotlight or Shortcuts shows its own choice. Give [detail pages](https://legatobar.com/docs/detail-pages.md#detail-pages) the choices their overview has, so every link keeps the period.
- **Each choice is its own fetch.** Only the period showing is fetched, along with the default when a status, gauge or fleet card reads it. Switching back to a period you looked at shows its last answer at once while it's fetched again. A new day or time zone clears period answers before they can appear under new dates. Shortcuts' Get Card Value and page summaries always read the default choice at its current dates, without changing the period showing in the panel.
---
# Detail pages and params
## Detail pages
A page with `"sidebar": false` isn't listed in the sidebar. It's the page behind a link: a "Garage door open" card on your home page leads to a Security page with every door and sensor, and Back returns. Link to it from any card that takes a link, with `legato://page/ID` (see [Links to other pages](https://legatobar.com/docs/card-fields.md#links-to-other-pages)), and from as many pages as you like.
```json
{ "title": "Security", "icon": "lock.shield", "sidebar": false, "cards": [ … ] }
```
- Arrived at by a card's link, the title row starts with the way back, named: **‹ Home**. A page [titled by its item](https://legatobar.com/docs/detail-pages.md#titled-by-its-item) is named in it by that item, the one that step goes back to. ⌘[ goes back too, and back on the first page, the cards are scrolled where you left them, with the same tabs and sections open.
- Only navigation changes. A detail page fetches its sources, notifies, and lights the menu bar icon like any other page, and Spotlight and Shortcuts find it, so you can always reach it.
- It can't be the [home page](https://legatobar.com/docs/sections.md#organizing-pages-into-sections): **Open on** lists only sidebar pages, and a home page that becomes a detail page is set aside, as a missing one is, until it's back in the sidebar. With **Last page viewed**, the panel reopens on a detail page if that's where you were.
- Behind a page with a [period](https://legatobar.com/docs/periods.md#periods), give it the same choices: a link opens it on the period the overview shows. See [Overview and detail pages with a period](https://legatobar.com/docs/design.md#overview-and-detail-pages-with-a-period).
- `legato list` and `list_pages` mark it with `"sidebar": false`. To list it in the sidebar again, take the key out or set it to `true`.
### One page for every item
When every item of a fleet gets the same detail page (each guest on a server, each project in a to-do app), write the page once with `params`, and let each item's link say which one it's showing. Legato fills the values in wherever the page says `{param.name}`: a source's requests, a button's path and body, a card's text and the title.
One file, every project: the link that opens Home sets project, and {param.project} in the page's request fills with it. Launch's link opens the same page with Launch's tasks.
```json
{ "title": "Guest", "icon": "server.rack", "sidebar": false,
"params": { "vmid": { "type": "integer", "example": "100" } },
"sources": { "guest": { "url": "https://pve.example.com", "secret": "proxmox",
"requests": { "status": "/api2/json/nodes/pve/qemu/{param.vmid}/status/current" } } },
"cards": [ … ] }
```
The link names the value: `legato://page/proxmox-vm?vmid=109`. A fleet or bars row maps it from its source, as `"url": { "template": "legato://page/proxmox-vm?vmid={vmid|raw}" }`, so a guest added later has a working page at once.
| Field | | |
| --- | --- | --- |
| `type` | optional | `string` (the default) or `integer`: digits only, and a string that is the token alone, such as a request body's `"vmid": "{param.vmid}"`, becomes the number. |
| `pattern` | optional | A regular expression the whole value must match, such as `[0-9]{3}`. |
| `type: "text"` | optional | A name of 1 to 40 characters. Allows letters in any script, digits, spaces and `. , ' - ( ) &`. No leading or trailing spaces. |
| `type: "query"` | optional | What someone typed to search for, from a [form that opens a page](https://legatobar.com/docs/button-input.md#forms-that-open-a-page): 1 to 200 characters on one line, anything but `{`, `}`, tabs, other control characters and marks that reverse the reading order, such as `tag:bills "late fee"`. No leading or trailing spaces. |
| `example` | required | The value the page is checked with when no link gives one: by `legato set`, `--validate-page` and the Source Preview window. |
| `list_key` | optional | A list's name: the value is a host's key on that list, for [a page about one host](https://legatobar.com/docs/source-requests.md#a-page-for-one-host-on-the-list) of a host list. No `type`, `pattern` or `default`. |
| `selects` | optional | `true` when the value picks something on the page, such as a row of its list, rather than another item. While the page reads again for a new value, it draws at once from its last answer: cards that don't read what the value changes stay as they are, and the rest show their last shape in grey until their answer is back. Pi-hole's Queries page takes the query you click this way. |
- **A value is checked before it's used.** A link can come from any app. A string or integer value is 1 to 64 letters, digits, `.`, `_`, `~` and `-`, and matches the parameter's type and pattern. A string parameter with its own `pattern` may also take `:` and up to 128 characters, for ids like a UniFi console's (`900A…:123456789`): the colon goes into a request's path or query as `%3A`, and into a body as written. One that doesn't is refused, so it can't reach another route or another field.
- **Up to four** params, named with lowercase letters, digits and `_`. A link gives them as `?name=value&name=value`, each once; names the page doesn't take are ignored.
For a place name, declare `"name": { "type": "text", "example": "Lake cabin" }` in `params`. Open it with `legato://page/open-meteo?name=Lake%20cabin`. A title of `"{param.name}"` shows `Lake cabin`. Text values are decoded from the link and checked. They are percent-encoded when filled into request URLs. `pattern` and `default` work for text too. A `query` value is handled the same way: decoded from the link, checked, percent-encoded in request URLs, and filled in as it was typed everywhere else, such as a title of `"{param.q}"`.
- **Without defaults, opened without acceptable values** (from a link that names none, or a value it refuses), the page shows only a line saying it opens from a link. Nothing is fetched.
- **Without defaults it sets no light and posts no notification,** since what it shows depends on the link: the page that lists the items watches them. Its buttons stay in the panel, and aren't offered to Spotlight or Shortcuts, which would press one without saying which item it's for.
- A name with spaces or emoji can't travel in a link, so put an id in the link and let the page take its name from the source with [`title_from`](https://legatobar.com/docs/detail-pages.md#titled-by-its-item).
- **The icon can come from a param too:** `"icon": "{param.icon}"` for an SF Symbol (`?icon=server.rack`), or `"icon": "si:{param.brand}"` for a logo, the prefix written in the page since a value can't hold `:`. Opened without values, the page shows Legato's default icon.
- Parameterized pages remember the item in Back and Forward history. Background Shortcuts reads do not accept an item parameter yet, so Get Card Value and page summaries read the defaults when present and otherwise refuse these pages. Parameter values cannot be `.` or `..`.
#### A default item
Give every param a `default` to make one item the page's home. Each default must pass the same type and pattern checks as a link value. Give every param a default, or none.
```json
{ "title": "Weather",
"params": {
"lat": { "example": "33.44", "default": "33.44" },
"lon": { "example": "-94.04", "default": "-94.04" }
},
"sources": { "weather": {
"url": "https://api.openweathermap.org",
"secret": "openweather", "auth": { "type": "query", "name": "appid" },
"requests": { "one": "/data/3.0/onecall?lat={param.lat}&lon={param.lon}&units=imperial" }
} },
"cards": [{ "id": "temperature", "type": "stat", "label": "Temperature", "value": 0,
"source": { "ref": "weather", "map": { "value": "one.current.temp" } } }]
}
```
This page can stay in the sidebar. Opening it there, in Spotlight or from a link without values shows the defaults. The default item fetches on schedule, counts in the Dock badge, posts notifications and offers buttons to Spotlight and Shortcuts.
A link with other values shows that item in the panel. It sets no light and posts no notification. The default item keeps fetching and watching in the background. A link with the default values returns home too. Shortcuts and external buttons always use the default item.
#### Titled by its item
`title_from` names the panel's title row from a source's answer: the monitor, guest or package the link opened. `ref` names one of the page's sources, and `value` is a [rule](https://legatobar.com/docs/mapping.md#mapping), read against that source's answer as a card's `map` is:
```json
{ "title": "Monitor", "sidebar": false,
"params": { "id": { "type": "integer", "example": "1" } },
"title_from": { "ref": "kuma", "value": { "first": "monitor_name", "of": "monitors",
"where": { "path": "monitor_id", "equals": "{param.id}" } } },
"sources": { "kuma": { "url": "https://status.example.com", "secret": "kuma", "auth": { "type": "basic" },
"requests": { "monitors": { "path": "/metrics", "format": "prometheus", "group_by": "monitor_id" } } } },
"cards": [ … ] }
```
Opened from `legato://page/uptime-monitor?id=4`, the title row says **Git** once the source answers, and **Monitor** until then.
- **`title` is the fallback.** It shows before the first answer, when the rule gives nothing (no monitor 4, a field the answer lacks, a template missing any of its values), and while the source needs access. A source that stops answering keeps the last name it gave.
- **One line of plain text,** up to 60 characters: line breaks become spaces, and a longer name ends in "…". Nothing in it is read as a link or markdown.
- **The title row, the Back trail and notifications** use it. The sidebar, Settings, Spotlight and Shortcuts, `legato list` and `list_pages` keep `title`, the page's own name; renaming the page with **Edit…** changes `title`.
- **It reads the source on its own,** sharing the fetch with the cards that use the same source, so a card that's hidden or has a mistake doesn't change the name. On a page with a [period](https://legatobar.com/docs/periods.md#periods), the source is read for the first choice, the default, as status cards are: the name doesn't change with the period showing.
- Any page can have one, but it's for a page about one item; a page about a whole service keeps a written title. It can't name a history (a `dataset` source).
## Views
A page and its siblings can show as tabs under one title, as Tesla's Overview, Drives and Charges do. The leading page lists them once, itself among them:
```json
"views": [ { "page": "tesla", "label": "Overview" }, { "page": "tesla-trips", "label": "Drives" }, { "page": "tesla-charging", "label": "Charges" } ]
```
- Each view stays its own page, with its own file, sources, layout, period and params, so `legato://page/tesla-trips` opens the Drives tab.
- The sidebar shows the leading page alone and keeps it selected on any of its views. The title row keeps the leading page's name, icon and title-row controls on every view, and the tabs sit under it, underlined.
- 2 to 8 views, each page once, labels of 1 to 24 characters. A view whose page isn't there is left out of the tabs.
- The tabs are drawn on pages with `"look": "sheet"` in the window. Give each view a sheet layout.
---
# Sections and collections
## Organizing pages into sections
The sidebar can group pages under named sections that open and close. Pages and sections are arranged right in the sidebar. Right-click an empty part of the sidebar, or a section's header, and choose **New Section**.
Drag a page anywhere in the sidebar: among a section's pages, or just under its header, puts it in that section (an empty or closed one too), and above every header takes it out again.
Or right-click a page and choose **Move to… → Sections**: pick a section, choose **New Section** to start one with that page, or **Ungrouped Pages** to put it back in the top list. An empty section shows **Drag pages here** under its header.
Ungrouped pages come first, then each section in order: drag a section's header to move the section, its pages with it.
Click a section's header to close or open it (an arrow appears when you point at it); Legato remembers the choice.
Right-click a section header and choose **Edit…** to change its name and give it an icon, or **No icon** to show its name alone; **Remove Icon** in the same menu takes an icon away. **Delete Section** keeps its pages and returns them to the ungrouped list. Drag pages or section headers to reorder them. **Move to…** offers sections and collections without dragging. Right-click a page and choose **Edit…** to rename it or choose its icon, or **No icon**. The editor opens under what it edits. Save, Return or a click outside it writes the new `title` and `icon` into the page's file, as an agent's `set_page` would; Cancel or Escape changes nothing, and closing it unchanged writes nothing. **Choose Icon…** shows the icon picker in the editor's place.
The window opens on the page last viewed. To open it on the same page every time, right-click that page and choose **Home Page**, or pick it under **Open on** in [Settings → Pages](https://legatobar.com/docs/settings.md#pages). Pages opened from Spotlight, Shortcuts or a notification still open on their own, and Back returns from the home page to the page left. Renaming a page keeps it home. A home page whose file goes away, deleted or renamed (its id comes from the file name), isn't forgotten: the window opens on the last page viewed until a page with that id is back. Deleting it with **Delete Page…** clears it.
A section's name is up to 40 characters. Sections and order are kept by page id, outside the page files, so an agent rewriting a page never moves it, and a page deleted and written again lands back in its section. A page's name and icon are its own `title` and `icon`: an agent that rewrites the page with another title renames it.
## Collections
Collections give the sidebar separate sets of pages and sections, up to nine. Choose **New Collection** from the sidebar's right-click menu or the chevron menu beside the sidebar toggle, then give it a name and an icon. The first collection, **Pages**, keeps your existing arrangement. Your new collection starts empty.
Click a collection's icon to return to the page you last viewed there. Up to four icons sit beside the sidebar toggle, the current one always among them. The chevron after them shows the rest, each with its icon and ⌘ shortcut. With the panel open, ⌘1 through ⌘9 select them in order. Save or cancel an event draft before switching.
Right-click a page or section and choose **Move to… → Collections**. Moving a section brings its pages with it; moving one page puts it at the top of its destination's ungrouped pages. You can also drag a page or section onto a collection icon. Dropping it onto its current collection leaves its placement alone. The Move menu reaches every collection, including ones whose icons don't fit.
Right-click an icon and choose **Edit…** to change its name and icon, or use its menu to move it left or right, or delete it. Drag one collection icon onto another to put it in that one's place. Deleting a collection moves its contents into the original collection and never deletes page files. The original collection can't be deleted. **Undo Delete Collection** is in the chevron menu until you make another preferences change.
Choose **Settings → General → New pages go to** to set the destination for new sidebar pages. You can also right-click a collection icon and choose **Use for New Pages**. This affects pages when Legato first loads them; existing pages keep their placement, including when an agent updates them. Deleting that destination resets it to the original collection. Detail pages do not get a collection. Following a link to a sidebar page switches to its collection; a detail page keeps the collection you came from. Back and Forward remember that context. An empty collection shows an empty page area.
Collections, their order and their last-viewed pages stay on this Mac. They don't change page JSON, fetching or notification settings.
The icon editor has a searchable browser with categories and recent choices. Search ordinary words such as “home”, “money” or “server”, then choose an icon and save the collection. **Use a symbol name** is optional, for symbols outside the bundled catalog.
Agents can arrange collections and sections too: `get_sidebar`, `set_collection`, `set_section`, `move_page`, `delete_collection` and `delete_section` (or `legato sidebar` and `legato arrange`), described in [Arranging the sidebar](https://legatobar.com/docs/mcp-tools.md#arranging-the-sidebar). They never change or delete page files. Collection placement stays out of page JSON.
---
# Cards
A page is a list of cards, shown in the order you give them. There are twenty-nine types. Shared fields and links has a table of what each one is for; the other four pages give each type's fields and show it drawn.
- [Shared fields and links](https://legatobar.com/docs/card-fields.md): What every card accepts, how wide each type is, the table of all twenty-nine types, and how a card links to a website or another page.
- [Numbers](https://legatobar.com/docs/card-numbers.md): stat, pacing, sparkline, gauge, bars, breakdown, flow, ranges, columns and tiles.
- [Lists and rows](https://legatobar.com/docs/card-lists.md): list, table, status, map, facts, fleet and checklist.
- [Time](https://legatobar.com/docs/card-time.md): countdown, window, agenda, month, timeline, strip and heatmap.
- [Text and layout](https://legatobar.com/docs/card-text.md): text, link and code, with heading and tabs, which arrange the cards around them.
---
# Shared fields and links
A page's `cards` array sets the order from top to bottom. There are twenty-nine card types; [Features](https://legatobar.com/features) shows each one alongside its example JSON.
`stat`, `status` (unless `"width": "full"`), `countdown` and `gauge` cards are half width, as are a `pacing` ring, a `link` tile and a `sparkline` with `"width": "half"`. Two consecutive half-width cards share a row. Everything else takes the full width.
| Type | For |
| --- | --- |
| [`stat`](https://legatobar.com/docs/card-numbers.md#stat) | One headline number: a balance, open PRs, uptime |
| [`pacing`](https://legatobar.com/docs/card-numbers.md#pacing) | Progress against a target: budget pace, a sprint, a ring for today's steps |
| [`list`](https://legatobar.com/docs/card-lists.md#list) | Up to 60 short lines: largest charges, new deals |
| [`table`](https://legatobar.com/docs/card-lists.md#table) | A small grid, up to 4 columns and 10 rows |
| [`sparkline`](https://legatobar.com/docs/card-numbers.md#sparkline) | A trend line of up to 240 points |
| [`status`](https://legatobar.com/docs/card-lists.md#status) | The health of one service or job |
| [`text`](https://legatobar.com/docs/card-text.md#text) | A short note, up to 500 characters |
| [`link`](https://legatobar.com/docs/card-text.md#link) | A button that opens an https URL or another page |
| [`countdown`](https://legatobar.com/docs/card-time.md#countdown) | Time until a moment: a flight boards, a domain renews |
| [`window`](https://legatobar.com/docs/card-time.md#window) | A window in the day: daylight left, opening hours, off-peak charging |
| [`map`](https://legatobar.com/docs/card-lists.md#map) | Places on Apple's map: the car, a package, a trip's stops |
| [`facts`](https://legatobar.com/docs/card-lists.md#facts) | A few labelled values: order number, carrier, ETA |
| [`gauge`](https://legatobar.com/docs/card-numbers.md#gauge) | A value in a range with coloured bands: CPU temperature, air quality |
| [`bars`](https://legatobar.com/docs/card-numbers.md#bars) | Categories with values: spend by category, votes |
| [`breakdown`](https://legatobar.com/docs/card-numbers.md#breakdown) | Parts of one whole in one coloured bar: net worth by asset, a budget by category |
| [`flow`](https://legatobar.com/docs/card-numbers.md#flow) | Where amounts go: DNS queries from each device to allowed and blocked, solar and grid to the house and the car |
| [`ranges`](https://legatobar.com/docs/card-numbers.md#ranges) | Rows from low to high on one scale: a week of temperatures, a price's daily range |
| [`columns`](https://legatobar.com/docs/card-numbers.md#columns) | Periods side by side, one to three series: income against spending by month |
| [`tiles`](https://legatobar.com/docs/card-numbers.md#tiles) | Small tiles four across, each a label, a value and a change, tinted by how far it moved: a watchlist |
| [`fleet`](https://legatobar.com/docs/card-lists.md#fleet) | A dot per host or job, up to 60 |
| [`checklist`](https://legatobar.com/docs/card-lists.md#checklist) | Up to 20 items, done or not |
| [`agenda`](https://legatobar.com/docs/card-time.md#agenda) | A day, a week or up to 30 days of meetings, trips, deadlines and bills, with a line at now |
| [`month`](https://legatobar.com/docs/card-time.md#month) | This month as a grid with a dot on each busy day, and the chosen day's items |
| [`timeline`](https://legatobar.com/docs/card-time.md#timeline) | A dated history newest first: a package's tracking, a job's runs, an order's steps |
| [`strip`](https://legatobar.com/docs/card-time.md#strip) | An item's states over a span, a thin bar per slice: a monitor's last day |
| [`heatmap`](https://legatobar.com/docs/card-time.md#heatmap) | A square per day in week columns, shaded by how much: a year of contributions or steps |
| [`code`](https://legatobar.com/docs/card-text.md#code) | A block of code or a command, monospaced, with a Copy button |
| [`heading`](https://legatobar.com/docs/card-text.md#heading) | A section title that splits a long page into parts, which can open and close |
| [`tabs`](https://legatobar.com/docs/card-text.md#tabs) | Two to five tabs in one place, each with its own cards: several feeds, today and this week, one server each |
The [page schema](https://legatobar.com/docs/page-writing.md#the-schema) has every card type with its fields and limits, as JSON Schema (draft-07): in your Pages folder at `.schemas/page.schema.json`, at [legatobar.com/schemas/page.schema.json](https://legatobar.com/schemas/page.schema.json), and from `get_page_schema` or `legato schema `, one type at a time. If this page and the schema ever disagree, the schema is right.
## Fields every card has
| Field | | |
| --- | --- | --- |
| `id` | required | Unique within the page. 1–64 characters: lowercase letters, digits, `-` and `_`, starting with a letter or digit. Keep ids stable between writes. |
| `type` | required | One of the twenty-nine types. |
Each type accepts only the fields listed for it, and the schema flags a misspelled field (`"lable"`) in your editor. Legato itself refuses a card that's missing a required field or has the wrong kind of value, saying which (`a stat card needs label`), and ignores a field it doesn't know, so check new pages against the schema. Wherever a card has a `label`, it's 1–60 characters; a `unit` is 1–16.
A three-letter currency code as `unit` (`USD`, `EUR`, `GBP`, …) formats numbers as money in the Mac's locale, with cents only when the number has them: `4218.55` with `USD` shows as `$4,218.55`, and `1060` as `$1,060`. Any other unit is shown as is after the number.
## Links to other pages
Wherever a card takes a link (a `list` row, a `facts` line, a `bars` row, a `link` card, a `fleet` item, a `tiles` tile, an `agenda` or `month` item, or a Markdown link in text), it can be another of your pages instead of a web address: `legato://page/ID`, where ID is the page's id as `legato list` and `list_pages` show it, the file's name without `.json`, matched exactly (case included), with a space written `%20` (`legato://page/My%20Page`). Nothing else goes in the address: no other `%` escapes and no port. A query is for one thing, a page's [params](https://legatobar.com/docs/detail-pages.md#one-page-for-every-item) (`legato://page/proxmox-vm?vmid=109`), and a `#` part for another, a card (below). A click shows that page in the panel, as choosing it in the sidebar does, and **Back** returns. The arrow is → rather than ↗, and the tooltip names the page ("Show the Pi-hole page"). A link to a page that doesn't exist (removed, or not made yet) isn't drawn as a link: a row or item shows its words, and a `link` card shows its label with "Page unavailable". The welcome pages work too: `legato://page/getting-started`. A page meant only to be reached this way can stay out of the sidebar: see [Detail pages](https://legatobar.com/docs/detail-pages.md#detail-pages).
### Links to a card
Add `#` and a card's id to bring that card into view: `legato://page/net-worth#cards`. Legato shows the page, chooses the tab that holds the card if it's in a [tabs](https://legatobar.com/docs/card-text.md#tabs) card, opens its section if a closed [heading](https://legatobar.com/docs/card-text.md#heading) holds it, and scrolls to it, unless it's already in full view. On the page the link is on, nothing else changes: a Liabilities total can open the Liabilities tab below it, with no new step for **Back**. A link to a heading opens its section, and a link to a tabs card scrolls to its tab names. A card id that isn't on the page, such as a card hidden by its `when`, opens the page as it is. Card ids are written as they are on the page: lowercase letters, digits, `_` and `-`.
```json
{ "id": "liabilities", "type": "stat", "label": "Liabilities", "value": 55558, "unit": "USD", "url": "legato://page/net-worth#cards" }
```
The same address works outside Legato: in a note, a Raycast quicklink, Shortcuts' **Open URLs**, or `open legato://page/budget` in Terminal opens the panel on that page (your browser asks first). An address for a page that doesn't exist opens the panel where it was.
```json
{ "id": "services", "type": "fleet", "label": "Services", "items": [
{ "name": "Pi-hole", "state": "ok", "url": "legato://page/pihole" },
{ "name": "Gitea", "state": "ok", "url": "https://gitea.example.com" } ] }
```
## Cards that link
For help choosing the structure, see [Page design](https://legatobar.com/docs/design.md#choose-the-right-structure), including a [linked overview and detail example](https://legatobar.com/docs/design.md#a-linked-overview-and-detail-example).
A `stat`, `status`, `breakdown` or `pacing` card with a `url` opens it when clicked. Without buttons, the whole card is the link: under the pointer (or with keyboard focus) it lights a little and shows its arrow, → for a page and ↗ for a web address, and its tooltip says where it goes. With buttons, a click on the card is never a press: the link is its own small button at the end of the row, named for the page or the site. Together with a [condition](https://legatobar.com/docs/mapping-conditions.md#cards-that-show-on-a-condition), a card can appear only when something needs attention and lead straight to the page about it.
## Item icons
Items on `bars`, `pacing` (rows), `breakdown`, `facts`, `checklist`, `list`, `agenda`, `month` and `timeline` cards can carry an `icon`, drawn at the start of the row, before the label and never inside a bar. When any item on a card has one, every row keeps its space, so the labels line up.
A symbol is grey, as the row's other supporting marks are. On `facts`, `bars`, `list`, `pacing` rows and `ranges`, an item can also name a `color` for its icon, by the [breakdown](https://legatobar.com/docs/card-numbers.md#breakdown) names: `blue`, `teal`, `orange`, `purple`, `green`, `pink`, `yellow`, `red`, `rose` or `grey`. Use it when the colour means something, such as a category's colour on other pages; leave it out otherwise. A breakdown's icons always take their part's colour. See [Card style](https://legatobar.com/docs/design.md#card-style).
```json
{ "key": "Resting", "value": "61 bpm", "icon": "heart", "color": "pink" }
```
| `icon` | Draws |
| --- | --- |
| `creditcard`, `cart`, `fork.knife` | That SF Symbol, in grey. |
| `si:chase`, `si:paypal` | A logo from [Simple Icons](https://simpleicons.org), in the text's colour. |
| `di:paypal`, `di:nocodb` | An icon from [Dashboard Icons](https://dashboardicons.com): in the text's colour by default, or in its own colours with **Show logos in one colour** off. |
| `mdi:cash`, `mdi:airplane` | An icon from [Material Design Icons](https://pictogrammers.com/library/mdi/), in the text's colour. |
| `site:citi.com` | The website's own icon: the sharpest of its Apple touch icon, the icons its homepage names and `/favicon.ico`. By default it's drawn like the one-colour sets, in the text's colour with its background taken out, so logos from different sites look like one set. With **Show logos in one colour** off, it keeps its brand colours, as a glass tile. |
`si:`, `di:` and `mdi:` are the names [Glance](https://github.com/glanceapp/glance) uses, so icons from a Glance config carry over.
The Mac downloads each web icon once, from jsDelivr or the named site only, keeps it, and asks again after 30 days; one that fails is tried again the next day, and its row stays blank meanwhile.
**Settings → General → Load icons from the web** turns downloads off; rows then show only SF Symbols. **Show logos in one colour**, beside it, is how each Mac chooses between one-colour logos (the default) and brand colours. Anything else in `icon` draws nothing.
A card filled from a [source](https://legatobar.com/docs/mapping.md#mapping) can choose an icon per row from the answer with `values`, such as a bank's icon from its name:
```json
"icon": { "path": "institution_name", "values": { "Chase": "site:chase.com", "Citibank Online": "site:citi.com" }, "default": "creditcard" }
```
`si:` logos are drawn from vectors, so where Simple Icons has a brand it's the crisper choice; `site:` covers the rest.
---
# Numbers
## stat
[See examples](https://legatobar.com/features#card-stat)
A single headline number.
| Field | | |
| --- | --- | --- |
| `label` | required | What the number is. |
| `value` | required | A number, or a string of up to 32 characters (`"99.98%"`, `"3 of 5"`). |
| `unit` | optional | A currency code, or a unit shown after the value (`Mbps`). |
| `delta` | optional | The change: a number (shown with a sign and an up or down arrow, and as money when `unit` is a currency), or a string of up to 16 characters (`"14 days to go"`). |
| `url` | optional | Where a click on the card goes: [another page](https://legatobar.com/docs/card-fields.md#links-to-other-pages) with more, or an https address. See [Cards that link](https://legatobar.com/docs/card-fields.md#cards-that-link). |
```json
{ "id": "balance", "type": "stat", "label": "Checking", "value": 4218.55, "unit": "USD", "delta": 312.4 }
```
## pacing
[See examples](https://legatobar.com/features#card-pacing)
Progress against a target: a budget over the month, a sprint, steps toward today's goal. Or rows, each against its own target: a budget per category.
| Field | | |
| --- | --- | --- |
| `label` | required | |
| `value` | required, unless there are `items` | Where you are now, a number. |
| `target` | required, unless there are `items` | The goal, a number above 0. |
| `elapsed` | optional | The fraction of the period gone, from 0 to 1. Halfway through the month is `0.5`. Leave it out for a goal with no period, like steps today. On a page without a [period](https://legatobar.com/docs/periods.md), `{ "month_elapsed": true }` in the map gives how far through this month today is. |
| `unit` | optional | |
| `detail` | optional | A second line under the card, up to 120 characters: `"no mindful minutes yet"`. |
| `shape` | optional | `bar` (the default), `ring`, or `rings` with 1 to 3 `items`: see [Rings](https://legatobar.com/docs/card-numbers.md#rings). |
| `amounts` | optional | `left` for a budget's words: each bar row says what's left (`$288 left`) or how far over (`$36 over`), and the pace line says `$521 under pace` or `over pace`. The card's own total keeps `$5,161 of $7,103`. Rings keep their figures. `value` draws the card's value as one large figure under its name (`65%`), with `note` beside it, for a level whose target is its full scale, such as a battery out of 100%. Default `spent`. |
| `note` | optional | With `amounts: value`, a few words beside the large figure, such as a battery's range (`213 mi`). |
| `color` | optional | The bar's colour, by a [breakdown](https://legatobar.com/docs/card-numbers.md#breakdown)'s names, where the colour means something: a battery's charge in `green`. Without it, the theme's chart colour. |
| `hide_caption` | optional | `true` leaves out the pace line under the bar or ring, which shows only with `elapsed`, like "$380 ahead of pace". Default `false`. |
| `items` | optional | Up to 20 rows of `{ "label", "value", "target", "icon", "key", "unit" }`: a label of 1–40 characters, a number, a target above 0, and optionally an [item icon](https://legatobar.com/docs/card-fields.md#item-icons), a `key` for its `details`, and a `unit` of its own when it isn't the card's. A row can also have a `subtitle`, `state`, `detail`, `url` and `image`: see [Rows with more](https://legatobar.com/docs/card-numbers.md#rows-with-more). |
| `image_shape` | optional | `poster` (the default), `square` or `wide`: the rows' [thumbnails](https://legatobar.com/docs/card-numbers.md#images-on-rows), unless a row sets its own. |
| `details` | optional | Up to 500 lines of `{ "key", "text", "detail", "url" }` that rows show when clicked open: the key of their row, a text of 1–80 characters, and optionally a right-aligned detail of up to 40, its `detail_color` (a refund in `green`, by the [breakdown card's names](https://legatobar.com/docs/card-numbers.md#breakdown)), an `aside` of up to 24 in a grey column (a date; `details_aside_at` puts it at the `start` or `end`, and once a line has one, dates and amounts each keep one width) and an https or `legato://page/ID` link to the individual record. |
| `fit` | optional | Keeps the page within the sidebar's length. The card shows as many rows as fit, at least 5, with **Show *N* more** only when some are left out. An opened row shows as many of its lines as fit, at least 3, with **Show all** only when some are left out, and the row opened last gives way first. Without the sidebar, every row shows and an opened row shows 20 lines. |
| `url` | optional | Where a click on the card goes: [another page](https://legatobar.com/docs/card-fields.md#links-to-other-pages) with more, such as an exercise ring leading to past days and workouts, or an https address. A card with `items` isn't a link, since a click on a row opens its details, unless its shape is `rings`. See [Cards that link](https://legatobar.com/docs/card-fields.md#cards-that-link). |
A bar takes the full width: "$2,140 of $3,200" and a bar filled to `value / target`. With `elapsed`, a tick marks where you'd be if exactly on pace, and a line under the bar says the pace: "$380 ahead of pace", "6 min behind pace", or "On pace" within 3% of the target. Nothing is coloured for being ahead or over: the tick, a full bar and the figures say it. Pacing never changes the page's status dot either, since ahead is bad for a budget and good for a sprint. Without `elapsed` there's no tick and no line: the figures and the bar already say how far there is to go.
With `items`, each row is the label, "$412 of $600" (the amount in the row's colour, "of $600" in grey) and its own bar. With `elapsed` every row has the pace tick. Leave `value` and `target` out to show only the rows, or set them for an overall bar above them. A card with rows is drawn as bars, whatever its `shape`.
Sourced rows can carry up to three places for buttons at their end, such as Message and Stop on a stream: see [Buttons on each row](https://legatobar.com/docs/button-rows.md#buttons-on-each-row).
A row with a `key` that `details` lines share gets a disclosure chevron: clicking it shows that row's first 20 lines under it, in the order given, with **Show all** for the remaining supplied lines and **Show fewer** to return to the preview. Clicking the row again hides its lines. A detail line with `url` opens its record separately from the row disclosure. This only reveals lines the page supplied; it does not fetch further records. Keys can be text or numbers, and `12` matches `"12"`, so a source can map a category's id straight in. A line without a key, such as an uncategorized transaction's, is skipped, and the rest of the card still shows. On a budget, that's each category's transactions this month:
```json
"details": [ { "key": 3411218, "text": "Costco", "detail": "$212 · Oct 14" }, { "key": 3411218, "text": "Trader Joe's", "detail": "$86 · Oct 21" } ]
```
```json
{ "id": "budgets", "type": "pacing", "label": "Budgets this month", "unit": "USD",
"items": [ { "label": "Groceries", "value": 412, "target": 600 }, { "label": "Restaurants", "value": 260, "target": 200 } ] }
```
### Rows with more
A row can say more than its label and figures, as a stream does while it plays: what's on, who's watching, where. Each part is optional.
| Field | | |
| --- | --- | --- |
| `subtitle` | optional | Up to 80 characters, in grey after the label on the title line: `"S2 · E5 · The Long Tide"`. When the line runs short, the subtitle is cut first, then the label. |
| `state` | optional | Up to 16 characters, a grey word at the right of the title line: `"Paused"`. It's words only: it never colours the row or counts as a problem. |
| `detail` | optional | Up to 80 characters, a grey line under the bar: `"riley · Living room TV · Direct play"`. Once any row has one, every row draws the line, and its figure ("31 of 47 min") moves to the line's end, so the rows keep one height. |
| `url` | optional | Makes the row a link, as a [list](https://legatobar.com/docs/card-lists.md#list) row is: https, [another page](https://legatobar.com/docs/card-fields.md#links-to-other-pages), or plain http on the card's source's own address, so a server on your network links. A row with `details` lines opens them instead, and Preview Source says its `url` isn't used. |
| `image` | optional | A thumbnail before the row, as tall as its words. See [Images on rows](https://legatobar.com/docs/card-numbers.md#images-on-rows). |
| `image_shape` | optional | The row's own shape, overriding the card's. |
Rows without these parts draw exactly as before. A row's text is cut by the line, never in the data: VoiceOver reads all of it. With a source, map the rows with `each`, and give `source.empty` for an answer with none:
```json
{ "id": "now", "type": "pacing", "label": "Now playing", "unit": "min", "items": [],
"source": { "ref": "media", "empty": { "when": { "path": "streams[0]", "exists": false }, "text": "Nothing playing" },
"map": { "items": { "each": "streams", "fields": { "key": "id", "label": "title", "subtitle": "episode", "state": "state",
"detail": "where", "value": "minutes", "target": "length", "image": { "template": "/Items/{item_id|raw}/Images/Primary?fillHeight=96" } } } } } }
```
### Images on rows
`pacing` rows and `list` items take an `image`: a poster, an album's cover or a still, drawn in the icon's place. They keep their own colours: they're media, the one exception to [logos in one colour](https://legatobar.com/docs/card-fields.md#item-icons).
- **From the card's source only.** `image` is a path on the source's own address (`/Items/9f…/Images/Primary`), or a full http(s) address on that same scheme, host and port. Anything else is refused: the row draws its placeholder, and Preview Source says why. A card whose source isn't read over http can't have images, and its page doesn't load.
- **Signed in as the source is.** Each image is fetched with the source's own sign-in, through the same connection settings, only while the panel shows the card, at most four at once and 2 MB each. Only PNG, JPEG, WebP, HEIC and GIF (its first frame) are drawn.
- **Kept on this Mac.** Images are kept in Legato's cache folder, about 50 MB at most, the least recently shown going first, and used for a week before they're fetched again. A failed image never shows a note or fails the card: its row keeps the placeholder and it's tried again ten minutes later.
- **Nothing moves.** A neutral placeholder of the same size shows while an image loads or when it can't, with the row's `icon` in it, or a picture mark once an image can't be had. A row whose `image` is empty (`""`) asks for nothing and shows the placeholder: map it that way when the service says an item has no artwork (Jellyfin's image tags), so no request goes for a picture that isn't there. Once any row has an image, every row keeps the thumbnail's room, so the words line up. VoiceOver skips the thumbnails, since the row's words already say what it is.
**Settings → General → Load icons from the web** doesn't apply to these images: they come from the service the card is connected to, never from anywhere else.
| `image_shape` | Shape |
| --- | --- |
| `poster` (the default) | 2:3, a film's or a show's |
| `square` | 1:1, an album's |
| `wide` | 16:9, a still |
On a pacing row the thumbnail is as tall as the row's words; on a list row it's one line and a little. A row's own `image_shape` overrides its card's, so a song's square cover can sit among posters.
A ring is half width, like a fitness ring: filled to `value / target`, with the value beside it and the target under that. It shares its row with the next card if that one is half width too.
```json
{ "id": "month", "type": "pacing", "label": "October spend", "value": 2140, "target": 3200, "elapsed": 0.55, "unit": "USD" }
```
```json
{ "id": "steps", "type": "pacing", "shape": "ring", "label": "Steps", "value": 83, "target": 8000, "unit": "steps", "detail": "no mindful minutes yet" }
```
### Rings
With `"shape": "rings"`, 1 to 3 `items` are nested rings, the first outermost, the way a watch shows Move, Exercise and Stand. The card is half width. Beside the rings, each item's value and target ("310/500 kcal") are in its ring's colour. The items' labels aren't drawn, since the units tell the rings apart, but VoiceOver reads them. Give each item its own `unit`. A ring past its target is drawn full; rings have no pace tick or caption. Name a `color` on an item to choose its ring's colour; without one, rings take pink, green and teal in turn. Get Card Value reads the first ring.
```json
{ "id": "activity", "type": "pacing", "shape": "rings", "label": "Activity", "url": "legato://page/exercise",
"items": [ { "label": "Move", "value": 310, "target": 500, "unit": "kcal" },
{ "label": "Exercise", "value": 12, "target": 30, "unit": "min" },
{ "label": "Stand", "value": 4, "target": 12, "unit": "h" } ] }
```
Add `days` and the card is a full-width calendar instead, with small rings for each day under the title. Each day has a `date` (`YYYY-MM-DD`) and `values`, one for each item in the items' order (`null` for a day with no figure). The items still give each ring's target, unit and colour. Days without an entry draw empty rings, and today is outlined. An empty `days` array keeps the card full width and says "No figures for this period." Each day’s readings, goals and missing figures are available to VoiceOver and on hover.
| Field | | |
| --- | --- | --- |
| `days` | optional | Up to 42 of `{ "date", "values" }`, with no more values than items. Without `calendar`, the first and last dates must fit within 42 consecutive days, which can take seven calendar rows. |
| `calendar` | optional | `week` or `month`: the week or the whole month the days are in, so a month's first few days still show the whole month. Without it, the weeks from the first day to the last. |
On a page with a [period](https://legatobar.com/docs/periods.md#periods), map `days` from a source's daily rows with `each`, using field names like `values[0]` for each item's value and `default: null` for missing readings, and set `calendar` from the period. A null default preserves the position of the next ring without turning an absent reading into zero. Show it only for a week or a month, beside a rings card for the period's average:
```json
{ "id": "each-day", "type": "pacing", "shape": "rings", "label": "Each day", "calendar": "month",
"items": [ { "label": "Move", "value": 0, "target": 500, "unit": "kcal" },
{ "label": "Exercise", "value": 0, "target": 30, "unit": "min" },
{ "label": "Stand", "value": 0, "target": 12, "unit": "h" } ],
"days": [ { "date": "2026-11-01", "values": [480, 35, 12] }, { "date": "2026-11-02", "values": [410, 22, 11] } ] }
```
## sparkline
[See examples](https://legatobar.com/features#card-sparkline)
A trend line.
| Field | | |
| --- | --- | --- |
| `label` | optional | Leave it out when the page's title already says what the line is, such as a Net Worth page's trend. |
| `points` | required | 2–240 numbers, oldest first. A card is about 330 points wide at full width, so more than 240 can't be told apart; average a longer series down with [`buckets`](https://legatobar.com/docs/mapping.md#mapping). |
| `max` | optional | The most the value can be, such as a machine's memory. The chart runs from zero up to it, with a dashed line there, so the fill shows how much of it is used, and the value reads "9.4 GB of 13 GB". A value over it still shows. A percentage pinned at `100` with `unit` `%`, such as a machine's CPU, keeps the 0–100% scale without the line or the "of 100%". |
| `target` | optional | A level the value is meant to reach or stay under, such as a car's charge limit. A dashed line, kept in view, and the value reads "69% · Limit 80%". Unlike `max`, the chart doesn't run from zero. |
| `target_label` | optional | The target's name, 1 to 24 characters. `Target` without one. |
| `right_unit`, `right_scale` | optional | A second scale on the right for the same line: the value times `right_scale`, in `right_unit` (1 to 8 characters). A car's battery reads in miles of range beside its percentage, with `right_scale` the miles for each percent, filled from its source. The value reads "69% · 224 mi". Give both or neither. |
| `change` | optional | `false` leaves out the badge beside the value that says how far it is from the first point. On by default; turn it off for a reading whose change isn't news, such as a machine's CPU or memory. |
| `width` | optional | `full` (the default) or `half`: a small chart that shares a row with the half-width card beside it, such as a machine's CPU beside its memory. Half width, `max`'s "of 13 GB" goes under the value, only the first and last labels sit under the line, and two charts in a row end on the same line. |
| `times` | optional | When each point was, one per point and in order: Unix seconds (or milliseconds) or ISO 8601. The points then sit at their moments rather than evenly spaced, and the line breaks where readings stop for more than three times their usual spacing (and at least 15 minutes), such as a car asleep overnight. Map it from the same list as `points`, with the same `each`. |
| `axis_labels` | optional | What's drawn under the line, one per point like `labels`, when it should be shorter than what the pointer shows: "9 PM" under the chart, "8:54 PM" on hover. Without it, `labels` are drawn there too. |
| `unit` | optional | |
| `start_label` | optional | 1–24 characters under the line's first point: the time it stands for, like `"12h ago"` or `"Oct 1"`. |
| `end_label` | optional | 1–24 characters under the last point: `"Now"`, `"Today"` or a date. |
| `labels` | optional | What each point stands for, one per point, oldest first, each 1–24 characters: `["Jan", "Feb", …]` or dates. |
| `shape` | optional | `smooth` (the default) joins the points with a curve; `sharp` joins them with straight segments, for values that shouldn't read as passing through the ones in between. |
| `grid` | optional | `true` draws lines across the chart at the axis's values. Off by default; the values down the leading edge show either way. |
| `series`, `points2` | optional | A second line on the same scale: two internet connections' latency, or download beside upload. `series` names the two lines (1 to 16 characters each) and `points2` holds the second's readings. Give both or neither. See [Two lines](#two-lines). |
| `times2` | optional | With `times` and `points2`: when each of `points2`'s readings was, as `times` is for `points`. |
A label that's empty, `null` or longer than 24 characters makes the card unreadable, from a page file or a source alike, and so do `labels` that don't have one for each point.
The card shows its label, then the latest value with its change since the first point. The change is a percentage, or the difference itself when a percentage would mislead: a unit of `%` or degrees, a first point of zero, or a change of sign. It's never coloured, since up isn't always good.
Under that is the line over a fading fill, its last point marked, with the values on an axis down its leading edge. With `labels`, up to five of them sit under the line: the first, the last and some evenly between. Without them, `start_label` and `end_label` sit under the ends. Rest the pointer on the line and the point under it is marked: the value, its change and its label show in the card's header until the pointer leaves.
When a service only reports a value as it is now, a sourced sparkline can draw its trend from readings the Mac records itself: see [Sparkline readings](https://legatobar.com/docs/mapping-sparklines.md#sparkline-readings). Such a card labels its points from its readings unless the page sets them: dates, ending with "Today", for daily readings; times, ending with "Now", for more often.
```json
{ "id": "cpu", "type": "sparkline", "label": "Host CPU", "unit": "%", "points": [12, 14, 11, 18, 22, 35, 41, 38, 27, 19],
"start_label": "10m ago", "end_label": "Now" }
```
### Two lines
`series` and `points2` draw a second line on the same scale, in orange, without a fill. The header names each line beside a dot in its colour, with its latest reading: "● WAN 12 ms ● WAN2 31 ms". Rest the pointer on the chart and each line shows its reading there. A line with no reading near the pointer shows "—". There's no change badge, since "since the first point" has no single answer for two lines, and no `right_unit`.
Without `times`, the two lines line up point for point, so `points2` has one reading for each of `points`. With `times`, give `points2` its own `times2`. Each line then sits at its own moments, and a reading one line doesn't have is a gap in that line, never a zero. A line breaks where its readings stop for more than one and a half times their usual spacing and twice the shortest, so a connection down for two hours of hourly readings breaks its own line there and leaves the other as it was. Readings averaged into `buckets` come one or two steps apart, and that never breaks a line. Either list can be empty while its line has no readings.
```json
{ "id": "latency", "type": "sparkline", "label": "Latency", "unit": "ms", "series": ["WAN", "WAN2"],
"points": [9, 11, 8, 30, 9], "times": [1794900000, 1794903600, 1794907200, 1794910800, 1794914400],
"points2": [24, 22, 26], "times2": [1794900000, 1794903600, 1794914400] }
```
From a source, map each line from its own rows with the same `each` for the points and their times:
```json
"points": { "each": "wan1", "value": "ms", "buckets": 180 },
"times": { "each": "wan1", "template": "{t}", "buckets": 180 },
"points2": { "each": "wan2", "value": "ms", "buckets": 180 },
"times2": { "each": "wan2", "template": "{t}", "buckets": 180 }
```
```json
{ "id": "rate", "type": "sparkline", "label": "30-year mortgage rate", "unit": "%", "shape": "sharp",
"points": [6.41, 6.38, 6.35, 6.37, 6.29, 6.22, 6.24, 6.18, 6.15, 6.11, 6.09, 6.12],
"labels": ["Nov", "Dec", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct"] }
```
## gauge
[See examples](https://legatobar.com/features#card-gauge)
A value within a range, with bands that say what the value means.
| Field | | |
| --- | --- | --- |
| `label` | required | |
| `value` | required | A number. One past either end sits at that end. |
| `min` | optional | The bottom of the range, `0` if left out. |
| `max` | required | The top of the range, above `min`. |
| `unit` | optional | |
| `bands` | optional | 1 to 6 of `{ "from", "to", "state" }`, in order. `from` defaults to `min` and `to` to `max`, and each `to` must be above its `from`. `state` is `ok`, `warning` or `critical`. |
Half width. The number, a track from `min` to `max` with each band in its colour and a dot where the value sits, and the range underneath. The band the value is in colours the number, names its state when it isn't `ok` (at full width), and counts toward the page's status and notifications exactly as a `status` would. Leave bands out for a plain reading that shouldn't count.
```json
{ "id": "cpu", "type": "gauge", "label": "CPU temperature", "value": 72, "max": 100, "unit": "°C",
"bands": [ { "to": 70, "state": "ok" }, { "from": 70, "to": 85, "state": "warning" }, { "from": 85, "state": "critical" } ] }
```
## bars
[See examples](https://legatobar.com/features#card-bars)
Categories with a value each.
| Field | | |
| --- | --- | --- |
| `label` | required | |
| `items` | required | 1 to 20 of `{ "label", "value", "icon", "url" }`: a label of 1–40 characters, a number of 0 or more, optionally an [item icon](https://legatobar.com/docs/card-fields.md#item-icons) before the label, and optionally a [link](https://legatobar.com/docs/card-fields.md#links-to-other-pages) the whole row opens, such as each project's own page. Once any row links, every row keeps room for its arrow. |
| `unit` | optional | Applies to every value. |
| `max` | optional | The value a full bar stands for, above 0. Left out, the largest item fills its bar. |
| `fit` | optional | `true` shows as many rows as keep the page within the sidebar's length, or the panel's [minimum height](https://legatobar.com/docs/settings.md), at least 5, with **Show *N* more** only when some are left out. Without the sidebar or a minimum height, every row shows. |
One row per item: the label, a bar, the value. Order the items the way the reader thinks about them, largest first for spend, the ballot's order for votes.
```json
{ "id": "spend", "type": "bars", "label": "Spend by category", "unit": "USD",
"items": [ { "label": "Groceries", "value": 412 }, { "label": "Dining", "value": 188 }, { "label": "Transit", "value": 64 } ] }
```
Bar values include their unit, such as `15 ms` or `18%`. In the Mac app, hover over a shortened row label to read it in full, or right-click it and choose **Copy label**.
## breakdown
[See examples](https://legatobar.com/features#card-breakdown)
What a total is made of: net worth by asset, a month's spend by category against its budget.
| Field | | |
| --- | --- | --- |
| `label` | required | |
| `items` | required | 2 to 6 of `{ "label", "value", "color", "icon" }`: a label of 1–40 characters, a number of 0 or more, and optionally a colour and an [icon](https://legatobar.com/docs/card-fields.md#item-icons). |
| `layout` | optional | `bar`, the default: one bar in segments over a legend. `rows`: a bar for each part. |
| `unit` | optional | Applies to every value. |
| `total` | optional | The headline when it isn't the items' sum, like net worth after debts. Say what it leaves out in `detail`. |
| `target` | optional | A budget the parts fill, above 0. The bar's full width stands for it, and the headline reads "$2,140 of $3,200". |
| `elapsed` | optional | With a `target`, the fraction of the period gone, from 0 to 1, as on a [`pacing`](https://legatobar.com/docs/card-numbers.md#pacing) card. |
| `detail` | optional | A line under the legend, up to 120 characters. |
| `url` | optional | Where a click on the card goes: [another page](https://legatobar.com/docs/card-fields.md#links-to-other-pages) with more, such as a sleep breakdown leading to the nights before it, or an https address. See [Cards that link](https://legatobar.com/docs/card-fields.md#cards-that-link). |
The label and the headline, then one bar split into a coloured segment per item, then a legend: each item's colour, label, value and share of the whole. The segments are in the items' order, so put the largest first unless the reader expects another. A segment too small to see still shows a sliver of its colour.
Without a `target`, the bar is the items' sum and the headline is that sum, or `total`. With one, the bar's full width is the target and the segments fill part of it. A tick marks pace when `elapsed` is set, and a line under the bar says the pace, as a [pacing](https://legatobar.com/docs/card-numbers.md#pacing) bar's does; the header's "$790 of $1,200" says the rest. Like pacing, it never changes the page's status dot.
`color` is one of `blue`, `teal`, `orange`, `purple`, `green`, `pink`, `yellow`, `red`, `rose` or `grey` (`gray` works too). Each Mac draws the system's shade of that colour for light or dark mode, so segments next to each other stay distinct on either background; that's why there's no hex. `purple` is the exception: a deeper violet than the system's, which leans pink. `graphite` is the theme's chart colour. Leave colours out and the items take five category colours in order: blue, aqua, yellow, violet and magenta, picked so neighbours stay apart for colour-blind readers. A colour that sits near one another item names is skipped, and a sixth item and any after it are grey. Name colours when the same category appears on several pages, so Investments is green wherever it's shown.
With `"layout": "rows"`, each part has a row of its own: its label, its segment on a track of its own, the same length it has in the one bar, then its value and share. An item's `icon` sits before its label in the part's colour, as it does in the legend, where it takes the colour dot's place. Rows suit parts you compare with each other, like a night's sleep stages; the one bar suits a single whole, like net worth. For a funnel, where each step is a share of the first rather than of a whole, use [`bars`](https://legatobar.com/docs/card-numbers.md#bars) with a `max`.
```json
{ "id": "sleep", "type": "breakdown", "label": "Sleep a night", "unit": "h", "layout": "rows",
"items": [ { "label": "Deep", "value": 1.6, "color": "purple", "icon": "moon.zzz" }, { "label": "Core", "value": 4, "color": "blue", "icon": "moon" },
{ "label": "REM", "value": 1.7, "color": "teal", "icon": "eye" }, { "label": "Awake", "value": 0.5, "color": "grey", "icon": "sun.max" } ] }
```
A debt doesn't fit in the bar, since values are 0 or more. For net worth, list the assets and put what's owed in `total` and `detail`:
```json
{ "id": "worth", "type": "breakdown", "label": "Net worth", "unit": "USD", "total": 410000,
"items": [ { "label": "Real estate", "value": 410000, "color": "blue" }, { "label": "Investments", "value": 268000, "color": "green" },
{ "label": "Cash", "value": 42000, "color": "teal" } ],
"detail": "After the $310,000 mortgage" }
```
```json
{ "id": "october", "type": "breakdown", "label": "October spend", "unit": "USD", "target": 3200, "elapsed": 0.55,
"items": [ { "label": "Groceries", "value": 940 }, { "label": "Dining", "value": 620 }, { "label": "Transit", "value": 330 } ] }
```
## flow
[See examples](https://legatobar.com/features#card-flow)
Where amounts go: sources down the left, destinations down the right, and a band from each source to each destination it sends to, as thick as its amount. DNS queries from each client to allowed and blocked, solar and grid to the house and the car, income to spending and savings.
| Field | | |
| --- | --- | --- |
| `label` | required | |
| `links` | required | 1 to 48 of `{ "from", "to", "value" }`: a source's label, a destination's label (each 1–40 characters) and an amount of 0 or more. Up to 6 sources and 8 destinations. |
| `from` | optional | The sources in the order to draw them, as `{ "label", "color" }`. Left out, they're the links' sources in the order they first appear. |
| `to` | optional | The destinations in the order to draw them, as `from`. |
| `unit` | optional | Applies to every amount. |
| `detail` | optional | A line under the chart, up to 120 characters. |
| `hide_amounts` | optional | `true` leaves out the amount under each source's name, so only the names show on the left. The headline total and each destination's share stay. Default `false`. |
| `url` | optional | Where a click on the card goes. See [Cards that link](https://legatobar.com/docs/card-fields.md#cards-that-link). |
The headline is everything that flows. Each source's amount sits under its name, and each destination's share of the whole after its name, so the labels stay outside the bars. Every band is drawn on one scale at both ends. A node is as tall as what passes through it, but never shorter than its label, so a client with a handful of queries still has its name. When `from` or `to` is given, every link has to come from or go to one of them.
Colours are the [breakdown](https://legatobar.com/docs/card-numbers.md#breakdown) names. Sources left without one take the breakdown's category colours in order, skipping any near a colour a source or destination names, and destinations left without one are grey. A band takes its source's colour. Name colours when a destination means something, such as green for Allowed.
```json
{ "id": "queries", "type": "flow", "label": "DNS queries today",
"to": [ { "label": "Allowed", "color": "green" }, { "label": "Blocked", "color": "grey" } ],
"links": [ { "from": "Mac Studio", "to": "Allowed", "value": 3680 }, { "from": "Mac Studio", "to": "Blocked", "value": 530 },
{ "from": "Apple TV", "to": "Allowed", "value": 1310 }, { "from": "Apple TV", "to": "Blocked", "value": 650 } ] }
```
From a [source](https://legatobar.com/docs/mapping.md#mapping), map `links` with `each`. A service that lists each source once with two amounts gives two links per row: [derive](https://legatobar.com/docs/mapping.md#derived-values) a list for each destination, then join them with a two-path `each`. Pi-hole v6 lists its top clients with their queries at `/api/stats/top_clients`, and their blocked queries with `?blocked=true`:
```json
"requests": { "clients": "/api/stats/top_clients?count=5", "blocked": "/api/stats/top_clients?blocked=true&count=50" },
"derive": [
{ "name": "rows", "value": { "each": "clients.clients",
"lookup": { "from": "blocked.clients", "by": "ip", "on": "ip", "as": "b" },
"fields": { "name": { "if": { "path": "name", "equals": "" }, "then": "ip", "else": "name" },
"blocked": { "path": "b.count", "default": 0 },
"allowed": { "subtract": [ "count", { "path": "b.count", "default": 0 } ] } } } },
{ "name": "allowed", "value": { "each": "rows", "fields": { "from": "name", "to": { "template": "Allowed" }, "value": "allowed" } } },
{ "name": "blocked_links", "value": { "each": "rows", "where": { "path": "blocked", "gt": 0 },
"fields": { "from": "name", "to": { "template": "Blocked" }, "value": "blocked" } } }
]
```
```json
{ "id": "clients", "type": "flow", "label": "Queries by client",
"to": [ { "label": "Allowed", "color": "green" }, { "label": "Blocked", "color": "grey" } ],
"source": { "ref": "pihole",
"empty": { "when": { "value": { "count": "clients.clients" }, "equals": 0 }, "text": "No client queries to show." },
"map": { "links": { "each": [ "allowed", "blocked_links" ],
"fields": { "from": "from", "to": "to", "value": "value" } } } } }
```
The empty rule handles a successful answer with no clients. A missing client list still needs attention; it does not count as an empty list.
## ranges
[See examples](https://legatobar.com/features#card-ranges)
Rows on one shared scale, each a bar from its low to its high: a week's forecast, a price's range by day. The scale runs from the lowest low to the highest high, so the rows compare at a glance: a cold day's bar sits to the left of a warm one's.
```json
{ "id": "week", "type": "ranges", "label": "This week", "unit": "°F", "colors": "temperature", "items": [
{ "label": "Today", "icon": "cloud.rain", "low": 59, "high": 79, "now": 67 },
{ "label": "Thu", "icon": "sun.max", "low": 55, "high": 72 },
{ "label": "Fri", "icon": "cloud.sun", "low": 48, "high": 66 } ] }
```
| Field | | |
| --- | --- | --- |
| `label` | required | The card's title. |
| `items` | required | 1–14 rows, in order. Each has a `label` (up to 24 characters, like "Today" or "Thu"), a `low` and a `high` (either way round), and optionally an `icon` (an SF Symbol, or `si:`/`site:` as list rows take) `now`, a value marked on the bar with a dot, like the temperature now on today's row, and `info`, up to two short notes (10 characters each) in columns of their own, the first before the icon and the second after it, like a forecast's wind and chance of rain. An empty note leaves its column blank, so the columns stay lined up. |
| `unit` | optional | A degree unit (`°F` or `°C`) shows values as "72°"; a currency shows money. `clock` reads values as hours of the day and shows them as times: 22.5 is 10:30 PM, and 24 and up are the next day's, so a night from 10:56 PM to 8:01 AM is 22.93 to 32.02. A source rule's [`clock`](https://legatobar.com/docs/mapping-tables.md#names-and-exact-times) turns a timestamp into these hours. |
| `colors` | optional | `accent` (the default) draws every bar in the theme's chart colour. `temperature` shades each bar by its own temperatures, purple and blue when cold, through teal and green, to yellow, orange and red when hot, read in the card's unit (`°C`, otherwise °F), so 70°F always looks warm, whatever the rest of the week does. |
| `info_colors` | optional | The `info` columns' colours, in order, by the same names as a [breakdown](https://legatobar.com/docs/card-numbers.md#breakdown)'s: `["green", "blue"]` for wind and rain. Without it they're grey. |
| `muted` | optional | `false` shows each row's low in the text colour instead of grey, like its high. |
| `color` | optional | Every bar in one colour where it means something, such as charges in `green`. The chart colour without; `colors: temperature` shades by temperature instead. |
| `min`, `max` | optional | A fixed scale for every row, such as 0 to 100 for charges that ran from 38% to 72%, so a top-up and a full charge look different. Without them the scale runs from the rows' lowest low to their highest high. |
| `detail` | optional | A note under the rows. |
Full width. From a forecast, map each day with `each`, `{dt\|weekday}` for "Today", "Thu" and so on, and `{wind_deg\|compass}` for a wind's direction; see [Mapping](https://legatobar.com/docs/mapping.md#mapping).
With `unit` `clock`, a week of nights from bedtime to wake-up:
```json
{ "id": "bedtimes", "type": "ranges", "label": "Bedtime and wake-up", "unit": "clock", "items": [
{ "label": "Wed", "low": 22.9, "high": 32.62 },
{ "label": "Thu", "low": 22.91, "high": 31.97 },
{ "label": "Today", "low": 22.94, "high": 32.02 } ] }
```
## columns
[See examples](https://legatobar.com/features#card-columns)
Periods compared side by side, with up to three series in each.
| Field | | |
| --- | --- | --- |
| `label` | optional | Leave it out when the page already says what the columns are. |
| `series` | required | 1 to 3 names of 1–24 characters, in legend order. One series has no legend: the card's label names it. |
| `legend_align` | optional | `leading` (the default) puts the series names under the title; `trailing` puts them at the card's right, on the title's line. |
| `slots` | optional | Room for this many columns, 1 to 96. The columns not here yet are left empty at the end, so a day that's still going draws at its full width: `24` for a day's hours. |
| `summary` | optional | Grey words after the title, on its line: `"**14,623** · **23.3%** blocked"`. Up to 120 characters; inline formatting works. |
| `items` | required | 1 to 48 of `{ "label", "values" }`, oldest first: a period label of 1–12 characters and one number per series, in the same order. |
| `unit` | optional | Applies to every value. A degree unit writes values as "64°". |
| `baseline` | optional | `zero` (the default) starts the columns at zero. `auto` starts them just below the lowest value, for readings like an hour-by-hour temperature, whose shape matters more than how far it is from zero. |
| `values_on_top` | optional | `true` writes each column's value above it, in place of the side axis. |
| `highlight` | optional | The label of the period that applies now, like `"Now"` or this month's `"Oct"`: its label, and its value on top, are bold and bright, while every column keeps its colour. A label no item has highlights nothing. |
| `stacked` | optional | `true` draws one column per period with its series stacked as parts of it, such as a night split into sleep stages. Values on top then show each column's total, and the baseline is always zero. |
| `series_colors` | optional | The series' colours, in order, by the same names as a [breakdown](https://legatobar.com/docs/card-numbers.md#breakdown)'s: `["purple", "blue", "teal"]`. In a stacked chart, `grey` is a lighter grey for the part that isn't the subject, so the other part reads first: Pi-hole's Allowed under Blocked. |
| `grid` | optional | `true` draws lines across the chart at each of the side axis's values. Without it, one faint line marks the middle value. |
| `last_partial` | optional | `true` when the last column is a period still filling, such as the hour now or today. It's drawn lighter, so its shortness doesn't read as a drop. |
| `detail` | optional | A note under the chart, up to 200 characters. |
A legend, then a group of columns per period, with three values up the side: zero, the middle, and the next round number above the tallest column (7,500 for a peak of 6,100), so the columns use the room. Only the top of a column is rounded. Stacked parts have a hairline between them and the legend lists them top first; a column too short to draw its parts is a thin sliver on the baseline, so an almost empty hour doesn't look like a short bar. Without `series_colors`, one series is drawn in the theme's chart colour, and two or more take the [breakdown](https://legatobar.com/docs/card-numbers.md#breakdown)'s category colours in order. Resting the pointer on a period shows its values, and a stacked column's total. An item with fewer values than there are series draws the ones it has. Keep period labels short and distinct, like `May` or `Wk 42`, since they sit under narrow columns. Past 12 columns, only every few labels are written, counted back from the newest, so a day by hour reads every third hour; resting the pointer on a column still names it.
```json
{ "id": "flow", "type": "columns", "label": "Income vs spending", "unit": "USD", "series": ["Income", "Spending"],
"items": [ { "label": "Aug", "values": [5400, 3980] }, { "label": "Sep", "values": [5400, 4475] }, { "label": "Oct", "values": [3600, 2210] } ],
"detail": "October is through the 21st." }
```
Stacked, each column is a whole made of its parts, coloured as a breakdown's are:
```json
{ "id": "stages", "type": "columns", "label": "Sleep stages", "unit": "h", "stacked": true, "values_on_top": true,
"series": ["Deep", "Core", "REM"], "series_colors": ["purple", "blue", "teal"],
"items": [ { "label": "Wed", "values": [2, 3.8, 1.8] }, { "label": "Thu", "values": [3.5, 2.5, 0.9] }, { "label": "Today", "values": [0.8, 4.7, 1.9] } ] }
```
## tiles
[See examples](https://legatobar.com/features#card-tiles)
A grid of small tiles, four across, each with a label, a value and a change: a watchlist's symbols with their prices and how far each moved today. By default a tile has a light green wash when it's up and a light red one when it's down, a little deeper the further it moved, and the change is written in green or red. With `"style": "quiet"` the tiles stay plain and only the change is coloured, with ▲ or ▼. A change that rounds to zero, or a tile with no change, stays plain either way.
```json
{ "id": "watchlist", "type": "tiles", "max_items": 12, "items": [
{ "label": "NRWD", "value": "$184.62", "change": 2.32, "detail": "Northwind Traders", "url": "legato://page/stock?symbol=NRWD" },
{ "label": "CTSO", "value": "$72.15", "change": -4.51, "detail": "Contoso Systems" },
{ "label": "ZQXJ", "value": "No quote" } ] }
```
| Field | | |
| --- | --- | --- |
| `label` | optional | The card's title. Leave it out in a tab that already names the tiles. |
| `items` | required | Up to 60 tiles, in the order given. Each has a `label` of 1–16 characters, like a symbol, and optionally a `value` (text up to 24 characters, like `"$184.62"` or `"72.15 EUR"`, or a number), a `change` (a number), a `detail` that shows when the pointer rests on the tile, like a company's name, and a `url` that a click opens: https, or `legato://page/ID` for another page. A tile with no `value` shows a dash. On a tile with no `change`, the value can run to two lines, for a note like "Check this symbol". An empty `items` says "Nothing to show yet". |
| `unit` | optional | What follows the change, `%` if left out. Any other unit comes after a space, and `""` shows the number alone. |
| `decimals` | optional | The change's decimal places, 0 to 4, or 2 if left out. |
| `scale` | optional | The change that gets the deepest tint, or 3 if left out. Smaller moves get lighter tints and larger ones the deepest. The scale is fixed, so a quiet day looks quiet. About 3 suits stocks in percent; coins move more, so try 10. |
| `max_items` | optional | Show only the first so many tiles, in order, with Show N more for the rest. |
| `style` | optional | `heat` (the default) washes each tile and colours the change; `quiet` leaves the tiles plain and colours the change, with an arrow. |
| `colors` | optional | `{ "up": …, "down": … }`, by the [breakdown](https://legatobar.com/docs/card-numbers.md#breakdown) names, such as `{ "up": "blue", "down": "orange" }`. Left out: green and red. |
Full width. The card writes the change with its sign, like "+2.32%" or "−4.51%", so map `change` to a number, never to a template. Tiles never count toward the page's status, a section's dot or a notification. VoiceOver reads each tile's label, value, change and detail.
From a source, map each row with `each`. Where there's nothing to compare, a condition with no `else` leaves `change` out and the tile stays plain:
```json
"map": { "items": { "each": "rows", "limit": 60, "fields": {
"label": "symbol",
"value": { "template": "${price|round:2}" },
"change": { "if": { "path": "time", "gt": 0 }, "then": "change_percent" },
"detail": "name",
"url": { "template": "legato://page/stock?symbol={symbol|raw}" } } } }
```
---
# Lists and rows
## list
[See examples](https://legatobar.com/features#card-list)
Short lines of text.
| Field | | |
| --- | --- | --- |
| `label` | required | |
| `items` | required | Up to 500 lines; give a long one `max_items` so it opens short. Each is a string of 1–160 characters, with [inline formatting](https://legatobar.com/docs/card-text.md#inline-formatting), or a row object (below). |
| `style` | optional | How the lines are marked: `plain` (the default), `bullet`, `numbered` (1. 2. 3.) or `check` (a green check on each, for what's done or included). |
| `tone` | optional | `neutral` (the default), `info`, `success`, `warning` or `critical`: tints the card as a [`text`](https://legatobar.com/docs/card-text.md#text) card's tone does, and colours its bullets, numbers or checks. |
| `copyable` | optional | `true` gives each line a Copy button that copies its words without the formatting: prompts to try, commands, codes. |
| `max_items` | optional | Show no more than this many lines, with **Show *N* more** under them for the rest, as an [agenda](https://legatobar.com/docs/card-time.md#agenda)'s `max_events` does. For a long list where the first few matter most, such as recent tasks. |
| `paged` | optional | `true` turns a long list into pages of `max_items` lines, with a pager at the end of the title row (back, which lines show, and on) in place of **Show *N* more**. For a list too long to open all at once, such as a month of transactions. A page that starts partway through a day repeats its heading. |
| `fit` | optional | With `paged`: each page shows as many lines as keep the page within the sidebar's length, so the panel never grows past it for this list. At most `max_items` and at least 5, by whole lines as the sidebar and the rest of the page change. Without the sidebar, a page is `max_items` lines. |
| `aside_at` | optional | Where the rows' `aside` column sits: `end` (the default), between the words and the detail, or `start`, before the words. On a page with `"look": "sheet"`, a date at the start is drawn in a small grey box. |
| `sections` | optional | `days` groups the rows by date. Each row's `section` is its date, such as `2026-12-03` (a time on that day works too). The groups are Today, then each of the next seven days under its day of the month, then one group for each later month ("Later in December"), where each row shows its own date. Give the rows in date order. |
| `layout` | optional | `rows` (the default), `shelf` or `chips`: see [Shelf](https://legatobar.com/docs/card-lists.md#shelf) and [Chips](https://legatobar.com/docs/card-lists.md#chips). |
| `image_shape` | optional | `poster` (the default), `square` or `wide`: the items' [thumbnails](https://legatobar.com/docs/card-numbers.md#images-on-rows), unless an item sets its own. |
| `truncate` | optional | `middle` keeps each row's words on one line and cuts a long one in its middle, so both ends show: a long generated host name. The whole text shows on hover. |
| `headings` | optional | Grey names over the rows' columns, under a rule: `lead`, `text`, `aside` and `detail`, each up to 24 characters, such as Time, Domain, Client and Outcome. Each sits over its column. Rows that link show no arrow, so the last column ends at the card's edge. For a list read as a table, such as a log. |
| `total` | optional | How many there are at the service when the list holds only the first of them: a query log's 74,628 when it shows the latest 100. A source can set it from the answer's count, and "74,628" counts. A [tab with `counts`](https://legatobar.com/docs/card-text.md#tabs) shows it after its name. |
| `pager_at` | optional | `bottom` puts a paged list's pager under its rows, with "Showing 100 of 74,628" (or how many lines it holds) at the left, so nothing sits on the title row. For a list with `headings`, or one beside a detail pane. In a [layout](https://legatobar.com/docs/page-writing.md)'s cell of its own, such a list (or the tabs it's in) stretches to the cells beside it and shares the room left under its rows between them, a fraction of a point each, so its footer ends level with their last line. |
If an item contains ` · ` (space, middle dot U+00B7, space), the text after the last one is right-aligned, so `"Costco · $212"` reads as a name with an amount beside it. Long items wrap to two lines.
A row object is for a line that links somewhere, has a detail at its right, a grey line under it, or an icon before it:
| Field | | |
| --- | --- | --- |
| `text` | required | 1–160 characters, with inline formatting. |
| `url` | optional | An https link, or [another page](https://legatobar.com/docs/card-fields.md#links-to-other-pages). Clicking anywhere on the row opens it. Under the pointer (or with keyboard focus) the row gets a faint highlight and an arrow at its right, ↗ for a web link and → for a page, and its tooltip says where it goes ("Open ups.com", "Show the Pi-hole page"). Once any row has a link, every row keeps room for the arrow so the details line up. |
| `detail` | optional | Up to 40 characters at the row's right, like `"2h ago"` or `"$212"`. |
| `detail_color` | optional | The detail's colour, by the [breakdown card's names](https://legatobar.com/docs/card-numbers.md#breakdown), in a deeper shade made for text: a credit's amount in `green`. Only when the colour means something. |
| `selected` | optional | `true` draws the row on a grey plate: the row the page is showing now, such as the drive on a route map above the list. A source can set it from a comparison with the answer, `{"if": {"path": "ended_at", "equals": {"answer": "pick.results[0].ended_at"}}, "then": {"template": "true"}, "else": {"template": "false"}}`. |
| `aside` | optional | Up to 40 characters in a grey column on the row's one line: a transaction's category beside its payee, or a date before it (`aside_at`). Once any row has one, the asides and the details each keep one width down the card, so they line up, and the words stay on one line, cut short when long. |
| `lead` | optional | Up to 40 characters in a grey column at the very start of the row, before its words: a log line's time. Every lead keeps the widest one's width, so the words line up. |
| `spark` | optional | Up to 60 numbers, oldest first, drawn as thin grey bars before the row's detail: a client's queries through the day. Each row's bars are against its own highest, so they show its shape rather than its size. Once any row has one, every row keeps the room. |
| `subtitle` | optional | 1–80 characters of plain text on a grey line under the row's words: an issue's `"APP-214 · Due today"`, or who commented. It stays on one line, ending in "…" when it doesn't fit, and `detail` stays beside the first line. Drawn in the default `rows` layout only. |
| `icon` | optional | An [item icon](https://legatobar.com/docs/card-fields.md#item-icons) before the words: a carrier's logo on a package (`si:ups`), a service's on a status line, or a symbol (`shippingbox`). Once any row has one, every row keeps its space, so the words line up. |
| `image` | optional | A [thumbnail](https://legatobar.com/docs/card-numbers.md#images-on-rows) from the card's source, drawn in the icon's place. |
| `image_shape` | optional | The item's own shape, overriding the card's. |
| `section` | optional | A heading of 1 to 40 characters. Drawn when it differs from the row above, in the default `rows` layout only. |
| `key` | optional | The row's identity from one answer to the next, such as an item's id: text or a number. |
A row's `url` may also be plain http when it's on the card's source's own address or a private network address (such as `192.168.1.20`, `10.0.0.5` or a `.local` name), so rows from servers on your network link. A [`status`](#status) card's `url` follows the same rule. Other cards' links stay https.
Strings and row objects can be mixed in one list. A [source](https://legatobar.com/docs/source-examples.md#a-feed-the-latest-posts-each-linking-to-its-page) can fill one from a blog's or news site's feed.
Sourced rows can carry up to three places for buttons at their end: see [Buttons on each row](https://legatobar.com/docs/button-rows.md#buttons-on-each-row).
```json
{ "id": "top", "type": "list", "label": "Largest this week", "items": ["Costco · $212", "Delta Air Lines · $189"] }
{ "id": "steps", "type": "list", "label": "Deploy", "style": "numbered", "items": ["Run `make test`", "Tag **v2.15**"] }
{ "id": "ask", "type": "list", "label": "Try asking", "tone": "success", "copyable": true, "items": ["What would make a great page for me?"] }
{ "id": "posts", "type": "list", "label": "Latest posts", "items": [{ "text": "Swift 6.3 released", "url": "https://www.swift.org/blog/", "detail": "2h ago" }] }
{ "id": "issues", "type": "list", "label": "Assigned to you", "items": [{ "text": "Fix the login loop", "subtitle": "APP-214 · Due today", "detail": "In Review" }] }
```
### Chips
Use `"layout": "chips"` for short items in quiet rounded capsules. Chips wrap from left to right. Each shows its icon and one line of text. Long text ends with an ellipsis. Only an item's `color` tints its icon. A `url` makes the chip a link. The `detail` is a tooltip and is read by VoiceOver. Leave out `label` for no header. `max_items` keeps Show N more. Chips take no images, row actions, marks, Copy or Ask buttons.
```json
{ "id": "notes", "type": "list", "layout": "chips", "max_items": 3,
"items": [{ "text": "Gusts Friday", "icon": "wind", "detail": "Gusts to 46 mph" },
{ "text": "Rain Sunday", "icon": "cloud.rain" }] }
```
### Shelf
With `"layout": "shelf"`, a list is up to four tiles across, each its [image](https://legatobar.com/docs/card-numbers.md#images-on-rows) at `image_shape`, then its `text` and a grey `detail`, each on one line and cut short: what was just added to a media library. Tiles keep a quarter of the width however few there are, so the shelf never stretches when an item arrives. `max_items` still applies, and **Show *N* more** adds rows of four. A tile with a `url` opens it. A tile without an image shows the placeholder (with its icon, if it has one). A shelf takes no `style`, `copyable` or `ask`, and no buttons on its tiles.
```json
{ "id": "new", "type": "list", "label": "Recently added", "layout": "shelf", "max_items": 4,
"source": { "ref": "media", "map": { "items": { "each": "added", "fields": { "text": "name", "detail": "when",
"image": { "template": "/Items/{id|raw}/Images/Primary?fillHeight=240" } } } } } }
```
A row object can have `section`, a heading of 1 to 40 characters. A heading appears when the row’s section differs from the row above. Sections show in the default `rows` layout only. With `max_items`, the first N rows stay in order and show their headings. Row links, icons and buttons keep their place.
## table
[See examples](https://legatobar.com/features#card-table)
A grid: service status, a short ledger, recent transactions.
| Field | | |
| --- | --- | --- |
| `label` | optional | |
| `columns` | required | 1–8 column headings, 1–32 characters each. |
| `rows` | required | Up to 10 rows. Each row is a list with exactly one cell per column. A cell is a number or a string of up to 60 characters. |
| `one_line` | optional | `true` keeps every cell on one line, cut short with … rather than wrapping to two. For a table wide enough to read that way, such as a full-width list in a [page layout](https://legatobar.com/docs/page-writing.md#layout-in-the-window). |
A row with the wrong number of cells is an error (`Row has 3 cells; the table has 4 columns.`). A column of numbers or of amounts written as text (`"$1,099"`, `"+$4,925.00"`, `"12%"`, `"—"`) is right-aligned, and an amount written with a `+` is green, as money coming in is elsewhere. Numbers are shown as plain numbers, so put currency in a string (`"$1,099"`) or in the heading. The last column of words takes the width the card has to spare, so the figures sit at its right edge.
```json
{
"id": "backups", "type": "table", "label": "Nightly backups",
"columns": ["Host", "Finished", "GB"],
"rows": [["nas", "02:14", 412.6], ["docker-vm", "02:31", 38.2]]
}
```
From a source, `rows` takes a list with `cells`: one rule per column, read from each element, so the table has as many rows as the answer gives. Keep `limit` at 10 or less. A cell with no text or number shows "—".
```json
"source": { "ref": "hub", "map": { "rows": {
"each": "systems", "where": { "path": "status", "equals": "up" },
"sort": { "by": "cpu", "order": "desc" }, "limit": 5,
"cells": ["name", "cpu", "memory", "disk"] } } }
```
## status
[See examples](https://legatobar.com/features#card-status)
The health of one thing.
| Field | | |
| --- | --- | --- |
| `label` | required | The service or job. |
| `state` | required | `ok`, `warning`, `critical`, `unknown` or `off`. |
| `detail` | optional | Up to 120 characters: why, or when it last ran. |
| `icon` | optional | An SF Symbol drawn in place of the state's own icon, in the state's colour, such as `moon.fill` for a market that's closed. Set it from a rule to change it with the answer. A name the Mac doesn't have shows the state's icon. |
| `url` | optional | Where a click on the card goes: [another page](https://legatobar.com/docs/card-fields.md#links-to-other-pages) with the details, or an https address. Plain http works too on the card's source's own address or a private network address, as it does for a [list row](#list), so a server's health card can open its web interface at `http://192.168.1.20` or `http://tower.local`. See [Cards that link](https://legatobar.com/docs/card-fields.md#cards-that-link). |
| `width` | optional | `half` (the default) shares a row with the half-width card beside it. `full` gives the card the whole row, as a page's main status above a row of tiles. |
| `placement` | optional | `"page_info"` puts the card in [Details](https://legatobar.com/docs/page-behavior.md#page-info), and the page leaves it out. See [In Details](#in-page-info). |
Each state has its own icon and colour: a green check, an orange triangle, a red octagon, a grey question mark, a grey power symbol for `off`. `icon` swaps the symbol and keeps the colour. `unknown` means the answer couldn't say; `off` means not running, and that's fine, such as a machine shut down on purpose. `off` counts as `ok` for the page's status, a section's dot and notifications. At full width, a state other than `ok` is also named beside it, such as "Warning"; an `ok` card lets the check say so. A page's status is the worst state among its `status` cards, the band a [`gauge`](https://legatobar.com/docs/card-numbers.md#gauge) is in and the items of a [`fleet`](https://legatobar.com/docs/card-lists.md#fleet). A move up to `warning` or `critical` posts a [notification](https://legatobar.com/docs/notifications.md).
```json
{ "id": "backup", "type": "status", "label": "Offsite backup", "state": "warning", "detail": "Last run 31 hours ago" }
```
### In Details
A service's own health belongs in Details, out of the way until it needs a look. Give its `status` card, or a `fleet` of its parts, `"placement": "page_info"`. The page doesn't draw it, and a heading whose cards all went there isn't drawn either. Details lists it first, under Health, with its whole detail and every item of a fleet. A row with a `url` opens it from there.
The Details button beside the page's title is always the same grey list, whatever its health cards say. A card that isn't `ok` or `off` shows in the line under the title, [notifies](https://legatobar.com/docs/notifications.md) and counts in the [Dock badge](https://legatobar.com/docs/notifications.md#the-dock-badge).
The card still counts for the page's status, notifications, Spotlight and Shortcuts, as it would on the page.
```json
{ "id": "health", "type": "status", "placement": "page_info", "label": "Radarr", "state": "ok", "width": "full", "detail": "Radarr 5.26 · No problems" }
```
Only a top-level `status` or `fleet` can go in Details. A card in a tab stays on the page, and a card in Details has no buttons (`actions`, `actions_placement`, `actions_align`, `row_actions`): put them on a card the page draws.
## map
[See examples](https://legatobar.com/features#card-map)
Places on a map: where the car is parked, a package, a trip's stops. Legato shows Apple's map around the pins in its muted style, held still: it doesn't drag or zoom. A click on a pin opens that place in Maps; anywhere else on the card, the area around the pins (or the place, with one pin). Apple's logo and Legal link show on it.
| Field | | |
| --- | --- | --- |
| `pins` | required | Up to 10 places, each a `lat` (-90 to 90) and a `lon` (-180 to 180), or a `place` in words (up to 200 characters, like `"Anaheim, CA 92899"`). Each takes an optional `label` (up to 40 characters, under the pin and the place's name in Maps) and `icon` (an SF Symbol in the pin, like `car.fill`; a plain dot without one). When a pin has both, its `lat` and `lon` win. An empty list says "No location yet", as a card waiting on its source does. |
| `label` | optional | The card's title. |
| `radius` | optional | How far around the pins the map shows, in metres, 50 to 5,000,000. Without it, enough to show every pin, and at least 400 m. |
| `detail` | optional | A line under the map, up to 200 characters. |
| `track` | optional | A recorded path, oldest first, up to 3,000 `{ "lat", "lon" }`: a drive's route as the car logged it, one solid light line with a hollow dot where it starts and a filled one where it ends, the map framed on it. Points at 0,0 or off the globe are left out. |
| `height` | optional | The map's height in points, 120 to 600. 150 without it; a route deserves 300. |
| `url` | optional | Where a click off the pins goes instead of Maps: an https address, or `legato://page/ID`. |
| `route` | optional | `true` joins the pins in order, oldest first, with a dashed line. See [Routes](https://legatobar.com/docs/card-lists.md#routes). |
| `route_icon` | optional | The SF Symbol on a route's last stop. Without it, `box.truck.fill`. |
| `open_maps` | optional | `false` turns off opening Maps: a click on a pin or the map does nothing, unless `url` is given. Without it, `true`. |
Full width. Each pin is a dot in the accent colour. A click on a pin opens that place in Maps, and a click elsewhere opens the area around the pins. Give `"open_maps": false` for a map that only shows where things are, such as a package's route. A source fills the pins like any list: `pins[0].lat` and `pins[0].lon` for one place, such as the car's `drive_state.latitude` and `drive_state.longitude` from Tessie, or `each` for several.
```json
{ "id": "car", "type": "map", "label": "Car", "pins": [ { "lat": 37.7955, "lon": -122.3937, "label": "Model Y", "icon": "car.fill" } ] }
```
### Places in words
Some services name a place but don't say where it is. A parcel's scans read like "ANAHEIM, CA 92899". Give a pin that text as its `place`, and Legato looks it up with Apple Maps after the page is drawn. The answer is kept on this Mac, so each place is looked up once. Only the place's words are sent to Apple, never the rest of the page.
Until a place is found, its pin isn't drawn. A card with none found yet says "Locating…". When every place has been looked up and none was found, it says "Couldn't find these places on the map". A place that wasn't found is tried again a day later. A lookup that fails because the Mac is offline is tried again soon, and the card keeps saying "Locating…".
### Routes
With `"route": true`, the pins are stops in the order you give them, oldest first. Legato joins them with a dashed line, draws the earlier stops as small dots and the last stop with `route_icon`. Only the last stop is named under its pin. The line is where the package was scanned, one stop to the next. It isn't a calculated route.
A stop that isn't found breaks the line there. When the last stop isn't found, no stop is drawn as the current one, so an earlier scan never looks like where the package is now.
A source fills a route from a list of scans with `each`. Parcel sends them newest first, so sort them oldest first, keep one stop per place in a row with `collapse`, and keep the newest 10 with `last`:
```json
{ "id": "route", "type": "map", "label": "Route", "route": true, "open_maps": false, "pins": [],
"source": { "ref": "parcel", "map": {
"pins": { "each": "events", "sort": { "by": "date", "as": "date" }, "collapse": "location", "last": 10,
"fields": { "place": "location", "label": "location" } } } } }
```
## facts
[See examples](https://legatobar.com/features#card-facts)
A few labelled values.
| Field | | |
| --- | --- | --- |
| `label` | optional | A heading above the rows. |
| `items` | required | 1 to 12 of `{ "key", "value", "icon", "url" }`. A `key` is 1–40 characters; a `value` is a string of up to 80 characters or a number; an optional [item icon](https://legatobar.com/docs/card-fields.md#item-icons) goes before the key. An optional `url` makes the line a link, as a [list row's](https://legatobar.com/docs/card-lists.md#list) is: [another page](https://legatobar.com/docs/card-fields.md#links-to-other-pages) with more about that value, or an https address. |
| `muted` | optional | `true` shows each row's label in grey, so the values stand out. |
Keys in a grey column with the values beside them, in the order sent. Use it for the things someone would otherwise look up: an order number, the carrier, the ETA.
A line with a `url` opens it when clicked. Under the pointer (or with keyboard focus) the line gets a faint highlight and an arrow after its value, → for a page and ↗ for a web address. Once any line links, every line keeps room for the arrow so the values line up. A detail page per line suits readings with a history: resting heart rate leading to its last 30 days.
```json
{ "id": "order", "type": "facts", "label": "Order 4821", "items": [
{ "key": "Carrier", "value": "UPS" }, { "key": "Tracking", "value": "1Z 999 AA1 01 2345 6784" }, { "key": "ETA", "value": "Thursday by 9 PM" } ] }
```
With `"layout": "figures"` and two to four items, the readings sit side by side, each a large figure with its key under it, the first in the text colour and the rest in grey: inside 55°, outside 46°. With `"layout": "line"` and two to six items, they sit on one quiet line, each value followed by its key in grey, such as a period's totals under its picker: **190 mi** 16 drives **228** Wh/mi. On a card too narrow for the line, they stack.
With `"layout": "wheels"` and exactly four items, in the order front left, front right, rear left, rear right, the card draws a car from above with each value by its wheel: a car's tire pressures. An item's `color` colours its value, so a low tire reads orange by its wheel; `grey` is the text colour, for a rule's "nothing wrong". Take the colour from the car's own warning flags, not a threshold of your own:
```json
"items[0].color": { "if": { "path": "vehicle_state.tpms_soft_warning_fl", "equals": true },
"then": { "template": "orange" }, "else": { "template": "grey" } }
```
## vehicle
A car from above, large, with its state drawn on it: each tire's reading by its wheel, a lock on the roof while it's locked, a green glow at the charge port while it charges, and anything open in orange where it is. Pair it with the car's state and battery beside it.
| Field | | |
| --- | --- | --- |
| `label` | optional | |
| `tires` | optional | Exactly four `{ "value", "color" }`, front left, front right, rear left, rear right. `color` as a facts row's: orange for a low tire; grey or none draws as usual. |
| `unit` | optional | The tires' unit, small in the body (`psi`). |
| `locked`, `charging` | optional | true or false. |
| `doors_open`, `frunk_open`, `trunk_open`, `windows_open` | optional | true or false, as the car reports them; a `values` lookup turns a 0 or 1 into one. |
## fleet
[See examples](https://legatobar.com/features#card-fleet)
One dot per host, job or device, for many of them at once.
| Field | | |
| --- | --- | --- |
| `label` | optional | The card's title. A fleet in a [tab](https://legatobar.com/docs/card-text.md#tabs) leaves it out when it would repeat the tab's name: it then has no header row and no count, and its notifications are named by the tab. |
| `items` | required | 1 to 60 of `{ "name", "state", "detail", "url", "group" }`: a name of 1–24 characters, a state of `ok`, `warning`, `critical`, `unknown` or `off`, an optional detail of up to 80 characters shown on hover, an optional `url` the item opens when it's clicked (https, or [another page](https://legatobar.com/docs/card-fields.md#links-to-other-pages)), and an optional `group` of 1–24 characters, a small heading the item sits under. |
| `max_items` | optional | Show no more than this many items, 1–60, with **Show *N* more** under them for the rest. What needs attention shows first. |
| `placement` | optional | `"page_info"` puts the fleet in Details, every item listed under its group, as a server's tasks and plugins. See [In Details](#in-page-info). |
A grid of named dots in as many columns as fit, with "24 ok", "23 ok · 1 off" or "2 of 24 need attention" in the corner. An `off` item has a grey dot and doesn't need attention: use it for a machine that's stopped on purpose, and keep `critical` for one that should be running. The worst state among the items counts toward the page's status dot, like a `status`, with `off` counting as `ok`. It replaces a column of status cards when there are more than a few.
An item with a `url` is a link to the service it stands for. Under the pointer (or with keyboard focus) it gets a faint highlight and an arrow after its name, its tooltip says where it goes ("Open Gitea · gitea.example.com", then the detail), and a click anywhere on it opens the address. With `legato://page/ID` the arrow is →, the tooltip says "Show the Pi-hole page", and a click shows that page. Only `https` addresses and pages open, as with every link in Legato; a source that reports an `http` one (a service checked on a local port) leaves that item plain. When the address a monitor checks is a health endpoint rather than the app, the [`origin` filter](https://legatobar.com/docs/mapping.md#mapping) keeps only its scheme and host: `{"template": "{monitor_url|origin}"}`.
```json
{ "id": "hosts", "type": "fleet", "label": "Hosts", "items": [
{ "name": "nas", "state": "ok" }, { "name": "pi-hole", "state": "ok" }, { "name": "backup", "state": "warning", "detail": "last run 31 hours ago" },
{ "name": "home-assistant", "state": "ok", "url": "https://ha.example.com" } ] }
```
A big fleet, such as thirty monitors, stays one card. `max_items` keeps it to a size that fits the panel. When there are more items than that, it shows the critical ones first, then warnings, then unknown, then the rest in the page's order; `off` counts as fine. **Show *N* more** brings back every item, in the page's order. When nothing is cut, the items keep the page's order. Show *N* more isn't remembered once the card goes from view: another page, a closed section or another tab shows it cut again. The corner count, the page's status, a section's or tab's dot, notifications, Spotlight and Shortcuts count every item, shown or not, so a hidden item that goes critical still notifies.
An item is known by its name for its notifications and the page's Recent activity. When two items can share a name, such as a fork beside the repository it came from, give each a `key` that stays the same from one answer to the next: Gitea's repository fleet uses `{"template": "{owner}/{name}"}`. Never put a secret in it.
`group` splits the dots under small headings, such as Services, Jobs and DNS, rather than a fleet for each. Items with no group come first, with no heading. Then each group follows, in the order its first item appears, holding its items in the page's order. Every group's dots line up in the same columns. With `max_items`, the items shown are chosen across the whole card first, then drawn in their groups. A group with nothing shown leaves out its heading. A group is trimmed of spaces and matched exactly, so `Jobs` and `jobs` are two groups. Two to four large groups read best.
```json
{ "id": "monitors", "type": "fleet", "label": "Monitors", "max_items": 24, "items": [
{ "name": "git", "state": "ok", "group": "Services", "url": "https://git.example.com" },
{ "name": "wiki", "state": "critical", "group": "Services", "detail": "502 for 4 minutes" },
{ "name": "nightly backup", "state": "warning", "group": "Jobs", "detail": "last run 31 hours ago" },
{ "name": "resolver", "state": "ok", "group": "DNS" } ] }
```
## checklist
[See examples](https://legatobar.com/features#card-checklist)
Items that are done or not.
| Field | | |
| --- | --- | --- |
| `label` | optional | The title, with the count of done items beside it. Leave it out for a checklist inside a tab that already names it: the card then has no title row, and its rows start at the top. |
| `items` | required | Up to 20 of `{ "text", "done", "detail", "icon", "badge", "badge_label", "badge_at", "section" }`: text of 1–120 characters, `true` or `false`, an optional [item icon](https://legatobar.com/docs/card-fields.md#item-icons) between the mark and the text, and optionally a `detail` of up to 120 characters, a second line under the text in smaller grey type, as Reminders shows a reminder's list. Both take [inline formatting](https://legatobar.com/docs/card-text.md#inline-formatting). A `badge` is an SF Symbol set into the start of the text in the accent colour, such as a to-do app's repeat mark (`arrow.clockwise.circle.fill`); unlike an icon it takes no room on rows without one. `"badge_at": "end"` puts it after the text in grey instead. A checklist item can give its badge a `badge_label`, such as `"High priority"`, for VoiceOver. Repeat, flag and pin badges have spoken defaults; use `badge_label` for other meanings. A `section` is a heading the row sits under: a row whose section differs from the row above starts a new one, as a to-do app groups its Upcoming by day (list layout only). An empty list is allowed, for a day with nothing due. |
| `mark` | optional | How a done item looks. `check` (the default): the circle turns into a checkmark and the text is struck through. `fill`: the circle fills and the text goes light, as in Reminders. `square`: a rounded square fills with a checkmark and the text goes light. `switch`: for things that are on or off, such as lights. Each item's icon is its mark (a symbol name, such as `lightbulb`; a power symbol otherwise), lit when `done` and dim when not, the text stays as it is, and the corner counts how many are on. A lit light, and anything else, glows yellow; fans (`fan`, `fan.ceiling`) and shades and blinds (`blinds.horizontal.open`, `window.shade.closed`) light in Legato's accent blue. |
| `layout` | optional | `list` (the default): a row per item. `grid`: two columns of small tiles, each item's mark beside its text with the `detail` under it. An item that's on (`switch`) or done tints its tile, and the whole tile is the item's action. For things you scan for state and toggle, such as a room's lights, shades and fans. A build that doesn't know `grid` shows the list. |
| `max_items` | optional | Show no more than this many rows, with **Show N more** for the rest, as a [list](https://legatobar.com/docs/card-lists.md#list)'s does. The corner still counts every row. Items written into the page stop at 20; a checklist a source fills can hold more, such as a to-do app's Upcoming. |
The corner counts "2 of 5". Without an `itemAction` the list is read-only: whatever writes the page writes it again as things get done. A checklist filled from a [source](https://legatobar.com/docs/button-rows.md#one-action-per-checklist-row) can give the rows an `itemAction`, so ticking one sends that item's request.
```json
{ "id": "release", "type": "checklist", "label": "Release 2.4", "items": [
{ "text": "Tag the build", "done": true }, { "text": "Write the notes", "done": false, "detail": "Maya · due Thursday" },
{ "text": "Submit for review", "done": false } ] }
```
A room's lights as a grid of switches:
```json
{ "id": "lights", "type": "checklist", "label": "Lights", "mark": "switch", "layout": "grid", "items": [
{ "text": "Ceiling", "done": true, "detail": "80%", "icon": "lightbulb" },
{ "text": "Table lamp", "done": false, "detail": "Off", "icon": "lightbulb" } ] }
```
---
# Time
## countdown
[See examples](https://legatobar.com/features#card-countdown)
Time until a moment, or since one.
| Field | | |
| --- | --- | --- |
| `label` | required | What happens then. |
| `at` | required | When, as ISO 8601 with seconds and a zone: `2027-03-12T19:15:00-04:00` or `2027-03-12T23:15:00Z`. Or Unix seconds, as services such as a weather API send a sunset, so a source can map it straight in: `{ "at": "current.sunset" }`. |
| `detail` | optional | Up to 120 characters: the gate, the price. |
Half width. The Mac counts down on its own between writes ("9d 4h", "2h 14m", "14m 32s"), shows "Now" at the moment and "2h 14m ago" after it, with the time or date under the count. Write the moment itself, not the time remaining, so the count stays right however long it is until the next write.
```json
{ "id": "boards", "type": "countdown", "label": "Flight boards", "at": "2027-03-12T19:15:00-04:00", "detail": "Gate B22" }
```
## window
[See examples](https://legatobar.com/features#card-window)
A window of time in the day, such as daylight, a store's hours or off-peak charging, drawn on one bar from midnight to midnight with now on it.
| Field | | |
| --- | --- | --- |
| `start` | required | When it starts: ISO 8601 with seconds and a zone, or Unix seconds as services send it. |
| `end` | required | When it ends, after the start and within a day of it. A window can cross midnight, such as 9 PM to 6 AM. |
| `next_start` | optional | When it next starts, so the time after it counts down to that. |
| `label` | optional | The headline in the window, up to 60 characters, like "Daylight left". Default "Left". |
| `before_label` | optional | The headline before it starts, like "Until sunrise" or "Opens in". Default "Starts in". |
| `after_label` | optional | The headline after it ends. With `next_start` it counts down to it (default "Starts in"); without, it counts up from the end (default "Ended"). |
| `start_label`, `end_label` | optional | Words before the start's and end's times under the bar, up to 24 characters each, like "Sunrise" and "Sunset". |
| `detail` | optional | A line under the bar, up to 120 characters. |
Full width. The track is a quiet grey, the window on it a pale chart colour, the part already gone the chart colour itself, and now a white knob, with the start and end times under their places. A window that crosses midnight shows at both ends of the bar. Above it, the time left counts down on its own. From a weather source, map sunrise and sunset straight in: OpenWeather's One Call answer has `daily[0].sunrise`, `daily[0].sunset` and `daily[1].sunrise`.
```json
{ "id": "daylight", "type": "window", "label": "Daylight left", "before_label": "Until sunrise", "after_label": "Until sunrise",
"start": "2027-03-12T06:34:00-06:00", "end": "2027-03-12T18:17:00-06:00", "next_start": "2027-03-13T06:32:00-06:00",
"start_label": "Sunrise", "end_label": "Sunset" }
```
## agenda
[See examples](https://legatobar.com/features#card-agenda)
Dated items over one day, a week or up to 30 days: meetings, an itinerary, an on-call rota, release windows, bills due.
| Field | | |
| --- | --- | --- |
| `label` | optional | |
| `days` | optional | 1–30, default 1: how many days the card shows, starting today in the Mac's time zone. Past a week, `hide_empty_days` keeps it short. |
| `hide_empty_days` | optional | `true` leaves out the days with nothing on them, instead of saying "Nothing scheduled" under each. When no day has anything, the card says it once. Default `false`. |
| `max_events` | optional | List no more than this many events, with **Show *N* more** under them for the rest. Today's events already over don't count and are left out until it's pressed, so the first events listed are still to come. |
| `hide_all_day_label` | optional | `true` leaves "All day" off all-day items, for a card where every item is a date, like bills due. When no item has a time, the time column goes too. Default `false`. |
| `items` | required | Up to 60 items, in any order. An empty list is allowed and shows "Nothing scheduled". |
Each item:
| Field | | |
| --- | --- | --- |
| `title` | required | 1–80 characters. |
| `start` | required | Either a date-time with seconds and a zone, like `countdown`'s `at` (`2027-03-12T09:30:00-06:00`), or a date, `2027-03-12`, for an all-day item. |
| `end` | optional | The same form as `start`, and not before it. A date `end` is the **last day**, inclusive: an offsite on the 12th and 13th is `"start": "2027-03-12", "end": "2027-03-13"` (not the 14th, as iCalendar would have it). |
| `detail` | optional | Up to 120 characters, on a line under the title: the room, the gate. |
| `url` | optional | An https link, or [another page](https://legatobar.com/docs/card-fields.md#links-to-other-pages). The button says **Join** from ten minutes before a timed item until it ends, and **Open** otherwise. |
| `state` | optional | `ok`, `warning`, `critical` or `unknown`, drawn as a coloured mark on the row. It doesn't count toward the page's status. |
| `color` | optional | `#RRGGBB`, such as a calendar's colour. It's drawn only as a thin bar at the row's leading edge, never as text or a fill, so any colour reads in light and dark mode. Anything else, like `blue` or `#123`, is an error. |
| `icon` | optional | An [item icon](https://legatobar.com/docs/card-fields.md#item-icons) before the title. |
Full width. The Mac groups items by day in its **current** time zone, under Today, Tomorrow and then the weekday, with all-day items first and timed ones by start time. An item that covers several days appears on each. Days in the window with nothing on them say "Nothing scheduled", so the card keeps its height (or are left out with `hide_empty_days`), and items outside the window are left out: write a week once and the card moves on a day at midnight by itself.
Today's past items are dimmed, a thin line marks now, and the item in progress shows "until 10:45". All of that keeps up on the Mac's own clock, with no write needed. An all-day item is a date, not a moment, so it stays on its day wherever the Mac is; a timed item written in another zone also shows its own time ("9:00 AM GMT+9"), so an itinerary written in one zone still reads right in another.
```json
{ "id": "schedule", "type": "agenda", "label": "Schedule", "days": 2, "items": [
{ "title": "Release freeze", "start": "2027-03-12", "end": "2027-03-14", "color": "#E8710A" },
{ "title": "Design review", "start": "2027-03-12T09:50:00-06:00", "end": "2027-03-12T10:45:00-06:00",
"detail": "Room 4", "url": "https://meet.example.com/design" },
{ "title": "Flight UA 512", "start": "2027-03-13T07:05:00-06:00", "detail": "ORD → SFO, gate B12", "state": "warning" } ] }
```
## month
[See examples](https://legatobar.com/features#card-month)
This month as a grid, with the chosen day's items under it.
| Field | | |
| --- | --- | --- |
| `label` | optional | |
| `items` | required | Up to 300 items in the [agenda](https://legatobar.com/docs/card-time.md#agenda)'s form, in any order. An empty list is allowed. |
| `days` | optional | 1–30, default 1: how many days the list under the grid shows, from the chosen day, as an [agenda](https://legatobar.com/docs/card-time.md#agenda)'s `days` does. With `30`, the next month at a glance under the grid. |
| `hide_empty_days` | optional | With `days`, `true` leaves out the days with nothing on them, instead of saying "Nothing scheduled" under each. When no day has anything, the card says it once. Default `false`. |
| `max_events` | optional | List no more than this many events under the grid, with **Show *N* more** for the rest, as an [agenda](https://legatobar.com/docs/card-time.md#agenda)'s `max_events` does. The grid's dots still show every item. With `"days": 30, "max_events": 20`, the next 20 events and the rest a click away. |
Full width. The grid shows six weeks from the week of the 1st, in the Mac's current time zone and starting on its first day of the week, so the card keeps its height and the last days reach into next month. Today is filled with the accent colour. A day with items gets up to three dots, one per `color` (grey for items without one).
Today is chosen until someone clicks another day, and the chosen day's items are listed under the grid as the agenda lists them: all-day items first, a line at now, **Join** and **Open**. With `days`, the list runs on from the chosen day for that many days, each under its own heading. The same items fill either card, so a page can switch between `agenda` and `month` by changing `type`. Each day of the month moves on at midnight by itself; on the 1st the grid turns to the new month.
The arrows beside the month's name page up to 12 months either way, and **Today** comes back; the panel opens on this month each time. A card shows the items written for whichever month it's on, so include the months you want someone to be able to page to, within the 300 items. A [calendar source](https://legatobar.com/docs/source-calendar.md#calendar-sources) reads each month as it's shown, and 30 days past it for the list.
```json
{ "id": "month", "type": "month", "items": [
{ "title": "Release freeze", "start": "2027-03-12", "end": "2027-03-14", "color": "#E8710A" },
{ "title": "Design review", "start": "2027-03-12T09:50:00-06:00", "end": "2027-03-12T10:45:00-06:00",
"detail": "Room 4", "url": "https://meet.example.com/design", "color": "#1A73E8" },
{ "title": "Offsite", "start": "2027-03-17", "end": "2027-03-18", "detail": "Lake house", "color": "#E8710A" } ] }
```
## timeline
[See examples](https://legatobar.com/features#card-timeline)
A dated history, newest first: a package's tracking events, a job's runs, an order's steps. It's drawn as an [agenda](https://legatobar.com/docs/card-time.md#agenda) is, under day headings with a time column, and a rail of nodes beside the times. The newest event is the current one, with a filled node.
| Field | | |
| --- | --- | --- |
| `label` | optional | Left out, the card has no title row, as a [checklist](https://legatobar.com/docs/card-lists.md#checklist)'s. |
| `items` | required | Up to 60 events (below). When Legato can read every one's `at`, it sorts them newest first itself; otherwise they stay in the order sent, which should be newest first. An empty list is allowed and says "No events yet". |
| `next` | optional | What the source expects next, such as a delivery window: `{ "title", "start", "end", "detail" }`, with `start` and `end` in the forms `at` takes. It's drawn above the newest event, a hollow node on a dashed rail, never as an event. Without a `start` Legato can read there's no row, so a source can map an expected date that's sometimes missing. A date alone leaves the time column empty, and `end` on the same day reads "2 – 6 PM". Once the window is over it's dimmed; Legato doesn't call it late. |
| `max_items` | optional | Show the newest so many events, with **Show *N* more** for the rest. The newest always shows; `next` and quiet spells don't count. |
| `gap_days` | optional | 1–30. When two shown events are this many days apart or more, a grey "No updates for 3 days" sits between them on a dashed stretch of rail, and above the newest when it's that old. It keeps up with the Mac's clock. A package page uses 2. |
Each item:
| Field | | |
| --- | --- | --- |
| `title` | required | 1–80 characters, the event in the source's own words: Out for delivery, Arrived at facility. |
| `at` | required | When it happened: ISO 8601, a date (`2026-11-04`, drawn with no time), a date and time with no zone (`2026-11-04 14:30:00`, read as the Mac's time), Unix seconds, or a carrier's own words, such as `Monday, November 2, 2026 3:14 PM`, `November 2, 2026 03:14 PM EST` or `02.11.2026 14:30`. Words with no zone are read on the Mac's clock, so the time shows as the carrier wrote it. A time Legato can't read is shown as written on the detail line, under the day before it. |
| `detail` | optional | Up to 120 characters on the line under the title: where it happened. |
| `state` | optional | `warning`, `critical` or `unknown` draws that mark on the rail in place of the node, for an exception or a failed delivery attempt; `ok` and `off` are the plain node. Like an agenda item's, it doesn't count toward the page's status: a `status` card says how the whole thing stands. |
| `icon` | optional | An [item icon](https://legatobar.com/docs/card-fields.md#item-icons) before the title. |
Full width. Days are headed Today, Yesterday, then "Wednesday, Nov 4" (with the year when it isn't this one), in the Mac's current time zone. Each title and detail is one line, cut short with the whole text as its tooltip, so no row grows. There's no progress ring, percentage or row for a step that hasn't happened: a history says what happened, and only `next` looks ahead. VoiceOver reads each row whole ("Out for delivery, Beaverton, OR, today at 8:12 AM, latest"; "Weather delay, Hodgkins, IL, yesterday at 6:02 AM, needs attention"), and the days as headings.
```json
{ "id": "tracking", "type": "timeline", "label": "Tracking", "max_items": 6, "gap_days": 2,
"next": { "title": "Expected delivery", "start": "2027-03-12T14:00:00-06:00", "end": "2027-03-12T18:00:00-06:00" },
"items": [
{ "title": "Out for delivery", "at": "2027-03-12T08:12:00-06:00", "detail": "Beaverton, OR" },
{ "title": "Weather delay", "at": "2027-03-11T06:02:00-06:00", "detail": "Hodgkins, IL", "state": "warning" },
{ "title": "Departed from facility", "at": "2027-03-07T16:20:00-08:00", "detail": "Ontario, CA" } ] }
```
Filled from [Parcel](https://parcelapp.net/help/api-view-deliveries.html) on a [page for every package](https://legatobar.com/docs/detail-pages.md#one-page-for-every-item): the delivery whose tracking number the link names, its events, the newest marked when Parcel reports a failed attempt (6) or an exception (7), and its expected window as `next`. Parcel passes each carrier's own times through, in whatever words the carrier uses, and the card reads them:
```json
"derive": [ { "name": "this", "value": { "each": "recent.deliveries", "where": { "path": "tracking_number", "equals": "{param.tracking}" },
"fields": { "events": "events", "code": "status_code", "expected": "date_expected", "expected_end": "date_expected_end" } } } ]
"source": { "ref": "parcel", "map": {
"items": { "each": "this[0].events", "limit": 60, "fields": { "title": "event", "at": "date", "detail": "location" } },
"items[0].state": { "path": "this[0].code", "values": { "6": "warning", "7": "warning" } },
"next.title": { "template": "Expected delivery" },
"next.start": "this[0].expected",
"next.end": "this[0].expected_end" } }
```
## strip
[See examples](https://legatobar.com/features#card-strip)
An item's states over a span, one thin bar per slice, coloured by the state it was in: a monitor's last day, a host's week, a container's month. It's drawn from [samples History keeps](https://legatobar.com/docs/history-collect.md#samples), and it says what happened, not how things stand now.
| Field | | |
| --- | --- | --- |
| `label` | optional | The card's title, like "Last 24 hours". |
| `segments` | required | Up to 240 slices, oldest first, each `{ "state", "label" }`. An empty list draws an empty track. |
| `start_label`, `end_label` | optional | Up to 40 characters under each end: "24 hours ago" and "Now". |
| `detail` | optional | Up to 40 characters beside the title: what the span adds up to, like "99.2% up". |
Each segment's `state` is `ok`, `warning`, `critical`, `unknown` or `off`, as a [status](https://legatobar.com/docs/card-lists.md#status) card has them, or `none` for a slice with no data, drawn as the empty track. Words that aren't a state are `unknown`; a segment without one is `none`. `label`, up to 80 characters, is what the segment says when the pointer is over it: "3 PM · down 12 min".
Full width, 18 points high. With room, bars have a 1-point gap; past about 100 segments on a panel they touch. The segment under the pointer is marked, and its label and state take the place of the two end labels on the same line, so the card doesn't grow or move; they come back when the pointer leaves. VoiceOver reads the title and how many slices were in each state ("Last 24 hours; 2 critical, 94 OK; 99.2% up"), and steps through the segments one by one with increment and decrement.
A strip is history, not status: it never counts toward the page's status, a section's dot or a notification, whatever its segments say. Put a `status` card beside it for how the item stands now.
```json
{ "id": "history", "type": "strip", "label": "Last 24 hours", "detail": "99.2% up",
"start_label": "24 hours ago", "end_label": "Now",
"segments": [ { "state": "ok", "label": "2 PM" }, { "state": "critical", "label": "3 PM · down 12 min" },
{ "state": "none", "label": "4 PM" } ] }
```
Filled from an item's samples on a [page for every item](https://legatobar.com/docs/detail-pages.md#one-page-for-every-item), with [`by_time`](https://legatobar.com/docs/mapping-expiry.md#slices-of-time) cutting the span into equal slices and [`worst`](https://legatobar.com/docs/mapping-expiry.md#slices-of-time) giving each one the worst state in it. Without `buckets`, `by_time` makes 144 slices, ten minutes each of a day:
```json
"sources": { "samples": { "dataset": "kuma-samples", "key": "{param.id}",
"derive": [ { "name": "up", "value": { "multiply": [ { "divide": [
{ "count": "kept.rows", "where": { "path": "row.state", "equals": "ok" } }, { "count": "kept.rows" } ] }, 100 ], "round": 1 } } ] } }
"source": { "ref": "samples", "map": {
"segments": { "each": "kept.rows", "by_time": { "at": "at", "span": "kept.span" },
"fields": { "state": { "worst": "row.state", "of": "rows" }, "label": { "template": "{from|time}" } } },
"detail": { "template": "{up}% up" } } }
```
## heatmap
[See examples](https://legatobar.com/features#card-heatmap)
A square per day, in week columns, each shaded by how much happened that day: a year of GitHub contributions, of steps, of tasks done. Weeks run left to right, oldest first, and days top to bottom, Sunday at the top, as GitHub draws its calendar. It says what happened, not how things stand now.
| Field | | |
| --- | --- | --- |
| `label` | optional | The card's title, like "Contributions". |
| `detail` | optional | Up to 40 characters beside the title: what the span adds up to, like "1,194 in the past year". The page works it out; the card doesn't. |
| `items` | required | Up to 371 days, each `{ "date", "value", "level", "label", "url" }`. An empty list says "No data". |
| `thresholds` | optional | 4 ascending numbers where levels 1 to 4 start, for an absolute scale. |
- **`date`** is a day, `YYYY-MM-DD`, placed as written: Legato never turns it into a moment, so no time zone can move it. A date with a time after it (`2026-11-08T00:00:00Z`) counts as its date part. The first date to the last span at most 371 days, and the grid runs from the first to the last: to end at today, include today's item. If two items have the same date, the last one wins, so group rows by date first.
- **`value`** is how much happened, and **`level`** is the shade, a whole number from 0 to 4. A given `level` wins. Without one, `thresholds` place the value: `[1, 2500, 5000, 10000]` makes 0 steps level 0, 3,000 level 2 and 12,000 level 4. Without thresholds, 0 and below are level 0 and the rest fall in the quartiles of every value above 0, as GitHub's own calendar does; with only a few values, the top levels may go unused.
- **A missing day is not a zero.** A date between the first and the last with no item, or an item with neither `value` nor `level`, is drawn as an empty outline: no data. A measured 0 is a grey square. A page whose service leaves out days that really were zero gives those days `"value": 0`.
- **`label`**, up to 80 characters, is what the day says under the pointer: "3 contributions on Nov 9". Without one, the date and value ("Nov 9, 2025 · 3").
- **`url`**, https or another page, is what a click on the day opens.
Full width. The squares fill the card's width, about 53 columns of 6 points in the panel, up to 14 points for a span of a few weeks; that's 7 rows, about 46 points high for a year. The month names sit over the first column of each month, and Less … More under the grid shows the five shades: grey for 0, then the theme's chart colour stronger for each level. The day under the pointer is outlined and its label takes the legend's place on the same line, so the card doesn't grow or move; the legend comes back when the pointer leaves. VoiceOver reads the title and the detail (or how many days have data, and their total), and steps through the days one by one with increment and decrement, saying "No data" for a missing one; a day with a link can be opened from there.
A heatmap is history, not status: it never counts toward the page's status, a section's dot or a notification.
```json
{ "id": "steps", "type": "heatmap", "label": "Steps", "detail": "8,412 a day",
"thresholds": [1, 2500, 5000, 10000],
"items": [ { "date": "2026-11-01", "value": 0 }, { "date": "2026-11-02", "value": 3100 },
{ "date": "2026-11-04", "value": 12500, "label": "12,500 steps on Nov 4" } ] }
```
GitHub's contribution calendar is a list of weeks, each with its days: [`flatten`](https://legatobar.com/docs/mapping-tables.md#turning-a-table-round) turns it into one list of days. Map `contributionLevel` to `level`, not its `color`, so the card draws in Legato's shades in light and dark. `last` keeps a longer answer to the newest 371 days:
```json
"source": { "ref": "calendar", "map": {
"items": { "each": "data.viewer.contributionsCollection.contributionCalendar.weeks", "flatten": "contributionDays", "last": 371,
"fields": { "date": "date", "value": "contributionCount",
"level": { "path": "contributionLevel", "values": { "NONE": 0, "FIRST_QUARTILE": 1, "SECOND_QUARTILE": 2, "THIRD_QUARTILE": 3, "FOURTH_QUARTILE": 4 } } } },
"detail": { "template": "{data.viewer.contributionsCollection.contributionCalendar.totalContributions} in the past year" } } }
```
A [History](https://legatobar.com/docs/history.md) dataset dated by day gives a day per group: `{ "each": "kept.rows", "group": "date", "fields": { "date": "key", "value": { "count": "rows" } } }`.
---
# Text and layout
## text
[See examples](https://legatobar.com/features#card-text)
A note, or a callout.
| Field | | |
| --- | --- | --- |
| `label` | optional | A heading above the note. |
| `body` | required without buttons | 1–500 characters, with [inline formatting](https://legatobar.com/docs/card-text.md#inline-formatting). A card with a [source](https://legatobar.com/docs/buttons.md#buttons) and buttons can leave it out, for a card that is only its label and buttons, such as a machine's Controls. |
| `tone` | optional | `neutral` (the default), `info`, `success`, `warning` or `critical`. |
| `icon` | optional | An SF Symbol name, drawn before the body in the tone's colour. |
| `style` | optional | `plain` (the default), `quote`, which draws the body as a quotation with a bar down its leading edge in the tone's colour, or `cover`, which makes the card a page's front: the `label` large, the body under it. Use `cover` for a page's first card only. |
| `fill` | optional | `blue`, `sky`, `lilac` or `green`: a soft tint with a fine grain behind the card, in place of the tone's, deeper in dark mode. For a page's cover or a note that opens a page. A fill never means a state and never changes the page's status; use a `tone` or a `status` card for that. |
| `note` | optional | A short reading at the right of the title's line, up to 40 characters, such as "68° in · 66° out" beside a car's Climate buttons. One line, usually filled from a source. Needs a `label`. |
Any tone but `neutral` adds an icon and tints the card; `icon` replaces that icon with your own, which with a tone makes a callout, like 👋 at the top of a page. Tones never change the page's status dot; use a `status` card when something needs attention.
```json
{ "id": "note", "type": "text", "body": "Dining is 18% over pace.", "tone": "warning" }
{ "id": "hello", "type": "text", "tone": "info", "icon": "hand.wave", "body": "**Welcome.** Ask your assistant for a page; see [the quickstart](https://legatobar.com/docs/quickstart)." }
{ "id": "said", "type": "text", "style": "quote", "body": "**12 of 16** sessions were false alarms." }
{ "id": "cover", "type": "text", "style": "cover", "fill": "blue", "label": "Home lab", "body": "Three servers, the network and the backups." }
```
### Inline formatting
A `text` card's `body`, a `list`'s `items`, a `checklist` item's `text` and `detail`, and a `heading`'s `text` take Markdown's inline formatting:
| Write | Shows |
| --- | --- |
| `**bold**` | **bold** |
| `*italic*` or `_italic_` | *italic* |
| `~~gone~~` | ~~gone~~ |
| `` `code` `` | `code`, in a monospaced font |
| `[the docs](https://legatobar.com)` | a link; only `https` links and [`legato://page/ID`](https://legatobar.com/docs/card-fields.md#links-to-other-pages) open, others show their words |
Block Markdown (headings, `-` lists, code fences) shows as written: use a `list` with a `style`, or a [`code`](https://legatobar.com/docs/card-text.md#code) card, for those. To keep a literal `*` or `_`, write `\*` or `\_`. For text a source fills from a service, such as an error's title, the [`verbatim`](https://legatobar.com/docs/mapping-tables.md) filter does this for every mark. Older versions of the Mac app show the formatting characters as they are.
## link
[See examples](https://legatobar.com/features#card-link)
A button that opens a web page, with an optional icon and a second line.
| Field | | |
| --- | --- | --- |
| `label` | required | The button's text. |
| `url` | required | An `https://` URL with no spaces, up to 2048 characters, or [`legato://page/ID`](https://legatobar.com/docs/card-fields.md#links-to-other-pages). |
| `detail` | optional | A second line under the label, up to 120 characters: a song's name, what's at the link. |
| `icon` | optional | An SF Symbol name in place of the default compass, like `music.note` or `doc.text`. |
| `tone` | optional | Colours the icon: `info` blue, `success` green, `warning` orange, `critical` red. Default `neutral`. |
| `layout` | optional | `button` (the default) or `tile`. |
The button shows the label and the URL's host, and opens the URL in the browser only when you click it. Only `https` URLs with a host are accepted, and the Mac checks again before opening one. A link to another page shows that page's name in place of the host.
```json
{ "id": "pr", "type": "link", "label": "Open the pull request", "url": "https://github.com/example/app/pull/482" }
{ "id": "listen", "type": "link", "label": "Music while you look around", "detail": "The Meadows - A Place To Rest",
"icon": "music.note", "tone": "success", "url": "https://open.spotify.com/track/3tCCbZaqd3GPy7jcWibXKq" }
```
With `"layout": "tile"`, a link card is half width, like a `stat`, and pairs with the half-width card after it. Its icon (in the accent colour unless `tone` says otherwise) sits beside the label, with the detail under it. The whole card is the link, lit with its arrow under the pointer, as [cards that link](https://legatobar.com/docs/card-fields.md#cards-that-link) are. Tiles suit a grid of places to go that each show a line of state, like rooms and how many lights are on; a source can fill the detail. A tile whose page is missing isn't a link.
```json
{ "id": "kitchen", "type": "link", "layout": "tile", "label": "Kitchen", "detail": "2 lights on", "icon": "fork.knife",
"url": "legato://page/kitchen" }
```
## code
[See examples](https://legatobar.com/features#card-code)
A block of code or a command: a config fix, a `curl` to try, a log excerpt.
| Field | | |
| --- | --- | --- |
| `label` | optional | A heading above the code. |
| `language` | optional | A short name shown as a small label, like `yaml`, `bash` or `json`: 1–24 characters of `a–z`, `0–9`, `+`, `#`, `.` and `-`. |
| `code` | required | 1–4,000 characters, shown exactly as written, line breaks and spaces included. |
Full width, in a monospaced font with a **Copy** button. Long lines scroll sideways rather than wrap, and past about 16 lines the block scrolls down too. The code isn't coloured. Older versions of the Mac app show a card saying they can't draw it.
```json
{ "id": "fix", "type": "code", "label": "The fix", "language": "yaml",
"code": "trigger:\n - platform: numeric_state\n above: 3.0\n for: \"00:01:30\"" }
```
## heading
[See examples](https://legatobar.com/features#card-heading)
A section title that splits a long page into parts.
| Field | | |
| --- | --- | --- |
| `text` | required | The title: 1–80 characters, with [inline formatting](https://legatobar.com/docs/card-text.md#inline-formatting). |
| `detail` | optional | A line under the title, up to 120 characters. |
| `icon` | optional | An SF Symbol name before the title, in the accent colour. |
| `collapsed` | optional | `true` starts the section closed. Default `false`. A closed section opens by itself when its page comes into view with a critical card inside, or when the page's first answer arrives just after you open it and is critical. On a page with params, each item keeps its own open and closed sections. A section you close yourself stays closed while it's critical. Once it has been ok or a warning and turns critical again, it opens on your next visit. |
| `cards` | optional | The ids of the cards its section holds, which come right after the heading, in any order. The cards after them stay on the page outside the section. Without it, every card up to the next heading. |
Full width, larger than a card's label, with no card around it. The cards after a heading, up to the next heading, are its section: a click on the heading closes or opens them, and a chevron at its right says which. A section that starts closed suits detail someone might want, like a second option or a long log, without it taking the page. The Mac remembers a click while Legato runs; the next write keeps it. Cards in a closed section still count toward the page's status and notifications. A heading whose cards all go in [Details](https://legatobar.com/docs/card-lists.md#status) (`"placement": "page_info"`) isn't drawn.
A section can hold just a few cards. List them in `cards`, and the heading opens and closes only those; the cards after them carry on as part of the page, outside it. Here the host and its nightly backup share a section and a dot, and the charts after them don't:
```json
{ "id": "health", "type": "heading", "text": "Health", "cards": ["host", "backup"] }
{ "id": "host", "type": "status", "label": "pve-lab", "state": "ok" }
{ "id": "backup", "type": "status", "label": "Nightly backup", "state": "ok" }
{ "id": "cpu", "type": "sparkline", "label": "CPU", "points": [7, 9, 8] }
```
A heading whose section holds status, gauge or fleet cards has a dot before its chevron, open or closed, in the colour of the worst of their states: green when all are OK, grey for unknown, orange or red when one needs attention. Cards in every tab of a tabs card in the section count, as they do for the page's status. A section with no such cards has no dot.
```json
{ "id": "found", "type": "heading", "text": "What I found", "icon": "magnifyingglass", "detail": "A week of history" }
{ "id": "option-b", "type": "heading", "text": "Prefer an instant response?", "detail": "Option B", "collapsed": true }
```
## tabs
[See examples](https://legatobar.com/features#card-tabs)
Two to five tabs in one place on the page, each with its own cards. A click on a tab's name shows its cards in place of the others'.
| Field | | |
| --- | --- | --- |
| `tabs` | required | 2–5 tabs, left to right. Each is `{label, cards}`. |
| `tabs[].label` | required | The tab's name: 1–24 characters, like `Hacker News` or `This week`. |
| `tabs[].cards` | required | 1–12 cards, laid out as a page's are, so two half-width cards share a row. Any type but `tabs` and `heading`. |
| `same_height` | optional | `true` keeps every tab at the height of the tallest, so switching tabs never moves the cards below. The shown tab's last card stretches to fill the room. Without it, each tab is as tall as its own cards. |
| `counts` | optional | `true` follows each tab's name with how many its first list holds: the list's [`total`](https://legatobar.com/docs/card-lists.md#list) when it has one, else its lines. The tabs then double as the totals: All 74,628, Blocked 15,000. |
| `search` | optional | A search field at the end of the tab names, for a page with [params](https://legatobar.com/docs/detail-pages.md): `param` names the one the words go in, `prompt` is its grey placeholder (up to 24 characters), and `match` is `contains` (the default), which sends the words between `*` wildcards, or `exact`. Return opens the page with them, and the clear button goes back to the param's default. The field shows what the param holds now, so a link that filtered the page shows its filter. |
Full width. The names sit in a row like card labels: the one showing in bold with the accent colour under it, the others lighter. Names that don't fit scroll sideways.
Give `"same_height": true` to tabs of lists that change length, such as Due, Upcoming and Inbox: a short list then keeps the long one's height instead of pulling the page up.
Leave it off when the tabs are the last card on the page, since nothing below them can move. Leave it off too when one tab is much taller than the others: a short tab, such as a chart, then sits at the top of a mostly empty card.
The first tab shows until someone picks another. Legato remembers the selected position for that page and card across launches.
Labels may repeat. Renaming or reordering tabs keeps the same position selected; if that position no longer exists, the first tab shows. Saved choices contain positions, not tab labels.
Tabs suit views of one thing that would otherwise stack down the page: several feeds, today against this week, one server or repository each. Cards in a tab that isn't showing still count. Their status, gauge and fleet states count toward the page's status and notify as on the page, a tab whose cards need attention has an orange or red dot after its name, and Spotlight and Shortcuts read them.
Card ids are unique across the whole page, cards in tabs included. A tabs card counts as one of the page's 24 cards, since only one tab shows at a time; the cards in its tabs don't, up to 120 cards on the page in all. Older versions of the Mac app show a card saying they can't draw it.
```json
{ "id": "servers", "type": "tabs", "tabs": [
{ "label": "Today", "cards": [
{ "id": "requests", "type": "stat", "label": "Requests", "value": "1.2M" },
{ "id": "errors", "type": "stat", "label": "Errors", "value": 31 } ] },
{ "label": "Web", "cards": [
{ "id": "web-1", "type": "status", "label": "web-1", "state": "ok" },
{ "id": "web-2", "type": "status", "label": "web-2", "state": "critical", "detail": "Not answering" } ] },
{ "label": "Database", "cards": [
{ "id": "db", "type": "status", "label": "Primary", "state": "warning", "detail": "Replica lag 40s" } ] }
] }
```
---
# Page design
A Legato page answers one question at a glance and lets a person act without leaving it. This guide is the design language Legato's own service pages are built to: [Pi-hole](https://legatobar.com/services/pi-hole), [Lunch Money](https://legatobar.com/services/lunch-money) and [Tesla via Tessie](https://legatobar.com/services/tessie). Follow it when you build a page, whether you're a person or an agent.
## Principles
- **Consolidate before you add.** A new card is the last resort. First ask whether the reading belongs as a row in a card that's already there, a second scale on a chart, or the title of a menu.
- **Cut what the layout should say.** Taglines, helper text, link cards and titles that repeat the page go. If a page needs them to make sense, fix the layout instead.
- **Nothing moves.** Hovering, confirming, a menu with no matching value and a missing title never shift, grow or reflow a card. Icons in a row line up, and a page fits the panel without scrolling.
- **Keep the page easy to update.** Keep `id`s, card types and order stable, so people know where to look and the next write is predictable.
- **Design for a busy day.** Lay the page out for the most the service can report, such as a full queue with every exception showing. A quiet account says little about which cards belong.
## Choose the right structure
Make one overview for each service, and as few other pages as possible.
A detail page earns its place when it's a separate job:
- **A time period of its own:** Trips by week, month or year.
- **A long history or list:** charging sessions, recent queries.
- **One item of a fleet:** each guest on a server. Write it once, with [params](https://legatobar.com/docs/detail-pages.md#one-page-for-every-item), not a copy per guest. Name it by its item with [`title_from`](https://legatobar.com/docs/detail-pages.md#titled-by-its-item), reading the same source as its cards, and keep `title` a short neutral fallback ("Monitor", "Package"). Don't repeat the item's name on a status card just to say which item it is. When the service only reports each item as it is now, the overview's `collect` keeps [samples](https://legatobar.com/docs/history-collect.md#samples) of every item, and the item's page reads its own with `{ "dataset": …, "key": "{param.id}" }`: a [strip](https://legatobar.com/docs/card-time.md#strip) of its state over the period under its status card, then a sparkline from the same samples. A strip is history, not status: it never goes in the Status section or on the overview.
- **Your own item and the others:** a place, an account or a repository you watch yourself. Give every param a [`default`](https://legatobar.com/docs/detail-pages.md#a-default-item). Your item then sits in the sidebar and lights and notifies like any page, and links open the others on the same page. Weather does this for places.
- **A name the person types** for their item, like a place, is a `text` param (`?name=Lake%20cabin`), used as the title when the service can't name it. Open-Meteo does this.
A topic of its own, like a car's climate, can justify a page. First try folding it into the overview: Tesla's Climate and Health pages became a Climate card of buttons and menus, and a few rows in the Car card. Don't make hub pages that only link to other pages.
| What someone needs | Use | Example |
| --- | --- | --- |
| A card only while its condition holds | [Conditional card](https://legatobar.com/docs/mapping-conditions.md#cards-that-show-on-a-condition) | A door is open |
| Alternate views of the same subject | [Tabs](https://legatobar.com/docs/card-text.md#tabs) | Blocked and allowed domains |
| The subject's health, out of the way until it needs a look | [Details](https://legatobar.com/docs/card-lists.md#status) (`"placement": "page_info"`) | A server's status |
| Detail that's useful but not urgent, out of sight until wanted | [Collapsed heading](https://legatobar.com/docs/card-text.md#heading) | Past deliveries |
| A deeper view with its own purpose | [Linked page](https://legatobar.com/docs/card-fields.md#links-to-other-pages) | Trips by week, a guest's own page |
| A change to the connected service | [Buttons](https://legatobar.com/docs/buttons.md#buttons) | A Controls card |
Give a detail page `"sidebar": false`: it stays out of the sidebar, and arriving by a link, its title row offers **‹ Name** to go back. See [Detail pages](https://legatobar.com/docs/detail-pages.md#detail-pages). Link to every detail page from the overview. A page link opens the page; `legato://page/ID#card` also opens the tab or section holding that card.
## The shape of an overview
Top to bottom:
1. **Health**, in Details: the status card with `"placement": "page_info"`.
2. **Controls**, one or two cards of buttons.
3. **The main trend**, a chart.
4. **Readings**, one facts card or a pair of stats.
5. **Recent**, a short list.
6. **Explore**, the links to the detail pages, only when they can't sit on the cards above.
7. **A log of activity**, always last: alerts or events, or past items such as Completed or Delivered in a closed section.
When the page is mostly rows the person acts on or waits for, such as tasks, packages or monitors, the rows come first and there's no health card. See [When the rows are the subject](#when-the-rows-are-the-subject).
### Health lives in Details
Give the one `status` card that watches the subject `"placement": "page_info"`, at full width (`"width": "full"`). Legato draws it in [Details](https://legatobar.com/docs/page-behavior.md#page-info)'s Health section, with its whole detail, and leaves it off the page. When it needs attention, the line under the title says so, Legato posts a notification and the page counts in the Dock badge. The page's status and notifications read the card as before.
```json
{ "id": "host", "type": "status", "placement": "page_info", "label": "pve1", "state": "ok", "width": "full", "detail": "Up 23 days · PVE 9.1" }
```
Only a top-level `status` or `fleet` card can go in Details. It can't be in a tab, and it has no buttons: put those on a card the page draws.
One status card watches the whole subject. A low battery lights the car's status, rather than a battery gauge with its own bands; a host's CPU and memory warnings light the host's status. See [Use status honestly](#use-status-honestly) for the states. When the subject is a server whose health is many parts (its tasks and plugins, as on Jellyfin), a `fleet` of them goes in Details in the status card's place, its items under their groups. A part that's only a warning, such as a restart pending, is an item only while it's on; a green Restart reads like a button.
Readings someone checks at a glance, such as the server's version, its uptime or how many clients are active, go in the facts card, where they're always in view. The status card's detail says what's wrong, or what the facts leave out.
A health card earns its place when it says something the page's rows don't, as a host's or a DNS filter's does. When the rows already show it, leave it out. A status card that only informs, with nothing that can go wrong, stays on the page. Whether a market is open is a reading, so keep that card on the page beside the readings it goes with.
Status cards can also sit in a closed [`heading`](https://legatobar.com/docs/card-text.md#heading) section on the page. Its dot shows the worst state inside, and it opens by itself when its page is shown with something critical inside.
### Controls are a row of icons
Add only the controls worth pressing. That a service's API can do something isn't a reason to put it on the page. A single action goes in the corner of the card it feeds, as Parcel's Add tracking sits on its list; a Controls card is for two or more.
On an overview, gather the buttons into one or two cards, each a `text` card with no `body`, titled for what it controls: **Controls**, **Climate**. Give them `"placement": "title"`: in the window, a sheet page draws them in its title row, at the right, as large grey icons with their labels as tooltips, so the page below is only readings. The person chooses which stay in the row; the rest wait under ⋯. Where a page has no large title, the cards are drawn near the top with `"actions_placement": "corner"`'s look: each button its icon alone, all at one width.
- **An on/off pair is one icon.** Give both halves the same `setting` and each its `turns` ("on" or "off"): the row shows the "on" half's icon, lit on a grey plate while the setting is on. Icons stay grey; nothing in the row is drawn in the accent colour.
- **A button needs a source on its card**, so a Controls card names one (`"source": { "ref": "car" }`). A button that sends a request calls that source's service, signed in the same way. See [Buttons](https://legatobar.com/docs/buttons.md#buttons).
- **Group related buttons** with `"|"` between them in `actions`: the panel draws a thin line where one group meets the next, as in charging | heat protection, Sentry, Lock. A group whose buttons are all hidden leaves no line.
- **Show one half of each pair.** Start and Stop, On and Off, each with a `when`, so one button stands for the setting and shows the way to change it.
- **A setting with a few values is a menu.** Give the button `choices` and `current`, and put `{choice}` in its request. The menu is titled with the value the service holds now, so the controls say how things are set as well as change them: 80%, 48 A, 72°F.
- **Label for the tooltip:** "Turn on Sentry", "Stop wheel heat", "Charge limit". Labels stop at 24 characters.
- **Leave out what Spotlight shouldn't run.** Spotlight presses a page's buttons without asking. Keep unlock, open-the-trunk and similar commands off the page.
- Mark the button that stops something running `prominent`. Give a button that's hard to undo `confirm`; Spotlight still presses it directly.
- **Buttons for one row go on that row** ([`row_actions`](https://legatobar.com/docs/button-rows.md#buttons-on-each-row), up to three, icons only), as Jellyfin's Message and Stop sit on each stream: they show when the pointer is on the row, keep their place when hidden, and one that's hard to undo asks first. Not on a shelf. Spotlight and Shortcuts never list them. When the service allows a button only on some servers, as Plex allows Stop only with Plex Pass, hide it with a `when` that reads the answer. A service with no way to message a viewer gets no Message button.
- **A download queue puts what needs you first.** Sonarr and Radarr list blocked or failed imports before the rest, each with the service's own word for it ("Import blocked"). A download with no size yet has no bar to draw, so the card counts it underneath with any past the first page ("3 more in Sonarr").
- **A list that guards a button is optional.** Portainer hides Stop on containers in your `keep-running` list; without the list, every container has Stop. The list's absence never turns a container red; only a container the list names that isn't running does.
- **No refresh buttons.** The panel's own Refresh (⌘R) refreshes the whole page. A button that does something else mustn't look like one either: circling arrows on Jellyfin's Scan this library read as a refresh, so it went.
- **A button that acts on one item the answer names**, like the newest failed run, takes it with [`{answer.…}`](https://legatobar.com/docs/buttons.md#buttons): hide it with `when` while there's none, and ask first when it's hard to undo. GitHub's Re-run failed jobs is built this way.
```json
{ "id": "controls", "type": "text", "label": "Controls", "actions_placement": "corner", "source": { "ref": "car" },
"actions": [
{ "label": "Charge limit", "icon": "battery.75percent", "path": "/car/set_charge_limit?percent={choice}",
"current": "charge_state.charge_limit_soc", "choices": [{ "label": "80%", "value": 80 }, { "label": "90%", "value": 90 }] },
"|",
{ "label": "Turn on Sentry", "icon": "eye", "path": "/car/enable_sentry", "when": { "path": "vehicle_state.sentry_mode", "equals": false } },
{ "label": "Turn off Sentry", "icon": "eye.slash", "path": "/car/disable_sentry", "when": { "path": "vehicle_state.sentry_mode", "equals": true } }
] }
```
On a detail page, a button can stay on the card it changes: Start and Stop charging in the corner of a Charging now card.
### Links to the detail pages
- **Put a link on a card that's already there** when one fits: a row with a `url` on the card whose reading the detail page expands, or an `open` button in the card's corner. A facts row counting running processes can open the page that lists them.
- **An Explore list is the last resort.** When no card fits, a `list` whose rows link to the detail pages follows the page's own cards, before the log of activity: Pi-hole's Queries, Clients, Local DNS and Servers.
- **Two pages that mostly expand the overview** go as two half-width `link` tiles (`"layout": "tile"`) near the top: Tesla's Charging and Trips.
- Don't add "Open in…" cards. Put the service's address on the status card's `url`.
### When the rows are the subject
Some pages are mostly rows the person acts on or waits for: tasks, packages, monitors. The rows are the status, so the shape above changes:
- **No health card.** Attention shows in the rows: sorted with what needs the person first, with a state word on the right when it isn't routine ("Delivery attempted", "Ready for pickup"), or as a fleet's dots, whose worst one sets the page's status.
- **A working list shows seven rows**, with Show N more. Four is for a recent list.
- **No longer copy of the list on another page.** Use tabs and Show N more instead. An item with its own list or history gets one page made with [params](https://legatobar.com/docs/detail-pages.md#one-page-for-every-item), however few items there are.
- **Past items go last**, in a closed section: Completed, Delivered.
[Parcel](https://legatobar.com/services/parcel) and [Uptime Kuma](https://legatobar.com/services/uptime-kuma) are built this way. A to-do list goes further:
#### A to-do list
A task app's overview is for choosing and finishing tasks. Overdue work shouldn't count as a problem, and it has no Controls: a daily goal or vacation mode doesn't belong beside the tasks.
1. **Tasks**, a [tabs](https://legatobar.com/docs/card-text.md#tabs) card of checklists that tick: Due (today's, then overdue), Upcoming (the service's dated tasks, grouped by day with `section`) and Inbox. Each shows seven rows, with Show N more, and has no title: the tab names it, and an untitled checklist starts at its first row. Give the tabs card `"same_height": true`, so a short Inbox keeps Due's height and the cards below stay put.
2. **Projects**, a short linked list with each project's open-task count. Each row opens one project page made with [params](https://legatobar.com/docs/detail-pages.md#one-page-for-every-item): its open tasks under their sections, in the service's order, fifteen before Show N more.
3. **Completed**, a closed section: done each day this week, and the latest few.
A row's detail line is its day (and time, when it has one) and its project; a subtask names its parent instead (`↳ Write the post`). A repeating task has a small repeat mark after its name, with `badge_label` for VoiceOver, rather than the word. Leave out any card that counts what the tabs already show. When the service sends a list in pages and Legato only reads the first, say so with a conditional note that links to the full list, and only write "at least" on a count that really is partial. [Todoist](https://legatobar.com/services/todoist) is built this way.
## Consolidate readings
- **Secondary readings go in one `facts` card.** Order its rows with the one people check most first, then the rest longest value to shortest, so the right-aligned values step down: Charging, Tires, Temps, Software, Odometer.
- **Two headline numbers make a pair of half-width `stat` cards**, side by side: Last 24 hours and Blocked, Assets and Liabilities.
- **Readings of one quantity share one chart.** A car's battery and its range are the same reading: one sparkline with the percentage on the left, miles on the right (`right_unit`, `right_scale`) and the charge limit as a dashed line (`target`). Not a gauge beside a Range stat.
- **A short reading beside a title** is a `text` card's `note`, drawn at the right of the title's line: `Temps · 68° in · 66° out`.
## Charts
- **A sparkline for history.** With `times`, points sit at their moments and a long gap (a car asleep overnight) shows as a faint dashed join.
- **Turn off the change badge** (`"change": false`) when the change since the first point isn't news, as for CPU, memory or a battery.
- **Paired metrics go half width** (`"width": "half"`), side by side: CPU and memory.
- **Not between two lists.** A chart never sits directly between two lists of items. Put it beside the page's readings, or have it open a closed section of past items, as the done-each-day chart opens Todoist's Completed.
- **A chart's filter is the page's [period row](https://legatobar.com/docs/periods.md#periods) or a link to a page made with [params](https://legatobar.com/docs/detail-pages.md#one-page-for-every-item).** A button sends a request to the service or opens an address. It can't pick what a chart shows.
- **Gauges, case by case.** A gauge suits a reading with a fixed size that someone acts on, like how full a disk is. A reading that changes through the day is usually clearer as a chart.
- **A `columns` legend** can sit on the title's line (`"legend_align": "trailing"`).
- **What a forecast's bars don't show** can follow them as [chips](https://legatobar.com/docs/card-lists.md#chips): gusts, poor air, a freeze, a wet day. Not a change in temperature, which the bars already show. At most three, about what's ahead, in plain words. The card is absent when there's nothing to say, and it never counts toward the page's status.
- **A year of daily activity is a [`heatmap`](https://legatobar.com/docs/card-time.md#heatmap)**: GitHub contributions, steps, completed tasks. One per page, full width, after the trend chart; its `detail` says the total, worked out in the page. It never counts toward the page's status. Give an absolute scale `thresholds`, and map a service's own levels (GitHub's `contributionLevel`) rather than its colours.
- **A watchlist's moves are [`tiles`](https://legatobar.com/docs/card-numbers.md#tiles)**: stocks, coins or anything else with a price and a change. Keep the list's order, give `max_items` (12 is three rows), and map `change` only when there's a real quote, so an unknown symbol shows its reason with no tint. Set `scale` to a move that's big for what you're watching. Tiles never count toward the page's status; put a company's name in `detail`.
## Titles and words
A card drops its title when the page's title and the card's value already make it obvious: a battery chart reading "80% · 259 mi · Limit 80%" on a Tesla page, a Net Worth trend. So does a card inside a tab whose title would repeat the tab's label. Every other card keeps one. If a source fills the title (`map.label`), remove that rule too, or the title comes back on the next fetch.
Labels and titles are cut off at one line, and the panel is narrow.
| | Aim for | Good | Too long |
| --- | --- | --- | --- |
| Page `title` | 1–2 words, it's a sidebar row | `Homelab` | `Homelab infrastructure status` |
| `label` | 2–4 words | `Offsite backup` | `Status of the nightly offsite backup job` |
| `stat` `delta` string | A few words | `14 days to go` | (16 characters is the hard limit) |
| `list` item | Under 40 characters | `Costco · $212` | `On Oct 14 you spent $212.48 at Costco` |
| `status` `detail` | One short clause | `Locked · Asleep · last report 12m ago` | A paragraph |
| Button `label` | A verb and its object, up to 24 characters | `Turn on heat protection` | `Turn on cabin overheat protection` |
- Send numbers as numbers, with a `unit`. `"value": 1060, "unit": "USD"` formats correctly in every locale; `"value": "$1,060.00"` doesn't.
- Use ` · ` in list items to right-align an amount: `"Delta Air Lines · $189"`.
- Don't repeat the page title in labels. On a Budget page, `October spend`, not `Budget: October spend`.
- Write for the person, not the log. `Last run 31 hours ago`, not `exit=0 ts=1760735102`.
- **Say only what the service confirms.** When a carrier has only made the label, the row reads `Label created`, not `Carrier received`. A tracking number the service can't find reads `Tracking not found`, not `Awaiting first scan`.
- **No explanatory text cards, and no note that's always there.** A note that's on screen most of the time, or only restates what a card does, belongs on that card: when a chart routinely shows the 14 furthest moves, its detail says "14 furthest of 22". A note that shows only in an unusual case is different; see the honest limit under [A to-do list](#a-to-do-list). The other exception: a short `text` card that says how to fix missing data the person can fix, shown only while it's missing (`source.when`). "Tessie has no cost for these charges. Set your electricity rate in Tessie…" goes once the charges have costs.
## Lists
**Media rows can show their artwork** (`image`, a path on the service's own server): posters and covers on a Now playing or Recently added row or a request for a film or show, and a `shelf` of four for what was just added. It's the one exception to logos in one colour; keep icons and logos plain everywhere else. Something in progress (a stream, a download) is a `pacing` row with a `detail` line and a `state` word such as Paused, which never counts as a problem.
Show the latest 4 rows of a recent list on an overview (`"max_items": 4`), and 7 of a working list, such as tasks or deliveries; the rest stay a click away under **Show N more**. Keep tables to about 5 rows.
## Big fleets
A fleet of more than about 24 items takes `max_items` (24 for short names, 16 for long ones): what needs attention shows first, and the rest are a click away under **Show N more**. When the service has kinds of item (Services, Jobs, DNS), give the items a `group` instead of splitting them into several fleets: two to four groups, never one per item.
## Fit the panel
The page is a narrow column, 400 points wide, beside the sidebar. The panel grows with the page until it's nearly as tall as the screen, and past that the page scrolls. Aim for a page that fits.
- **Count what shows:** with the health in Details, a controls row, a chart, a facts card and a short list is about right.
- **`stat`, `status`, `countdown` and `gauge` cards sit two across**, as do a `pacing` ring, a `link` tile and a sparkline with `"width": "half"`. A half-width card shares its row with the next one if that's half width too, so put them in pairs. A lone one takes the full width, and a `status` with `"width": "full"` always does.
- **Fold what's useful but not urgent into a closed section** rather than letting the page scroll. Never fold what someone reads at a glance, such as a server's operating system: that goes in the facts card. A closed section with something critical inside opens itself when the page is shown. Name the section for what's in it, with a `detail` that helps decide whether to open it: `All 14 charges · largest first`, not `More`. Use one or two sections, not a heading on every card. Keep heading `id`s stable: the Mac remembers a section someone opened by its `id`.
- A closed section still counts: its cards count toward the page's status and notify like any other.
## Card style
Every card draws its words in the same few styles, so cards side by side on a page read as one set. You don't set these; they're how Legato draws each part:
| Part | Looks like | For |
| --- | --- | --- |
| Title | Small, semibold, grey, as the sidebar labels its sections | Every card's `label`, the one-number cards' and a `status` card's included; a status card's `detail` is the bright line under it. A `link` card's name stays bright, since there it's the content |
| Title figure | The title's size, regular | A total beside the title: a breakdown's "7.3 h", a pacing bar's "$412 of $600"; a text card's `note` |
| Big number | Large, semibold | The figure a `stat`, `gauge`, `countdown`, `window`, `sparkline` or ring is about |
| Row label and value | Regular, the text colour | Each row of `facts`, `bars`, `breakdown`, `list`, `pacing` and `ranges`, and a `text` card's body |
| Supporting | The row's size, grey | A share, "of $600", a unit after a number, a chart's second scale |
| Item icon | Grey, or its item's `color` | Before a row's label, never in a bar |
| Caption and detail | Small, grey | A line under the card |
What that asks of a page:
- **A detail says only what the card doesn't.** A "Last night" sleep card doesn't need "Asleep, night ending today"; a card over a week can say "Average of 6 nights", since nothing else on it does. Leave `detail` out, or map it to `""` for the views that need none.
- **Leave chart colours to Legato unless they mean something.** A chart without a `color` draws in the theme's chart colour, a quiet tint that follows the person's theme (Settings → Appearance), as `graphite` does. Parts and series without one take five category colours in order. Name a colour only when it means the same thing on every page, such as green for Allowed.
- **The accent is the person's, not the page's.** Buttons, switches and what's on take the accent they chose. Selection stays grey, and no page can set the accent or the theme.
- **Colour an icon only when the colour means something**, such as the same category colour on every page. Without `color`, icons are grey, so a card of plain facts stays quiet.
- **An empty reading is a dash.** In a source map, templates for a stat's `value` or a facts row's `value` become "—" when every placeholder is missing. So `"{minutes} min"` with no minutes shows "—". Labels, details, messages, event titles and derived text retain their surrounding words. A partly filled reading, such as "42 of —", keeps the available value.
- **Let the card say the arithmetic.** A pacing or breakdown card with a target says the pace under its bar when the period is set (`elapsed`), and nothing otherwise; don't add a `detail` that repeats "x% of goal".
## Use status honestly
A page's status is the worst `state` among its `status` cards, the bands its gauges are in and the items of its fleets. A `text` tone colours its own card and never counts. When a card moves up to warning or critical, Legato posts a macOS [notification](https://legatobar.com/docs/notifications.md) and counts the page in the red badge on its Dock icon, so protect the states: each one should mean something.
- `ok`: working as expected.
- `warning`: needs attention soon, not now. A backup that's late, a disk at 85%, a battery under 20%.
- `critical`: needs someone now. A site down, a tire very low.
- `unknown`: you couldn't check. Don't report `ok` when you don't know.
- `off`: stopped on purpose, like a guest shut down for the night. Grey, and it counts as `ok`.
When `off`'s power symbol doesn't fit what the state means, give the card an [`icon`](https://legatobar.com/docs/card-lists.md#status) that does. It keeps the state's colour. Use it for every case that means the same thing: a market that's shut shows a moon before the open and after the close, as well as overnight.
For anything that expires, such as a certificate, a domain or a renewal, use the [`expires` rule](https://legatobar.com/docs/mapping-expiry.md#expiry) rather than nested conditions: `as: state` lights the card or the fleet item, and `as: text` writes its line ("9 days left", "Expired"). In a fleet where only some items have the date, give the state `"default": "ok"`.
A service that can answer 200 with an error in the body (GraphQL `errors`, `success: false`) gets [`fail`](https://legatobar.com/docs/source-polling.md#polling-and-failures) on its source, so the fetch counts as failed and the card keeps its last answer with a note. Don't build a text card that shows only while the error is there. To ask whether a value is there at all (a latest release, an error), use the [`exists`](https://legatobar.com/docs/mapping-conditions.md#conditions) test: `not: null` holds for a missing value too.
Keep the words neutral: a card **needs attention**; it isn't "going wrong" or "failing". If a page shows warning every day, the threshold is wrong, and people will stop looking. A `pacing` bar is never coloured for pace and never changes the dot. A `gauge` with bands does, so give bands only to readings someone should act on.
## Show exceptions without making everything a warning
Use `source.when` to decide whether a sourced card belongs on screen. Use its card type, tone or status to say what the visible information means. These are separate decisions.
- **Activity:** water is flowing, a car is charging. A conditional `stat` or a facts row can show this without changing the page's status.
- **Attention:** a door that should be closed is open. Use `status: warning` when someone should act soon.
- **Urgency:** a leak. Use `critical` only when that urgency is justified.
- **Uncertainty:** a sensor stopped reporting. Keep that visible; don't substitute zero or `false` and make the card vanish.
Conditions are evaluated against the source's derived answer, before the card's `map`. A missing value, null, or a numeric comparison with a non-number makes a card's condition unknown: the card stays visible with a note. A failed fetch keeps the last answer, with an error or stale-source notice. A hidden card's source still polls. See the [condition reference](https://legatobar.com/docs/mapping-conditions.md#cards-that-show-on-a-condition).
Showing no exception cards doesn't prove the whole system is healthy. Don't label an empty alert area "All clear" unless your source establishes that. Preview the page with no conditions true, one true, and every condition true, and aim for a page that still reads at a glance when everything is happening at once.
## Say when it's from, if it matters
The footer of every page shows how long ago it was last updated, so you don't need a "last checked" card. If the data itself has a time that differs from the fetch (a car's last report, a forecast for Saturday), put it in the status's `detail` or a row.
When the service has its own window or filter for a figure, use it, and name it as the service measures it. Uptime Kuma reports uptime over 24 hours, so the row says "24 hours", not "Today".
## Overview and detail pages with a period
An overview with a [period row](https://legatobar.com/docs/periods.md#periods), like a Health page with **Today**, **Week** and **Month**, links to a detail page for each figure. Following a link carries the period: Week on Oct 18 – 24 opens Steps on the same week. That works only when the detail page has the same kind of choice, so:
- **Give every detail page the overview's choices**, and `"step": true` if the overview steps. Copy the `period` object; ids and labels can differ, but a `span` or `last_days` the detail page lacks breaks the link's period.
- **Make every card on the detail page follow it.** A detail page showing "Last 30 days" under a row that says Oct 18 – 24 contradicts itself. Request the period's days (`{period.start}` to `{period.through}`, or `{period.start_unix}` for an API that takes Unix seconds), and work out the figures from those rows.
- **Agree with the overview.** Use the same selected period and the same metric-validity rule, so a week's "Steps a day" is the same number on Health and on Steps. Missing values are not zeroes.
- **One day and several days are different views.** For one day, show that day and some context; for a week or a month, the average, the total for things that add up, the highest and lowest day, and a chart by day. Choose the view from `{period.id}` using a [derived value](https://legatobar.com/docs/mapping.md#derived-values) and [`when`](https://legatobar.com/docs/mapping-conditions.md#cards-that-show-on-a-condition).
- **Label a chart's columns so each is different.** Use `{Date|date}` ("Oct 31") for daily readings.
- **Say which days a card covers.** `{period.dates}` in a card's text reads "Oct 18 – 24", so a facts card about the period can take it as its label.
```json
"period": { "step": true, "choices": [
{ "id": "today", "label": "Today", "last_days": 1 },
{ "id": "week", "label": "Week", "span": "week" },
{ "id": "month", "label": "Month", "span": "month" } ] },
"sources": { "h": { "url": "https://example.test", "requests": {
"range": "/days?from={period.start}&to={period.through}",
"recent": "/days?to={period.through}&limit=30" },
"derive": [ { "name": "shown", "value": { "template": "{period.id}" } },
{ "name": "readings", "value": { "count": "range.list", "where": { "path": "steps", "gt": 0 } } },
{ "name": "avg", "value": { "avg": "steps", "of": "range.list", "where": { "path": "steps", "gt": 0 }, "round": 0 } } ] } },
"cards": [
{ "id": "today", "type": "stat", "label": "Today", "source": { "ref": "h", "when": { "path": "shown", "equals": "today" }, "map": { "value": "recent.list[0].steps" } } },
{ "id": "avg", "type": "stat", "label": "Daily average", "source": { "ref": "h", "when": { "path": "shown", "not": "today" }, "empty": { "when": { "path": "readings", "equals": 0 }, "text": "No figures for this period." }, "map": { "value": "avg" } } },
{ "id": "days", "type": "columns", "label": "Each day", "series": ["Steps"],
"source": { "ref": "h", "when": { "all": [{ "path": "shown", "not": "today" }, { "path": "readings", "gt": 0 }] },
"map": { "items": { "each": "range.list", "where": { "path": "steps", "gt": 0 }, "sort": "date", "fields": { "label": { "template": "{date|date}" }, "values[0]": "steps" } } } } } ]
```
## Worked examples
- **Tesla via Tessie** ([pages](https://legatobar.com/services/tessie)): three pages. The overview opens with a closed Status section (Model Y, and tiles to Charging and Trips), then Controls (charge limit and current menus | heat protection, Sentry, Lock) and Climate (climate, defrost, wheel heat, a temperature menu | seats), one battery chart with miles and the limit, a Car facts card, and recent alerts.
- **Pi-hole** ([pages](https://legatobar.com/services/pi-hole)): one overview with its health in Details (Ad blocking, and Pi-hole's notes when it has some), two stats (the first with the active clients, and a Pause menu or Resume in its corner), an hourly chart and the top domains, and an Explore list to four detail pages that each hold what the overview doesn't.
- **AdGuard Home** ([pages](https://legatobar.com/services/adguard-home)): Protection is in Details, and the overview opens with Controls (a Pause menu, or Resume | Safe Browsing, parental filter | Clear DNS cache), one queries-per-hour chart, two stats, a Server facts card, the top domains and Explore. Each of its four detail pages is a long list: queries, clients, blocklists, local DNS.
- **A server**: an overview with the host and its nightly backup in Details, half-width CPU and memory charts, a Host facts card, a fleet of guests, and an Explore list. Each guest has its own page: a Controls card (console | power | back up), half-width CPU and memory, a Stats facts card, and recent tasks.
## A linked overview and detail example
Download both pages and the sample response:
- [Home overview](https://legatobar.com/examples/design-home.json)
- [Security detail](https://legatobar.com/examples/design-security.json)
- [Sample source answer](https://legatobar.com/examples/design-home-state.json)
These are demonstration readings, not a connection to your home. Both pages use the same read-only source URL, which lets Legato share the fetch. The sample says the garage is open and water is flowing: the garage raises a warning, while the water card is an ordinary stat. Clicking the garage opens Security, a detail page kept out of the sidebar; its Doors and Sensors tabs keep the detail compact, and **‹ Home** returns.
Save the downloads in one directory and run there:
```sh
legato set design-security design-security.json
legato set design-home design-home.json
```
Use these exact IDs because the links refer to them. Create the destination first so the overview's link resolves immediately.
## Agent workflow: build, then verify
1. **Read before writing.** Read the installed schema (`legato schema` or `get_page_schema`), the existing page and its version, and the source's actual response. Preserve unrelated content and use `if_match` when updating an existing page.
2. **Choose the structure.** State the overview's question. Fold before you add a page. Put the health card in Details, the buttons in a controls row, one chart for the trend and one facts card for the readings.
3. **Build complete destinations.** Give cards stable, unique IDs across the whole page, including tabs. Create linked pages before the overview; keep every link consistent with the page ID.
4. **Validate the result.** Write with `set_page` or `legato set`, and read the load status. A saved file is not necessarily a loaded page.
5. **Exercise the states.** Check quiet, busy, missing-data and failed-fetch cases, every `when` on a button pair, and a menu whose current value matches no choice. `preview_page` fills the cards from a sample answer for each case, and `get_page`'s `status.sources` shows whether the real fetch worked. Confirm ordinary activity doesn't raise a light.
6. **Check nothing moves.** Look for a page that scrolls, a row of buttons that crowds its title, and a card that grows on hover. Don't press real buttons unless the person asked you to. Report the checks you couldn't do.
## The page design skill
This guide also comes as a skill, a short file of instructions that an agent loads when a job calls for it. With the skill, your agent reads this guide before it designs a page, checks the design against it, and confirms that Legato loaded what it wrote. Ask it to review a page you already have, and it lists what it would change, card by card.
Install it with the `skills` installer, which works with Claude Code, Codex and most other agents:
```bash
npx skills add https://legatobar.com
```
It asks which agents to add the skill to, and whether to install it for this project or for every project (`-g` picks every project). Later, `npx skills update` fetches the newer version when this guide changes.
To install it by hand, save [the skill's one Markdown file](https://legatobar.com/skills/legato-page-design/SKILL.md) in a folder named `legato-page-design`, in the place your agent looks for skills: `~/.claude/skills` for Claude Code, `~/.agents/skills` for Codex.
Start a new session, and the agent uses the skill when you ask for a Legato page. To call it yourself, type `/legato-page-design` in Claude Code or `$legato-page-design` in Codex.
The skill reads and writes pages with Legato's tools or the `legato` command, so [connect the agent](https://legatobar.com/docs/connect-agent.md) first.
## Icons
`icon` is an SF Symbol name. Pick one that says what the page or button is about at a glance, and prefer plain outline names over `.fill` variants for pages. A button's pair can use the plain and `.slash` or `.fill` forms of one symbol (`eye`, `eye.slash`). If the Mac doesn't have the symbol, the page shows a generic icon instead of an error, so a typo fails quietly. [Icons](https://legatobar.com/docs/icons.md) points to Apple's catalog of names.
---
# Icons
A page's `icon` is an SF Symbol name. It appears beside the title in the sidebar. Choose a symbol that fits the page, such as `shippingbox` for deliveries or `server.rack` for a homelab.
```json
{ "title": "Packages", "icon": "shippingbox", "cards": [ … ] }
```
## Finding a name
Apple publishes the full set of symbols and how to use them:
- [SF Symbols app](https://developer.apple.com/sf-symbols/): Apple's free Mac app shows every symbol, searchable by name and topic. Select one and choose Edit → Copy Name, then paste it into the page.
- [SF Symbols in the Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/sf-symbols): Apple's guidance on using symbols, including weights, scales and variants.
The app also shows which macOS release each symbol first appeared in. Legato runs on macOS 26 and later, so any symbol from macOS 26 or earlier works on every Mac that runs it.
## Rules
- Names are lowercase words separated by dots, up to 64 characters.
- Prefer the plain outline names over `.fill` variants. They match the rest of the sidebar.
- A name works if the Mac has that symbol. If it doesn't, the page shows a generic grid icon (`square.grid.2x2`) instead of an error, so a typo or a symbol from a newer macOS fails quietly.
---
# Sources
A page can fetch its own data. Give it named `sources`, and Legato calls each one on a schedule and fills the cards from the answer. You don't need to write Swift, change the app or keep an agent running: once the page is written, it stays current by itself.
A source can be an internet API such as GitHub or Tessie, a service on your network such as Pi-hole or Home Assistant, or this Mac's own [calendars and reminders](https://legatobar.com/docs/source-calendar.md). Cards on a page with sources can also carry [buttons](https://legatobar.com/docs/buttons.md) that call the same service: pause ad blocking, lock the car, tick off a task. The page files, the answers and your [secrets](https://legatobar.com/docs/secrets.md) stay on the Mac; requests go only to the services the page names.
An agent can write a page like this as easily as one with fixed values: ask it for a page that keeps itself up to date. A page can mix both, sourced cards next to cards with values written in.
## Start here
- [Try an API and preview](https://legatobar.com/docs/source-preview.md): A whole page that reads a public API with no key, and a way to see a source's answer before it starts polling.
- [Worked examples](https://legatobar.com/docs/source-examples.md): Pages to copy from, including a feed and a service that takes several requests.
## Set up a source
- [Source fields and loading](https://legatobar.com/docs/source-reference.md): Every field of a source and of a card's `source`, and which APIs fit.
- [Signing in and requests](https://legatobar.com/docs/source-requests.md): How the secret reaches the service, and the methods, bodies and answer formats a source can use.
- [Secrets](https://legatobar.com/docs/secrets.md): API keys in the Mac's Keychain or 1Password, each tied to one host.
- [Polling and failures](https://legatobar.com/docs/source-polling.md): When a source refreshes, what its cards show when a fetch fails, and how it backs off.
- [Calendar and Reminders](https://legatobar.com/docs/source-calendar.md): This Mac's events and tasks as sources, with no API at all.
- [Troubleshooting](https://legatobar.com/docs/source-troubleshooting.md): What to check when a page is missing or a card shows an error.
## Use the answer
- [Mapping](https://legatobar.com/docs/mapping.md): Paths and rules that take fields from an answer and put them in a card.
- [Buttons](https://legatobar.com/docs/buttons.md): Send something back to the service from a card.
---
# Try an API and preview
## Try a public API
This complete page uses [GitHub’s Get a repository endpoint](https://docs.github.com/en/rest/repos/repos#get-a-repository) to show stars and forks for a public repository. It needs no API key.
1. Open Legato. Each time it starts, it installs the page schema in its Pages folder for editor suggestions.
2. [Download github-starter.json](https://legatobar.com/examples/github-starter.json), or copy the complete JSON below. Save it as `~/Library/Application Support/Legato/Pages/github-starter.json`, using plain text with the `.json` extension. Or, from Terminal: `/Applications/Legato.app/Contents/Helpers/legato set github-starter github-starter.json`.
3. Within a second, Legato finds the file and the **GitHub** page appears. The first fetch fills both cards.
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "GitHub",
"sources": {
"repo": {
"url": "https://api.github.com/repos/octocat/Hello-World",
"auth": { "type": "none" },
"headers": {
"Accept": "application/vnd.github+json",
"X-GitHub-Api-Version": "2026-03-10"
},
"every": "1h"
}
},
"cards": [
{ "id": "stars", "type": "stat", "label": "Stars",
"source": { "ref": "repo",
"map": { "value": "stargazers_count" } } },
{ "id": "forks", "type": "stat", "label": "Forks",
"source": { "ref": "repo",
"map": { "value": "forks_count" } } }
]
}
```
The page then makes **one request per hour while your Mac is awake and unlocked**. Both cards use the same answer: `sources.repo` defines the connection, `ref` selects it, and each `map` takes a different response field. After sleep or unlock, a due source refreshes; opening the panel also checks sources that are due.
Change `octocat/Hello-World` to another public `owner/repository`, or follow the next section to connect a different API. [GitHub](https://legatobar.com/services/github) has the full pages, with a token. Save the file again and the page changes within a second. Right-click a page and choose **Show in Finder** to find its file, or **Delete Page…** to move the file to the Trash (put it back from there to restore it).
## Edit with suggestions
Start from a JSON page and let the editor guide the fields. Open the page in VS Code or another editor with JSON Schema support. The starter's `$schema` line points to `./.schemas/page.schema.json`, which Legato installs in the `.schemas` directory inside Pages. It enables property suggestions, hover descriptions and structural validation without needing an internet connection.
Keep that line when adapting an example. The schema covers sources, authentication, mappings, buttons and card fields. It can catch an invalid field or missing property; it cannot know an API's real response or prove that a mapping selects the right data. Use the preview below to check source references, mappings and rendered cards.
Both the schema and the app reject unknown top-level page keys, including `widgets` and `light`. They also reject unknown keys in sources, authentication, requests, conditions and buttons. The app still ignores unknown options inside mapping rules, such as `defualt`; the schema catches those too.
Keep the `$schema` line to catch typos while editing. If you keep pages elsewhere, [download the schema](https://legatobar.com/schemas/page.schema.json) and place it at the same relative path, or adjust `$schema` to its location.
## Preview before polling
Before a page polls, check its cards in the **Source Preview** window, with a sample response or one real fetch. Right-click a page in the panel's sidebar and choose **Preview Source…** to open it on that page's file.
For a file that isn't in the Pages folder yet, right-click an empty part of the sidebar, choose **Source Preview…**, then **Choose page…**.
Then select a named **Source**. Loading a file makes an in-memory preview; it does not change the file or add it to your active pages.
Paste a **Sample response**, or use **Import…** to load a UTF-8 response file, then click **Preview sample**. For the GitHub starter, this illustrative sample is enough:
```json
{ "stargazers_count": 100, "forks_count": 12 }
```
The preview displays the actual cards, mapping issues, **Mapped card JSON**, and **Response and derived values**. Sample previews require an active trial or license. They do not contact an API or read source secrets. They help catch missing response fields or values that do not fit a card, beyond what editor validation can check.
For a direct request to the source’s `url`, paste its raw JSON, text or Prometheus answer. If the source uses named `requests`, even just one, paste a JSON object keyed by request name; encode text and Prometheus answers as JSON strings. Samples and imported pages must be no larger than 1 MB.
To try the real service, click **Fetch Once**; it works during the trial or with a [license](https://legatobar.com/docs/license.md). It uses the selected source and its saved Keychain secret through the same fetcher as normal polling, including shared rate-limit waits and conditional GETs. Preview cards do not run buttons. **Cancel** stops a pending preview fetch; changing the source or sample clears the old result.
An agent gets the same sample preview with the MCP tool [`preview_page`](https://legatobar.com/docs/mcp-tools.md#checking-a-pages-sources), or `legato preview` from a script, and sees each source's last fetch in `get_page`'s `status.sources`.
Edit configuration in your external editor, then click **Reload page**. Reloading clears the old output and keeps your selected source and sample when that source still exists. To use it in the menu bar, save it in the Pages folder. **Open Pages Folder** in the editor-support section opens that location and installs the bundled schema if needed.
## Adapt a request you already know
Start with a working API request and a sample response. For the starter above, the equivalent request is:
```sh
curl 'https://api.github.com/repos/octocat/Hello-World' \
-H 'Accept: application/vnd.github+json' \
-H 'X-GitHub-Api-Version: 2026-03-10'
```
A polling source should read data. Use POST polling only for read operations, such as a template request; put commands that change something in [Buttons](https://legatobar.com/docs/buttons.md#buttons), which run when clicked.
Translate the parts you need into a named source:
| Request part | Page setting |
| --- | --- |
| URL | `sources..url` |
| GET or POST | `method`; GET is the default |
| JSON sent with POST | `body`, as a JSON value, not a quoted curl command |
| Accept, API version, other non-secret headers | `headers`, an object of header names and string values |
| API token or password | `secret` names an item you save in **Settings → Secrets** (or with [`Legato secret set`](https://legatobar.com/docs/secrets.md#from-the-command-line-or-an-agent)); `auth` describes how to send it |
| Fields in the response | Card `source.map`, such as `"value": "stargazers_count"` |
| How often it should refresh | Source `every`; start conservatively, such as `1h` |
For a bearer token, set `"secret": "my-api"` and `"auth": { "type": "bearer" }`, then save `my-api` for the API's host in Settings → Secrets. Keep the credential itself out of the file. Use `auth: { "type": "none" }` for an unauthenticated endpoint.
Every request sends `Accept: application/json` and `User-Agent: Legato`, unless the source's headers set their own. Source `headers` apply to its data requests and buttons. A named request or button can override a common header; authentication fills the credential header afterward. A login's own headers belong in `auth.request.headers` and are separate from these common headers. See [Signing in](https://legatobar.com/docs/source-requests.md#signing-in) for API-key headers, Basic authentication and token logins.
Start with one card and one field. Add more cards referencing the same source after that works. The [card reference](https://legatobar.com/docs/cards.md) lists the fields each card accepts, and [Mapping](https://legatobar.com/docs/mapping.md#mapping) explains nested objects, arrays and small transformations.
---
# Source fields and loading
## Loading and status files
Legato loads a page within a second of a save, and a script can wait for `Pages/.status/.json` to say whether it took it; `legato set` and the MCP `set_page` tool do that for you. They check the page before writing it, so a page with a mistake leaves the old one as it was. [How Legato loads a page](https://legatobar.com/docs/page-loading.md#how-legato-loads-a-page) and [Status files](https://legatobar.com/docs/page-loading.md#status-files) have the details.
A status's `ok` describes the page as a whole. A card whose `source` or buttons are wrong still loads as a warning card of its own, saying what's wrong; check it in the panel or with **Preview Source…** on the page's right-click menu.
## Source and page reference
Each file is one page: `title`, optional `icon`, up to 24 `cards`, named `sources`, and an optional [`notify`](https://legatobar.com/docs/source-reference.md#notifications) and [`title_from`](https://legatobar.com/docs/detail-pages.md#titled-by-its-item); see [Writing and versions](https://legatobar.com/docs/page-writing.md) for the rest. Any other top-level key stops the file loading. The optional `$schema` property enables editor assistance; Legato still checks the page when it loads.
A page can mix sourced cards with ordinary cards whose values are written in.
A named source contains connection settings, without `map`:
| Source field | Required? | Meaning |
| --- | --- | --- |
| `kind` | no | `http` (the default), `calendar` for this Mac's own calendars, or `reminders` for its reminders; see [Calendar sources](https://legatobar.com/docs/source-calendar.md#calendar-sources) and [Reminders sources](https://legatobar.com/docs/source-calendar.md#reminders-sources). The rest of this table is for `http`. |
| `url` | yes, or `hosts` or `feeds` | API address. A source that reads every host on a list gives [`hosts`](https://legatobar.com/docs/source-requests.md#several-hosts-from-a-list) instead, and one that reads every feed on a list gives [`feeds`](https://legatobar.com/docs/source-requests.md#several-feeds-from-a-list). Use HTTPS for internet APIs; plain HTTP is intended for local services. With `requests`, its scheme, host and port define the origin. Its path or query can carry [dates](https://legatobar.com/docs/source-requests.md#dates-in-requests). |
| `secret` | no | Name in Settings → Secrets, not the credential value: 1–48 lowercase letters, digits and hyphens, such as `my-api`. |
| `secret_optional` | no | `true`: while no secret is saved for this host, requests go without signing in. For a key or password sent with each request, not a login. Mostly for [host lists](https://legatobar.com/docs/source-requests.md#several-hosts-from-a-list), where some hosts have a password and some don't. |
| `secret_expires` | no | A name for the [expiry date](https://legatobar.com/docs/secrets.md#expiry-dates) saved with `secret`, such as `token_expires`. The date (`2027-02-09`) is added to the answer under that name before `derive`, and the name is left out when no date is saved. Lowercase letters, digits and `_`; not `data`, a request's name or a derived name. |
| `auth` | no | How to authenticate. A named secret defaults to bearer authentication. |
| `method`, `body` | no | GET or POST, with an optional JSON body. Used for a single request to `url`. |
| `headers` | no | Common headers for data requests and buttons. |
| `format` | no | `json` (default), `text`, `feed`, `prometheus` or `docker-logs` for a single request. |
| `requests` | no | Up to 8 named requests, combined into one answer; paths use the source origin. |
| `derive` | no | Values computed from the answer before mapping. |
| `fail` | no | When an answer the service sent counts as a failure all the same: `{ "when": condition, "message": rule }`. See [When the answer reports an error](https://legatobar.com/docs/source-polling.md#when-the-answer-reports-an-error). |
| `collect` | no | Rows of the answer to keep on this Mac for other pages. See [History](https://legatobar.com/docs/source-reference.md#history). |
| `every` | no | Whole number plus `s`, `m`, `h` or `d`, such as `15m` or `2h`. Minimum `1m`; default `5m`. |
A source can also be `{ "dataset": "name" }`: a page's history, kept on this Mac, read for the period showing. See [History](https://legatobar.com/docs/history-reading.md#read-the-history-on-another-page).
Each sourced card has exactly these connection fields:
| Card `source` field | Required? | Meaning |
| --- | --- | --- |
| `ref` | yes | A name in the page's `sources` object. |
| `map` | yes, unless `when` is set | Card fields to fill, and their paths or rules. A card whose content is written out and only shows on a condition needs none. |
| `empty` | no | `{ "when": condition, "text": template }`. When the condition holds in the answer, the card shows the text under its own label, with its buttons hidden (Add Event buttons stay), instead of a card the answer can't fill: no meetings, no open pull requests, nothing due. |
| `when` | no | A [condition](https://legatobar.com/docs/mapping-conditions.md#conditions): the card shows only while it holds. See [Cards that show on a condition](https://legatobar.com/docs/mapping-conditions.md#cards-that-show-on-a-condition). |
| `loading` | no | On a page whose param [`selects`](https://legatobar.com/docs/detail-pages.md), what the card shows while a pick is on its way and the card reads something it changes: `placeholder` (the default) draws its last shape in grey, `keep` draws it as it was. `keep` suits a list whose length follows the pane beside it. |
| `failed` | no | On a `status` card only: `{ "state", "detail", "after" }`. Once the source has failed `after` times in a row (2 to 10, default 3), the card shows `state` (`warning`, `critical` (the default) or `unknown`) and `detail` instead of its last answer. See [When a service stops answering](https://legatobar.com/docs/source-polling.md#when-a-service-stops-answering). |
**Behind a path.** For a service behind a reverse proxy, use `"url": "https://media.example.com", "base": "/sonarr"`. Legato adds `base` before request, button, row action and row image paths, including login and `title_from` requests. Full HTTPS URLs stay unchanged. The base starts with `/` and cannot contain `?`, `#` or `..`. A trailing slash is removed.
**Self-signed certificates.** A server at an IP address or a `.local` name can use one. The first time Legato meets it, the source fails with "certificate isn't trusted", and you trust it in [Settings → Certificates](https://legatobar.com/docs/settings.md#certificates). Legato then accepts only that certificate from that address and port. A page file can't trust a certificate.
One source can fill several kinds of card from the same answer: stats, lists and status cards alike. The source owns the polling interval. All its cards share the fetch and schedule, so adding a card does not add another request, and Legato checks for updates only while your Mac is awake and unlocked. With multiple named requests, one cycle makes each request once. The [worked examples](https://legatobar.com/docs/source-examples.md#worked-examples) are complete pages; other snippets are explicitly labeled as fields or rules to place inside a page.
### Supported APIs and limits
Use direct sources for simple GET/POST APIs with JSON request bodies, JSON, text, feed or Prometheus responses, static API credentials, one login request returning a token, or an OAuth client's ID and secret. Named requests run independently, with two exceptions: a request with [`each_row`](https://legatobar.com/docs/source-requests.md#a-request-for-each-row) is sent once for each row of another request's answer, after it (and one more may be sent for each row inside those answers), and one with [`with`](https://legatobar.com/docs/source-requests.md#a-value-from-another-answer) takes a value from another request's answer, after it. There is no longer chain than that. A request with [`follow`](https://legatobar.com/docs/source-requests.md#a-list-across-pages) is one request sent again for each page of a list. A request with [`missing` or `optional`](https://legatobar.com/docs/source-requests.md#a-request-with-nothing-there-yet) is left out of the answer when it has nothing there yet or fails, instead of failing the source.
A source with **no `secret` and no `auth`** can also name a full `https://` URL in `requests`, including another host. For example, `"url": "https://api.open-meteo.com"` with `"requests": {"fc": "/v1/forecast?latitude={param.lat}&longitude={param.lon}¤t=temperature_2m", "air": "https://air-quality-api.open-meteo.com/v1/air-quality?latitude={param.lat}&longitude={param.lon}¤t=us_aqi"}` lets one card read `fc.current.temperature_2m` and `air.current.us_aqi`. Params are filled and percent-encoded as for paths. Full URLs must use HTTPS, cannot contain a login, and cannot have `method` or `body`; they are GET requests with the usual timeout, size limit, headers and error handling. Both hosts appear in the page’s source summary and Source Preview; rate limits belong to each destination. A source with a secret can read one such URL too, from a request with `"auth": { "type": "none" }`, which goes without the source's sign-in or headers; see [A public address beside the service](https://legatobar.com/docs/source-requests.md#a-public-address-beside-the-service).
OAuth sign-in through a browser for services other than those Legato [connects to](https://legatobar.com/docs/source-requests.md#connections) (an [OAuth client](https://legatobar.com/docs/source-requests.md#oauth-clients) is supported), cookie-based login, form or multipart bodies on reads and sign-ins ([buttons can send a form](https://legatobar.com/docs/buttons.md#buttons-that-send-a-form)), XML other than RSS and Atom feeds, automatic pagination and self-signed certificates on a host name other than a `.local` one are not supported, nor is a credential that has to go in the URL path. [Services you may already use](https://legatobar.com/docs/source-examples.md#services-you-may-already-use) lists some that fit and some that don't. For those APIs, or for complex transformations, run an agent or script separately and have it [write the finished page](https://legatobar.com/docs/page-writing.md#writing-a-page) with `legato set`. Legato does not run that script. A Home Assistant template is executed by Home Assistant, not by Legato.
Choose an interval suited to the API's quota and how quickly the information changes. An hourly public-data poll is a better starting point than the one-minute minimum. Server-requested waits can delay the next attempt; conditional GETs can avoid downloading an unchanged response, but still make a request when due.
## Notifications
A page notifies when one of its `status`, `gauge` or `fleet` cards moves up to warning or critical, whether the card's state comes from a source or is written in; see [Notifications](https://legatobar.com/docs/notifications.md). A card still waiting for its source's first answer keeps the level it had, so a page waiting on its sources doesn't count as a recovery.
A page can also send a notification of its own with `notify`:
```json
"notify": { "id": "backup-2026-10-24", "title": "Backup finished", "body": "1,204 files, 3.1 GB, in 4 minutes." }
```
- Each `id` shows once. Save the file with a new `id` to notify again; saving it with the same one shows nothing more.
- It's skipped when the file was last modified more than 24 hours before Legato sees it.
- A `notify` that breaks the rules (no `id` or `body`, a `body` over 200 characters, a `title` over 60, or a key other than those three) stops the whole file loading: the page shows a warning card that says what's wrong, and its status file has `ok: false`. `set_page` and `legato set` refuse it with `invalid_page` and keep the old page.
A notification about a card also carries up to three of that card's buttons, so you can act on it from the notification. Only buttons that run without asking qualify: `"kind": "open"` buttons, and `http` buttons with a [`success`](https://legatobar.com/docs/buttons.md#buttons) check and no [`confirm`](https://legatobar.com/docs/button-tasks.md#buttons-that-ask-first). A button without a `success` check asks first in Shortcuts, and a notification can't ask, so it stays in the panel. Give a button a `success` check if you want it on the notification. See [Notifications](https://legatobar.com/docs/notifications.md).
## History
A source can keep rows from its answers on this Mac, for other pages to read later: deliveries a service forgets once they've arrived, readings it only reports as they are now. (To draw one number over time on a sparkline, use [Sparkline readings](https://legatobar.com/docs/mapping-sparklines.md#sparkline-readings) instead.) Add `collect` to the source, saying which items to keep, which of their fields, under what key and for how long:
```json
"collect": { "dataset": "parcel-deliveries", "each": ["active.deliveries", "recent.deliveries"],
"key": "{carrier_code}:{tracking_number}",
"fields": ["carrier_code", "tracking_number", "description", "events[].date", "events[].event"],
"date": { "date": { "first": "date", "of": "events", "where": { "path": "event", "contains": "Delivered" } } },
"keep": { "for": "400d" }, "readers": ["delivery-times"] }
```
A page listed in `readers` reads all matching rows with a source of its own, `{ "dataset": "parcel-deliveries" }`, filtered to its period. The rows stay on this Mac and don't sync; **Settings → History** shows what each page keeps, and exports or deletes it. Agents and scripts can add rows too, with `legato rows add`, when the owner declares `"accepts_rows": true`. Changes to retained fields, text removal or date rules update previously kept rows while collection pauses; Settings offers Re-key when the key template changes.
For a reading over time of every item of a fleet, such as each monitor's state every 5 minutes, add `"sample": { "every": "5m" }`: History then keeps one row per item per interval, for a year unless `keep` says otherwise. See [Samples](https://legatobar.com/docs/history-collect.md#samples).
A dataset source takes `key` to read one item's rows: `{ "dataset": "kuma-samples", "key": "{param.id}" }` on a [page for every item](https://legatobar.com/docs/detail-pages.md#one-page-for-every-item). The key is compared as text on both sides: kept keys are always text (collect refuses an item whose key is a number), and `key` is the text the link filled in, so `"7"` reads the item kept as `7` and `"07"` doesn't. A key a link didn't fill reads nothing, and the cards say "Open this page from an item's link".
A service that answers for a range of dates, such as Tessie's charges or GitHub's pull requests, doesn't need this: ask it for the period showing (see [Dates in requests](https://legatobar.com/docs/source-requests.md#dates-in-requests)).
See [History](https://legatobar.com/docs/history.md) for every field, dates, retention, readers and a complete Parcel example.
---
# Signing in and requests
## Signing in
`auth` says how the secret reaches the service. It applies to every request the source makes and to its buttons, except a request that reads [a public address](#a-public-address-beside-the-service).
| `auth` | Sends |
| --- | --- |
| omitted, or `{ "type": "bearer" }` | `Authorization: Bearer `. Most API keys and tokens: Tessie, Home Assistant, GitHub. |
| `{ "type": "header", "name": "X-Api-Key" }` | The secret in that header. |
| `{ "type": "header", "name": "Authorization", "value": "MediaBrowser Token=\"{secret}\"" }` | That header, with the secret where `{secret}` is. For services that want words around the key, such as Jellyfin and Emby. |
| `{ "type": "query", "name": "apikey" }` | The secret as `?apikey=…` on each request. |
| `{ "type": "basic" }` | HTTP Basic. A secret of `user:password` is sent as is; one without a `:` is sent as the password with no user name, which is how Uptime Kuma takes API keys. |
| `{ "type": "login", … }` | Signs in with a request first, keeps the token it gets back, and sends that instead. See below. |
| `{ "type": "oauth_client", "token_url": "/oauth/token" }` | Signs in as an OAuth client, trading its ID and secret for a short-lived access token, and sends the token as `Authorization: Bearer`. See [OAuth clients](#oauth-clients). |
| `{ "type": "none" }` | Nothing. |
A header's `value` holds `{secret}` exactly once and nothing else in braces, in at most 200 characters. The secret in Settings → Secrets is just the key; the page holds only the words around it:
```json
"auth": { "type": "header", "name": "Authorization", "value": "MediaBrowser Token=\"{secret}\"" }
```
It goes wherever the source's sign-in does: every request, its buttons, following a task, and images on its rows. Preview Source shows it as `Sends Authorization: MediaBrowser Token="…"`. A secret with a line break is never sent. If a service echoes the secret back in an answer or an error, Legato replaces it with "…" before a card, History or Preview Source sees it (for secrets of 6 characters or more, so a short one can't blank ordinary words).
A login describes the sign-in request, where the token is in its answer, and how to send the token. This `auth` field is a fragment to place inside a named source:
```json
"auth": {
"type": "login",
"request": { "method": "POST", "path": "/api/auth", "body": { "password": "{secret}" } },
"token": "session.sid",
"send": { "header": "X-FTL-SID" },
"logout": { "method": "DELETE", "path": "/api/auth" }
}
```
- `{secret}` in the request's body or headers is replaced with the secret.
- `send` is `{ "header": name }`, `{ "query": name }` or `{ "bearer": true }` (the default).
- Legato keeps the token until a request is refused with HTTP 401, then signs in once more. A fetch and a button press at the same moment share one sign-in.
- Login requires a nonempty token at the declared path; a missing token is an error. For a passwordless service, use `{ "type": "none" }` instead of a login.
- `logout` (optional) signs the session out: when Legato quits, and when the credential for the same named secret changes and an old session is replaced. Different secret names keep separate sessions, even on the same service. It's a path or `{ method, path, headers, body }`, `DELETE` by default, and carries the token the way `send` says. Give it for services that limit how many sessions are open at once, such as Pi-hole, or every launch leaves one behind until it expires. Updating `logout` applies to an existing session on the next fetch; if pages sharing the same sign-in and secret name disagree, the most recently used recipe supplies the logout policy. Quit cleanup includes sign-ins still finishing, but a crash or an unresponsive service can leave a session until the service expires it.
### OAuth clients
Some services, Tailscale among them, let you make an OAuth client for an app like Legato. A client has an ID and a secret that last until you revoke them, so you don't have to swap in a new key every few months. Legato trades the two for an access token (OAuth's client credentials grant) and sends that token with every request:
```json
"secret": "tailscale-client",
"auth": { "type": "oauth_client", "token_url": "/api/v2/oauth/token" }
```
- Save the client in Settings → Secrets as `client-id:client-secret`, the ID and the secret joined by a colon. Legato splits it at the first colon, so the secret itself may hold colons but the ID can't. From 1Password, the ID and the secret can come from [two fields](https://legatobar.com/docs/1password.md#a-secret-in-two-fields).
- `token_url` is the service's token endpoint: a path on the source's address, after any `base`, or a full URL on that same address. A token endpoint on another host isn't supported.
- `scope` (optional) is the scopes to ask for, separated by spaces, such as `"devices:core:read"`. Leave it out to get what the client was given.
- `client_auth` (optional) is `"body"`, the default, which sends the ID and secret in the form, or `"basic"`, which sends them as HTTP Basic for services that want it that way.
- The token stays in memory only: never on disk, in History or in Preview Source. Legato gets a new one shortly before it runs out (going by the `expires_in` the service gives) and when a request is refused with HTTP 401. It drops the token when the secret changes and when Legato quits. A fetch and a button press at the same moment share one token.
- If the service turns the client down, the card says so. It shows OAuth's error code when the service sends one, as in "refused the OAuth client (invalid_client)", and the HTTP status when it doesn't, as in "api.tailscale.com refused the OAuth client (HTTP 401)". A 403 on a request means the client's scopes don't cover it.
### Connections
Some services let Legato sign in through your browser, so there's no token to copy. Todoist is the first. In Settings → Secrets, a secret for one of these services offers **Connect**. Legato opens the service's sign-in page in your browser, you sign in and allow access, and Legato saves the connection under the secret's name. A template for the service offers Connect in its Sign in step too.
```json
"url": "https://api.todoist.com/api/v1",
"secret": "todoist"
```
- A page names a connection as it names any secret, with the default `bearer` auth, so the same page works with a connection or a pasted token.
- Legato keeps the connection in this Mac's Keychain and gets a fresh access token from the service shortly before the old one runs out.
- The token goes only to the service's API host (`api.todoist.com`), over HTTPS, as a Bearer token. A source that would send it another way or to another address fails and says why. A host list can't use a connection.
- Each Mac connects on its own. A connection can't come from 1Password and has no expiry date.
- When the service no longer accepts the connection, Settings → Secrets shows it as needing attention, and **Connect Again** signs in once more.
- **Disconnect**, in the secret's menu, signs Legato out of the service and deletes the connection from this Mac. You can also remove Legato in the service's own settings.
## Requests and formats
A source makes one request to its `url`, or several named ones. These fields are a source fragment:
```json
"url": "http://pi.hole",
"requests": {
"summary": "/api/stats/summary",
"blocking": "/api/dns/blocking",
"top_blocked": "/api/stats/top_domains?blocked=true&count=10"
}
```
The answer is then `{ "summary": …, "blocking": …, "top_blocked": … }`, one key per request, so paths in `map` start with the request's name: `summary.queries.total`. Each request is a path on the source's origin, or an object with `path`, `method`, `body`, `headers` and `format`. It cannot change the source's scheme, host or port, except to read [a public address](#a-public-address-beside-the-service). Request-specific headers override common source headers.
`format` says how to read an answer:
| `format` | Reads |
| --- | --- |
| `json` (the default) | JSON. An answer that's JSON inside a string, such as a rendered template, is read as the JSON inside. |
| `text` | The text, as one string. |
| `feed` | An RSS, Atom or JSON feed, as `{ "title", "url", "count", "items" }`; see [A feed](https://legatobar.com/docs/source-examples.md#a-feed-the-latest-posts-each-linking-to-its-page). |
| `prometheus` | Prometheus metrics text, as a list of `{ "name", "labels", "value" }`. |
| `docker-logs` | Docker log frames or plain TTY text, as `{ "lines": [{ "stream": "stdout", "time": "2026-11-09T12:00:00Z", "text": "Ready" }], "count": 1 }`. |
For Docker logs, request `/containers/{id}/logs?stdout=1&stderr=1&tail=20×tamps=1` with `"format": "docker-logs"`. Lines stay in response order, newest last. Each line names `stdout` or `stderr`. Plain TTY text uses `stdout`. `time` is present only when the line starts with an RFC 3339 timestamp. ANSI colour codes and trailing newlines are removed. Invalid UTF-8 is replaced. The answer keeps the last 200 lines and cuts each text to 500 characters. An invalid or truncated frame makes the response read as plain text.
### Requests from a list
A watchlist is the person's own, so its symbols go in a [list](https://legatobar.com/docs/lists.md#sending-a-list) in Settings → Lists, where a page file can't carry them, and a named request sends them. `each_entry` sends the request once for each entry of the list, with `{entry}` in its path filled in:
```json
"url": "https://finnhub.io",
"secret": "finnhub",
"auth": { "type": "header", "name": "X-Finnhub-Token" },
"requests": {
"quotes": { "path": "/api/v1/quote?symbol={entry}", "each_entry": { "list": "stock-watchlist", "max": 30 } }
}
```
The answer at `quotes` has one row per entry, in the list's order:
```json
"quotes": [
{ "entry": "NRWD", "answer": { "c": 184.62, "dp": 2.32 } },
{ "entry": "ZZZZ", "error": "finnhub.io answered HTTP 404" }
]
```
A card maps the rows with `each`, reading `entry` and `answer`: `{ "each": "quotes", "where": { "path": "answer", "exists": true }, "fields": { "text": "entry", "detail": { "template": "{answer.c}" } } }`.
- `list` names the list. `max` is how many entries are sent: the first ones in the list that can be sent, 1 to 50, 20 if you leave it out. Entries after that get a row saying "Not sent: this page sends the first 30 entries".
- Each entry is checked first, as a [page param](https://legatobar.com/docs/detail-pages.md) is: 1 to 64 of `A–Z`, `a–z`, `0–9`, `.`, `_`, `~` and `-`, and never `.` or `..`. With `"type": "text"`, an entry can be a short name of up to 40 letters, digits, spaces and `. , ' - ( ) &` instead. `pattern` is a regular expression the whole entry must also match. An entry that doesn't pass is never sent, and its row says so.
- The entry is encoded and goes only in the path or query, never the host, a header or a body. A request with `each_entry` is a GET.
- An entry listed twice is sent once.
- Each entry's answer can be up to 256 KB. A list of more than 200 entries fails the request instead of making a row for each.
- Each `each_entry` request has at most 4 entries out at a time, and requests to one service with one secret leave at least 0.1 seconds apart, so 30 entries take about 3 seconds.
- If one entry fails, only its row has an `error`. The whole source fails, and cards keep their last answer with a note, when the service refuses the secret (HTTP 401), asks Legato to wait (HTTP 429, or quota headers), can't be reached, has a certificate to review, or fails every entry.
- While the list is missing or empty, nothing is sent, the answer is `[]`, and cards using the source say "Add the list stock-watchlist in Settings → Lists".
- A source makes at most 64 requests a fetch, counting each `each_entry` as its `max`: room for quotes and company profiles for 30 symbols, plus one more.
- When the list changes, the source is read again right away. An answer that was on its way for the old list is dropped, and nothing from it is kept in History.
`all_entries` sends the request once, with every entry in place of `{entries}`, separated by commas:
```json
"prices": { "path": "/api/v3/simple/price?ids={entries}&vs_currencies=usd", "all_entries": { "list": "coins", "max": 50 } }
```
- Entries are checked and encoded as for `each_entry`. An entry with a comma in it can't be sent.
- `max` is the most entries the list can hold: 1 to 100, 50 if you leave it out. With more, or with an entry that can't be sent, nothing is sent, and cards say which list to fix and which entry: "Entry 3 of the list coins can't be sent; check it in Settings → Lists".
- While the list is missing or empty, nothing is sent and the answer is `null`.
- The answer is the service's, as with any request.
Settings → Lists names the services a page sends each list to, and Details shows "Sends the list stock-watchlist" under the source. A template asks for the list with a `list-name` input that fills `each_entry.list` or `all_entries.list`, and a `lists` entry whose `why` says where its entries go.
To keep history for each entry, `derive` the rows that answered and [collect](https://legatobar.com/docs/history-collect.md#samples) them with `"key": "{entry}"`. A detail page then reads one entry's samples with `{ "dataset": "stock-prices", "key": "{param.symbol}" }`.
### A request for each row
Some services list things by id and keep the names elsewhere. Seerr's waiting requests carry a TMDB id and whether it's a movie or a show, and each title is its own request. `each_row` sends a named request once for each row of another request's answer, with the row's fields in braces filling its path:
```json
"url": "http://192.0.2.40:5055",
"secret": "seerr",
"auth": { "type": "header", "name": "X-Api-Key" },
"requests": {
"pending": "/api/v1/request?filter=pending&take=20",
"titles": { "path": "/api/v1/{media.mediaType}/{media.tmdbId}",
"each_row": { "from": "pending.results", "key": "id", "max": 20,
"pick": ["title", "name", "releaseDate", "firstAirDate", "posterPath"], "keep": "6h" } }
}
```
The answer at `titles` has one row per row of `pending.results`, in the same order, each with the row's `key`:
```json
"titles": [
{ "key": 41, "answer": { "title": "Saltmarsh", "releaseDate": "2024-03-08", "posterPath": "/s4ltm4rsh.jpg" } },
{ "key": 42, "error": "192.0.2.40 answered HTTP 404" }
]
```
A card joins the two with a [lookup](https://legatobar.com/docs/mapping.md#mapping): `"lookup": { "from": "titles", "by": "key", "on": "id", "as": "title" }`, then reads `title.answer.title`.
- `from` names another of the source's requests, then where its rows are in that answer (`pending.results`, or just `pending` when the answer is the list). An object there is one row: Gitea's repository answers at `/repos/{owner}/{repo}`, and `"from": "repo"` sends one request about its default branch, so a branch Legato can't send (`release/2026`) fails that row, not the source. It's sent after the source's other requests and reads that answer as it came, before `derive`. That request has to be an ordinary one answering JSON, a request with [`with`](#a-value-from-another-answer), or a request for each row of an ordinary one (below). It can't read a list's entries or a [public address](#a-public-address-beside-the-service), so a fetch is never more than three rounds.
- **Rows from a `with` request.** Gitea's repository search narrows to the person's own repositories only with their numeric id, which `/api/v1/user` answers. `"repos": { "path": "/api/v1/repos/search?uid={uid}&limit=25", "with": { "uid": "me.id" } }` goes in the second round, and a request for each row with `"from": "repos.data"` goes in the third. Its rows are read as from an ordinary request, with no `parent_key`, and nothing can read its answers in turn.
- **Rows inside rows.** A request for each row can read another one's answers, one level deep. UniFi's console lists its sites, each site's devices at `/sites/{id}/devices`, and each device's statistics at `/sites/{site}/devices/{id}/statistics/latest`. With `"from": "devices.data"`, where `devices` is itself sent for each site, the rows are the devices inside every site's answer, in order. Each gets `parent_key`, the key of the site it came from, for its path: `"path": "/sites/{parent_key}/devices/{id}/statistics/latest"`. A site whose request failed gives no devices. When the path after the name leads to one object rather than a list, that object is one row: Gitea's pull request answers at `/pulls/{number}`, so `"from": "pulls"` reads each one whole, and `"path": "/repos/{base.repo.owner.login}/{base.repo.name}/commits/{head.sha}/status"` asks for its head commit's checks. Past 200 rows in all, the first 200 are read, and as always only the first `max` are sent. A third request reading the second's rows isn't allowed.
- `key` is the field that names each row, a string or a number. It comes back with each answer for the lookup. A row with no key, or with the same key as an earlier row, isn't sent, and its row has `"key": null` and an `error`.
- Each `{field}` is a path in the row. Its value has to be a string or a whole number that would pass as a [page param](https://legatobar.com/docs/detail-pages.md): 1 to 64 of `A–Z`, `a–z`, `0–9`, `.`, `_`, `~` and `-`, never `.` or `..`. It's encoded as one segment and goes only in the path or query, on the source's own address: never a host, a header or a body. A request for each row is a GET. A row whose value can't be sent gets an error row.
- `max` is how many rows are sent, the first that can be: 1 to 50, 20 if you leave it out. Rows after that say "Not sent: this page sends the first 20 rows".
- `pick` names the top-level fields to keep from each answer. Seerr's movie answer runs to 40 KB of cast and trailers, and a title needs a few fields of it.
- `keep` reuses an answer for that long before asking again, from `1m` to `24h`. Use it for answers that don't change, like a film's title, so a button's follow-up reads don't ask again for every row. Kept answers stay in memory, for that address and secret only. A failed answer is never kept.
- Calls go as a list's do: 4 at a time, 0.1 seconds apart to one service, each answer up to 256 KB, and more than 200 rows fails the request. A row that fails, even every one of them, fails only its own row, since the rows' own request already reached the service. A refused secret, a request to wait or an unreachable host fails the source.
- It counts as its `max` toward a source's 64 requests a fetch. It can't be used in a source with [hosts](#several-hosts-from-a-list).
### A request with nothing there yet
Some services answer 404 for something that will exist later. changedetection.io's latest difference is 404 until a watch has changed once, and a source fails on a 404, so a watch that never changes would keep its page in error. Give that request `missing`, the statuses that mean nothing is there yet:
```json
"requests": {
"watch": "/api/v1/watch/{param.uuid}",
"diff": { "path": "/api/v1/watch/{param.uuid}/difference/previous/latest", "format": "text", "missing": [404] }
}
```
- An answer with one of those statuses leaves the request's name out of the source's answer, so test it with `exists: false` or give the card an `empty`. Any other failure fails the source as before.
- `missing` is `[404]`, `[410]` or both. It goes on one request to the service: not with `each_row`, `each_entry`, `all_entries`, `follow` or `"auth": { "type": "none" }`.
A request for detail the cards can do without takes `"optional": true` instead. changedetection.io's report of the week's changes adds a line to each watch, and a big install can take longer to answer it than Legato waits. When an optional request fails, for an error status, no answer in time or an answer too large, its name is left out and the other requests still fill the cards. An optional request that takes a value from another answer (`with`) and doesn't find it is left out too. A refused secret, a 403 or a request to wait still fails the source, since those are about the key or the whole service. It goes on the same kind of request as `missing`.
### A value from another answer
Some requests need an id that another request answers. Cloudflare lists tunnels under an account, and the account's id comes back with the zones. `with` names the value and where it is in the other answer, and `{name}` in the path takes it:
```json
"url": "https://api.cloudflare.com",
"secret": "cloudflare",
"requests": {
"zones": "/client/v4/zones",
"tunnels": { "path": "/client/v4/accounts/{account}/cfd_tunnel?is_deleted=false",
"with": { "account": "zones.result[0].account.id" } }
}
```
- Each value is another request's name, then where the value is in its answer: `zones.result[0].account.id`, or `nodes[0].node` when the answer is a list. The request goes after the source's other requests and reads that answer as it came, before `derive`.
- That request has to be an ordinary one answering JSON. It can follow pages, but it can't have `with`, `each_row`, `each_entry`, `all_entries` or `"auth": { "type": "none" }` itself, so a request with `with` always goes in the round after the requests it reads.
- A value can also be a list of up to 3 places, tried in order: the first that has a value is sent. Pi-hole's Queries page asks about the query a link picked, else the newest: `"with": { "d": ["pick.queries[0].domain", "newest.queries[0].domain"] }`.
- `with` names 1 to 4 values. A name is a lowercase word, such as `account` or `node_id`, and can't be one Legato fills itself, like `date` or `secret`. Every name goes in the path or a body string, and every `{word}` in the path has to be one of them.
- The value has to be a string or a whole number that would pass as a [page param](https://legatobar.com/docs/detail-pages.md): 1 to 64 of `A–Z`, `a–z`, `0–9`, `.`, `_`, `~` and `-`, never `.` or `..`. In the path it's encoded as one segment. In a JSON body string it goes in as it is, for a GraphQL query's variables: `"body": { "query": "…", "variables": { "accountTag": "{account}" } }`. Other braces in the body go out as written. A value never goes in a header or the host.
- When the value is missing or can't be sent, this request isn't sent, and the source fails with a note that says where the value was looked for: "tunnels needs zones.result[0].account.id, which zones didn't answer". Cards keep their last answer, as for any failure.
- A request with `with` can also follow pages. It can't send a list's entries or be sent for each row, and it can't be used in a source with [hosts](#several-hosts-from-a-list). It counts as one request toward the 64 a fetch, or as `follow`'s `max`.
### A public address beside the service
A source with a secret keeps its requests on its own address. A request can read a public address as well, with `"auth": { "type": "none" }` and a full `https://` URL as its path. The Cloudflare source above can read GitHub's latest connector release, so a card can compare it with the version the tunnel runs:
```json
"release": { "path": "https://api.github.com/repos/cloudflare/cloudflared/releases/latest", "auth": { "type": "none" }, "keep": "6h" }
```
A public API may limit how often a Mac without a key can ask, and a release changes far less often than a tunnel's state. `keep` makes Legato reuse the answer it last read for that long, from `1m` to `24h`, before asking that address again. The kept answer stays in memory, for that address only, and a request with a secret never gets it.
When the public address fails, the rest of the source still answers. That covers an error status, an unreachable host, an answer too large or one Legato can't read, and a request to wait. The request then gives its last good answer from the past day, or nothing, so `release` is missing and an `exists` test on it is false. Source Preview shows the answer it got, without the public host's error.
- It's sent with none of the source's sign-in: no secret, no token from a login or an OAuth client, no secret in the query, and none of the source's `headers` or `base`.
- Its own `headers` can hold fixed values, such as an `Accept` the service asks for. They can't be `Authorization`, `Proxy-Authorization`, `Cookie` or `Host`, and they can't have braces. `{secret}` can't go anywhere in it.
- It's a GET of one answer, over https, with no login in the URL. It can't have `method`, `body`, `with`, `each_row`, `each_entry`, `all_entries` or `follow`, and other requests can't take values from its answer.
- A redirect stays on that address. A refusal there (HTTP 401 or 403) is never taken as a refused secret. When that host asks Legato to wait, its public requests wait until then, in every source, and the service's own requests go on as before.
- `keep` goes only on a request with `"auth": { "type": "none" }`. A request for each row takes its own `keep` in `each_row`.
- Details and Source Preview list its host beside the service's.
### A list across pages
Many APIs answer a long list a page at a time and say whether there's more. Stripe answers 100 payments at most, with `"has_more": true` when there are others, and the next page starts after the last one's `id`. `follow` asks again until the list ends, putting the next page's cursor in a query parameter, and joins the pages:
```json
"url": "https://api.stripe.com",
"secret": "stripe",
"requests": {
"moves": { "path": "/v1/balance_transactions?created[gte]={period.start_unix}&created[lt]={period.end_unix}&limit=100",
"follow": { "items": "data", "while": "has_more", "param": "starting_after", "from_last": "id", "max": 10 } }
}
```
The answer at `moves` is the first page with every page's items at `data`, in order, and `has_more` from the last page read. So a period with more than 1,000 movements still says `true`, and a card can say it shows only part of them.
- `items` is where each page's list is, and `while` the field that's `true` while there's another page. Both are fields of the answer, not inside a list.
- Some services say there's more only by sending a cursor, and leave it out on the last page. UniFi's Site Manager answers `nextToken` until the list ends. Leave `while` out and give `from`, and the list goes on while that cursor is there: a page with no cursor, `null` or empty text is the last. Such a page may come back short, or even empty, with a cursor, and the next one is still read. `"follow": { "items": "data", "param": "nextToken", "from": "nextToken", "max": 4 }`
- The cursor comes from `from_last`, a field of the page's last item (Stripe's `id`), or from `from`, a field of the page itself. Stripe's search answers `next_page`, sent back as `page`: `"param": "page", "from": "next_page"`. With `from`, the joined answer takes that field from the last page too.
- `param` gets the cursor, encoded once; an earlier value of it in the path is replaced, and every other parameter stays as written. A cursor is never read for `{…}` tokens.
- `max` is how many pages are read at most, the first included: 1 to 20, 10 if you leave it out. It doesn't change how many items a page holds: that's the service's own parameter (`limit=100`).
- The pages go one after another, 0.1 seconds apart. If any page fails, has no list, has no `true` or `false` at `while`, says there's more with an empty list (with `while`), or gives no cursor or one already read, the whole request fails. A card never shows totals from part of the pages, and keeps its last good answer as it does for any failure.
- Other fields of the answer, such as a count or a page number, are the first page's. Legato doesn't drop repeats: when a service's pages repeat an item, as Stripe's search sometimes does, the joined list has it twice. Count from a list, not a search.
- At most 10,000 items and 8 MB joined, besides each page's 1 MB. It's a GET answering JSON, and can't be combined with `each_entry`, `all_entries` or `each_row`; a request for each row may read a followed answer's rows. It counts as its `max` toward a source's 64 requests a fetch.
### Several hosts from a list
Some services run the same API on many hosts: every vendor's status page answers at `/api/v2/summary.json`, and every Glances box at `/api/4/`. A source with `hosts` in place of `url` reads every host on a [list](https://legatobar.com/docs/lists.md#lists) in Settings → Lists, with the same requests, and gives one row for each:
```json
"status": {
"hosts": { "list": "status-pages", "max": 30 },
"every": "2m",
"requests": { "summary": "/api/v2/summary.json" },
"derive": [ { "name": "name", "value": "summary.page.name" } ],
"fail": { "when": { "path": "summary.page.id", "exists": false } }
}
```
Each entry on the list is an address: a host name, read over https (`www.githubstatus.com`), or an address with its scheme and port (`https://status.example.com:8443`, `http://192.168.1.20:61208`). The answer at `hosts` has a row for every entry, in the list's order:
```json
"hosts": [
{ "entry": "www.githubstatus.com", "origin": "https://www.githubstatus.com", "key": "h3f9a2c1e07b4d55",
"host": "www.githubstatus.com", "state": "answered", "answer": { "name": "GitHub" } },
{ "entry": "status.example.net", "origin": "https://status.example.net", "key": "h81d0e7b2c4a9f6e",
"host": "status.example.net", "state": "failed", "fails": 2, "last_success": "2026-11-12T15:04:00Z",
"answer": { "name": "Example" }, "error": "status.example.net didn't answer" }
]
```
A card maps the rows with `each`, reading each host's own answer under `answer`. A fleet from the rows:
```json
{ "each": "hosts", "fields": {
"name": { "if": { "path": "answer.name", "exists": true }, "then": { "template": "{answer.name|clip:24}" }, "else": { "template": "{host|clip:24}" } },
"state": { "if": { "path": "state", "equals": "answered" }, "then": "answer.rating", "else": { "template": "unknown" } },
"url": "origin" } }
```
- **Each host is a source of its own.** It gets the requests, `derive` and `fail` as written, against that host. With `derive`, its row's `answer` holds only the values `derive` made, so derive what the cards need. Without `derive`, the row holds the whole answer, which for a status page's incident history can be 500 KB a host. A host that fails, or whose answer `fail` turns down, has `state` `failed` and an `error`; the others answer as usual. A fetch fails as a whole only when Legato is signing out or the read is cancelled.
- **A host that stops answering keeps its last answer** (in memory: not after Legato restarts). Its row is `failed`, with the `error`, how many reads in a row it has failed (`fails`, which counts up to 10), when it last answered (`last_success`) and its last `answer`. The card's own rules decide what that means: `{ "path": "state", "equals": "answered" }` greys a dot at once, and `{ "path": "fails", "gte": 3 }` turns a server red after three missed reads, showing its last readings until then. An answered row has `fails` 0 and no `last_success`.
- **`state`** is `answered`, `failed`, `not_sent` (an entry that isn't an address a host list reads, or one past `max`) or `over_budget` (a read that has already kept as much as it can). `key` is the same for the same address however it's written, and changes when the address does.
- **Addresses.** `https` goes to a DNS name, an IPv4 address, a `.local` name or a single word, such as `atlas`. Plain `http` goes only to the last three, which macOS allows for local networks. An entry has no path, user or query, IPv6 addresses aren't read yet, and an address listed twice is read once. A certificate a server made for itself is trusted as for any source: at an IP address or a `.local` name, once you trust it. The check is of the address's shape: a name you add can still lead to a server on your own network.
- **Signing in.** A host-list source may name a `secret` and an `auth` of `basic`, `bearer`, `header` or `query` (not a login or an OAuth client). Each host gets the secret saved under that name for its own address: save it once for each host in Settings → Secrets, as `glances:password` for basic sign-in. With `"secret_optional": true`, a host with none saved goes without signing in. Settings → Secrets lists a required secret once for each host, and an optional one not at all. A host that wants a password says so on its own row (HTTP 401). A secret goes only to the host it was saved for: on any of its ports, and over plain `http` when the entry is written that way. A host list has no headers of its own: each host gets the `Accept` and `User-Agent: Legato` headers every source sends, its secret, and cache validators for an answer it already gave. Every request is a GET to a path on the host, and a redirect stays on the same host.
- **Limits:**
- `max` is 1 to 30 hosts, read four at a time, with up to 6 requests each and 180 in all (`max` × requests). Requests from a list (`each_entry`, `all_entries`) can't go inside one.
- Each host's answer can be up to 1 MB, and a read keeps up to 8 MB in all.
- **When every host fails,** the rows still come back, each `failed` with its kept answer, so cards show each host as it stands. The source itself counts as answered, so it keeps reading at its own interval rather than backing off.
- **List changes.** A list longer than 200 entries fails the source. When the list changes, the source is read again right away. While it's missing or empty, nothing is read, `hosts` is `[]`, and cards say to add the list.
- **What it can't do:**
- `title_from` can't read a whole host list, which has no one name for the page.
- A card reading a whole list can't have buttons: link each row to its host with `url`, or to a page for that host (below).
- It can't `collect`.
- `{period.…}` can't be used in it, and `{param.…}` only as `only` (below).
- Settings → Lists says the page reads each entry as an address, and Details names the list.
#### A page for one host on the list
A row can open a page about that host alone. Give the page a param with `list_key`, naming the list, and a source with `only`:
```json
"params": { "box": { "list_key": "glances-hosts", "example": "h0000000000000000" } },
"sources": { "glances": {
"hosts": { "list": "glances-hosts", "only": "{param.box}" },
"secret": "glances", "secret_optional": true, "auth": { "type": "basic" },
"requests": { "system": "/api/4/system", "quicklook": "/api/4/quicklook" } } }
```
Link to it from a row with `"url": { "template": "legato://page/glances-box?box={key}" }`.
- **The source reads that one host,** as an ordinary source on its address, with the secret saved for it. It answers as that source would, with no rows. Its buttons go to that host, `title_from` can read it, and two or three such sources on one page read the same host.
- **A key names one address.** It's made from the address, so a link can never point the page at another host, and only a host the list holds is read. A key the list doesn't hold reads nothing, its buttons do nothing, and the cards say "This address isn't on the list glances-hosts". That includes an old link once the address is edited, which makes a new key.
- **No default yet:** the page is opened from a row.
### Several feeds from a list
A person's feeds are their own, so their addresses go in a [list](https://legatobar.com/docs/lists.md#lists), not in the page. A source with `feeds` in place of `url` reads every feed address on the list, as RSS, Atom or JSON Feed, with no sign-in:
```json
"feeds": {
"feeds": { "list": "news-feeds", "max": 30 },
"every": "30m"
}
```
The answer has a row for each entry under `feeds`, as a [host list](#several-hosts-from-a-list) has under `hosts`, and every feed's posts together under `items`:
```json
{ "feeds": [ { "entry": "https://example.com/feed.xml", "url": "https://example.com/feed.xml", "key": "h3f9a2c1e07b4d55", "host": "example.com",
"state": "answered", "fails": 0, "answer": { "title": "Example Notes", "url": "https://example.com/", "count": 20, "items": [ … ] } } ],
"items": [ { "title": "A post", "url": "https://example.com/a-post", "published": "2026-11-16T09:00:00Z", "author": "Riley",
"feed": "Example Notes", "feed_key": "h3f9a2c1e07b4d55" } ],
"count": 1 }
```
- **An entry is a whole feed address,** with its path and query: `https://example.com/blog/feed.xml?lang=en`, or `example.com/feed`, which is read over https. The scheme and host are lowercased and a default port dropped; the rest is kept as written, so `/feed` and `/feed/` are two feeds. Plain `http` goes only to an IP address, a `.local` name or a single word; a public `http://` entry gets a row saying to use its `https://` address. The same address listed twice is read once.
- **`items` is every feed's posts, newest first,** up to 200, with `feed` (the feed's title, or its host when it has none) and `feed_key` (its row's key). A post with no date goes after the dated ones, and one dated in the future sorts as now. A row's `answer` keeps the feed's newest 50 posts without their summaries; a failed feed keeps its last ones, which stay in `items`.
- **A feed that fails is its own row's error,** as a host is. A feed that asks for a password says so, and one that redirects to another address fails and says so: put the address it ends up at in the list.
- **A page for one feed** takes a `list_key` param and `"feeds": { "list": "news-feeds", "only": "{param.feed}" }`, linked from a row with `?feed={key}`. It answers as a [feed](https://legatobar.com/docs/source-examples.md#a-feed-the-latest-posts-each-linking-to-its-page) does, summaries and all but with its posts newest first, so `title_from` can name the page after the feed.
- **What it can't do:** a feed list has no requests, secret, headers or `derive` of its own, its cards have no buttons, `title_from` can't read a whole list, and it can't `collect`. `max` is 1 to 30 feeds, read four at a time, each answer up to 1 MB.
### Dates in requests
A request can ask for a date range that moves with the calendar: this month's budget, the last 30 days. Put a `{date.…}` token in a request's `path`, in a single request's `url` (its path or query), in a `body` string or in a header, and Legato fills it in each time the request goes out, in the Mac's time zone:
```json
"url": "https://api.lunchmoney.dev",
"requests": {
"month": "/v2/summary?start_date={date.month_start}&end_date={date.month_end}"
}
```
| Token | Gives (on Sunday 25 Oct 2026) |
| --- | --- |
| `{date.today}`, `{date.yesterday}`, `{date.tomorrow}` | `2026-10-25`, `2026-10-24`, `2026-10-26` |
| `{date.week_start}`, `{date.week_end}` | The week's first and last days, as the Mac's calendar starts weeks: `2026-10-25`, `2026-10-31` |
| `{date.month_start}`, `{date.month_end}` | `2026-10-01`, `2026-10-31` |
| `{date.last_month_start}`, `{date.last_month_end}` | `2026-09-01`, `2026-09-30` |
| `{date.year_start}`, `{date.year_end}` | `2026-01-01`, `2026-12-31` |
| `{date.days_ago_7}`, `{date.days_ago_30}`, `{date.days_ago_90}` | `2026-10-18`, `2026-09-25`, `2026-07-27` |
| `{date.days_ahead_7}`, `{date.days_ahead_30}` | `2026-11-01`, `2026-11-24` |
| `{date.days_ahead_N}` | Any number from 0 to 3660 calendar days ahead. For a 30-day agenda including today, end at `{date.days_ahead_29}`. |
| `{date.now}` | The moment, with its offset: `2026-10-25T11:30:00-05:00` (encoded in a URL) |
| `{date.days_ago_N}` | Any number of days back, up to 3660: `{date.days_ago_29}` is `2026-09-26` |
| `{date.…_at}` | The moment a day starts, with its offset: `{date.month_start_at}` is `2026-10-01T00:00:00-05:00`. For an end day it's the moment after it, so `{date.month_end_at}` is `2026-11-01T00:00:00-05:00`, for APIs that take a range of moments with the end left out (Stripe's `lt`). `{date.now}` has none. |
| `{date.hours_ago_N_at}` | The moment N hours ago (1 to 720), with its offset: `{date.hours_ago_24_at}` for the last day of readings. |
| `{date.hour_back_N_at}` | The end of this hour, N hours back (0 to 9,000), on the hour: `{date.hour_back_0_at}` is the next hour's start, `{date.hour_back_24_at}` the same hour yesterday. `{date.hour_back_N_first}` and `{date.hour_back_N_last}` are the days a stretch that starts or ends there begins and ends on. A `last_hours` period uses these. |
| `{date.…_unix}` | Any `_at` moment, and `{date.now_unix}` and `{date.hours_ago_N_unix}`, in Unix seconds instead: `{date.month_start_unix}` is `1790830800`. For services that take those, such as Tessie's `from` and `to`. |
Day tokens include their last day. A service that counts both ends counts `{date.days_ago_30}` to `{date.today}` as 31 days; for 30 days today included, start at `{date.days_ago_29}`.
On a page with a [period](https://legatobar.com/docs/periods.md#periods), more tokens are the period chosen in its row: `{period.start}` and `{period.end}`, its first and last days; `{period.through}`, its last day so far, which is today while the period is still going and its last day once it's over; and `{period.start_at}`, `{period.end_at}` and `{period.through_at}`, the moments it starts and ends, with `{period.start_unix}`, `{period.end_unix}` and `{period.through_unix}` the same moments in Unix seconds. With `"compare": "previous"`, `{compare.start}`, `{compare.end}`, `{compare.start_at}` and `{compare.end_at}` are the same stretch of the period before. They can all go wherever `{date.…}` tokens can:
```json
"requests": {
"spent": "/v2/summary?start_date={period.start}&end_date={period.end}"
}
```
Only these exact tokens are filled; other braces, such as a Home Assistant template's `{{ … }}` in a body, go out as written. A token Legato doesn't know fails the page when it loads. Dates can't go in the host, or in a login request.
With `prometheus`, `group_by` names a label to group by instead: one object per value of that label, holding its labels and each metric as a field. `split_by` lists labels that tell apart several samples of one metric; their values are added to the field's name. A response with no usable samples is an error. Uptime Kuma's `/metrics` with `"group_by": "monitor_id", "split_by": ["window"]` produces data like this example answer:
```json
[ { "monitor_id": "1", "monitor_name": "Gitea", "monitor_type": "http",
"monitor_status": 1, "monitor_response_time": 25,
"monitor_uptime_ratio_1d": 0.9965, "monitor_uptime_ratio_30d": 1 } ]
```
---
# Polling and failures
- Polling pauses while the Mac sleeps or is locked. On wake, unlock or panel open, sources refresh if due.
- Failures back off with repeated attempts, capped at 30 minutes or the configured interval if that is longer. They never shorten that interval. A success returns to the normal schedule.
- An answer can count as a failure too, when the service reports an error inside it: see [`fail`](https://legatobar.com/docs/source-polling.md#when-the-answer-reports-an-error).
- A data request gives up after 10 seconds without data, or 20 seconds in all, and has a 1 MB response limit, enforced while the answer downloads: Legato stops reading at 1 MB. Redirects must keep the same scheme, host and effective port.
- Before the first answer, a card shows what it is waiting for or an error. Later failures keep the last good value and add an error line. The footer shows the newest successful update on the page, so also check individual card errors.
- To read a page's sources again without waiting, click the arrow left of the pin at the top of the panel (⌘R). A server's cooldown still holds.
- macOS may ask for local-network access the first time Legato reaches a local service.
### When a service stops answering
A failed fetch keeps each card's last answer, with the error under it, so one dropped request doesn't blank a page. A service that has stopped answering for good would therefore stay green. Give the status card that stands for the service `failed`, and after a few failures in a row it says so:
```json
{ "id": "host", "type": "status", "label": "pve-lab", "state": "ok",
"source": { "ref": "pve", "map": { "detail": "data.pveversion" },
"failed": { "state": "critical", "detail": "Proxmox isn't answering", "after": 3 } } }
```
- The card takes that state and detail and notifies, as any status change does. Without `detail` it says "Not answering since 2:14 PM" (or "Not answering" when the source never answered).
- The next answer puts the card back to what the answer says.
- `after` counts failed fetches, which back off (see above): with `every` of `1m`, the third comes about 3 minutes after the first. Polling pauses while the Mac sleeps, so this tells you about the service only while the Mac is awake; for a service that must be watched around the clock, use a monitor such as Uptime Kuma as well.
- It applies before `when`, so a card that shows on a condition still shows when its source fails.
- A `fleet` takes `failed` too. Its items can't say how they stand while the source is silent, so the fleet shows one dot in their place, named by the card's label ("Server"), with that state and detail: it lights the page and notifies once, not once per item.
- A rate limit or a refused secret counts as a failure too: the card can't say what the service is doing.
- So does an answer the source's [`fail`](https://legatobar.com/docs/source-polling.md#when-the-answer-reports-an-error) turns down. Without `detail`, the card then says "Reporting an error since 2:14 PM", since the service is answering.
### When the answer reports an error
Some services answer HTTP 200 even when the request went wrong, and say so in the body: GraphQL APIs send an `errors` list, others `success: false`. Legato would take that as an answer, and the cards would show dashes. Give the source `fail`, and such an answer counts as a failed fetch:
```json
"sources": { "gh": { "url": "https://api.github.com/graphql", "method": "POST", "secret": "github", "body": { "query": "{ viewer { login } }" },
"fail": { "when": { "path": "errors", "exists": true }, "message": "errors[0].message" } } }
```
- `when` is a [condition](https://legatobar.com/docs/mapping-conditions.md#conditions), checked on the answer after [`derive`](https://legatobar.com/docs/mapping.md#derived-values), so it can test a derived value. `all` and `any` combine tests.
- **Test that the error is there** with [`exists`](https://legatobar.com/docs/mapping-conditions.md#conditions). Any other test whose path is missing or null doesn't hold here, whatever it compares, so an answer without `errors` passes; `equals: null` never fires.
- `message` is a [rule](https://legatobar.com/docs/mapping.md#mapping) for the service's reason. The note under the cards is "api.github.com reported an error: Bad credentials", on one line and cut at 200 characters, or "api.github.com reported an error" when there's no `message` or it gives nothing.
- It's then exactly a failed request: each card keeps its last answer with the note, polling [backs off](https://legatobar.com/docs/source-polling.md#polling-and-failures), a status card's `failed` counts it, and [History](https://legatobar.com/docs/source-reference.md#history) and [sparkline readings](https://legatobar.com/docs/mapping-sparklines.md#sparkline-readings) keep nothing from it. A rate limit the response's headers announce still holds.
- `fail` goes in `sources.`, since it decides for every card on the source; a card's `failed` says what one status card shows after several failures. Only HTTP sources take it: calendars, reminders and History are read on this Mac.
- Adding `fail` to a source that [collects](https://legatobar.com/docs/source-reference.md#history) keeps its history as it is: the same rows and the same history in Settings → History.
- **Preview Source** shows an answer that `fail` turns down, with the reason above the cards.
- **A GraphQL answer can carry data and errors together**, such as one repository it couldn't read in a list of twenty. A rule on `errors` alone then holds the whole page on its last answer. Fail only when something every good answer has is missing: `{ "all": [ { "path": "errors", "exists": true }, { "path": "data.viewer.repositories", "exists": false } ] }`.
| Service | `fail` |
| --- | --- |
| GitHub GraphQL, Linear | `{ "when": { "path": "errors", "exists": true }, "message": "errors[0].message" }` |
| Cloudflare | `{ "when": { "path": "success", "equals": false }, "message": "errors[0].message" }` |
| Parcel | `{ "when": { "path": "success", "equals": false }, "message": "error_message" }` |
| Tautulli | `{ "when": { "path": "response.result", "not": "success" }, "message": "response.message" }` |
| SABnzbd | `{ "when": { "path": "status", "equals": false }, "message": "error" }` |
With [named requests](https://legatobar.com/docs/source-requests.md#requests-and-formats), the path starts with the request's name: `gql.errors[0].message`, or `{ "any": [ … ] }` over several.
### Rate limits and unchanged responses
- **Server-requested waits.** Legato honors `Retry-After` as seconds or an HTTP date on HTTP 429, on 503 when it carries `Retry-After`, and on 403 responses carrying rate-limit signals. A 503 without `Retry-After` is an ordinary failure and backs off as usual. Ordinary permission-denied 403 responses are treated as errors, not quota signals. A recognized rate-limit refusal without a usable deadline waits at least 60 seconds.
- **Exhausted quotas.** When `X-RateLimit-Remaining` or `RateLimit-Remaining` reaches 0, Legato waits for the matching `X-RateLimit-Reset` or `RateLimit-Reset`. Services send that in different forms, and Legato reads any of them: a delay in seconds, a Unix timestamp (any number from 1,000,000,000 up), an HTTP date or an ISO 8601 date. A successful response can therefore postpone the next poll too. Where several hints apply, Legato keeps the latest deadline, but no hint holds a source back for more than 24 hours.
- **Shared waits.** Sources using the same origin and configured credentials share the cooldown. Polling, **Fetch Once** and buttons respect it; an early request shows when it can try again. Rate-limited button and checklist-row commands are never replayed automatically. After the wait, click the button or tick the row again if you still want the action.
- **Conditional GETs.** For eligible GET requests, Legato retains the response and its ETag or Last-Modified validator in memory. A later request sends `If-None-Match` or `If-Modified-Since`; HTTP 304 reuses that response and reevaluates the current mappings and derived values. It does not fetch a full body again.
- **Cache boundaries.** POST reads and button requests are not cached. Cached responses are separated by URL and request headers, including authentication; changing credentials does not reuse another credential's data. `no-store` and `Vary: *` prevent storage. This is not an offline cache: reuse requires a server's 304 response, and the cache is lost when the app closes.
---
# Calendar and Reminders
## Calendar sources
A source with `"kind": "calendar"` reads every calendar on this Mac, the ones in Calendar's sidebar whether they're ticked or not, through macOS itself. Nothing is fetched from the internet and nothing leaves the Mac. It suits a page an agent writes for you, such as "my next meeting, with a Join button", next to everything else in the panel. [Examples/pages/calendar.json](https://legatobar.com/examples/calendar.json) is a complete page:
```json
"sources": { "calendar": { "kind": "calendar", "window": "month", "every": "5m" } },
"cards": [
{ "id": "up", "type": "countdown", "label": "Next up", "at": "2026-01-01T00:00:00Z",
"source": { "ref": "calendar",
"map": { "label": "up.title", "at": "up.at", "detail": "up.detail" },
"empty": { "when": { "path": "has_up", "equals": false }, "text": "No timed events coming up" } },
"actions": [ { "kind": "open", "label": "Join", "icon": "video.fill", "url": "{up.join}", "prominent": true,
"when": { "path": "up.has_join", "equals": true } } ] },
{ "id": "month", "type": "month", "days": 7, "hide_empty_days": true, "max_events": 7, "items": [],
"source": { "ref": "calendar",
"map": { "items": { "each": "agenda", "limit": 300, "fields": {
"title": "title",
"start": { "if": { "path": "all_day", "equals": true }, "then": "start_date", "else": "start" },
"end": { "if": { "path": "all_day", "equals": true }, "then": "end_date", "else": "end" },
"detail": "location", "url": "join", "color": "color" } } } },
"actions": [ { "kind": "add-event", "label": "New Event", "icon": "calendar.badge.plus" } ],
"actions_placement": "corner" }
]
```
The `month` card is a [`month`](https://legatobar.com/docs/card-time.md#month): this month as a grid, a dot in each calendar's colour on the days with events, and under it the chosen day (today until you click another) and the six after it, leaving out empty days, seven events at a time. `days` goes up to 30, to list the month ahead. `agenda` lists events in order and `limit` keeps the first so many, so size `limit` for your calendar: about 72 days are read, and a busy calendar may need up to the card's 300. The arrows beside the month's name page to other months, up to 12 either way: the source then reads that month too, so the card has its events.
Only `agenda` and `agenda_count` follow the month on screen; `up`, `next`, `today` and `events` stay with now, so a **Next up** card on the same source doesn't move.
Each row has a line at now, a **Join** button on the meeting under way, and its calendar's colour, as Calendar shows it. Change a calendar's colour in Calendar and the card follows. All-day events pass their dates (`start_date`, `end_date`) rather than moments, so they stay on their day.
For a list of the days ahead instead, use an [`agenda`](https://legatobar.com/docs/card-time.md#agenda) with `days` (up to 7) and a `window` that covers them: `"window": "3d"` with `"days": 3`, mapping `items` from `agenda` the same way.
| Field | Required? | Meaning |
| --- | --- | --- |
| `kind` | yes | `calendar`. |
| `window` | no | How far ahead to look, in hours or days from `1h` to `7d`, or `month` for a month card: the six weeks it shows, and the 30 days after them for its list (`days`). Default `2d`. |
| `calendars` | no | Calendar names to include, as Calendar shows them. Default: every calendar. |
| `every` | no | A safety refresh, default `5m`. The source also refreshes within seconds of a change in any calendar, when an event starts or ends, at midnight and when the time zone changes. |
| `derive` | no | As for any source. |
The answer, which `map` reads:
| Path | What it is |
| --- | --- |
| `up` | What the panel should show now: the event under way, else the next one. `title`, `at` (its end while under way, else its start, for a `countdown`), `detail` (how long, or "Now · until 10:45 AM", and where), `join`, `has_join`, `in_progress`, `calendar`. Null when nothing is coming. |
| `has_up` | Whether there is an `up`. |
| `next`, `current` | The next event to start, and the one under way, or null. |
| `today` | Every event today, including those already over (`past: true`). |
| `events` | What's under way or still to come within `window`. |
| `agenda` | Every event on every whole day `window` touches, including those already over: for an `agenda` or `month` card. With `"window": "2d"` at 10 AM, that's all of today, tomorrow and the day after. With `"window": "month"`, the grid's six weeks and the 30 days after them, so a month card's `days` list has its events; `events` still stops at the grid. |
| `today_count`, `agenda_count`, `busy_minutes_today`, `busy_today` | How many events today and in `agenda`, and the time booked today, with overlaps counted once (`busy_today` is formatted, such as "2h 45m"). |
| `empty` | "Nothing in the next 2 days", worded for `window` ("Nothing this month" for `month`). |
Each event has `title`, `start` and `end` (ISO 8601 with this Mac's offset), `all_day`, `time` ("9:30 AM" or "All day"), `time_range`, `day` ("Today", "Tomorrow", "Fri, Oct 30"), `location`, `join`, `has_join`, `calendar`, `color` (`#RRGGBB`), `in_progress` and `past`. All-day events also carry `start_date` and `end_date` (the last day, inclusive), since they belong to a date wherever the Mac is. Declined and cancelled events are left out. Times and day names follow this Mac's time zone and language.
`join` is a video-call link found in the event's URL, then its location, then its notes: Zoom, Google Meet, Microsoft Teams, Webex, FaceTime, Whereby, Chime, GoTo, Slack huddles and Discord. A link counts only when its host is the service's own (so `evilzoom.us` doesn't) and its path is a meeting's, and only over https. Links wrapped by Outlook SafeLinks or Google are unwrapped first.
**Add Event.** A button with `"kind": "add-event"`, on a card whose source is a calendar source, opens a **New Event** form in the panel, starting now. On a [`month`](https://legatobar.com/docs/card-time.md#month) card with another day chosen, it starts on that day instead, at the same time.
The button can fill it in: a `title` of 1–80 characters (a template filled from the answer, or plain text; default blank, and the form won't add the event until it has one), a `duration` from `5m` to `12h` (default `1h`), and a `calendar` by name (default: the calendar Calendar adds new events to).
The form also takes a location, all-day, the start and end, repeat (every day, weekday, week, two weeks, month or year), the calendar, an alert, a URL (`https://` is added when it's typed without one) and notes; **Add** (or Return) saves it and the card shows it at once. Unlike other buttons, it stays on a card that has nothing to show, since a free day is when it's wanted.
Run from Shortcuts, the button adds the event as its settings say, with no form (titled "New Event" when it sets no title); chosen in Spotlight, it opens the form on its page.
**Calendar access.** The first time a calendar source runs, its first card says what it would show and offers **Allow Calendar Access**, which brings up macOS's prompt; Legato never asks at launch. If access was turned off, the card offers **Open Privacy Settings** instead. If Legato may only add events, the card offers **Allow Full Access**; if an organization manages access, the card says so. Other cards on the same source wait for the first.
## Reminders sources
A source with `"kind": "reminders"` reads this Mac's reminders, the ones Reminders shows, through macOS itself, and a checklist row can check one off. Nothing leaves the Mac. The smallest page is a count and a checklist:
```json
"sources": { "reminders": { "kind": "reminders", "show": "overdue+today" } },
"cards": [
{ "id": "due", "type": "stat", "label": "Due today", "value": 0,
"source": { "ref": "reminders", "map": { "value": "today_count",
"delta": { "if": { "path": "overdue_count", "gt": 0 }, "then": { "template": "{overdue_count} overdue" }, "else": { "template": "None overdue" } } } } },
{ "id": "todo", "type": "checklist", "label": "Today and overdue", "mark": "fill", "items": [],
"source": { "ref": "reminders",
"map": { "items": { "each": "items", "limit": 20, "fields": { "text": "title", "detail": "detail", "done": "done" } } },
"empty": { "when": { "path": "count", "equals": 0 }, "text": "{empty}" } },
"itemAction": { "kind": "complete-reminder", "label": "Complete", "icon": "checkmark" } }
]
```
| Field | Required? | Meaning |
| --- | --- | --- |
| `kind` | yes | `reminders`. |
| `show` | no | `overdue`, `today` or `overdue+today` (the default), in `items`. `dashboard` and `all` answer differently (below). A reminder due on a date is overdue from the next day; one due at a time, from that time, as in Reminders. |
| `lists` | no | Reminders list names to include, as Reminders shows them. Default: every list. |
| `list_ids` | no | Lists to include by id, a `lists` row's `id`, with `show` `dashboard` or `all`. A list's page takes it from its link: `"list_ids": ["{param.list}"]`. Not with `lists`. |
| `days` | no | With `dashboard`: how many days after today `upcoming` reaches, 1 to 31. Default 7. |
| `completed_days` | no | With `dashboard`: how many days `completed` and `by_day` cover, today included, 1 to 31. Default 7. |
| `every` | no | A safety refresh, default `5m`. The source also refreshes within seconds of a change in Reminders, when a timed reminder falls due, at midnight and when the time zone changes. |
| `derive` | no | As for any source. |
The answer has `items`, oldest first (on one day, reminders without a time before timed ones), and `count`, `overdue_count`, `today_count` and `empty` ("All caught up").
Each item has `id`, `title`, `line` (the title, with when it's due after it when that says something: "Call vet · 9:30 AM", "Pay rent · Yesterday", and just "Water plants" for one due today with no time), `due` (ISO 8601, or null for a reminder due on a date), `due_date`, `all_day`, `time` ("9:30 AM", or empty), `when` ("Today 9:30 AM", "Mon, Oct 26"), `due_text` (what `line` adds), `list`, `color` (the list's, `#RRGGBB`), `overdue`, `today`, `priority` (`high`, `medium`, `low` or `none`), `repeat` (how often it repeats: "Daily", "Weekly", "Monthly", "Yearly" or "Every 10 days", "Every 3 weeks"; a rule on set weekdays still reads "Weekly"; empty when it doesn't repeat), `detail` (the line Reminders shows under a title: `due_text`, `list` and `repeat`, those that say something, joined with " · ", such as "9:30 AM · Home · Weekly"; map it to a checklist item's `detail`), `notes`, `url` and `done` (always false, for a checklist's `done`).
With the first three shows, only incomplete reminders with a due date are read.
**A whole overview: `show: "dashboard"`.** One read of every open reminder and those completed lately, for the [Reminders](https://legatobar.com/services/reminders) pages:
- `due`: today's reminders (without a time first, then by time, including those whose time has passed), then earlier overdue days, newest first. Each reminder once. `due_count`, `today_count`, `overdue_count`.
- `upcoming`: due in the `days` after today, by day. `upcoming_count`.
- `undated`: no due date, the oldest made first. `undated_count`.
- `lists`: every list, the most open reminders first, each with `id`, `title`, `color`, `open`, `overdue` (those due before today, the ones under Overdue) and `detail` ("8 open · 2 overdue", "None open"). `list_count`.
- `completed`: completed in the last `completed_days`, newest first, each with `id`, `title`, `list`, `list_id`, `color` and `completed` (ISO 8601, for `|ago`). `done_count`, `done_today`, and `by_day`: one `{label, date, count}` per day, oldest first, for a `columns` card.
**One list: `show: "all"`.** Every open reminder in `items`, overdue (oldest first), today, later, then undated, with `count`, `list_title` (for the page's `title_from`) and `empty`, which says so when the list is gone.
Rows from these two shows add `list_id`, `group` (the heading they go under: Today, Overdue, Tomorrow, "Thu, Nov 19", Upcoming or No date; map it to a checklist's `section`), `day` ("Today", "Mon, Oct 26", empty with no date), `info` (day, time and list: "Today · 9:30 AM · Home"), `info_short` (without the list), `repeats` (true or false, for a repeat badge) and `priority_mark` (`!!!`, `!!`, `!` or empty, as Reminders puts before a title). An undated row has a null `due` and `due_date`.
Ticking a repeating reminder does what Reminders does: the occurrence is kept as completed and the reminder moves to its next date, with the same `id`. Ticking from one card reads every reminders source again, so another page showing the same reminder catches up at once.
Sections, tags, flags, subtasks and a list's own order aren't available to apps, so a page can't show or filter by them. A subtask is an ordinary reminder in its list.
A checklist on a reminders source can carry `"itemAction": { "kind": "complete-reminder", "label": "Complete" }`: ticking a row marks it done at once (with `"mark": "fill"`, its circle fills, as in Reminders), and after a moment marks that reminder done in Reminders and fades the row out. Ticking it again during that moment undoes it, and nothing changes in Reminders. (Every checklist row action waits the same way.) It finds the reminder by the row's `id`. `complete-reminder` works only as a checklist's `itemAction` on a reminders source, not as a button.
**Reminders access.** It's a separate permission from Calendar. The first read's card offers **Allow Reminders Access**, which brings up macOS's prompt; if access was turned off, **Open Privacy Settings**.
---
# Worked examples
Each example is a complete small page. Connection settings live once under `sources`, and each card has only `ref` and `map`. The [example pages](https://legatobar.com/docs/source-examples.md#example-pages) add more cards and controls.
### A feed: the latest posts, each linking to its page
Any blog, news site or release page with an RSS, Atom or JSON feed works with `"format": "feed"`. The answer is the same shape for all three: the feed's `title` and `url`, a `count`, and `items` in the feed's order (newest first, in almost every feed; a feed of more than 200 keeps its 200 newest), each with `title`, `url`, `published` (ISO 8601, UTC), `author`, `summary` (plain text, up to 300 characters) and `id` when the entry has them.
A [`list`](https://legatobar.com/docs/card-lists.md#list) card's rows can be objects with a link and a detail, so each post opens when it's clicked:
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "Apple Developer News",
"icon": "newspaper",
"sources": {
"news": {
"url": "https://developer.apple.com/news/rss/news.rss",
"auth": { "type": "none" },
"format": "feed",
"every": "1h"
}
},
"cards": [
{ "id": "latest", "type": "list", "label": "Latest",
"source": { "ref": "news",
"map": { "items": { "each": "items", "limit": 8,
"fields": { "text": "title", "url": "url",
"detail": { "template": "{published|ago}" } } } } } }
]
}
```
`{published|ago}` puts "2h ago" at each row's right; a post without a date gets a dash. For newest first in a feed that isn't, add `"sort": { "by": "published", "order": "desc" }`.
An address that answers with a web page rather than a feed fails with "didn't send an RSS, Atom or JSON feed": use the feed's own address, usually linked from the site as RSS or found at `/feed`, `/rss` or `/atom.xml`.
A feed that arrives cut off, or with broken XML, fails with "stopped partway through" or "has an XML error on line N"; the card keeps what it last showed and tries again at the next refresh.
### Several feeds in one place: tabs
A [`tabs`](https://legatobar.com/docs/card-text.md#tabs) card shows one of its tabs at a time, so several feeds share the room one takes. Each card in a tab has its own `source`, just as a card on the page does; the `tabs` card itself has none. [Examples/pages/reading.json](https://legatobar.com/examples/reading.json) puts Hacker News, Apple's developer news and the Swift blog in three tabs:
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "Reading",
"icon": "newspaper",
"sources": {
"hn": { "url": "https://hnrss.org/frontpage", "auth": { "type": "none" }, "format": "feed", "every": "30m" },
"apple": { "url": "https://developer.apple.com/news/rss/news.rss", "auth": { "type": "none" }, "format": "feed", "every": "1h" },
"swift": { "url": "https://www.swift.org/atom.xml", "auth": { "type": "none" }, "format": "feed", "every": "6h" }
},
"cards": [
{ "id": "feeds", "type": "tabs",
"tabs": [
{ "label": "Hacker News",
"cards": [
{ "id": "hn", "type": "list", "label": "Front page", "style": "numbered",
"source": { "ref": "hn",
"map": { "items": { "each": "items", "limit": 10,
"fields": { "text": "title", "url": "url", "detail": { "template": "{published|ago}" } } } } } }
] },
{ "label": "Apple",
"cards": [
{ "id": "apple", "type": "list", "label": "Developer news",
"source": { "ref": "apple",
"map": { "items": { "each": "items", "limit": 8,
"fields": { "text": "title", "url": "url", "detail": { "template": "{published|ago}" } } } } } }
] },
{ "label": "Swift",
"cards": [
{ "id": "swift", "type": "list", "label": "Swift.org blog",
"source": { "ref": "swift",
"map": { "items": { "each": "items", "limit": 8,
"fields": { "text": "title", "url": "url", "detail": { "template": "{published|ago}" } } } } } }
] }
] }
]
}
```
Every source keeps polling whichever tab is showing, so a status card in a tab out of sight still counts toward the page's status and notifies. Buttons and row actions go on the cards in the tabs, as they would on the page.
### Pi-hole v6: a sign-in and three requests
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "Pi-hole",
"sources": {
"pihole": {
"url": "http://pi.hole",
"secret": "pihole",
"every": "1m",
"auth": {
"type": "login",
"request": {
"method": "POST",
"path": "/api/auth",
"body": {
"password": "{secret}"
}
},
"token": "session.sid",
"send": {
"header": "X-FTL-SID"
},
"logout": {
"method": "DELETE",
"path": "/api/auth"
}
},
"requests": {
"summary": "/api/stats/summary",
"blocking": "/api/dns/blocking",
"top_blocked": "/api/stats/top_domains?blocked=true&count=10"
}
}
},
"cards": [
{
"id": "queries",
"type": "stat",
"label": "Queries today",
"source": {
"ref": "pihole",
"map": {
"value": "summary.queries.total"
}
}
}
]
}
```
The secret can be an app password from Pi-hole's Settings → Web interface / API. [Pi-hole in your Mac's menu bar](https://legatobar.com/services/pi-hole) has five linked pages built this way, sharing one sign-in, with a button to pause and resume blocking, and how to set them up.
### Uptime Kuma: metrics grouped per monitor
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "Home lab",
"sources": {
"kuma": {
"url": "https://kuma.example.com",
"secret": "kuma",
"every": "1m",
"auth": {
"type": "basic"
},
"requests": {
"monitors": {
"path": "/metrics",
"format": "prometheus",
"group_by": "monitor_id",
"split_by": [
"window"
]
}
},
"derive": [
{
"name": "problems",
"value": {
"count": "monitors",
"where": {
"path": "monitor_status",
"not": 1
}
}
}
]
}
},
"cards": [
{
"id": "services",
"type": "fleet",
"label": "Services",
"source": {
"ref": "kuma",
"map": {
"items": {
"each": "monitors",
"where": {
"path": "monitor_type",
"not_in": [
"push",
"dns",
"group"
]
},
"fields": {
"name": "monitor_name",
"state": {
"path": "monitor_status",
"values": {
"1": "ok",
"0": "critical",
"2": "warning",
"3": "off"
},
"default": "unknown"
},
"detail": {
"template": "{monitor_response_time} ms · {monitor_uptime_ratio_1d|percent} in 24 hours"
}
}
}
}
}
}
]
}
```
The secret is an API key from Kuma's Settings → API Keys. Once Kuma has an API key, it accepts only keys.
### Home Assistant: one template for the whole page
Rather than download every entity, ask Home Assistant to render one small JSON answer with exactly what the page needs:
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "Home",
"sources": {
"home": {
"url": "http://homeassistant.local:8123/api/template",
"secret": "home-assistant",
"every": "1m",
"method": "POST",
"body": {
"template": "{{ {\"kitchen\": states('light.kitchen_main_lights'), \"lights_on\": states.light | selectattr('state','eq','on') | map(attribute='name') | list} | tojson }}"
}
}
},
"cards": [
{
"id": "kitchen",
"type": "stat",
"label": "Kitchen",
"source": {
"ref": "home",
"map": {
"value": {
"path": "kitchen",
"values": {
"on": "On",
"off": "Off"
},
"default": "Unavailable"
}
}
}
}
]
}
```
The secret is a long-lived access token from your Home Assistant profile → Security. Buttons call services on the same host: `/api/services/light/turn_off`.
## Example pages
These example pages show named sources at work. Replace the example hosts, VIN, Rachio IDs and Home Assistant entity IDs with your own before you use one:
| Page | Built from | Shows | Buttons |
| --- | --- | --- | --- |
| [GitHub starter](https://legatobar.com/examples/github-starter.json) | Public JSON API, no key | Repository stars and forks | none |
| [GitHub](https://legatobar.com/examples/github.json) | Classic token, GraphQL and REST, `fail` for GraphQL errors, one page for every repository (`owner`, `repo`) titled from the answer | Review requests, your pull requests, notifications, CI on each default branch, a year of contributions (`heatmap`), each repository's numbers and runs | Mark all read; Re-run failed jobs (`{answer.…}`, asks first) |
| [Calendar](https://legatobar.com/examples/calendar.json) | This Mac's calendars (`kind: calendar`), no key | The meeting under way or next, with a countdown; the month with a dot for each calendar's events, and the week ahead under it | Join (opens the meeting's link), New Event (opens a form to add one) |
| [Reminders](https://legatobar.com/examples/reminders.json) | This Mac's reminders (`kind: reminders`), no key | Due, Upcoming and No date to tick off, each list with its counts, what you've completed | Complete (checks the reminder off in Reminders) |
| [Reading](https://legatobar.com/examples/reading.json) | Three public feeds (`format: feed`), no key | Hacker News, Apple's developer news and the Swift blog, one tab each, every post a link | none |
| [Pi-hole](https://legatobar.com/examples/pihole.json) | Login sign-in shared by five linked pages, derived hourly history | Blocking status, the last 24 hours, each hour's traffic, top domains; Queries, Clients, Local DNS and Servers pages | Pause (a menu of lengths), Resume blocking |
| [AdGuard Home](https://legatobar.com/examples/adguard-home.json) | Basic sign-in shared by five linked pages, name-keyed lists as rows (`entries`), names from another request (`lookup`) | Protection, queries per hour, the last 24 hours, top domains; Queries, Clients, Blocklists and Local DNS pages | Pause (a menu of lengths), Resume, Safe Browsing and parental switches, Clear DNS cache, Update the lists |
| Home lab | Basic sign-in, Prometheus metrics, derived values | Overall health, services, jobs and backups, DNS, slowest responses, certificates | none |
| [Tesla](https://legatobar.com/examples/tesla.json) | Bearer token (Tessie), one request | Doors, battery, range, charging, temperatures, tire pressures | Lock, Start climate, Stop climate |
| [Sprinklers](https://legatobar.com/examples/rachio.json) | Bearer API key (Rachio), one request, derived counts | Controller status, rain sensor, enabled zones | Water a zone for 10 minutes, Stop watering |
| [Lunch Money](https://legatobar.com/examples/lunch-money.json) | Bearer token, sums over a list of accounts | Bank connections, cash, credit cards, balances by type | Sync banks |
| [Budget](https://legatobar.com/examples/ynab.json) | Bearer token (YNAB), the current month | Ready to assign, overspent categories, what's left in the biggest categories | none |
| [Todoist](https://legatobar.com/examples/todoist.json) | Bearer token, filter requests joined in order, parent and section names from other requests (`lookup`), one page for every project (`params`), a sort by two paths, a note when an answer is cut short | Due, Upcoming and the Inbox to tick off; open tasks per project; completions each day | Complete a task from its row |
| [Parcel](https://legatobar.com/examples/parcel.json) | `api-key` header, two requests shared by both pages, a sort by a derived rank then a date, one page for every package (`params`) found across both lists | What needs attention first, then what's on the way by expected day; recent deliveries; each package's tracking history | none |
| [Plex](https://legatobar.com/examples/plex.json) | `X-Plex-Token` header | Now playing with posters, Recently added, libraries with counts, whether the server answers | Stop on each stream (Plex Pass) |
| [Sonarr](https://legatobar.com/examples/sonarr.json) | `X-Api-Key` header, a sort by a derived rank, a size Sonarr doesn't know yet left out | Sonarr's own health checks, the download queue with posters, the week's episodes, recently missing episodes, library counts | Remove on each download, Search on each missing episode |
| [Radarr](https://legatobar.com/examples/radarr.json) | `X-Api-Key` header, three release dates joined into one agenda | The same as Sonarr, for films, with a month of cinema, digital and disc releases | Remove on each download, Search on each missing film |
| [Portainer](https://legatobar.com/examples/portainer.json) | `X-API-Key` header, Docker through Portainer's proxy, a sort by four filtered lists, a Keep running list (optional; without it every container has Stop), one page for every container (`params`) with History samples | Every container's state, what needs you, the running count, host facts; each container's CPU, memory and health checks | Start and Restart on each row; Start, Stop and Restart on a container's page |
| Home | Bearer token, one Home Assistant template | Alarm, water main, thermostat, doors and windows, safety sensors, lights | Room lights and scenes, shades, Apple TV, All lights off |
## Services you may already use
These consumer APIs were checked against their documentation on 2026-10-20. Each takes a token Legato can send and answers in JSON, so a page can read it without a script. The example pages above use them.
| Service | Signing in | Where to get the token | API docs |
| --- | --- | --- | --- |
| Tessie (for a Tesla) | `bearer` | Tessie settings → API | [developer.tessie.com](https://developer.tessie.com/reference/authentication) |
| Rachio | `bearer` | Rachio app → Profile → API key | [rachio.readme.io](https://rachio.readme.io/reference/authentication) |
| Lunch Money | `bearer` | my.lunchmoney.app/developers | [lunchmoney.dev/v2](https://lunchmoney.dev/v2/overview) |
| YNAB | `bearer` | Account settings → Developer settings → personal access token | [api.ynab.com](https://api.ynab.com/) |
| Todoist | `bearer` | Settings → Integrations → Developer → API token | [developer.todoist.com/api/v1](https://developer.todoist.com/api/v1/) |
| Parcel (Premium) | `{ "type": "header", "name": "api-key" }` | web.parcelapp.net → API key | [parcelapp.net/help](https://parcelapp.net/help/api-view-deliveries.html) |
| Jellyfin, Emby | `{ "type": "header", "name": "Authorization", "value": "MediaBrowser Token=\"{secret}\"" }` | Dashboard → API Keys (Emby: Settings → Advanced → API Keys) | [api.jellyfin.org](https://api.jellyfin.org) |
| Open-Meteo | None (free for non-commercial use) | Nothing to get | [open-meteo.com/en/docs](https://open-meteo.com/en/docs) |
| OpenWeather (One Call 3.0) | `{ "type": "query", "name": "appid" }` | openweathermap.org → My API keys, with **One Call by Call** subscribed | [openweathermap.org/api/one-call-3](https://openweathermap.org/api/one-call-3) |
| Plex Media Server | `{ "type": "header", "name": "X-Plex-Token" }` | Plex's [authentication token guide](https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/) | [developer.plex.tv/pms](https://developer.plex.tv/pms/) |
Notes for each:
- **Tessie.** Replace each `YOUR_VIN` with your car's VIN. A command such as `/command/lock` answers `{ "result": true }`, which the page's `success` condition checks; the car may need to wake first.
- **Rachio.** IDs can't come from an earlier answer, so look yours up once: `GET https://api.rach.io/1/public/person/info` gives your person ID, and `GET /1/public/person/{id}` lists your devices and zones. Put them in place of `YOUR_DEVICE_ID` and `YOUR_ZONE_ID`. Rachio allows 3,500 requests a day.
- **Lunch Money.** Account balances need no dates. A monthly budget or spending summary does: `/v2/summary` requires a start and end date, which [`{date.month_start}` and `{date.month_end}`](https://legatobar.com/docs/source-requests.md#dates-in-requests) fill in. `balance` is a string; add up `to_base`, which is a number. **Sync banks** can run once a minute.
- **YNAB.** `last-used` stands for your most recent plan, and `months/current` for this month. Amounts are in milliunits; the example uses the `_currency` and `_formatted` fields YNAB adds beside them. YNAB allows 200 requests an hour per token.
- **Todoist.** Two pages, set up on [Todoist's own page](https://legatobar.com/services/todoist): download [todoist.json](https://legatobar.com/examples/todoist.json) and [todoist-project.json](https://legatobar.com/examples/todoist-project.json), and keep their IDs, since each project on the overview opens `todoist-project?project=`, one page for every project. Today, overdue, upcoming (`7 days & !today & !overdue`) and the Inbox are each their own filter; Due joins today's and the overdue ones in that order, so old overdue tasks never jump ahead. A task's parent comes from every open task by `lookup`, for a subtask's `↳ Parent` line. A project's tasks come in no order, so the page sorts them by `["section.order_key", "order_key"]`, as Todoist shows them. Filters and lists are paged and Legato doesn't follow `next_cursor`, so the page checks for one: when an answer has more, a note links to Todoist and project counts say "At least". On the free plan the activity log behind **Recently completed** keeps only a short history.
- **Parcel.** Set up on [Parcel's own page](https://legatobar.com/services/parcel): download [parcel.json](https://legatobar.com/examples/parcel.json) and [parcel-package.json](https://legatobar.com/examples/parcel-package.json), and keep the ID `parcel-package`, since each row opens `parcel-package?n=&brand=`. Parcel has no request for one package, so that page reads the same two lists as the overview and keeps the one whose `tracking_number` matches. An answer can be a 200 with `"success": false`, so the pages check `success` before calling the list empty. Parcel answers from its own cache and allows 20 requests an hour; every 30 minutes is plenty. Packages also keeps each delivery in [History](https://legatobar.com/docs/history.md) as `parcel-deliveries`, for the Delivery times pages to read.
- **Plex.** Plex answers in XML unless asked for JSON. Legato sends `Accept: application/json` already, so don't override it. Use the server's local address over plain HTTP (`http://:32400`) with **Secure connections** set to Preferred; an `https://` address by IP fails certificate checks. Use a token that doesn't expire: Plex's newer JWT tokens last 7 days and need a refresh Legato can't do. Don't trade a classic token for a JWT one: Plex retires the classic token when you do. The [Plex page](https://legatobar.com/services/plex) has the details.
- **Sonarr and Radarr.** Both answer on `/api/v3` with the key from **Settings → General** in an `X-Api-Key` header. Behind a reverse proxy at a path, keep the path out of `url` and put it in `base` (`"base": "/sonarr"`), so request, button and poster paths all get it. The [Sonarr](https://legatobar.com/services/sonarr) and [Radarr](https://legatobar.com/services/radarr) pages have the details.
- **Portainer.** Portainer CE reaches Docker for you: `/api/endpoints//docker/…` is Docker's own API. CE has no read-only role, so any token can stop containers, and no check for newer images. The [Portainer page](https://legatobar.com/services/portainer) has the details.
These didn't fit, so use a script or agent that [writes the page](https://legatobar.com/docs/page-writing.md#writing-a-page) with the data it fetched:
- **Oura.** Personal access tokens were retired in December 2025. The API now needs OAuth, with tokens that expire.
- **Philips Hue.** The bridge's v2 API needs HTTPS with the bridge's own certificate, which macOS doesn't trust. The v1 API puts the key in the URL path, and the remote API needs OAuth.
---
# Troubleshooting
| What you see | Check |
| --- | --- |
| No page | Confirm Legato is running, the file is inside `~/Library/Application Support/Legato/Pages/`, and its name ends in `.json` and doesn't start with a dot. Choosing a file in Source Preview previews it without installing it. If the page still doesn't appear, read its [status file](https://legatobar.com/docs/page-loading.md#status-files). After the trial, pages show again once there's a [license](https://legatobar.com/docs/license.md). |
| No editor suggestions | Use a JSON Schema-aware editor, keep the `$schema` line, and open Legato to install `Pages/.schemas/page.schema.json`. If editing outside Pages, adjust the schema location. |
| File or source error | Use a complete page, not a reference fragment. Check JSON syntax, the source name used by `ref`, and that every sourced card has a `map`. |
| HTTP 401 or 403 | Check the API's authentication scheme, the secret's name and host, token permissions, and required version or Accept headers. Login headers belong in `auth.request.headers`. |
| Rate limit or “asked Legato to wait” | Let the shown cooldown expire. It is shared by polling, Fetch Once and buttons for the same origin and credentials. Increase `every` if limits recur; a blocked button needs another click after the wait. |
| “Didn't send JSON” | Check the endpoint returns API JSON rather than a web page or sign-in form. Use `format: "text"` only if you want to display the entire text answer. |
| Missing or unexpected card values | Right-click the page → **Preview Source…** and preview a sample. Check mapping issues and Mapped card JSON. Named requests add a name prefix; lists evaluate paths relative to each item. |
| No usable Prometheus samples | Check `/metrics`, credentials, and the `group_by` label. HTML and empty results are not valid metric data. |
| Secret missing or unreadable | Save it for the configured host in Settings → Secrets. A different app signature or Keychain restriction may require saving it again. |
| Cards show dashes, and no error | The service may report errors in a 200 answer. Right-click the page → **Preview Source…** and Fetch Once to see it, then give the source [`fail`](https://legatobar.com/docs/source-polling.md#when-the-answer-reports-an-error). |
| A button succeeds but the card has not changed | Check the command response, any `success` condition, and subsequent source errors. An accepted command can take time to affect the device. |
---
# Mapping
A service answers in its own shape, and a card has fields of its own: a stat's `value`, a list's `items`. A sourced card's `map` joins the two. Each key is a field of the card, and each value is a rule that says where it comes from in the answer.
The simplest rule is a path, such as `summary.queries.total`. Others fill in a template, build a list from an array, count or total it, choose between two rules on a condition, or do arithmetic. `derive` works a value out once on the source, and every card that uses the source can read it.
Paths, rules and the options a list takes are all below. Four subjects have a page each:
- [Names and tables](https://legatobar.com/docs/mapping-tables.md): Answers that use names as keys or parallel arrays, and tables that need flattening or grouping.
- [Expiry and slices of time](https://legatobar.com/docs/mapping-expiry.md): Days left on a certificate or a renewal, and a long series cut into a set number of slices.
- [Conditions](https://legatobar.com/docs/mapping-conditions.md): The tests a rule, a card or a button can make on the answer.
- [Sparkline readings](https://legatobar.com/docs/mapping-sparklines.md): A sparkline of a value the service only reports as it is now.
## Derived values
`derive` works out values from the answer and adds them to it, in order, so a later one can use an earlier one, and so can `map`. Each entry is a name and a [rule](https://legatobar.com/docs/mapping.md#mapping). This source fragment assumes its named requests produce a `monitors` array:
```json
"derive": [
{ "name": "total", "value": { "count": "monitors" } },
{ "name": "problems", "value": { "count": "monitors", "where": { "path": "monitor_status", "not": 1 } } },
{ "name": "headline", "value": {
"if": { "path": "total", "equals": 0 },
"then": { "template": "No monitor data" },
"else": { "if": { "path": "problems", "equals": 0 },
"then": { "template": "All {total} up" },
"else": { "template": "{problems} of {total} need attention" } }
} }
]
```
Names are lowercase letters, digits and `_`. An answer that isn't an object is kept under `data`.
## Mapping
`map` is an object whose keys are fields of the card and whose values are rules saying where each one comes from in the answer. A key can reach into the card's own lists: `items[0].value` fills the first fact's value. Card fields have plain names, so a map key never takes quotes, and each field is named once.
A rule can also name the page: [`title_from`](https://legatobar.com/docs/detail-pages.md#titled-by-its-item) reads one against a source's answer for the panel's title row.
Paths are relative to the current JSON value. They support named object fields, dots and zero-based array indexes. They are not full JSONPath expressions or JavaScript: there are no wildcards, recursive searches or executable expressions.
| Response shape | Path or rule |
| --- | --- |
| Nested object | `owner.login` |
| Nested array item | `projects[0].tasks[1].title` |
| First item of a top-level array | `[0].name` |
| Key with spaces or punctuation | `list[0]["Resting HR"]` |
| Entire response, including plain text | `$` |
| List from an array | `{ "each": "projects[0].tasks", "template": "{title}" }` |
| List from a top-level array | `{ "each": "$", "template": "{name}" }` |
Inside `each`, paths are relative to that item and `{$}` means the item itself. Use `owner.login` for a nested field; a leading `$.` is not supported. Field names can contain letters, numbers, underscores and hyphens. Put any other key in quotes and brackets: `list[0]["Resting HR"]` or `["Sleep (h)"]`, for services such as NocoDB and Airtable that name fields the way you title columns. A quoted key can hold spaces, dots and brackets, but not `"`, `\`, `{`, `}` or `|`.
| Rule | Example | Gives |
| --- | --- | --- |
| A path | `"summary.queries.total"` | The value at that path. Paths use dots and `[n]` for array items: `top_blocked.domains[0].domain`. |
| Template | `{ "template": "{summary.clients.active} active clients" }` | Text with `{path}` filled in. A missing value becomes "—". |
| List | `{ "each": "top_blocked.domains", "fields": { "label": "domain", "value": "count" }, "limit": 5 }` | One item per array element, built from `fields` (or one string per element, with `"template"` instead of `fields`, or one list per element, with `"cells"`, for a [table's rows](https://legatobar.com/docs/card-lists.md#table)). Paths inside are relative to the element; `{$}` is the element itself. |
| List of numbers | `{ "each": "data", "where": { "path": "cpu", "gte": 0 }, "value": { "path": "cpu", "scale": 100, "round": 1 }, "buckets": 144 }` | One value per element, from the rule in `value`: a sparkline's `points`. An element the rule gives nothing for is left out, so give the sparkline's `labels` rule the same `where` and `buckets`, and the two stay the same length. `buckets` (2 to 240) keeps at most that many by gathering neighbours into runs of near-equal length: a `value` list averages each run, and a `template` or `fields` list reads its last element. A day of one-minute readings in 144 buckets is one point per 10 minutes. With `"running": true` each number is the total so far, for a month-to-date line; see [Calendar days](https://legatobar.com/docs/mapping-expiry.md#calendar-days). |
| Aggregate | `{ "count": "lights_on" }`, `{ "avg": "monitor_response_time", "of": "monitors" }` | `count` an array, or `sum`, `avg`, `min`, `max`, `first`, `join` or `worst` one field over the array in `of`. `join` takes a `separator` (", " by default). `worst` is the worst state among them: see [Slices of time](https://legatobar.com/docs/mapping-expiry.md#slices-of-time). |
| Condition | `{ "if": { "path": "problems", "equals": 1 }, "then": …, "else": … }` | One rule or the other. Without `else`, nothing when the condition fails. |
| Arithmetic | `{ "add": ["bank_cash", "manual_cash"] }`, `{ "subtract": ["assets", "debts"] }` | `add`, `subtract`, `multiply` or `divide` 2 to 8 sides, each a rule or a number. `subtract` and `divide` go left to right. A side that's missing or not a number, or a division by zero, leaves the result missing, so `default` applies. |
| Month elapsed | `{ "month_elapsed": true }` | How far through this calendar month now is, from 0 to 1: the 24th of a 30-day month is about 0.78. For a pacing card's `elapsed` on a page without a [period](https://legatobar.com/docs/periods.md). |
| Since | `{ "since": "StartedAt" }` | Gives seconds from a moment to now. The input can also be a rule. Reads ISO 8601, Unix seconds or milliseconds. Future moments give negative numbers. Missing or unreadable dates and years before 1970 give no value, so `default` applies. Supports `scale`, `round` and the other adjusters. |
| Expiry | `{ "expires": { "days": "cert_days" }, "warning": 14, "as": "state" }` | A state, words or days for something that expires: see [Expiry](https://legatobar.com/docs/mapping-expiry.md#expiry). |
A list's `each` can also be 2 to 4 paths, joined in order before `where`, `sort` and `limit` apply, for a service that splits one kind of thing across requests. A path among them that holds one object, such as a car's state now, counts as one row, so a story of drives and charges can begin with how the car is now. Lunch Money keeps linked and manual accounts apart; this lists every credit card from both, largest balance first:
```json
{ "each": ["banks.plaid_accounts", "manual.manual_accounts"], "where": { "path": "type", "equals": "credit" },
"sort": { "by": "to_base", "order": "desc" }, "limit": 20, "fields": { "label": "display_name", "value": "to_base" } }
```
A path with no array in the answer is skipped; with none at all, the card keeps its last value.
Lists and aggregates take the same options for choosing elements:
- `entries`: `true` turns each element that's an object into one row per field, `{ "key", "value" }`, before anything else. See [Names as keys](https://legatobar.com/docs/mapping-tables.md#names-as-keys).
- `lookup`: each element's match in another array, attached as a field before the other options apply. See below.
- `where`: a [condition](https://legatobar.com/docs/mapping-conditions.md#conditions) each element must meet, with paths relative to the element.
- `flatten` and `group`: after `where`, each element's own list in its place, then rows gathered by a value they share. See [Turning a table round](https://legatobar.com/docs/mapping-tables.md#turning-a-table-round).
- `sort`: a path to sort by, or `{ "by": path, "order": "desc" }`. `by` can also be 2 to 4 paths, each breaking the ties of those before it: Todoist's tasks sort by `["section.order_key", "order_key"]`, their section's place and then their own. Rows that tie on every path keep their order.
- `collapse`: after `sort`, a path to a value. A row whose value there is the same as the row kept before it is left out, and so is a row with no value there. Text matches with spaces trimmed and case ignored. Only neighbours count, so scans in Reno, Boise and Reno again keep all three. A map card's [route](https://legatobar.com/docs/card-lists.md#routes) uses it for one stop per place.
- `limit`: how many to keep, from the first.
- `last`: how many to keep, from the end, after `sort` and `collapse`. Use it for the newest rows when they're sorted oldest first. A rule takes `limit` or `last`, not both.
Some services send ids in one answer and the names for them in another. Lunch Money's budget summary lists each category's spending by `category_id`, and its categories request has the names. A `lookup` finds, for each element, the first element of the array in `from` whose `by` field equals the element's `on` field, and attaches it as the field named in `as`:
```json
{ "each": "summary.categories",
"lookup": { "from": "cats.categories", "by": "id", "on": "category_id", "as": "category" },
"where": { "path": "category.is_group", "not": true },
"fields": { "label": { "path": "category.name", "default": "Other" }, "value": "totals.other_activity" } }
```
A renamed category then shows its new name the next time the source answers, with nothing in the page to update. `from` is read from the same place as the array itself: the whole answer for a card's `map` or a derived value. The two ids match as values, so `12` and `"12"` are the same. An element with no match goes without the field, so a `default` applies, and `as` replaces any field the element already had with that name. When `from` is one object rather than an array, it's the only candidate: Mealie's meal plan rows carry a `groupId`, and `"lookup": { "from": "group", "by": "id", "on": "groupId", "as": "group" }` attaches `/api/groups/self` to each, so a row's link can read `group.slug`.
---
# Names and tables
### Names as keys
Some services send a name as the key and its number as the value. AdGuard Home's top domains are `[{"apple.com": 3}, {"google.com": 2}]`: a list of one-field objects, where the domain is the key. `"entries": true` turns each object into rows of `{ "key", "value" }`, so the rest of the rule can read them:
```json
{ "each": "top_queried_domains", "entries": true, "limit": 5,
"fields": { "label": "key", "value": "value" } }
```
`each` can also name a single object, such as `{"apple.com": 3, "google.com": 2}`, which gives one row per field. `entries` comes first, so `where`, `sort` and `limit` work on the rows it makes. An object's fields have no order of their own, so they come in key order; add a `sort` for any other. Keys with dots, colons or slashes, like `https://dns10.quad9.net:443/dns-query`, stay whole, since `key` is read as a field, not a path.
### Parallel arrays
Open-Meteo sends hourly weather as parallel arrays. Add `"zip": true` to turn them into rows in array order:
```json
{ "each": "hourly", "zip": true,
"fields": { "label": "time", "values[0]": "temperature_2m" } }
```
For `{"hourly":{"time":["09:00","10:00"],"temperature_2m":[52.1,53]}}`, this makes two columns rows. Use the same rule in `derive` or a card map. `where`, `sort`, `limit` and `buckets` work on the rows as usual.
A null leaves that field missing. For example, null pollen values match `exists: false`. Fields that are not arrays are ignored. Unequal arrays stop at the shortest array. `zip` needs one `each` path and cannot be combined with `entries`.
### Names and exact times
`{record|first_word}` takes the first whitespace-separated word. `{record|rest_words}` takes the remaining text, with surrounding whitespace removed. Spaces and tabs both separate the first word; the remaining names stay together. For a local DNS record such as `192.0.2.10 printer.example`, these give the address and hostname. Derive the name first, then sort rows by it.
`{time|time}` draws an exact local 24-hour clock time with seconds, such as `17:03:12`, from Unix seconds or a supported date. It stays fixed as an answer ages, making it useful for query logs. Include the date separately when showing older history. The `hour` filter includes a zone on a repeated daylight-saving hour so the two hours have different labels.
### Turning a table round
Some services answer one way round when a chart wants the other. Lunch Money's budget summary lists each category with its months inside it; a [`columns`](https://legatobar.com/docs/card-numbers.md#columns) chart of income against spending wants each month with its categories. Two options do it, after `where` and before `sort`:
- `flatten`: a path to each element's own list, which takes the element's place. Each item of that list gets the element it came from as `parent`, so it can still be told apart. Items that aren't objects are left out. A GitHub contribution calendar's weeks flatten into its days for a [heatmap](https://legatobar.com/docs/card-time.md#heatmap). An object at the path gives its fields as `{key, value}` rows, for a service that sends each slot's counts by name: Pi-hole's clients over time, `{"timestamp": …, "data": {"192.0.2.10": 41}}`, flatten into one row per client per slot.
- `group`: a path to a value the rows share. One row per value, in the order each first appears, as `{ "key", "count", "rows" }`. `sort`, `limit` and `fields` then work on the groups, and an aggregate with `"of": "rows"` totals each one.
A field's name can be a path into a list the card takes, so `values[0]` and `values[1]` fill a column's two values. This is the chart on the Net Worth example: income from income categories, spending from the rest, January to this month:
```json
{ "each": "summary.categories",
"lookup": { "from": "cats.categories", "by": "id", "on": "category_id", "as": "category" },
"where": { "all": [ { "path": "category.is_group", "not": true }, { "path": "category.exclude_from_totals", "not": true } ] },
"flatten": "occurrences", "group": "start_date",
"fields": {
"label": { "template": "{key|month}" },
"values[0]": { "add": [ { "sum": "other_activity", "of": "rows", "where": { "path": "parent.category.is_income", "equals": true } },
{ "sum": "recurring_activity", "of": "rows", "where": { "path": "parent.category.is_income", "equals": true } } ],
"scale": -1, "round": 0 },
"values[1]": { "add": [ { "sum": "other_activity", "of": "rows", "where": { "path": "parent.category.is_income", "not": true } },
{ "sum": "recurring_activity", "of": "rows", "where": { "path": "parent.category.is_income", "not": true } } ],
"round": 0 } } }
```
`summary` here is `/v2/summary?start_date={date.year_start}&end_date={date.month_end}&include_occurrences=true`, and `cats` is `/v2/categories?format=flattened`.
`min` and `max` also take `rank`, a list of values from best to worst, for values whose order isn't numeric. Uptime Kuma's status is 1 up, 3 maintenance, 2 pending, 0 down, so `{ "max": "monitor_status", "of": "monitors", "rank": [1, 3, 2, 0] }` is the worst status of any monitor.
Any rule can then be adjusted:
| Option | Example | Does |
| --- | --- | --- |
| `values` | `{ "path": "blocking.blocking", "values": { "enabled": "ok", "disabled": "warning" } }` | Looks the value up. Entries are literal values or an object containing only `{ "template": … }`; other rule objects are not evaluated here. |
| `default` | `"default": "unknown"` | Used when there's no value, or no `values` entry for it. Like a lookup entry, it can be a literal or a sole `template` object. |
| `match` | `{ "path": "config.data.meta", "match": "ctime=([0-9]+)" }` | Searches the value's text with a regular expression and keeps the first capture group (or the whole match without one), as a number when it reads as one: `creation-qemu=11.1.3,ctime=1793983411` → 1793983411. It comes before `values`, `scale` and `round`; no match is no value, so `default` applies. Page-authored `match` patterns stop after a short execution budget; inputs above 65,536 UTF-16 code units are not matched. A budget limit acts like no match, so the rule’s `default` applies. Parameter patterns use the same budget and refuse a value on timeout. |
| `clock` | `{ "path": "[\"Sleep start\"]", "clock": 12, "round": 2 }` | A moment (ISO 8601, Unix seconds, or a date and time like `2026-10-29 22:56:24 -0500`) as hours of the day on this Mac: 10:56 PM is 22.93. Times before this hour (0–23) are the next day's and count from 24, so with `12` a wake-up at 8:01 AM is 32.02 and a night stays in order. For a [ranges](https://legatobar.com/docs/card-numbers.md#ranges) card with `unit` `clock`. Applied before `scale`. |
| `scale`, `offset`, `round` | `{ "path": "climate_state.inside_temp", "scale": 1.8, "offset": 32, "round": 0 }` | Scaled, then offset, then rounded to that many decimals: here, °C to °F. |
Template placeholders take filters after a `|`, and filters chain:
| Filter | Example | Gives |
| --- | --- | --- |
| `title`, `upper`, `lower` | `{state\|title}` | "not_home" → "Not home" |
| `round`, `round:n` | `{temp\|round:1}` | 73.46 → "73.5" |
| `percent`, `percent:n` | `{monitor_uptime_ratio_1d\|percent}` | 0.9965 → "99.7%" |
| `duration`, `duration:unit` | `{blocking.timer\|duration}` | 299 seconds → "4m 59s". A unit reads other times: `ticks` (100 ns, so 10,000,000 a second, as Jellyfin and Emby count), `ms`, `s` (the default) or `min`: `{NowPlayingItem.RunTimeTicks\|duration:ticks}` is 70,800,000,000 → "1h 58m". |
| `timecode`, `timecode:unit` | `{PlayState.PositionTicks\|timecode:ticks}` | A player's clock, rounded down to the second: "1:42:10", "42:05" under an hour, "0:07". Takes the same units as `duration`. A negative time reads "0:00", and text that isn't a number passes through, as with `duration`. |
| `pad:n` | `S{ParentIndexNumber\|pad:2}E{IndexNumber\|pad:2}` | A whole number zero-padded to n digits (1–4): 2 and 5 → "S02E05". Longer numbers aren't cut; anything that isn't a whole number passes through unchanged. |
| `clip:N` | `{overview\|clip:80}` | Shorten text to at most N characters (1 to 500), including the ellipsis. Prefer a word boundary in the last 20 characters. Trim trailing spaces and punctuation. Shorter text stays unchanged. |
| `until` | `{blocking.timer\|until}` | The clock time that many seconds from now: "2:00 PM" |
| `from_now` | `{choice\|from_now}` | The moment that many seconds from now, in ISO 8601 UTC: 3600 → "2026-11-17T21:41:05Z". For a button's request, such as a silence's end; see [Buttons](https://legatobar.com/docs/buttons.md). |
| `month` | `{start_date\|month}` | The month of a date, short: `2026-10-01` → "Oct". |
| `month_year` | `{published\|month_year}` | The month and year of a date: `2026-11-18` → "Nov 2026". For a date that should read the same next year, such as a release's. |
| `date` | `{Date\|date}` | A date, short: `2026-10-31` → "Oct 31", with no "Today" and no year. For columns by day across a month, where every column needs a label of its own. |
| `compass` | `{wind_deg\|compass}` | Degrees as one of the eight points of the compass: 200 → "S", 315 → "NW". |
| `hour` | `{dt\|hour}` | "Now" for this hour, then the hour short: "11P", "1A", "12P". For a forecast's columns. |
| `hour:plain` | `{dt\|hour:plain}` | The hour short, this one too: "12P" where `hour` says "Now". For a chart of the last 24 hours, whose last column is still filling. |
| `clock`, `clock_hour` | `{time\|clock}` | A moment's time of day as this Mac's clock shows it: "6:12 PM" (or "18:12"), and with `clock_hour` just its hour, "6 PM". For a chart's labels, since unlike `ago` they don't change as time passes: `{time\|weekday} {time\|clock_hour}` is "Tue 2 PM". |
| `bytes` | `{usage\|bytes}` | A count of bytes in the unit that suits it, 1,024 to the next and written as people say sizes: 14,195,561 → "13.5 MB", 462,773,288,960 → "431 GB", 4,617,948,836,659 → "4.2 TB". One decimal under 100, none from 100. Text that isn't a number passes through. |
| `plain` | `{__search_hit__.highlights\|plain}` | An HTML snippet as words, such as a search hit's excerpt: `Home insurance,` → "Home insurance,". Tags that mark words (`b`, `i`, `em`, `span`, `mark` and the like) go with no space; any other tag, and each run of spaces and line breaks, becomes one space. `&`, `<`, `>`, `"`, `'`, ` ` and numeric entities are decoded once, after the tags are gone. Nothing is drawn or loaded. |
| `verbatim` | `{title\|clip:160\|verbatim}` | Text exactly as the service sent it, for a field that takes inline formatting: a list item's text or a text card's body. `__init__()` keeps its underscores, and `[docs](https://…)` stays as words, with no link. It puts a backslash before each ASCII punctuation mark, which the formatting hides; anywhere else the backslashes show. It goes last, after `clip` or any other filter. |
| `ceil` | `legato://page/pihole-queries?at={time\|ceil}` | A number rounded up to a whole one: a moment with fractions of a second, `1795624370.4`, as the Unix second `1795624371`, so a link's "up to this second" includes it. |
| `ms` | `{reply.time\|ms}` | Seconds read as a reply time: `0.00012` is `0.1 ms`, `0.0123` is `12 ms` and `1.24` is `1.2 s`. Under a tenth of a millisecond it's `<0.1 ms`. |
| `host` | `{address\|host}` | An address's host alone: `https://raw.example.com/lists/pro.txt` is `raw.example.com`. |
| `file` | `{address\|file}` | The last part of an address's path: `pro.txt`. With `host`, a name for a list that has none of its own. |
| `raw` | `https://my.lunchmoney.app/transactions?transaction_id={id\|raw}` | A number exactly as the service sent it, with no thousands separators: 2528490123 stays `2528490123`, not "2,528,490,123". For an id in a link. Text passes through unchanged. |
| `origin` | `{monitor_url\|origin}` | An address's scheme, host and port, without its path: `https://glance.example.com/api/healthz` → `https://glance.example.com`. For a link to the app a health check watches. |
| `weekday` | `{dt\|weekday}` | "Today", then the short weekday: "Thu". For a forecast's rows. |
| `day` | `{date_expected\|day}` | The day a date falls on, as you'd say it: "Today", "Tomorrow", "Yesterday", then "Sat, Oct 31" (with the year when it isn't this one). For when something is due or expected. |
| `ago` | `{published\|ago}` | How long ago an ISO 8601 date or Unix time was: "now", "5m ago", "2h ago", "3d ago", then the date ("Oct 12"). A date with no time, like `2026-10-12`, counts from that day's midnight on the Mac. Worked out when the source answers. |
| `in` | `{dt\|in}` | How far ahead a moment is: "now", "in 12m", "in 2h", "in 3d", then the date after a week. Past moments say "now". Reads the same dates as `ago`. Worked out when the source answers. |
`ago`, `month`, `month_year`, `day`, `weekday` and `hour` read Unix time (seconds, or milliseconds as Tesla sends them), ISO 8601, a plain date (`2026-10-31`) or a date and time with no zone (`2026-10-31 14:30:00`, as Parcel sends them). The last two are read as the Mac's own time, so a date isn't the evening before when you're west of Greenwich.
Numbers are formatted for reading: `104628` becomes "104,628".
---
# Expiry and slices of time
### Expiry
Certificates, domains, subscriptions and keys expire. `expires` reads how many days are left (`days`) or when it expires (`date`), and `as` says what it gives:
- `state`: `ok`; `warning` from `warning` days left (14 by default); `critical` from `critical` days left (0 by default, so due today) and once it has expired. `unknown` when there's no input, unless the rule has its own `default`.
- `text`: "Expires today", "Expires tomorrow", "9 days left"; "Expired today", "Expired yesterday", "Expired 3 days ago".
- `days`: whole days left. 0 is today, whether it expires later today or expired earlier today; negative from the day after.
```json
{ "expires": { "days": "monitor_cert_days_remaining" }, "warning": 14, "as": "state" }
{ "expires": { "date": "renews_at" }, "as": "text" }
```
- **Days** are calendar days on this Mac, from today to the day it expires, as the `day` filter says "Tomorrow". A certificate expiring at 2 AM UTC on 9 November expires today on the 8th in New York.
- **`days`** is a number, or text that reads as one (`"12"`). A fraction counts toward zero: 13.9 is 13 days left, and -0.4 expired today.
- **`date`** is read as the [`date` rule](https://legatobar.com/docs/history-dates.md#dates) reads dates: Unix time, ISO 8601, a plain date, a date and time with no zone (as this Mac's time), carriers' words, and a feed's dates. A date with no time is good through that day; a moment has gone once it's now.
- **`warning` and `critical`** are whole days from 0 to 3650, and `critical` is no more than `warning`.
- **A missing input**, or one that isn't a number or a real date (`2026-02-30` isn't), gives nothing, so `default` applies.
- **When it's worked out:** a card's `map` works it out each time the page is drawn, and `derive` when the source answers. When the day changes, pages draw again and a source whose `derive` counts to a date is read again.
- It can't be used in a history source's [`row`](https://legatobar.com/docs/history-reading.md#only-what-the-page-needs-row), since a kept value can't follow the days as they pass. Name its input in `row` and use it in `derive`.
A token's own expiry date can come from Settings → Secrets rather than the service: give the source `"secret_expires": "token_expires"` and read `token_expires` like any date. Put the rule in the card's `map` and `when`, not `derive`, so the days keep counting while the service doesn't answer. A card that warns only in the token's last 14 days, and a note while no date is saved:
```json
{ "id": "token", "type": "status", "label": "API access token", "state": "unknown",
"source": { "ref": "api",
"when": { "value": { "expires": { "date": "token_expires" }, "as": "state" }, "in": ["warning", "critical"] },
"map": { "state": { "expires": { "date": "token_expires" }, "as": "state" },
"detail": { "expires": { "date": "token_expires" }, "as": "text" } } } }
{ "id": "token-date", "type": "text", "body": "Add the token's expiry date in Settings → Secrets.",
"source": { "ref": "api", "when": { "path": "token_expires", "exists": false } } }
```
Uptime Kuma sends `monitor_cert_days_remaining` for HTTPS monitors only, so a fleet's state gives a `default` of `ok`, or every other monitor would be `unknown`. A certificate with 0 days left is `critical` (red), as is an expired one. An invalid certificate isn't an expiring one, so that keeps its own test:
```json
"state": { "if": { "path": "monitor_cert_is_valid", "equals": 0 },
"then": { "template": "critical" },
"else": { "expires": { "days": "monitor_cert_days_remaining" }, "as": "state", "default": "ok" } }
```
A list of certificates, soonest first:
```json
"items": { "each": "monitors", "where": { "path": "monitor_cert_is_valid", "in": [0, 1] },
"sort": "monitor_cert_days_remaining", "limit": 4,
"fields": { "label": "monitor_name",
"value": { "expires": { "days": "monitor_cert_days_remaining" }, "as": "text" } } }
```
A card that shows only while a certificate needs attention tests `"not": "ok"`. A missing field is `unknown`, so it shows the card too; `"equals": "critical"` would hide it.
```json
"when": { "value": { "expires": { "days": "cert_days" }, "as": "state" }, "not": "ok" }
```
### Slices of time
`keep` beside `buckets` chooses what each run keeps. A value list takes `"max"`, `"min"`, `"sum"`, `"average"` or `"last"`. The default is average. A template or fields list takes `{"max":"path"}` or `{"min":"path"}` to keep the row with the highest or lowest number at that path. Ties keep the earlier row. A row with no number there loses to one that has one. The default is the last row. For rain, `{"each":"one.minutely","value":"precipitation","buckets":12,"keep":"max"}` keeps a five-minute shower that an average would flatten.
`buckets` gathers rows by count, which suits a steady series. For a strip of an item's [samples](https://legatobar.com/docs/history-collect.md#samples), where an hour with no sample has to show as one, add `by_time`: the span is cut into `buckets` equal slices of time, and each row goes in the slice its time falls in.
```json
"segments": { "each": "kept.rows", "by_time": { "at": "at", "span": "kept.span" }, "buckets": 96,
"fields": { "state": { "worst": "row.state", "of": "rows" }, "label": { "template": "{from|time}" } } }
```
- **`by_time`** is `{ "at": path, "span": path }`: where each row's time is, and where the answer has the span, an object with `from` and `until`. A dataset source of samples answers with both: each row's `at` and `kept.span`. Times are ISO 8601 (as samples are), Unix seconds, or any instant the [date rules](https://legatobar.com/docs/history-dates.md#dates) read.
- **`span`** can also be written out, `{ "from": …, "until": … }`, in Unix seconds or instants: the page's own period, `{ "from": "{period.start_unix}", "until": "{period.end_unix}" }`, for an answer that doesn't say its span. With `"keep": "sum"` and `value`, an empty slice is 0 rather than nothing, so a count over time keeps every slice: one series per client from Pi-hole's clients over time.
- **`last_hours`** in place of `span` makes the span the last that many whole hours (1 to 168), ending with the one this is, one slice an hour unless `buckets` says. For a log the service answers as rows, such as an hour-by-hour strip of one domain's queries over a day: `"by_time": { "at": "time", "last_hours": 24 }`.
- **Every slice is made,** empty or not, oldest first, and each is `{ "from", "until", "count", "rows" }`: `fields` and `template` read the slice, so `count` is its rows and an aggregate `"of": "rows"` reads them. A row whose time is outside the span, or at its `until`, is left out.
- **`buckets`** is 2 to 240 slices; without it, `by_time` makes 144, ten minutes each of a day. A [strip](https://legatobar.com/docs/card-time.md#strip) takes up to 240, so a day of 5-minute samples (288) needs slices of at least two of them.
- **`value`** averages each slice's numbers, and an empty slice gives nothing, so a [sparkline](https://legatobar.com/docs/card-numbers.md#sparkline) of the same rows closes its gaps up as sparklines do. The strip draws them.
- `where` applies first. `by_time` doesn't take `group`, `sort`, `limit`, `last`, `collapse`, `flatten`, `entries` or `lookup`: its slices are in time order, each one there.
**`worst`** is the worst state among rows: `{ "worst": "row.state", "of": "rows" }`. States rank `ok`, `off`, `unknown`, `warning`, `critical`, so a slice with one `critical` sample is `critical`. A row whose value is missing, or isn't one of these, counts as `unknown`, and no rows at all gives `none`, the strip's empty slice. `off` ranks above `ok` here (the page's status counts it as `ok`), so a slice where a guest was off shows that it was.
### Calendar months
`by_month` makes one slice per calendar month instead: the last `months` months up to this one, oldest first, each one there whether it has rows or not. It's for a service that leaves out months with nothing in them, such as Immich's photos per month, so a columns card still shows a month with none.
```json
"items": { "each": "buckets", "by_month": { "at": "timeBucket", "months": 12 },
"fields": { "label": { "template": "{from|month}" }, "values[0]": { "sum": "count", "of": "rows" } } }
```
- **`by_month`** is `{ "at": path, "months": 1 to 36 }`: where each row's time is, and how many months, the current one last.
- **Each month** is `{ "from", "until", "count", "rows" }`: `from` is its first day and `until` the next month's, as plain dates (`2026-11-01`), so `{from|month}` gives "Nov". `count` is its rows, and an aggregate with `"of": "rows"` reads them; a `sum` over a month with no rows is 0.
- **A plain date or month, or a time with no zone** (`2026-11-01`, `2026-11`, `2026-11-06T16:46:00`) counts in the month it's written in. A moment with a zone, or Unix seconds, is read in the Mac's time zone, so a photo at 00:30 UTC on 1 December is November's in Chicago.
- `where` applies first. `by_month` doesn't take `buckets`, `by_time`, `group`, `sort`, `limit`, `last`, `collapse`, `flatten`, `entries` or `lookup`.
### Calendar days
`by_day` makes one slice for each calendar day from `from` through `through`, oldest first, each one there whether it has rows or not. It's for charting each day from a service that lists events rather than days, such as Stripe's payments: columns for the last week, or a line through the days of the page's [period](https://legatobar.com/docs/periods.md#periods) (a columns card takes 48 at most).
```json
"items": { "each": "moves.data", "where": { "path": "type", "equals": "charge" },
"by_day": { "at": "created", "from": "{date.days_ago_6}", "through": "{date.today}" },
"fields": { "label": { "template": "{from|weekday}" }, "values[0]": { "sum": "amount", "of": "rows" } } }
```
- **`by_day`** is `{ "at": path, "from": day, "through": day }`. Each day is a plain date (`2026-11-01`) or one token: `{period.start}` and `{period.end}` on a page with a period, or a [date token](https://legatobar.com/docs/source-requests.md#dates-in-requests) such as `{date.days_ago_29}` and `{date.today}`. They're worked out as the rule runs, so the chart moves with the period and the calendar. Both days are included, up to 400 days.
- **Each day** is `{ "from", "until", "count", "rows" }`: `from` is the day and `until` the next, as plain dates, so `{from|date}` gives "Nov 3" and `{from|weekday}` "Tue". A `sum` over a day with no rows is 0.
- **A plain date, or a time with no zone,** counts on the day it's written. A moment with a zone, or Unix seconds, is read in the Mac's time zone, so a payment at 02:00 UTC on 4 November is the 3rd's in Chicago. A service's own dashboard may count days in another zone.
- A day with no rows looks the same as a quiet day. When the list behind it may be cut short (a [list across pages](https://legatobar.com/docs/source-requests.md#a-list-across-pages) that stopped at its `max`), say so on the card, since its earliest days would look empty.
- **A running total** draws a month so far, as Stripe's own dashboard does: derive the days with their totals, then list those with `"running": true`, which makes each number itself plus every one before it. A day with nothing adds nothing, so the line stays level.
```json
"derive": [ { "name": "days", "value": { "each": "moves.data", "by_day": { "at": "created", "from": "{period.start}", "through": "{period.through}" },
"fields": { "day": "from", "gross": { "sum": "amount", "of": "rows" } } } } ]
```
```json
"points": { "each": "days", "value": "gross", "running": true }, "labels": { "each": "days", "template": "{day|date}" }
```
- `where` applies first. `by_day` doesn't take `buckets`, `by_time`, `by_month`, `group`, `sort`, `limit`, `last`, `collapse`, `flatten`, `entries` or `lookup`.
---
# Conditions
Conditions appear in `where`, `if` and a button's `when`. Each has a `path` (or a `value`, which is any rule) and one test: `equals`, `not`, `in` (a list), `not_in`, `gt`, `gte`, `lt`, `lte`, `contains`, `in_list` (a [list](https://legatobar.com/docs/lists.md#lists) in Settings → Lists) or `exists`. `"1"` and `1` count as equal, and a missing value meets `not`.
`exists: true` holds when there's a value, and `exists: false` when there's none. Null counts as none, as GitHub's `"latestRelease": null` says there's no release; `""`, `0`, `false` and an empty list are values. Use it rather than `not: null`, which a missing value also meets, so it holds for every answer. Unlike the other tests it always has an answer, so a card's `when` never shows the can't-say note for it. This names the latest release, or None:
```json
{ "if": { "path": "latestRelease.tagName", "exists": true }, "then": "latestRelease.tagName", "else": { "template": "None" } }
```
`contains` holds for text that has the given text in it (case matters), or a list with an item equal to it: a guest tagged `docker;homelab` contains `homelab`.
`in_list` names a [list](https://legatobar.com/docs/lists.md#lists) kept in Settings → Lists, and holds when the value contains any of its entries. Case, accents and punctuation don't matter, and an entry matches only whole words: "Hill" matches "Fernhollow Hill, ST" but not "Hillside". Add `"if_missing": true` to make the test hold when the list is missing or empty, and `"optional": true` when the page works fine without the list, so its cards don't ask you to add it. This counts the deliveries whose delivered place is in the list `delivery-area`:
```json
{ "count": "deliveries", "where": { "path": "location", "in_list": "delivery-area" } }
```
- Like other tests, it can take a `value` (any rule) in place of `path`.
- A list that doesn't exist or has no entries makes the condition false, and the page says "Add the list delivery-area in Settings → Lists" (or "Add entries to the list delivery-area in Settings → Lists").
- It can't be used in a history source's [`row`](https://legatobar.com/docs/history-reading.md#only-what-the-page-needs-row), since a list can change in Settings and a kept value can't know. Use it in `derive`.
`equals`, `not`, `gt`, `gte`, `lt`, `lte` and `contains` can compare with another value in the same answer instead of one written in the page: give `{ "path": "…" }` in its place. In a `where`, that path is in the same row; `{ "answer": "…" }` reaches outside it, into the whole answer, such as the backups made since a guest was created: `"where": { "path": "ctime", "gte": { "answer": "created" } }`. An `if` in a row's `fields` reaches the whole answer the same way, to mark the row that matches something else in it. This counts the packages whose candidate version isn't the installed one, from Proxmox's `apt/versions`:
```json
{ "count": "versions.data", "where": { "all": [ { "path": "CurrentState", "equals": "Installed" },
{ "path": "Version", "not": { "path": "OldVersion" } } ] } }
```
When the other path has nothing there, the condition can't say, as when the tested path has nothing: a card's `when` shows the card with a note, and `where`, `if` and buttons count it as false (a missing value still meets `not`).
To test more than one thing, put 2 to 8 conditions in `all` (every one must hold) or `any` (at least one must). They nest. This lists credit cards that don't round to $0:
```json
"where": { "all": [ { "path": "type", "equals": "credit" }, { "value": { "path": "to_base", "round": 0 }, "not": 0 } ] }
```
Conditions also decide whether a whole card shows: see [Cards that show on a condition](https://legatobar.com/docs/mapping-conditions.md#cards-that-show-on-a-condition).
### Cards that show on a condition
For help choosing the structure, see [Page design](https://legatobar.com/docs/design.md#choose-the-right-structure), including a [linked overview and detail example](https://legatobar.com/docs/design.md#a-linked-overview-and-detail-example).
A card's `when` shows it only while a condition holds in its source's answer, the derived values before `map`. A page can then stay quiet and show only the exceptions: a door left open, water running, blocking turned off. Linked to a page with the details, an exception is one click from them.
```json
{ "id": "garage", "type": "status", "label": "Garage door open", "state": "warning", "url": "legato://page/security",
"source": { "ref": "house", "when": { "path": "garage", "equals": "open" } } }
```
- **True:** the card shows. **False:** it's hidden, with its buttons. It doesn't count toward the page's status or notify. Notifications quietly count it as OK again (no "Back to OK", since a condition turning false isn't a recovery), so a warning card, or a fleet's item, that comes back notifies each time.
- **The answer can't say:** nothing or null at a path the condition tests, or a comparison (`gt`, `lt`, …) with something that isn't a number, like `"unavailable"` (`exists` always has an answer). The card shows, with a note saying so, so a field the service stopped sending can't quietly hide an alert. This is stricter than `where`, `if` and a button's `when`, where a missing value meets `not` and a comparison that can't be made is false.
- **Before the first answer**, the card waits as any sourced card does. **After a failed fetch**, the last answer decides, so the card keeps the visibility it had, and the source goes on polling while the card is hidden, so it can come back. If cards are hidden behind a source that's failing, a notice appears above the page’s sections and tabs ("… couldn't be reached, so cards here that show only on a condition may be out of date", or "… reported an error, …" when the source's `fail` turned the answer down). It stays visible when a section is collapsed or another tab is selected.
- **What's left:** a heading whose section had cards and shows none hides too. A tab whose cards are all hidden says "Nothing to show right now." (the tabs stay where they are), and a tabs card with nothing in any tab hides. A page with nothing left says so.
- A misspelled or malformed condition is an error on the card, not a hidden card. `when` goes on each card that uses it, not on a shared source. A card with `when` may leave out `map`, or give an empty one; `map` is otherwise an object with at least one field.
Paths, rules and filters are all there is: a source never runs code on your Mac.
---
# Sparkline readings
Some services only report a value as it is now, like a net worth or a battery level. A sparkline's `points` can be a `history` rule instead: the Mac records the rule's number each time the source answers and draws the readings it has kept.
```json
{ "id": "trend", "type": "sparkline", "label": "Net worth, 60 days", "unit": "USD",
"source": { "ref": "money", "map": { "points": { "history": "net", "every": "1d", "keep": 60 } } } }
```
| Setting | | |
| --- | --- | --- |
| `history` | required | A [rule](https://legatobar.com/docs/mapping.md#mapping) giving a number, here the derived `net`. |
| `every` | optional | One reading per period, `1d` by default, at least `1m`. A later reading in the same period replaces the earlier one, so with `1d` the day's last answer is its point. Days start at midnight on the Mac. |
| `keep` | optional | How many readings to keep, the newest, from 2 to 60. Default 60. |
Until there are two readings, the card says it's collecting them. Only a sparkline's `points` take a history rule. The card's `labels`, `start_label` and `end_label` come from the readings' times unless the page sets them, each point labelled the way the ends are: with `1d` or longer, the first reading's date ("Oct 28") and "Today" (or the last reading's date when it wasn't today); more often, the first reading's time and "Now" while the last reading is at most one and a half periods old, each with its date when it isn't today's. They stay true on their own: at midnight, and when "Now" runs out, the card is drawn again from the readings kept, without asking the service. A lowered `keep` drops the oldest readings, and their labels, at once.
### Another page's readings
A home page can show readings another page keeps, as they are, without recording them again: `{ "history_of": "net-worth#trend.points" }` names the page id, the card and its `points`. The chart opens with every reading that card has, and the other page goes on recording them. `every` (default `1d`) says how far apart they are, for the labels, and `keep` (2–60) how many of the newest to show. The card says it's collecting readings until that history has two.
```json
{ "id": "worth", "type": "sparkline", "label": "Net worth", "unit": "USD",
"source": { "ref": "money", "map": { "points": { "history_of": "net-worth#trend.points", "keep": 30 } } } }
```
The readings are kept on the Mac, not in the page file, so rewriting the page keeps them, and each Mac has its own. They're kept in History's database, listed in **Settings → History** under "Sparkline readings" by page, with **Export…** and **Delete…** for each page, and included in **Export history…**. They're removed five minutes after their page leaves the Pages folder. They start when the rule is added: there's nothing to backfill from, and the Mac records only while Legato is running and the source answers.
Use `history_of` to show a sparkline's numbers on another page. To collect and query whole rows across pages, use a dataset. See [History](https://legatobar.com/docs/history.md).
---
# Buttons
Add `actions` to a card that has a source, and it gets buttons: pause ad blocking, turn on a light, start a sprinkler zone. Each button sends a request to the same service as the source, signed in the same way, and Legato then refreshes the source to check for the change.
Where a button goes on a card and the fields it takes are below. Buttons that do more have a page each:
- [Tasks and asking first](https://legatobar.com/docs/button-tasks.md): Buttons that follow a long-running task, ask before they run, or name what the card is showing.
- [Text input](https://legatobar.com/docs/button-input.md): Buttons that open a form for typed text or a pick from a list.
- [Rows and checklists](https://legatobar.com/docs/button-rows.md): An action for each checklist row, and buttons at the end of each row of a list.
A card can also be only its buttons: a [`text`](https://legatobar.com/docs/card-text.md#text) card with a `label`, no `body`, and a `source` with just its `ref`, no `map`. The buttons' `when` conditions still read that source's answer. A machine's Controls card is one:
```json
{ "id": "controls", "type": "text", "label": "Controls", "actions_placement": "corner",
"source": { "ref": "guest" },
"actions": [{ "label": "Start", "icon": "play.fill", "path": "/api2/json/nodes/pve/qemu/107/status/start",
"when": { "path": "status.data.status", "equals": "stopped" } }] }
```
Every button also shows up in Spotlight under its own label: choose it and press Return, and Legato presses it, then opens its page (Settings → General → "Open the page when you press a button from Spotlight" turns that off). This `actions` field is a card fragment for the Pi-hole source:
A button that changes many things at once, such as one that accepts every suggestion on a list, can stay in the panel with `"offer": false`: Spotlight, Shortcuts and notifications then never offer it, so it's only pressed where the panel shows what it acts on. Give it `"confirm"` too, so the panel asks before it runs: `offer` alone doesn't ask.
A button in a card's corner is its icon alone, its name in a tooltip. When the icon wouldn't say enough, for a change that reaches every device, `"show_label": true` draws its name beside its icon in a plain bordered button: Pi-hole's Queries page has **Block domain**, **Allow domain** and **Remove from deny list**, each shown only for the query it fits.
### Put each button on the card it changes
A card's buttons are drawn inside it, under what it shows. So attach each button to the card whose value it changes, not to a card of its own: Start climate on the cabin temperature, Lock on the doors' status, Water now on the zone it waters. The card then reads as one control: what's true now, and what you can do about it. The Tesla example's Inside card does this:
```json
{
"id": "inside", "type": "stat", "label": "Inside", "unit": "°F",
"source": { "ref": "tesla", "map": {
"value": { "path": "climate_state.inside_temp", "scale": 1.8, "offset": 32, "round": 0 },
"delta": { "path": "climate_state.is_climate_on", "values": { "true": "Climate on", "false": "Climate off" } } } },
"actions": [
{ "label": "Start climate", "icon": "fan", "method": "POST", "path": "/YOUR_VIN/command/start_climate",
"when": { "path": "climate_state.is_climate_on", "equals": false } },
{ "label": "Stop climate", "icon": "fan.slash", "method": "POST", "path": "/YOUR_VIN/command/stop_climate",
"when": { "path": "climate_state.is_climate_on", "equals": true } }
]
}
```
(The full example adds `success` and `error`; see the table below.)
- **Show the state the button changes on the same card.** Here `delta` says "Climate off", so after a press the follow-up read turns it to "Climate on" right above the button, and the person sees it worked.
- **Offer only the button that makes sense now.** Give opposite actions opposite `when` conditions, as Start and Stop climate do, so one button shows at a time, in the same place. Mark the one that ends something running `"prominent": true`, as the Tesla example does for Stop climate: the filled button says "this is on" at a glance.
- **Label with a verb, briefly.** "Start climate", "Lock", "Pause 5m": up to 24 characters, with an SF Symbol `icon` that matches.
- **Keep it to one or two per card.** Up to four fit; they sit side by side and stack when the card is too narrow, as a half-width card often is.
- **Or put them in the card's corner.** `"actions_placement": "corner"` on the card puts its buttons at its top right, beside what it shows, instead of in a row under it. Each is drawn as its icon alone, with its label as the tooltip, so the card's own lines keep their room; give each button an `icon` (one without keeps its label). A button with `"confirm": true` asks in the corner too ("Reboot?", then ✕ and ✓), and the corner keeps room for that question all along, so asking doesn't move the card's lines. A question with its own `message`, or a name to type, needs the card's width and asks under the card. The corner suits a short card with a few buttons, such as Start or Stop climate on the cabin temperature, or a server's Start, Shut down and Reboot. On a text card that's only its name and buttons (no `body`), the corner buttons are drawn at the size of buttons under a card, beside the name. On a list, and on a facts or text card with a `label`, they sit on the name's line and the rows below keep the card's full width. A card with no name has no such line, so they sit beside its lines, which take the rest of the width: give a facts card a `label` to keep its values at the right edge. `"bottom"`, under the card, is the default.
- **Or put them in the page's title row.** `"placement": "title"` on a text card of buttons (no `body`) draws them at the right of the page's large title, as a window's toolbar: each its icon alone, its label in a tooltip, a menu showing its value. An on/off pair that shares a `setting`, each half with `turns`, is one icon, lit on a grey plate while it's on. Several such cards sit in one row, a thin line between them. The person arranges the row in Customize Controls (right-click the row, or the end of ⋯): one shelf of what's in the bar, in order, and one of the rest, with controls dragged along or between them. ⋯ always shows, and opens the rest as working rows (switches switch, menus show their value), each with + to put it in the bar. Menus in the row show their icon and value with no pill. Only a sheet page in the window has the large title; elsewhere the card is drawn as an ordinary card. Spotlight and Shortcuts offer every one either way.
- **Or make them settings rows.** `"actions_placement": "rows"` draws each button with a `setting` as a row named by it, the way System Settings lists them: a menu (`choices`) shows its value on the row's right, and an on/off pair of buttons sharing one `setting`, each with `"turns": "on"` or `"off"`, is a switch. Give the pair `when`s that never hold together: the one shown says the state, so the switch is on while the button that turns it off is the one offered, and flipping it presses that button, question and all. Buttons with no `setting`, such as Start charging, sit in the card's corner. Rows suit a Controls card on a [sheet](https://legatobar.com/docs/page-writing.md), where they read like the facts beside them. Up to 16 buttons.
```json
{ "id": "controls", "type": "text", "label": "Controls", "actions_placement": "rows", "source": { "ref": "car" },
"actions": [
{ "label": "Turn on Sentry", "icon": "eye", "path": "/sentry/on", "setting": "Sentry", "turns": "on", "when": { "path": "sentry_mode", "equals": false } },
{ "label": "Turn off Sentry", "icon": "eye.slash", "path": "/sentry/off", "setting": "Sentry", "turns": "off", "when": { "path": "sentry_mode", "equals": true } } ] }
```
- **Or offer a menu of values.** Give a button `choices`, each a `label` and a `value`, and put `{choice}` in its `path`, `body` or `headers`: the button becomes a menu, and picking one sends the request with that value, such as a cabin temperature or a charge limit. `current` names where the source's answer holds the value now; that choice is ticked and titles the menu (70°F ▾). When the answer holds a value no choice has, such as the highest setting while a car defrosts, the menu shows the button's `icon` instead (its label without one). The labels can say one thing and the values another, such as °F labels for a service that takes °C:
```json
{ "label": "Cabin temperature", "path": "/car/command/set_temperatures?temperature={choice}",
"current": "climate_state.driver_temp_setting",
"choices": [{ "label": "68°F", "value": 20 }, { "label": "70°F", "value": 21 }, { "label": "72°F", "value": 22 }] }
```
In a `body`, a string that is `"{choice}"` and nothing else takes the choice's value as it is, so a number stays a number. AdGuard Home's pause wants milliseconds as a number and refuses `"300000"`:
```json
{ "label": "Pause protection", "icon": "pause", "path": "/control/protection",
"body": { "enabled": false, "duration": "{choice}" },
"choices": [{ "label": "1 minute", "value": 60000 }, { "label": "1 hour", "value": 3600000 }] }
```
Any other body string, such as `"for {choice} ms"`, is filled as text, where a number is grouped (`300,000`); `{choice|raw}` gives the digits as sent.
Spotlight and Shortcuts list each choice as its own button, "Cabin temperature: 70°F". A menu can't ask first (`confirm`).
- **Or make the menu from the answer.** When the choices are things the service lists, such as the models an Ollama server has installed, `choices` can be a list rule instead: `each` names the array, and `fields` gives each choice's `label` and `value`. Picking one sends the request with that value, as a fixed menu does:
```json
{ "label": "Load a model", "icon": "play.fill", "path": "/api/generate",
"body": { "model": "{choice}" },
"choices": { "each": "tags.models", "fields": { "label": "name", "value": "name" } } }
```
The menu is read from the source's answer each time it opens: up to 24 choices in the answer's order (a `where` or `sort` in the rule changes that), each label cut to 24 characters. A choice is pressed by its value, so if the list changes before you pick, the request still goes to the one you picked, or not at all if it's gone. With nothing to choose, or two choices with the same value, the button is dimmed and its tooltip says why. `current` ticks the choice the answer holds, as on a fixed menu. A menu made from the answer stays in the panel: Spotlight, Shortcuts and notifications don't offer it, since its choices change. It can't go on a row or a checklist's `itemAction`.
- **Or send a time.** Some services want a moment in the request, such as when a silence or a snooze ends. In a body, `{action.at}` is the moment of the press and `{choice|from_now}` is the moment a menu's number of seconds from then, both in ISO 8601 UTC (`2026-11-17T20:41:05Z`). Grafana's Silence menu sends both:
```json
{ "label": "Silence", "icon": "bell.slash", "path": "/api/alertmanager/grafana/api/v2/silences",
"body": { "matchers": [{ "name": "__alert_rule_uid__", "value": "{param.uid}", "isEqual": true, "isRegex": false }],
"startsAt": "{action.at}", "endsAt": "{choice|from_now}", "createdBy": "Legato", "comment": "Silenced from Legato" },
"choices": [{ "label": "1 hour", "value": 3600 }, { "label": "1 day", "value": 86400 }, { "label": "1 week", "value": 604800 }] }
```
`{action.at}` goes wherever `{action.id}` does, on a card's buttons and a row's. `from_now` reads any number of seconds, so `{answer.snooze|from_now}` works too.
- **Part them into runs.** Put `"|"` between two buttons in `actions` to start a new run of them: the panel draws a thin upright line between the runs that show, as in Lock, Sentry | climate, defrost, steering wheel heat | seats. A run whose buttons are all hidden leaves no line. A card holds up to six buttons, or sixteen in its corner (the `"|"` don't count), so one Controls card can carry a car's on/off pairs, one of each showing at a time.
- **Or centre the row.** `"actions_align": "center"` on the card centres the row of buttons under it; the card's label and lines stay where they are. It suits a card that is mostly its buttons, such as a row of scenes. `"leading"` is the default.
```json
"actions": [
{ "label": "Pause 5m", "icon": "pause.fill", "method": "POST", "path": "/api/dns/blocking",
"body": { "blocking": false, "timer": 300 }, "when": { "path": "blocking.blocking", "equals": "enabled" } },
{ "label": "Resume", "icon": "play.fill", "method": "POST", "path": "/api/dns/blocking",
"body": { "blocking": true, "timer": null }, "when": { "path": "blocking.blocking", "equals": "disabled" } }
]
```
| Field | | |
| --- | --- | --- |
| `kind` | optional | `http` (the default) calls the service, as below. `open` opens an address instead; see after this table. `add-event` opens a New Event form on a calendar source's card; see [Calendar sources](https://legatobar.com/docs/source-calendar.md#calendar-sources). `complete-reminder` works only as a checklist's `itemAction`; see [Reminders sources](https://legatobar.com/docs/source-calendar.md#reminders-sources). |
| `label` | required | 1–24 characters. It can show a value from the answer, `{answer.name}`; see [Buttons that act on what the card shows](https://legatobar.com/docs/button-tasks.md#buttons-that-act-on-what-the-card-shows). |
| `icon` | optional | An SF Symbol name. |
| `method` | optional | `POST` (the default), `PUT`, `PATCH`, `DELETE` or `GET`. Use `GET` only for a service that takes a command that way, such as changedetection.io's `?recheck=1`. A `GET` sends no `body` or `form`, so its values go in the path's query. |
| `path` | required | Starts with `/`, and is added to the source's scheme, host and port. It can't name another host. `{answer.}` fills a value from the card's answer. |
| `body` | optional | A JSON body. Its strings can take `{answer.}` too. |
| `graphql` | optional | A GraphQL request in place of `body`: `{ "query": "…", "variables": { … } }`. See [Buttons that send GraphQL](#buttons-that-send-graphql). |
| `form` | optional | A form in place of a JSON `body`, for services whose commands read only a form: `{ "hashes": "all" }`. See [Buttons that send a form](#buttons-that-send-a-form). |
| `headers` | optional | Extra headers for the button request, as `{ "name": "value" }`. Common source `headers` are inherited; button headers can override them. Keep credentials in a named secret. |
| `when` | optional | Show the button only when the source's last answer meets a [condition](https://legatobar.com/docs/mapping-conditions.md#conditions), such as `{ "path": "blocking.blocking", "equals": "enabled" }`. With it, a card can offer Pause while blocking is on and Resume while it's paused. |
| `success` | optional | A condition checked against the button's JSON response, such as `{ "path": "result", "equals": true }`. Use this when HTTP success alone does not mean the service accepted the command. |
| `error` | optional | A path to the failure reason in the button's response, such as `"reason"`. |
| `prominent` | optional | `true` draws the button filled in the accent colour. Use it for the one that matters most right now, such as Stop climate while the climate runs. Off by default. |
| `confirm` | optional | Ask in the panel before the request goes out: `true` asks the label with a question mark, or `{ "message", "button", "type" }` gives the question (up to 160 characters), the button that runs it (up to 24) and text to type first (up to 40), each optional; the question and the text to type can take `{answer.}`. See [Buttons that ask first](https://legatobar.com/docs/button-tasks.md#buttons-that-ask-first). |
| `timeout` | optional | How long the request may take, in seconds: 60 (the default) to 1800. For a service that works only while the request stays open, such as Ollama, which stops downloading a model when the request closes. The button spins until the service answers. A button with more than 60 is pressed only in the panel: Spotlight, Shortcuts and notifications don't offer it. |
| `inputs` | optional | Ask for what to send: 1 to 4 fields, typed text or a pick from a list, filled into the request as `{input.}`. A press opens a form in the page's place. See [Buttons that ask for text](https://legatobar.com/docs/button-input.md#buttons-that-ask-for-text). On an `open` button, the form opens one of your pages with what was typed, such as a search: see [Forms that open a page](https://legatobar.com/docs/button-input.md#forms-that-open-a-page). |
| `submit` | optional | With `inputs`: the form's own button, up to 24 characters. "Add" unless set. |
| `rule` | optional | Legato presses the button itself: `{ "when": …, "every": "6h" }`. See [Buttons that press themselves](#buttons-that-press-themselves). |
| `shown` | optional | `false`, with a `rule`: the button isn't drawn or offered anywhere, and only its rule presses it. |
- A card can have up to 6 buttons; give them `when` conditions so only the ones that fit the state show at once. They're hidden until the source has answered once, since what a button means can depend on the state.
- A button runs only when you click it, and only on this Mac. While it runs it shows a spinner; a press may take up to a minute, since a car has to wake up first, for example, or as long as its `timeout`. After an accepted command the source checks again at once, and again 2, 5, 20 and 60 seconds later.
- HTTP success means the request reached the service successfully. A configured `success` condition decides whether the response reports a successful command. Without that condition, `result: false` or `response.result: false` is treated as failure automatically; other HTTP 2xx responses are accepted. A failure reason appears under the card for two minutes.
- Command acceptance does not prove the device has changed state yet. The follow-up reads update the card with the service's latest state; those reads can themselves fail or report the old state.
- A button needs a source on the same card: it calls that source's service, signed in the same way. A card with written-in values can't carry one.
### Buttons that press themselves
A `rule` presses a button for you. Each time the card's source answers, Legato checks the rule's `when` against the answer, derived values included. When it holds, and the time in `every` has passed since the rule last pressed, the button is pressed the way a click presses it, with the same checks. A press that fails waits the same `every` before the next try. Rules run only while Legato is open and the Mac is awake.
This suits upkeep you'd otherwise have to remember, such as asking a bank to sync once its last full sync is 12 hours old:
```json
{ "label": "Sync banks", "method": "POST", "path": "/v2/plaid_accounts/fetch", "shown": false,
"rule": { "when": { "path": "age", "gte": 12 }, "every": "6h" } }
```
`every` is at least `15m`. With `"shown": false`, only the rule presses the button: it isn't drawn on the card or offered to Spotlight, Shortcuts or notifications. Leave `shown` out to keep the button on the card as well. A rule can't go on a button that asks first (`confirm`), takes `inputs` or `choices`, or sits on a row. Details lists the page's rules under **Rules**, with when each last ran and whether the press went through.
### Buttons that send GraphQL
A service with a GraphQL API takes every change as a mutation sent to one address. Give the button `graphql` in place of `body`, and it sends `{ "query": …, "variables": … }` there. This button marks an issue done in an issue tracker:
```json
{ "label": "Done", "icon": "checkmark", "path": "/graphql",
"graphql": {
"query": "mutation($id: String!, $state: String!) { issueUpdate(id: $id, input: { stateId: $state }) { success } }",
"variables": { "id": "{answer.issue.id}", "state": "{answer.done_state}" } },
"success": { "path": "data.issueUpdate.success", "equals": true } }
```
- `query` goes exactly as written. Its braces belong to GraphQL, so Legato never fills anything in it. Put each value in `variables` and use it in the query as `$name`. A query holding `{answer.…}`, `{input.…}`, `{action.id}` or `{param.…}` won't load, since it would go out unfilled; nor will `{choice}` in a menu's query.
- `variables` is filled like a `body` in that kind of button: `{answer.…}` on a card's button, `{choice}` on a menu, `{input.…}` from a form, a row's own fields on a row's button or a checklist's `itemAction`. A string that is one placeholder alone keeps its type, so a number stays a number for an `Int!`. Leave `variables` out for a mutation that takes none.
- The request is always a `POST` to `path`. A button can't have `graphql` and `body` together, and it can't follow a task with `completion`.
- A GraphQL service usually answers HTTP 200 even when it refuses, so any `errors` in the answer fails the press, with the first one's message as the reason, even when `data` came back as well, since part of the mutation may not have run. An answer with no `data` fails too. Legato doesn't send the press again, with one exception: on a source that signs in for a session, a press refused with HTTP 401 goes once more after signing in again, since the service ran nothing. `success` then checks `data` the way it checks any answer.
- A query the service can't read often gets HTTP 400 with `errors`; the first message is the reason shown.
### Buttons that send a form
Some services read a command's values only from a web form (`application/x-www-form-urlencoded`), not from JSON. qBittorrent is one. Give the button `form` in place of `body`, and it sends each field as `name=value`. This row button stops a torrent in qBittorrent:
```json
{ "label": "Stop", "icon": "stop.fill", "path": "/api/v2/torrents/stop",
"form": { "hashes": "{hash}" } }
```
- `form` is an object of 1 to 20 fields. Each value is text, a number or `true`/`false`, and is filled like a `body` in that kind of button: `{answer.…}` on a card's button, `{choice}` on a menu, `{input.…}` from a form, a row's own fields on a row's button or a checklist's `itemAction`.
- Each value goes as text: a number as its digits (`1048576`, never `1,048,576`), `true` and `false` as words. A value filled with a list or an object can't be sent, and the press fails.
- An empty optional `{input.…}` leaves its field out, as in a JSON body. A field written as `""` goes as `name=`.
- The fields go in name order, and the request's `Content-Type` is always the form's: a `Content-Type` in the source's or the button's `headers` doesn't change it.
- A form request never follows a redirect.
- The method is `POST` (the default), `PUT` or `PATCH`. A button can't have `form` with `body` or `graphql`.
---
# Tasks and asking first
### Buttons that follow a task
Some services answer a command with a task to follow: Proxmox starts a backup or a shutdown and returns the task's id. Give that button `completion`, and Legato follows the task until it ends:
```json
"completion": {
"path": "/api2/json/nodes/pve/tasks/{data}/status",
"done": { "path": "data.status", "equals": "stopped" },
"success": { "path": "data.exitstatus", "equals": "OK" },
"interval": 2,
"timeout": 300
}
```
| Field | Required? | Meaning |
| --- | --- | --- |
| `path` | yes | The task's address on the source's host, filled from the command's answer. Filled values are escaped, so an id with `:` or `/` in it stays one part of the path. |
| `done` | yes | A condition on the task's answer that holds once it has ended. |
| `success` | yes | A condition that must also hold then, or the press didn't work. |
| `interval` | no | Seconds between reads of the task, 1 to 60. Default 2. |
| `timeout` | no | Seconds to follow it, 1 to 3600. Default 300; a backup can need 3600. |
- **While it runs:** Legato reads the task with GET, signed in as the source is, and the button shows as busy. A press from Shortcuts or Spotlight returns once the service accepts the command; Shortcuts says it started, and the panel shows how it ends.
- **When it doesn't end well:** the card says so if the task fails, its status can't be read, or the timeout passes first. The card is read again either way, since the command went through. Check the service before pressing again: Legato losing track of a task doesn't stop it.
- **Quitting Legato** stops following the task, and it isn't picked up again on the next launch.
- **A button with `when`** reads its source once more just before sending, so a Start chosen from an old answer isn't sent to a guest that's already running. The service still decides; this isn't a lock.
`completion` doesn't change who asks first: the panel and Shortcuts ask when the button has `confirm`, and Spotlight presses it directly. A checklist row's action can't have it.
In an action body, `{action.id}` becomes a new UUID for each press. Transport retries keep that UUID. This is suitable for command deduplication; a timestamp is not. When a service wants the time of the press instead, `{action.at}` gives it in ISO 8601 UTC. A `success` condition still needs to check the service’s command result when HTTP 200 can contain a refusal.
### Buttons that ask first
Some presses are hard to undo: restarting a server, shutting down a machine other things run on. Give that button `confirm`, and a click in the panel shows a question in its card, where the buttons were, with Cancel and a button that runs it. Nothing is sent until that button is pressed.
```json
{ "label": "Restart host", "icon": "power", "path": "/api2/json/nodes/pve/status", "body": { "command": "reboot" },
"confirm": { "message": "Restart pve? Every guest stops first.", "button": "Restart", "type": "pve" } }
```
- With `type`, the button stays dimmed until that text is typed exactly, as when a service asks for a name before deleting it. Keep it for the press that would cost the most.
- `"confirm": true` asks "Restart host?" with the label as the button.
- Escape cancels. Choosing another page or closing the panel puts the question away.
- **Spotlight presses it directly.** Choosing a button by name in Spotlight is the decision, so it doesn't ask again.
- **Shortcuts asks first,** with `message` when there is one (it doesn't ask for the typed text).
- **It never goes on a notification,** which can't ask, even with a `success` check.
- A checklist's `itemAction` can't ask first: a tick is meant to be quick. Put an action that needs a question on a button.
A button with `"kind": "open"` opens an https address from the source's answer in the browser, and sends nothing to the service. It takes `label`, `icon`, `url`, `when` and `prominent`. `url` is a template, such as `"{up.join}"` for a meeting's Join button or `"{html_url}"` for a GitHub page. An address that isn't https with a host doesn't open, and the card says why. As an `itemAction`, it fills `url` from the ticked row. With `inputs`, it's a form that opens one of your pages with what was typed, such as a search: see [Forms that open a page](https://legatobar.com/docs/button-input.md#forms-that-open-a-page).
For Home Assistant, this single action object goes inside a card's `actions` array:
```json
{ "label": "Turn off", "icon": "power", "method": "POST", "path": "/api/services/light/turn_off",
"body": { "entity_id": "light.kitchen_main_lights" }, "when": { "path": "kitchen", "equals": "on" } }
```
### Buttons that act on what the card shows
Some requests name the thing the card is showing: the run that failed, the newest request waiting for approval, the stream playing now. Put `{answer.}` in the button, and the press fills it from the card's source answer (after `derive`). This is a repository page's Re-run failed jobs, whose source derives `failed_run_id` and `failed_run_name` from the newest failed run:
```json
{ "label": "Re-run failed jobs", "icon": "arrow.clockwise", "method": "POST",
"path": "/repos/example-org/example-app/actions/runs/{answer.failed_run_id}/rerun-failed-jobs",
"confirm": { "message": "Re-run the failed jobs of {answer.failed_run_name}?", "button": "Re-run" },
"when": { "path": "failed_run_id", "exists": true }, "error": "message" }
```
| Where | How the value goes in |
| --- | --- |
| `path` | As sent: a number as its digits (`18765432109`, never grouped), percent-encoded so `/`, `?`, `&` or `#` can't change the address. |
| `body` strings | A string that is `"{answer.x}"` and nothing else takes the value as the answer has it, so a number stays a number and a list stays a list. In other text, a number goes as its digits. |
| `label` | As the card writes text, cut to 24 characters. Keep words of its own, such as "Stop {answer.name}": Spotlight and Shortcuts list the button by them. |
| `confirm` `message` and `type` | As the card writes text; the question is cut to 160 characters. With `type`, the name to type can come from the answer, for a delete. |
| `completion` `path` | Filled at the press, as the path is; the task's own id still comes from the command's answer. |
| `headers` | Never: headers carry credentials. A page with one there doesn't load. |
- **The press uses the answer the card is showing.** Nothing is read again first, and nothing checks the service: if the run was re-run elsewhere, the service's refusal shows under the card, with its reason when `error` names where the answer gives one. Each value can be a filter's output, as in `{answer.name|lower}`.
- **A value the answer lacks** leaves the button dimmed, saying why when you point at it ("the answer has no failed_run_id"), and nothing is sent. So does one a path can't take: an empty text, `.` or `..`, a list, or a whole number too big to send exactly (give a big id as text in `derive`). `when` is how a page hides the button instead, as above. The Source Preview window lists such buttons under Issues.
- **If the card changes under you,** the press doesn't go out. A click, a menu choice or a form's Add sends only while the card's values are the ones it was chosen from; a question that's open goes away when they change, and the card says to press again.
- **Spotlight presses it with the latest answer,** without asking, as for any button. **Shortcuts** asks with the filled question and stops if the values change while it asks. A button whose values are missing is listed, but isn't pressed: both say it has nothing to act on.
- **It never goes on a notification,** which can stay for hours: a press from it would act on whatever the answer says then.
- A checklist's `itemAction` fills from its own row (`{id}`), not from `{answer.…}`. An `open` button's `url` and an Add Event `title` already read the answer with plain paths, such as `{html_url}`.
The same pattern fits other services. A series page's Search on Sonarr sends the series' number as a number:
```json
{ "label": "Search", "icon": "magnifyingglass", "path": "/api/v3/command",
"body": { "name": "SeriesSearch", "seriesId": "{answer.series.id}" } }
```
Approving the oldest waiting request on Seerr names it first. Seerr's request list has no titles, so the page looks each one up with a [request for each row](https://legatobar.com/docs/source-requests.md#a-request-for-each-row) and derives `rows`, each with its `id` and `title`:
```json
{ "label": "Approve", "icon": "checkmark", "path": "/api/v1/request/{answer.rows[0].id}/approve",
"confirm": { "message": "Approve {answer.rows[0].title}?" }, "when": { "path": "rows[0].title", "exists": true } }
```
And Tautulli ends the stream the card shows, with its session's key in the query: `"path": "/api/v2?cmd=terminate_session&session_key={answer.stream.session_key}"`.
---
# Text input
### Buttons that ask for text
Some requests need something only you know: a tracking number, a note, a name. Give that button `inputs`, up to 8. A press opens a form in the page's place, as Add Event's does (or [over the page](#a-form-over-the-page)), and the form's own button (`submit`, "Add" unless set) sends the request with what was typed. This is the Packages page's Add tracking, for Parcel's add-delivery request:
```json
{ "label": "Add tracking", "icon": "plus", "path": "/external/add-delivery/",
"inputs": [
{ "name": "number", "label": "Tracking number", "required": true, "max": 40,
"pattern": "[A-Z0-9]{8,40}", "spaces": "remove", "case": "upper",
"hint": "As the carrier prints it", "invalid": "Letters and digits only" },
{ "name": "carrier", "label": "Carrier", "kind": "choice", "required": true,
"choices": [{ "label": "USPS", "value": "usps", "icon": "si:usps" },
{ "label": "UPS", "value": "ups", "icon": "si:ups" },
{ "label": "FedEx", "value": "fedex", "icon": "si:fedex" }],
"guess": { "from": "number", "rules": [{ "pattern": "1Z.*", "value": "ups" },
{ "pattern": "9[2-5][0-9]{20}", "value": "usps" }] } },
{ "name": "description", "label": "Description", "required": true, "max": 60, "placeholder": "What's in it" }
],
"body": { "tracking_number": "{input.number}", "carrier_code": "{input.carrier}", "description": "{input.description}" },
"success": { "path": "success", "equals": true }, "error": "error_message" }
```
| Input field | | |
| --- | --- | --- |
| `name` | required | A letter, then letters, digits or `_`. `{input.}` fills it. |
| `label` | required | 1–24 characters, above the field. |
| `kind` | optional | `text` (the default), one line; `choice`, one of `choices`: chips when there are up to 6, a menu when there are more; or `toggle`, an on/off switch. |
| `on_value`, `off_value` | toggle | What a toggle sends when it's on and when it's off: a string, a number, true or false, or a list of up to 20 strings or numbers. Unless set, on is `true` and off is `false`; with an `on_value` and no `off_value`, the key is left out of the body when it's off. |
| `required` | optional | Add stays dimmed until every required field has something in it. |
| `placeholder`, `hint` | optional | Up to 40 characters. The hint is the line under the field, where a problem shows instead. |
| `max` | text | The longest value, 1–200 characters after `spaces` and `case`. 100 unless set. |
| `pattern` | text | A regular expression the whole value must match, such as `[A-Z0-9]{8,40}`. `invalid` (up to 80 characters) is what a value that misses it is told. |
| `spaces`, `case` | text | `"spaces": "remove"` takes every space out; `"case"` is `upper`, `lower` or `keep`. Both apply before the value is checked and sent, so a pasted `1z 999 aa1` goes out as `1Z999AA1`. |
| `default` | optional | A text input's starting text, or a choice's value. |
| `choices` | choice | 2–24 of `{ "label", "value", "icon" }`, the icon optional. |
| `guess` | choice | Picks a choice from a text input as it's typed: the first rule whose `pattern` matches all of it. A pick by hand stays. |
| `start` | optional | What the field opens on, read from the row (a row's button) or the card's answer, such as `"payee"`. See [Edit forms](#edit-forms). |
| `multiple` | choice | `true` takes several of the choices, as checkboxes, and sends them as a list. |
| `lines` | text | 2–8 lets the text run over lines, as notes do, growing to that many before it scrolls. |
- **Every field is checked before anything is sent.** Each one's problem shows once you leave it, or when you press Add, in the line under it. Return presses Add; Escape is Cancel. Some services count a refused request against a daily limit (Parcel allows 20 adds a day, refusals included), so a value Legato can tell is wrong never goes out.
- **The service says no.** With `success` and `error`, the service's own reason shows beside Cancel and Add, and the fields stay filled to fix and try again. Legato doesn't retry by itself.
- **It works:** the form closes and the source reads again, as after any button.
- **The form is kept** while you look at other pages or close the panel, until Add works or Cancel. Pressing the button again brings it back.
- **Typed text goes in as a value, never as part of the request's wording.** In the body it's a JSON string, escaped as JSON. A body string that is `"{input.x}"` and nothing else takes the value as it is, so a choice's number stays a number; when an optional field is left empty, that key is left out. Elsewhere in a string it's filled as text, and empty when the field is. Text holding `{secret}` or `{action.id}` arrives as typed: nothing typed is read for placeholders.
- **In the path, only checked values.** A choice can fill the path or a header, since its values are the page's own. A text input can fill the path only with a `pattern`, and it is percent-encoded, so `/`, `?`, `&` or `#` can't change the address. Typed text never fills a header.
- **The request is filled from the inputs** (and `{action.id}`, and any `{answer.…}`) only, as a menu's is from its choice.
- **Spotlight opens the form,** on the button's page, and nothing is sent until Add. **Shortcuts** presses it only when every required input has a `default`; otherwise it says to open the form. **It never goes on a notification.**
- A button with `inputs` can't also have `choices` or `confirm` (Add is the decision), and a checklist's `itemAction` can't have them.
### A form over the page
`"form_style": "card"` opens the form in a card that slides in over the page, under the right end of the title row where Details's card opens, so the page stays in view while you answer. Use it for a short answer about something the page shows, such as a category for one transaction from a row's button:
```json
{ "label": "Choose category", "icon": "pencil", "form_style": "card", "submit": "Save",
"method": "PUT", "path": "/v2/transactions/{id}",
"inputs": [ { "name": "category", "label": "Category", "kind": "choice", "required": true,
"choices": [ { "label": "Groceries", "value": 12 }, { "label": "Household", "value": 31 } ] } ],
"body": { "category_id": "{input.category}", "status": "reviewed" } }
```
- The card takes the keyboard, so you can type in its fields. Return presses the card's button, except in a long list's filter field, where it picks the highlighted choice without sending.
- The fields are grouped as System Settings groups them: a label and its value on each row, and a field that needs room, such as notes or several picks, in a group of its own under its label.
- Escape or Cancel puts the form away without sending anything. A click elsewhere in the panel does too while nothing has changed, and the click goes on to what it was on, so you can click from one row to the next. Once something has changed, a click elsewhere leaves the form open, so nothing you typed is lost. Clicking another app or the menu bar icon closes the panel as usual and keeps the form: the card is back when the panel opens on its page.
- On a row's button, the card is titled with the row, with the row's amount and grey line under it. A long list's suggestions lead under Suggested, with the search box over every choice below them.
- When the service says no, the card stays open with its reason, as the form in the page's place does.
- Everything else is the same as in the page's place. `"form_style": "page"` is the default, and only a button with `inputs` can have `form_style`.
### Edit forms
A form can open on what's there now and send back only what you change. Give each input a `start`, read from the row for a row's button or from the card's answer for a card's button, and the button `"send": "changed"`. This is the Transactions page's edit form, opened with a click on the row (`"row_actions_place": "row"`):
```json
{ "label": "Edit transaction", "icon": "pencil", "method": "PUT", "path": "/v2/transactions/{id}",
"form_style": "card", "submit": "Save", "send": "changed",
"inputs": [
{ "name": "category", "label": "Category", "kind": "choice", "start": "category_id",
"choices": { "each": "cats.categories", "fields": { "label": "name", "value": "id", "group": "group_name" } } },
{ "name": "payee", "label": "Payee", "start": "payee", "max": 140 },
{ "name": "reviewed", "label": "Reviewed", "kind": "toggle", "start": "status",
"on_value": "reviewed", "off_value": "unreviewed" },
{ "name": "notes", "label": "Notes", "lines": 4, "start": "notes", "max": 200 },
{ "name": "tags", "label": "Tags", "kind": "choice", "multiple": true, "start": "tag_ids",
"choices": { "each": "tags.tags", "fields": { "label": "name", "value": "id" } } } ],
"body": { "category_id": "{input.category}", "payee": "{input.payee}", "status": "{input.reviewed}",
"notes": "{input.notes}", "tag_ids": "{input.tags}" } }
```
- A text field opens on the value as text, and a choice on the choice with that value. Several picks open on the values in a list that are also choices. A toggle opens on when the value is its `on_value` or `true`.
- With `"send": "changed"`, Save stays dimmed until something differs from what the form opened on. Only the changed fields go out: the other keys are left out of the body, so the form never writes back a value nobody touched. A field you empty on purpose goes as empty: `""` for text, `null` for a choice, `[]` for several picks.
- When the row changed at the service since the form opened, nothing is sent and the card says so.
- Leave out `send` (or write `"send": "all"`) when the request replaces the whole thing, such as Pi-hole's list of upstream servers: every field goes, its `start` only filling the form.
### Choices from the answer
A choice input can list what the card's answer holds instead of fixed choices, such as a budget's categories. Give `choices` a list rule, as a map's `items` takes, with `label`, `value` and, if you like, `group`:
```json
{ "name": "category", "label": "Category", "kind": "choice", "required": true,
"choices": { "each": "cats.categories",
"where": { "all": [ { "path": "archived", "equals": false }, { "path": "is_group", "equals": false } ] },
"fields": { "label": "name", "value": "id", "group": "group_name" } } }
```
- The list is read when the form opens, from the answer the card shows, so the request that fills it goes in the card's source, beside the others. Up to 500 choices, in the answer's order; each group is a heading in the menu.
- When the form is sent, the answer is read again, and a value that has left the list since is refused.
- Past 24 choices the menu becomes a search box over a short list. Typing narrows it to the choices whose label holds what you type, the arrow keys move through what shows, and Return picks one without sending the form.
- A choice made from the answer can't have a `default` or a `guess`. If it’s required, open the form to pick a value. Shortcuts can omit an optional choice when it presses the button. Its values come from the service, so they can fill the path or the body, never a header.
On a row's button, `suggest` reads the row for the values worth offering first, such as the categories an agent thinks fit:
```json
"suggest": { "each": "custom_metadata.legato.choices", "fields": { "value": "category_id" } }
```
The suggestions show as chips above the menu, and the first one is picked when the form opens. Only values that are also on the input's list count, up to 6, and they take the list's labels, so a row can't add a choice or name one differently. Picking a chip or a menu entry sets the same value.
### A switch in the form
A `toggle` is on or off, so it's never `required`, and its `default` is `true` or `false` (off unless set). It fills one JSON body value whole, written exactly `"{input.name}"`: never the path, a header, a form field or part of a longer text, and a form that opens a page can't have one. Numbers in `on_value` and `off_value` must be whole numbers up to 9007199254740991, or have a fraction. This one adds a tag when it's on and leaves the tags alone when it's off:
```json
{ "name": "remember", "label": "Remember for this payee", "kind": "toggle", "on_value": [77] }
```
with `"additional_tag_ids": "{input.remember}"` in the body. A list or true/false filling a body value whole goes out as JSON.
### Forms that open a page
A form can open one of your pages with what was typed, instead of sending a request: a search. Give an `open` button `inputs`, and make its `url` a link to the page, with each `{input.name}` as a whole value of the link's query. This is the Paperless page's Search Paperless:
```json
{ "kind": "open", "label": "Search Paperless", "icon": "magnifyingglass",
"url": "legato://page/paperless-search?q={input.q}",
"inputs": [ { "name": "q", "label": "Search", "required": true, "max": 200, "placeholder": "Words, or tag:bills" } ],
"submit": "Search" }
```
The page it opens takes the value as a [param](https://legatobar.com/docs/detail-pages.md#one-page-for-every-item) of type `query`, `"params": { "q": { "type": "query", "example": "insurance" } }`, and its source asks the service with it: `/api/documents/?query={param.q}&page_size=25`.
- **What was typed goes in the link as one value,** percent-encoded, so `tag:bills "late fee" & more` arrives as typed and can't add a name to the link or reach another page. The page checks it as its param, and when it refuses the value, the form stays open and says why.
- **Every input is required,** since a page link takes every value. The link names one of your pages, its id and names written out; only the values come from the form.
- **Search sends the form and shows the page,** as a card's link does: the form closes, and Back returns to the page you searched from. Nothing is sent to the button's own source.
- **It stays on a card with nothing to show,** as Add Event does: an empty inbox is still worth searching from.
- **Spotlight opens the form,** as for any button with `inputs`. It never goes on a notification.
---
# Rows and checklists
### One action per checklist row
A [checklist](https://legatobar.com/docs/card-lists.md#checklist) whose `items` are mapped with `each` can carry an `itemAction` next to its `actions`: one action object, with the same fields as a button, that runs for the row you tick. Its `path`, `body` strings and `headers` are templates filled from that row of the source's answer, so `{id}` is the task's own id. This is the Todoist page's checklist, which closes a task:
```json
{ "id": "due-now", "type": "checklist", "label": "Next up", "items": [],
"source": { "ref": "todoist", "map": { "items": { "each": "due.results", "sort": "due.date", "limit": 4,
"lookup": { "from": "projects.results", "by": "id", "on": "project_id", "as": "project" },
"fields": { "text": "content", "detail": { "template": "{due.date|day} · {project.name}" }, "done": "checked" } } } },
"itemAction": { "label": "Complete", "icon": "checkmark", "method": "POST", "path": "/api/v1/tasks/{id}/close" } }
```
A repeating task closed this way moves to its next date, which Todoist works out, and leaves the list once that date is ahead. Closing a parent task closes its subtasks too.
- A row that isn't done shows an empty circle; click it and the request goes out with that row's values. Done rows don't fire. The `label` names the action for VoiceOver and the row's tooltip.
- A value filled into the `path` is percent-encoded, so an id holding `/` or `?` can't name another route. Body strings and header values are filled as they are. The filled path must still start with `/`.
- `when` tests the row rather than the whole answer: `{ "path": "priority", "gt": 1 }` leaves low-priority rows plain.
- With [`graphql`](https://legatobar.com/docs/buttons.md#buttons-that-send-graphql) in place of `body`, a tick sends a GraphQL mutation: the row fills its `variables`, and there a string that is one placeholder alone keeps its type, as on a row's button.
- A row the answer leaves without a value for a placeholder gets no request; the Source Preview window lists such rows under Issues, so you can see it before a tick does nothing.
- The row spins until the source answers again (at most a minute), then shows whatever the service now says: the task gone, or ticked. Success, failure reasons, cooldowns and sign-in all work as for a button.
With `"mark": "switch"`, the rows are things that are on or off, and a press acts on a row that's on as well as one that's off, so one toggle request serves both. This is a Home Assistant card of the lights that are on, each with a bulb that turns it off; its source's template answers `lights_on` as a list of `{ "name", "id", "on" }`:
```json
{ "id": "lights", "type": "checklist", "label": "Lights on", "mark": "switch", "items": [],
"source": { "ref": "home-assistant", "map": { "items": { "each": "lights_on", "limit": 20,
"fields": { "text": "name", "done": "on", "icon": { "template": "lightbulb" } } } } },
"itemAction": { "label": "Turn off", "method": "POST", "path": "/api/services/light/toggle",
"body": { "entity_id": "{id}" } } }
```
### Sending the row back
Some services replace a whole item with whatever you send: Mealie's shopping items take a `PUT` of the full item, and a body of just `{ "checked": true }` empties its note and quantity. For those, add `"body_from": "row"`. The tick then sends the row's element as the service sent it, with the fields in `body` laid over it:
```json
"itemAction": { "label": "Tick", "icon": "checkmark", "method": "PUT",
"path": "/api/households/shopping/items/{id}", "body_from": "row", "body": { "checked": true } }
```
- The element goes back as it came, nulls and nested objects included. Fields Legato added to the row (a `lookup`) aren't sent, and nothing copied from the row is read for placeholders, so a note that says `{id}` stays as written.
- `body` is an object, and each of its fields replaces the element's field of the same name. Its strings are filled from the row as usual, and `{action.id}` there is the press's id.
- `map.items` must read a request's answer with `each`, not a `derive`d value, and without `entries`, `zip`, `flatten` or `group`, which make new rows. The page won't load otherwise.
- The method is `PUT`, `PATCH` or `POST`. It can't go with `form` or `graphql`, and only a checklist's `itemAction` takes it.
- The element is as the source last answered. If someone changed the item in the service since then, the tick puts back what Legato saw, so give the source a short `every`.
- A body over 256 KB isn't sent: the tick says so.
### Buttons on each row
A [list](https://legatobar.com/docs/card-lists.md#list) or [pacing](https://legatobar.com/docs/card-numbers.md#pacing) card whose `items` are mapped with `each` can carry `row_actions`: up to three places for buttons at the end of every row's first line, each filled from that row. A pacing row's bar and detail line, and a list row's grey line, run the card's full width under them. This is a media server's Now playing card, with Message and Stop on each stream:
```json
{ "id": "now", "type": "pacing", "label": "Now playing", "items": [],
"source": { "ref": "media", "map": { "items": { "each": "streams",
"fields": { "key": "id", "label": "title", "value": "minutes", "target": "length" } } } },
"row_actions": [
{ "label": "Message", "icon": "bubble.left.and.bubble.right", "method": "POST", "path": "/Sessions/{id}/Message",
"body": { "Header": "Legato", "Text": "{input.text}", "TimeoutMs": 10000 },
"inputs": [ { "name": "text", "label": "Message", "required": true, "max": 120 } ], "submit": "Send" },
{ "label": "Stop", "icon": "stop.fill", "method": "POST", "path": "/Sessions/{id}/Playing/Stop",
"confirm": { "message": "Stop {title} for {user}?", "button": "Stop" },
"when": { "path": "can_control", "equals": true } } ] }
```
- Each button has a button's fields: `label`, `icon`, `method`, `path`, `body`, `headers`, `when`, `success`, `error`, `completion`, `confirm` (`true`, or `message` and `button`), `graphql`, `form` and `inputs` (a [form](https://legatobar.com/docs/button-input.md#buttons-that-ask-for-text)). It needs an SF Symbol `icon`, which is what the row draws; the `label` is its tooltip and what VoiceOver says.
- A bare `{x}` reads that row of the source's answer, as `itemAction` does, so `{id}` is the stream's own id. `{answer.…}` reads the card's whole answer, `{input.…}` what the form sends, and `{action.id}` the press's own id. A row field called `answer`, `input` or `action` is never read: those names come first.
- A value filled into the `path` is percent-encoded and must be a single value: an empty one, `.` or `..` can't go there. In the `body`, a string that is one placeholder alone keeps its type, so a number stays a number, as on a button. **This differs from `itemAction`**, which fills every body value as text.
- `headers` take fixed values only: a row's values never go in a header.
- A row's button can send a GraphQL mutation with [`graphql`](https://legatobar.com/docs/buttons.md#buttons-that-send-graphql) in place of `body`. The row's values go in its `variables`, as in `"variables": { "id": "{id}" }`, and the query goes as written.
- `when` tests the row. A row it fails has no button there, and the button's place stays empty, so the others don't move.
- `"alternate": true` puts a button in the place of the one before it, for the other half of an on/off pair such as Stop and Start. Give the two `when`s that never hold on the same row; if both do, the first one shows. A card can list four buttons this way, in three places: Stop, Start (its alternate), Remove and Delete files. The first button can't be an alternate, and an alternate can't follow another. A row that lacks a value the button needs (a stream with no `user` for Stop's question) shows the button dimmed, saying why, and the Source Preview window lists it under Issues.
- The buttons show under the pointer, with keyboard focus and while one runs; the first line keeps their room the rest of the time, so nothing moves. Give the card `"row_actions_shown": "always"` to show them on every row all the time, as a download queue does. When no row on the card has a button now (no stream can be controlled), the rows take the full width instead. VoiceOver offers them as the row's actions.
- On a list, `"row_actions_place": "detail"` draws the buttons as one small group over the row's detail, such as its amount, and only under the pointer or with keyboard focus. The rows keep no room for them, so the list reads like any list until you point at a row, as in a mail app. It suits rows you mostly read and sometimes answer, such as an agent's questions. The group sits in one white capsule, as a mail app's hover actions do: plain icons, the one under the pointer in a soft round highlight. It can't go with `row_actions_shown` set to `always`, and a pacing card keeps its buttons at the end of the first line.
- On a list, `"row_actions_place": "row"` draws no buttons at all: a click on a row presses the first button that row offers, which usually opens its form, as clicking a message opens it in a mail app. The row lights under the pointer as a link does, and a row that offers no button keeps its `url`. It takes no `row_actions_shown`.
- On a list with `"row_actions_place": "detail"`, put `"|"` between two buttons to draw a thin line. `"row_actions": [{ "label": "Accept", … }, "|", { "label": "Reject", … }, { "label": "Choose category", … }]` sets Accept apart. It goes only between two buttons, never between an alternate and its partner, and takes no place of its own.
- `confirm` asks in the row: its question takes the row's text, and ✕ and ✓ take the icons' place. A form opens in the page's place, titled with the button and the row. Only one question or form is open at a time.
- A question or form acts only on the row it was opened for. When the row changes what it shows (another episode in the same session), the question closes with a note; when the row leaves (the stream ended), it closes quietly. A form's Send says so instead.
- The button spins until the source answers again (at most a minute), as a checklist row does.
- `done_note` (1–12 characters, such as `"Passed"`) is what the row says after the service accepts a press. The words sit where the row's icons were, for two minutes, whenever the pointer is elsewhere, and the row keeps its size. Use it when a press changes nothing else on the row, as with a test that passes. A refused press shows its reason under the card instead, and pressing again clears the words.
- Rows come and go, so row buttons are never offered to Spotlight, Shortcuts or notifications. The card's own `actions` are, as always.
- Not on a checklist (which has `itemAction`), a `shelf` list, a `ring` or `rings` pacing card, or a list with `ask` or `copyable`.
---
# Secrets
A source names a secret by name; the value itself lives in the Mac's Keychain. Add secrets in **Settings → Secrets**, which also lists the secrets your pages need, with the name and host filled in, so you only paste the value.
To keep a value in 1Password instead, see [1Password secrets](https://legatobar.com/docs/1password.md). For Todoist, **Connect** signs in through your browser and saves a [connection](https://legatobar.com/docs/source-requests.md#connections) instead of a token.
- A secret's name is 1–48 lowercase letters, digits and hyphens. Settings → Secrets saves no other names, so a page that names `my_api` can never be filled; call it `my-api`.
- Each secret is tied to **one host**. Legato sends it only to that host, so a page can't point a secret at another server. One name can be saved for several hosts, each with its own value: a [host list](https://legatobar.com/docs/source-requests.md#several-hosts-from-a-list) sends each host the one saved for it.
- Secret values are sent only to their configured service, when a request needs them. The `legato` tools and MCP server never read or return them, and they aren't in the page file. Agents can [list secrets, change their expiry dates and delete them](https://legatobar.com/docs/mcp-tools.md#secrets) without seeing a value.
- Save source secrets in Settings → Secrets, or with `Legato secret` below. Legato reads only its own source-secret records in the Keychain. A changed app signature or Keychain access restriction can prevent the current build from reading a saved item; if the card says "This build of Legato can't read the secret", save it again in Settings → Secrets.
- Use the least access a service offers: a Pi-hole app password rather than its admin password, and an Uptime Kuma API key rather than a login.
### From 1Password
A secret's value can stay in 1Password instead. In Settings → Secrets, add it with **+** (or **Set…**), choose **1Password** under **Value from** and give the item's reference, such as `op://Legato/Pi-hole/password` (in 1Password, **Copy Secret Reference** from a field's menu). Legato reads the value when a source needs it, with a [1Password service account](https://www.1password.dev/service-accounts) saved in the same tab (**Set Up…** beside 1Password), through Legato's own 1Password helper (nothing else to install). [Secrets from 1Password](https://legatobar.com/docs/1password.md) walks through setting it up. A secret in two parts, such as an OAuth client's ID and secret, can come from [two fields](https://legatobar.com/docs/1password.md#a-secret-in-two-fields). From the command line, `Legato secret set --1password` links a reference only when the caller supplies the same service account token saved in Legato. Saved references use the token saved now.
- The page still names only the secret (`"secret": "pihole"`). Which 1Password item it is, and the host it's sent to, are set in Settings, never by a page, so a page can't ask for another item or send one elsewhere.
- Legato keeps the value in memory and reads it again every hour, and at once when the service refuses it, so a rotated credential reaches the cards on its own. If 1Password can't be reached, the last value read keeps working for up to a day (unless the service refused it), and Legato tries 1Password again after a minute, then less and less often.
- The service account token is kept in the Keychain and handed to Legato's own 1Password helper on its standard input, never in an environment or on a command line. No `op` tool or Homebrew is needed. Give the service account read access to only the vaults Legato needs.
- A wrong reference, or one the service account can't read, shows when you save it, and on the card with a message saying what's wrong.
### Expiry dates
Some tokens stop working on a set day: a Tailscale API access token lasts 90 days at most, and a GitHub fine-grained token as long as you chose. Save that day with the secret and a page can warn you before it comes.
- In Settings → Secrets, tick **Expires** and pick the day when you add or replace a secret. To change only the day, right-click the secret and choose **Set Expiry…**. From the command line, add `--expires 2027-02-09` (or `--expires 90d`) to `secret set`, or run `secret expires`.
- From 14 days before that day, the secret's status is **Needs attention**, and hovering over it says how many days are left.
- Saving a new value takes the day shown in the sheet, or none. A day kept from the old token would warn at the wrong time.
- A page reads only the day, through its source's [`secret_expires`](https://legatobar.com/docs/source-reference.md#source-and-page-reference), and counts down to it with the [`expires` rule](https://legatobar.com/docs/mapping-expiry.md#expiry).
- For a 1Password secret, the day is kept in Legato, not 1Password. If you rotate the item in 1Password, change the day in Legato too.
### From the command line, or an agent
The Legato app is also a command, for scripts, password managers and AI agents that already hold a credential. It reads the value from standard input, never from an argument, so the secret stays out of shell history and the process list, and saves it to the Keychain exactly as Settings → Secrets would.
Nothing is sent anywhere: the value goes to the Keychain, and cards that were waiting for it try again at once.
```bash
# Typed: the value isn't echoed
/Applications/Legato.app/Contents/MacOS/Legato secret set lunch-money
# From 1Password, without the value passing through anything else
op read 'op://Private/Lunch Money/credential' | /Applications/Legato.app/Contents/MacOS/Legato secret set lunch-money
```
| Command | Does |
| --- | --- |
| `Legato secret set NAME [--host HOST] [--replace]` | Saves the value read from standard input. `HOST` defaults to the host of the page that names `NAME`, so write the page first. A secret that's already saved needs `--replace`. |
| `Legato secret set NAME --1password REFERENCE [--1password REFERENCE] [--host HOST] [--replace]` | Links a [1Password reference](https://legatobar.com/docs/1password.md#from-the-command-line-or-an-agent) instead of a value, only with the same `OP_SERVICE_ACCOUNT_TOKEN` saved in Legato. Twice for a [secret in two fields](https://legatobar.com/docs/1password.md#a-secret-in-two-fields). |
| `Legato secret set NAME … --expires DATE` | Saves the expiry date with the secret: `2027-02-09`, or `90d` for 90 days from today. Without it, a new value has no date. |
| `Legato secret expires NAME DATE\|none [--host HOST]` | Changes or clears only the expiry date. |
| `Legato secret list` | Saved secrets by name and host (`from 1Password` for a reference), with their expiry dates and the pages that use each, then the ones your pages name that aren't saved yet. Values are never shown. |
| `Legato secret delete NAME [--host HOST]` | Removes a saved secret. |
| `Legato secret token set [--replace]` / `token delete` | Saves (or removes) the [1Password service account token](https://legatobar.com/docs/1password.md#the-service-account-token-from-the-command-line), read from standard input. |
An agent setting up a page for you writes the page, then runs `secret set` with the credential piped in from wherever it holds it, then `secret list` to check nothing is missing.
---
# Secrets from 1Password
A page's [sources](https://legatobar.com/docs/sources.md) name their credentials as secrets, such as `"secret": "pihole"`. A secret's value can be typed into Settings → Secrets and kept in the Mac's Keychain, or it can stay in 1Password: Legato then reads it with a 1Password service account when a source needs it.
Keeping it in 1Password means there's one copy of each credential. When you rotate a key in 1Password, the cards pick up the new one on their own.
## What you need
- A 1Password account where you can create a **service account**.
That's all. Legato reads 1Password with a helper of its own, built with [1Password's SDK](https://www.1password.dev/sdks/), so you don't need 1Password's `op` tool or Homebrew. (If the helper can't run, Legato uses `op` where it's installed, at `/opt/homebrew/bin/op` or `/usr/local/bin/op`. Settings → Secrets shows which it reads with.)
## Set it up
1. **Make a vault for Legato.** Put in it only the items your pages need, such as your Pi-hole app password or a GitHub token. A service account can only read the vaults you grant it, so a separate vault keeps what Legato can reach small.
2. **Create a service account** with read access to that vault, following [1Password's guide](https://www.1password.dev/service-accounts/get-started). 1Password shows its token once; it starts with `ops_`.
3. **Save the token in Legato.** Open **Settings → Secrets** and choose **Set Up…** beside **1Password**. Paste the token into **Service account** and choose **Save**. Legato keeps it in the Keychain. Or save it from a shell, without it appearing on screen: `printenv OP_SERVICE_ACCOUNT_TOKEN | /Applications/Legato.app/Contents/MacOS/Legato secret token set` (see [below](#the-service-account-token-from-the-command-line)).
4. **Copy the item's reference.** In 1Password, open the item, then choose **Copy Secret Reference** from the field's menu. A reference looks like `op://Legato/Pi-hole/password`.
5. **Add the secret.** Choose **+** under the list (or **Set…** on a secret a page already asks for) and fill in:
- **Name**: the name the page uses, such as `pihole`.
- **Host**: the host the secret goes to, such as `pi.hole` or `192.168.1.2`.
- **Value from**: **1Password**.
- **Reference**: the reference you copied.
Choose **Save**. Legato reads the item once right away and says whether 1Password returned a value. A wrong reference, or a vault the service account can't read, shows here rather than on a card.
The page itself doesn't change. It names the secret exactly as it would for a Keychain secret:
```json
"sources": {
"pihole": {
"url": "http://pi.hole",
"secret": "pihole",
"every": "1m"
}
}
```
A secret the page needs but nobody has set yet is already in the Secrets list, marked **Not set**. Choose **Set…** on it: its name and host are filled in. Switch **Value from** to **1Password** and paste the reference.
## A secret in two fields
Some secrets come in two parts: a username and a password, or an OAuth client's ID and secret. Legato sends them as one value, `first:second`. A 1Password item usually keeps the two in separate fields, so give Legato a reference to each:
- In Settings → Secrets, choose **1Password** under **Value from**, **Two** under **Fields**, then fill in **First** (the username or client ID) and **Second**.
- When you install a page, Sign in names the fields, such as **Client ID reference** and **Client secret reference**.
- From the command line, give `--1password` twice, the first field first.
Legato reads both fields together and checks both when you save. If one can't be read, the message names it. The first field can't contain a colon, since the colon separates the two parts.
If an item keeps both parts in one field as `first:second`, choose **One** (**One field** on Sign in) and give that field's reference.
## From the command line, or an agent
`Legato secret set` can link a reference when the caller supplies the **same service account token saved in Legato**:
```bash
/Applications/Legato.app/Contents/MacOS/Legato secret set pihole --1password 'op://Legato/Pi-hole/password'
```
For a [secret in two fields](#a-secret-in-two-fields), give `--1password` twice: `--1password 'op://Legato/Example API/client id' --1password 'op://Legato/Example API/client secret'`.
Before saving anything, Legato compares your `OP_SERVICE_ACCOUNT_TOKEN` with its saved token, then checks the reference by reading it, with the helper (or `op`). It passes only that token and a small fixed environment; account, Connect-server and configuration overrides from your shell are ignored. A different token, an app sign-in or no token is refused. Use Settings → Secrets for those setups.
`--host HOST` sets the host (by default, the host of the page that names the secret), and `--replace` overwrites a secret that's already saved, with the same check. `Legato secret list` shows these secrets as `from 1Password`. Saved references use the service account token saved now.
### The service account token, from the command line
```bash
printenv OP_SERVICE_ACCOUNT_TOKEN | /Applications/Legato.app/Contents/MacOS/Legato secret token set
```
`Legato secret token set` saves the token read from standard input, never from an argument, so it stays out of shell history and the process list. A saved token is replaced only with `--replace`. `Legato secret token delete` removes it. Either way, Legato forgets every value it read with the old token. `Legato secret list` says whether a token is saved, never what it is.
Saving a token gives Legato the access that token holds. Replacing or deleting it can stop cards working if the new token cannot read the items or no token is saved. Legato's copy is in the Keychain, locked to Legato: another program asking for it is refused unless you approve a macOS prompt, so a token you saved isn't handed to agents. The same goes the other way: an item another program puts in Legato's part of the Keychain isn't used without your approval.
### Which service account to give Legato
- **One of its own, for a vault of its own** (recommended). Agents that don't hold that exact token ask you to link references in Settings.
- **The same token your agents use.** Simpler, and agents can set up 1Password secrets themselves. Legato's vault is then only as protected as your agents' environment.
## How Legato reads it
- **When a source needs it, together.** The first request that uses the secret reads it from 1Password. Reads asked for within a tenth of a second of each other go to 1Password as one request, and so does every secret due to be read again within the next 10 minutes, so the secrets your pages use renew together. Several cards asking for the same secret share one read.
- **Then from memory, for an hour.** Legato keeps the value in memory, never on disk, and reads it again after an hour. So a rotated credential reaches the cards within the hour.
- **Again when the service refuses it.** When the service turns the credential down (HTTP 401, or a refused sign-in), Legato reads it again before the next try, in case it was rotated, and never sends the refused value again. Other failures, such as an unreachable host, an HTTP 403 or a server error, don't cause a new read.
- **Failed reads wait their turn.** When 1Password can't be read, Legato waits a minute before trying that item again, then twice as long each time, up to an hour, however often the cards poll. At most two requests run at once.
- **Through Legato's helper.** The helper starts with the first read and signs in to 1Password once, then answers each read over a pipe, so the service account isn't signed in again for every read. Legato hands it the token on its standard input, never in its environment or on its command line, and it writes nothing anywhere else, so no secret ends up in a log. It gets nothing from your environment, so no other 1Password sign-in applies. A read that takes more than 40 seconds stops the helper; the next read starts it again. It starts again, too, when you save a different service account.
- **When 1Password can't be reached.** The last value read keeps working for up to a day after it was read, unless the service had refused it. After that, cards that need it wait, and say why, until 1Password answers again. When Legato starts with no way to reach 1Password, those cards wait from the start.
Service accounts have [hourly and daily request limits](https://www.1password.dev/service-accounts/rate-limits) that depend on your 1Password plan (on Individual and Families plans, 1,000 requests a day across the account). One request reads every secret in it, from any number of items, and signing in costs none. Because Legato reads your secrets together about once an hour, that's roughly 24 requests a day however many 1Password secrets your pages use, plus a read after each refusal and the retries above. (`op`, where Legato falls back to it, makes a request for each secret.)
## What a page can and can't do
A page names a secret and nothing else. Which 1Password item it is, and which host it's sent to, are set in Settings, or from the command line with the same service account token saved in Legato. A page can't name a 1Password item, so a page an agent wrote can't ask for another item in your vault or send one somewhere else.
Like every secret, a 1Password secret is tied to **one host**, and Legato sends it only there. The `legato` tools and MCP server never read or return secret values, so an agent working through them doesn't see them.
This protects you from pages and from agents using Legato's tools. It isn't a sandbox against a program running as you: anything that runs as your user can read what your user can, including other processes' environments, as [1Password notes](https://www.1password.dev/cli/secrets-environment-variables).
## In Settings → Secrets
A 1Password secret shows **1Password** where its value comes from, and its status:
| Status | Means |
| --- | --- |
| Ready | Read with the service account when a source needs it. |
| Needs attention | No service account is saved (choose **Set Up 1Password…**), or this copy of Legato has neither its helper nor `op` (reinstall Legato). |
**Replace…** on a 1Password secret opens it with its reference filled in, so you can change it. A reference isn't secret; a Keychain value is never shown. **Remove…** removes the secret from Legato, not the item from 1Password.
**Remove…** in the **1Password** sheet (choose **Configure…** beside 1Password) deletes the service account token from the Keychain, forgets every value read with it and stops any read under way. Cards that use 1Password secrets then stop until a token is saved again. Saving a different token also forgets those values; the saved references are then read with the new token.
## Troubleshooting
When a read fails, the card says why. The common messages are below; anything else 1Password reports appears after "1Password:".
| The card says | Try |
| --- | --- |
| Add a 1Password service account in Settings → Secrets | In Settings → Secrets, choose **Set Up…** beside **1Password** and save a token. |
| 1Password has no vault by that name that the service account can read | The vault name is wrong, or the service account can't read that vault. A service account's vaults can't be changed after it's created, so fix the reference, or create a new service account that can read that vault and save its token. |
| 1Password has no item at that reference, or the service account can't see it | Check the item's name in the reference against **Copy Secret Reference**. |
| That 1Password item has no field by that name | The field name is wrong; copy the reference from the field itself. |
| 1Password refused the service account token | The token isn't valid any more. Create a new one for the service account and save it again. |
| 1Password's request limit for this service account was reached | Your plan's hourly limit for this token, or the daily limit every service account on your 1Password account shares. Legato tries again later. Legato reads each secret about once an hour, so reaching it usually means something else on the account is busy; a plan with higher limits also helps. |
| 1Password couldn't be reached, or 1Password didn't answer within 30 seconds | Check the Mac's connection. Legato tries again after a minute, then less and less often, and keeps using the last value it read for up to a day. |
To check a reference outside Legato, run `op read` with the same token, if you have `op`:
```bash
OP_SERVICE_ACCOUNT_TOKEN='ops_…' op read 'op://Legato/Pi-hole/password' > /dev/null && echo ok
```
## Security notes
- The token is kept in your Keychain, under Legato's own name, and handed only to Legato's helper, which is inside the signed app (or to `op`, when Legato falls back to it).
- The helper runs 1Password's SDK, whose core runs in a WebAssembly runtime that needs one of the Hardened Runtime's exceptions (`allow-unsigned-executable-memory`). That exception is the helper's alone; Legato itself takes none of them.
- When Legato falls back to `op`, it runs `op` from where Homebrew or 1Password's installer put it. Anything that can replace that file as your user could see the token, as it could if the token were in a shell profile. Keep the service account to read access on Legato's own vault.
- To stop Legato reading 1Password at once, choose **Remove** in Settings → Secrets: it also forgets the values already read. Revoking the token in 1Password stops new reads, but a value Legato already holds can keep working for up to a day after it was read (it can't tell a revoked token from 1Password being unreachable), or until you quit Legato.
---
# Lists
A page that checks a place, such as where a package was delivered, shouldn't carry your town in its file: a page shared as a download would then have it in. Instead, keep the words or places in a named list in **Settings → Lists**, on this Mac, and the page names the list with an [`in_list`](https://legatobar.com/docs/mapping-conditions.md#conditions) condition. A page can also send a list's entries to a service, such as the symbols on a stock watchlist. See [Sending a list](#sending-a-list).
- A list's name is 1–48 characters: `a–z`, `0–9` and `-`, starting with a letter or digit, such as `delivery-area`.
- Each entry is plain text, such as "Fernhollow, ST", never a pattern.
- A value matches when it contains any entry as whole words, whatever the case, accents or punctuation.
- Lists are kept in Settings on this Mac, never in a page file, so a page you share or download names the list and holds no one's places.
- A list that's only checked with `in_list` never leaves the Mac. A list a page sends goes to that page's service each time the page reads it, and Settings → Lists shows where.
- A missing or empty list reads false unless `if_missing` is true, and the page still says where to add it, unless the condition is `optional`.
- An agent can set a list for you with the MCP tool `set_list`, or `legato lists set` from a shell. See [Lists and History](https://legatobar.com/docs/mcp-tools.md#lists-and-history).
## Sending a list
Some services answer one item at a time, such as a stock quote, or take a list of ids in one request, such as coin prices. A named request can send a list's entries:
```json
"requests": {
"quotes": { "path": "/api/v1/quote?symbol={entry}", "each_entry": { "list": "stock-watchlist", "max": 30 } },
"prices": { "path": "/api/v3/simple/price?ids={entries}&vs_currencies=usd", "all_entries": { "list": "coins" } }
}
```
- `each_entry` sends the request once for each entry, with `{entry}` filled in. `all_entries` sends it once, with every entry in place of `{entries}`, separated by commas.
- Entries go in the request's path or query, encoded, and nowhere else. An entry that isn't a plain symbol or id isn't sent.
- While the list is missing or empty, nothing is sent, and the page says to add the list in Settings → Lists.
- When you edit the list, the page reads the service again right away.
- In **Settings → Lists**, the **Used by** column names the service: "Stocks · sent to finnhub.io".
[Requests from a list](https://legatobar.com/docs/source-requests.md#requests-from-a-list) has the details.
---
# History
Most services report what's true now and forget the rest. Parcel lists the deliveries on the way and a short list of recent ones, so a page that reads it can't say how long deliveries took last quarter. Other services report a reading only as it is now.
History keeps what you choose from those answers, on this Mac. The source that fetches from the service gets a `collect`, which says which items to keep, which of their fields, under what key and for how long. Any page it names as a reader can then add a `dataset` source, which answers with the kept rows for the period showing.
`sample` keeps a reading of every item at a set interval, such as each monitor's state every 5 minutes, and a page for one item reads its own. An agent or a script can add rows too, for data that reaches the Mac some other way.
The rows stay on this Mac and don't sync. **Settings → History** shows each history, exports it and deletes it.
## Start here
- [Collect and samples](https://legatobar.com/docs/history-collect.md): What `collect` and `sample` keep, with every setting, and when a page needs neither.
- [Reading history](https://legatobar.com/docs/history-reading.md): The source a reader page uses and the answer it gets.
- [Parcel example](https://legatobar.com/docs/history-parcel.md): Two complete pages, one that keeps deliveries and one that reports how long they took.
## What a history holds
- [Dates and retention](https://legatobar.com/docs/history-dates.md): Which date a row counts under, and how long rows stay.
- [Accounts and readers](https://legatobar.com/docs/history-accounts.md): Whose data a history holds, which pages may read it, and what happens when its page goes away.
- [Coverage and local storage](https://legatobar.com/docs/history-coverage.md): The dates a history has rows for, the gaps in it, and where the data is kept.
- [Rows from outside](https://legatobar.com/docs/history-rows.md): Rows added by an agent or a script.
---
# Collect and samples
Some services only tell you what's happening now. Parcel lists the deliveries on the way and a short list of recent ones, then forgets them, so a page that reads it can't say how long deliveries took last quarter. History fixes that: a page keeps the rows it chooses from each answer, on this Mac, and other pages you allow read them later, with a period row like any other page.
- **One page collects.** A source with `collect` keeps chosen fields of chosen items, as rows in a named history (a dataset), each time it fetches.
- **Other pages read.** A source with `{ "dataset": "name" }` answers with the rows kept, filtered to the page's period, and cards use the usual [rules](https://legatobar.com/docs/mapping.md#mapping) on them.
- **Or samples over time.** With `sample`, a page keeps one row per item per interval, such as each monitor's state every 5 minutes, and a page for each item reads its own with `key`. See [Samples](https://legatobar.com/docs/history-collect.md#samples).
- **Nothing leaves the Mac.** The rows are in Legato's folder on this Mac, they don't sync between Macs, and **Settings → History** shows, exports and deletes them.
- **Rows can also come from outside,** from an agent or a script, with `legato rows add` or the MCP tool `add_rows`.
## When you don't need it
Many services keep their own history and answer for a range of dates. Ask them for the period showing, with `{period.start}` and `{period.end}` in the request (see [Periods](https://legatobar.com/docs/periods.md#periods)), and the page works from the first fetch, with nothing kept on the Mac:
- **Tesla, through Tessie:** the charges request takes `from` and `to`, so a charging page asks for the period's sessions.
- **Lunch Money:** `balance_history` gives monthly balances for a range of months. History is only worth it for daily points.
- **GitHub:** a repository's pull requests carry `created_at` and `merged_at`, so open-to-merge times come from the list itself.
- **Pi-hole:** its long-term database answers for a range of days, 91 by default. Keep a history only to look further back than that.
Use History for services that forget: Parcel's deliveries, readings a service only reports as they are now, or rows an agent supplies. For a single number over time on one sparkline, a [history rule](https://legatobar.com/docs/mapping-sparklines.md#sparkline-readings) is simpler: it shows the newest configured readings (up to 60) for that card, with no `collect` and no readers. Its readings are listed in [Settings → History](https://legatobar.com/docs/history-coverage.md#settings-history) too.
## Collect on the page that fetches
Add `collect` to the source whose answer has the items. This is the Packages page's Parcel source; the complete page is in the [Parcel example](https://legatobar.com/docs/history-parcel.md#a-complete-example-parcel).
```json
"parcel": {
"url": "https://api.parcel.app", "secret": "parcel", "auth": { "type": "header", "name": "api-key" },
"every": "30m",
"requests": { "active": "/external/deliveries/?filter_mode=active",
"recent": "/external/deliveries/?filter_mode=recent" },
"collect": {
"dataset": "parcel-deliveries",
"each": ["active.deliveries", "recent.deliveries"],
"key": "{carrier_code}:{tracking_number}",
"fields": ["carrier_code", "tracking_number", "description", "status_code",
"events[].date", "events[].event", "events[].location"],
"remove_after": { "events[].event": { "markers": ["Received By:", "Delivered:"],
"keep_exact": ["Signature Not Req", "Signature Required"] } },
"date": { "date": { "first": "date", "of": "events", "where": { "path": "event", "contains": "Delivered" },
"sort": { "by": "date", "order": "desc", "as": "date" } } },
"keep": { "for": "400d" },
"readers": ["delivery-times"]
}
}
```
Each time the source answers, Legato takes the items at `each`, keeps only `fields` of each, removes text after the `remove_after` markers, works out the row's `date`, and stores the row under its `key`. A row whose key comes again replaces the one kept. The cards on the page use the answer as they always do: collecting changes nothing they show and adds no request. A source with `collect` that no card uses is fetched all the same, on its `every`. A fetch that fails keeps nothing, including an answer the source's [`fail`](https://legatobar.com/docs/source-polling.md#when-the-answer-reports-an-error) turns down; adding `fail` to a source that collects keeps its history as it is.
**Records and measurements are kept differently.** A record history keeps the latest complete record for each key; it does not append a new version on every poll. A delivery uses its tracking identifier, so a later answer updates that delivery. For measurements over time, each monitor's state or each host's load, add `sample` and History keeps one row per item per interval, timed by Legato's own clock: see [Samples](https://legatobar.com/docs/history-collect.md#samples).
A sparkline's `history` rule is simpler: one number per card over time, with its own `every` and `keep` settings. Its readings are kept in the same database and listed in Settings → History by page, where you can export or delete them, but they aren't a dataset: there's no `collect`, no key and no readers. See [Sparkline readings](https://legatobar.com/docs/mapping-sparklines.md#sparkline-readings).
| `collect` field | Required? | Meaning |
| --- | --- | --- |
| `dataset` | yes | The history's name, which readers use: 1–64 lowercase letters, digits and `-`, starting with a letter or digit, like `parcel-deliveries`. |
| `each` | yes | A [path](https://legatobar.com/docs/mapping.md#mapping) to the list of items to keep, or a list of 2 to 4 paths read in order. When a key comes up more than once in one answer, the item where it first appears is kept. |
| `key` | yes | A template of the item's own fields that names it, the same next time: `{carrier_code}:{tracking_number}`. Up to 256 characters, with at least one `{…}`. Each field it uses must be text; an item whose key is missing, blank, longer than 256 characters or made from a number isn't kept, and is counted as rejected. |
| `fields` | yes | The only fields kept of each item: 1 to 64 different paths. Write `[]` after a list for every item of it: `events[].date`. Everything else in the answer is left out before anything is stored. |
| `keep` | yes | `{ "for": "400d", "clock": … }`: how long a row is kept, `1d` to `9999d`, and what its age counts from. See [How long rows are kept](https://legatobar.com/docs/history-dates.md#how-long-rows-are-kept). |
| `remove_after` | no | For 1 to 16 kept fields, text removed after a marker before the row is stored. See [Removing text](https://legatobar.com/docs/history-collect.md#removing-text). |
| `date` | no | A [rule](https://legatobar.com/docs/mapping.md#mapping), read on the row as it's kept, giving the row's date. See [Dates](https://legatobar.com/docs/history-dates.md#dates). |
| `time_zone` | no | The zone the service's times without one are in, like `America/Los_Angeles`. Needs `date`. |
| `date_range` | no | `{ "from", "to" }`: the dates kept as dates. Needs `date`. |
| `readers` | no | Up to 32 ids of other pages that may read the history. See [Readers](https://legatobar.com/docs/history-accounts.md#readers-and-grants). |
| `accepts_rows` | no | `true` lets `legato rows add` and `add_rows` add rows. `false` by default. |
| `account` | no | A template from the answer saying whose data it is, like `{account.id}`. When its value changes, a new history starts. See [Accounts](https://legatobar.com/docs/history-accounts.md#accounts-and-histories). |
- **Keep complete records.** A row is replaced whole, so an item must carry everything you want kept each time. Parcel sends every event of a delivery each time, which suits it. A service that sends only the newest events of a record would replace the older ones.
- **Keep only what a reader needs.** `fields` is the promise of what's stored: a page with `fields` of three names keeps three names, whatever else the service sends.
- **One source per history.** A page can collect several histories from different sources, but two sources on one page can't collect the same `dataset`.
- **What can collect:** an `http` source, or a source of `collect` alone that only [receives rows](https://legatobar.com/docs/history-rows.md#rows-from-outside-legato). Not a `calendar`, `reminders` or `dataset` source.
- **What can't:** a source that uses `{period.…}` or `{compare.…}`, since one history can't change with the period row; and any source on a page with [params](https://legatobar.com/docs/detail-pages.md#one-page-for-every-item), or `{param.…}` anywhere in `collect`. Collect on the page that lists every item, and let the page with params read the history.
Legato checks `collect` with the rest of the page, whether or not a card uses the source. A mistake stops the page loading, with a message after the file's name (`packages.json: sources.parcel.collect: …`) such as:
| Message | Cause |
| --- | --- |
| `sources.parcel.collect: key is a template of the item's fields, like {carrier_code}:{tracking_number}, of up to 256 characters` | `key` has no `{…}`, or is too long |
| `sources.parcel.collect: fields lists 1 to 64 different fields to keep` | `fields` is empty, too long, or names a field twice |
| `sources.parcel.collect: keep is { "for": days like 400d, "clock": date, last_seen or date_or_last_seen }` | `keep` is missing or wrong |
| `sources.parcel.collect: time_zone reads the date rule's times, so it needs a date` | `time_zone` without `date` |
| `sources.parcel.collect: date_range bounds the date rule's dates, so it needs a date` | `date_range` without `date` |
| `sources.parcel.collect: collect has no setting "readres" (it takes accepts_rows, account, dataset, date, date_range, each, fields, keep, key, readers, remove_after, time_zone)` | A misspelled setting |
| `sources.archive and sources.parcel both collect parcel-deliveries; a page keeps a dataset from one source` | Two sources, one history (named in alphabetical order) |
| `sources.parcel: a source that collects can't use {period.…}` | A collecting source follows the period row (`{period.…}` or `{compare.…}`) |
| `sources.parcel: a page with params can't collect; collect on the page that lists every item, and read its dataset here` | `collect` on a page with `params` |
| `sources.daily: only an http source can collect` | `collect` on a calendar or reminders source |
| `sources.daily: a source that only receives rows has collect and nothing else` | A source with no `url` that has more than `collect` |
| `sources.daily: with no url to fetch, collect needs "accepts_rows": true` | A source of `collect` alone without `accepts_rows` |
### Removing text
Carriers put names in delivery events: "Delivered. Received By: Pat Example". `remove_after` keeps the first marker in the field and replaces everything after it with ` [removed]`, before the row is stored:
```json
"remove_after": { "events[].event": { "markers": ["Received By:", "Delivered:"],
"keep_exact": ["Signature Not Req", "Signature Required"] } }
```
| Kept as | From |
| --- | --- |
| Delivered. Received By: [removed] | Delivered. Received By: Pat Example |
| Delivered: [removed] | Delivered: P.EXAMPLE |
| Delivered: Signature Not Req | Delivered: Signature Not Req |
| Delivered, Front Door/Porch | Delivered, Front Door/Porch (no marker) |
- A marker is literal text, and case matters. 1 to 16 markers, each 1–64 characters, for each of up to 16 fields.
- When several markers are in the text, the one that comes first is kept.
- `keep_exact` lists up to 32 phrases (1–64 characters each) that may follow a marker and stay, matched whole once the spaces around them are trimmed. "Delivered: Signature Not Req, P. Example" becomes "Delivered: [removed]".
- Nothing after the marker, or only spaces, leaves the text as it is.
- It applies to text fields only, and it runs on rows added from outside too.
This removes text at a marker you name. It isn't anonymization: a name the service puts somewhere else stays, so read a few answers in **Preview Source…** before choosing the markers.
## Samples
Some services only say how things are now: a monitor is up and answered in 41 ms, a host is at 12% CPU, a container is running. With `sample`, the page that lists them keeps one row per item per interval, so a page for each item can show its last day, or its last quarter, from what the overview fetched.
```json
"kuma": {
"url": "https://status.example.com/metrics", "every": "1m",
"collect": {
"dataset": "kuma-samples", "each": "monitors", "key": "{monitor_id}",
"sample": { "every": "5m" },
"fields": { "state": { "path": "monitor_status", "values": { "1": "ok", "0": "critical", "3": "off" }, "default": "unknown" },
"ms": "monitor_response_time" },
"readers": ["uptime-monitor"]
}
}
```
- **One row per item per interval.** `sample.every` is the interval: minutes that divide an hour, `1m` to `1h` (`1m`, `2m`, `3m`, `4m`, `5m`, `6m`, `10m`, `12m`, `15m`, `20m`, `30m`, `60m` or `1h`), `5m` by default. It's apart from the source's own `every`, and can't be shorter than it: with a `5m` source and `1m` samples, four intervals in five would be empty.
- **Timed by Legato's clock.** Intervals start on the clock: at 14:06 with `5m`, the sample is the 14:05 one. A later answer in the same interval replaces that interval's row, whole, so each holds the last answer in it. A one-minute outage between two answers in the same interval isn't kept; sample more often to catch shorter ones.
- **`fields` are rules.** An object of 1 to 16 names (lowercase letters, digits and `_`) and the [rules](https://legatobar.com/docs/mapping.md#mapping) that fill them from the item; a list of such names keeps those fields as they are. What's stored is each rule's result: text of up to 256 characters, a number, or true or false. Anything else, or nothing, leaves the name out of that sample. A sample is at most 512 bytes of JSON.
- **What a sample's rules can't use:** `{param.…}`, `{period.…}`, `{ "answer": … }`, `lookup`, `match` or `in_list`. A kept value has to mean the same thing later, whichever link opened the page, whatever period shows and whatever Settings → Lists holds.
- **Kept a year.** `keep` is optional: a sample is kept 365 days unless `"keep": { "for": "90d" }` says otherwise. Its age is its own time, so there's no `clock`.
- **Not with** `remove_after`, `date`, `time_zone`, `date_range` or `accepts_rows`: a sample's time is Legato's, its values are rule results, and nothing adds samples from outside.
- `key`, `each`, `account` and `readers` are as for records. An item whose key is missing, blank or a number isn't kept, and is counted as rejected. A service that numbers its items, as Proxmox numbers guests, gets a text id in `derive`: give the list a field `"id": { "template": "{vmid|raw}" }`, collect from that list, and key by `{id}`.
### Reading one item
A page for every item reads its own samples with `key`, which its link fills:
```json
"sources": { "samples": { "dataset": "kuma-samples", "key": "{param.id}" } }
```
- **`key` is compared as text on both sides.** Kept keys are always text, and `key` is the text the link filled in, so `"7"` reads the item kept as `7`, and `"07"` doesn't. It works on a record history too, for that one row.
- **Without a period row, the last 24 hours.** More exactly, the last 24 hours of intervals with the one in progress last: at 14:06 with `5m`, from 14:10 yesterday to 14:10 today. "Now" is the end of the interval in progress, at most one interval ahead of the clock. The page reads again at each interval's end, even when nothing new has been kept, so a quiet hour shows as one.
- **With a [period](https://legatobar.com/docs/periods.md#periods), the period's.** From the start of its first day to midnight after its last, in the Mac's time zone, up to the interval in progress when it includes today. A [strip](https://legatobar.com/docs/card-time.md#strip) follows the period row; it isn't one of the cards that always read the default choice.
- **Without `key`,** a read takes every item's samples, up to 100,000 of them; more says "This period holds more samples than a page reads at once; read one item with key". Thirty items over 24 hours are 8,640.
- `row` is for records: a sample is small already.
The answer:
```json
{ "kept": {
"rows": [ { "key": "git", "at": "2026-11-08T14:05:00Z", "row": { "state": "ok", "ms": 41 } } ],
"selected_count": 288, "total_count": 105120, "undated_count": 0,
"span": { "from": "2026-11-07T14:10:00Z", "until": "2026-11-08T14:10:00Z" },
"sample": { "every": "5m", "seconds": 300 },
"epoch": { … }, "coverage": { "recording_since": …, "last_success": …, "interruptions": [ … ] } } }
```
| Field | Meaning |
| --- | --- |
| `rows` | The samples in the span, oldest first: each with its item's `key`, `at` (the start of its interval, ISO 8601 in UTC) and `row` (its fields). |
| `selected_count`, `total_count` | How many `rows` has, and how many the item (or, without `key`, the history) keeps in all. |
| `span` | The span read, `from` and `until`, for [`by_time`](https://legatobar.com/docs/mapping-expiry.md#slices-of-time). |
| `sample` | The interval, as written and in seconds. |
| `epoch`, `coverage` | As for records. An interval with no sample is a time nothing was kept: the Mac asleep, the service not answering. |
The strip and a response-time sparkline on one item's page:
```json
{ "id": "history", "type": "strip", "label": "Last 24 hours", "start_label": "24 hours ago", "end_label": "Now", "segments": [],
"source": { "ref": "samples", "map": {
"segments": { "each": "kept.rows", "by_time": { "at": "at", "span": "kept.span" },
"fields": { "state": { "worst": "row.state", "of": "rows" }, "label": { "template": "{from|time}" } } } } } },
{ "id": "ms", "type": "sparkline", "label": "Response time", "unit": "ms", "points": [],
"source": { "ref": "samples", "map": {
"points": { "each": "kept.rows", "by_time": { "at": "at", "span": "kept.span" }, "value": { "path": "row.ms", "round": 0 } } } } }
```
`by_time` cuts the span into 144 slices unless `buckets` says, and `worst` gives each slice its worst state; see [Slices of time](https://legatobar.com/docs/mapping-expiry.md#slices-of-time).
### What changes, and what pauses
- **A rule changing** keeps old samples as they were measured, and new ones follow the new rule. A change of `sample.every` starts at the next interval; old samples keep their spacing.
- **A name taken out of `fields`** leaves every read, export and `rows list` at once, then is removed from the samples on disk in the background, a batch at a time, which carries on after Legato restarts. Collecting doesn't wait. A name put back shows new values only; old ones stay gone.
- **A changed key** pauses with "Paused: the page now keys its samples differently", and the choice is **Start new history**: a sample keeps its fields' results, not the item, so there's nothing to re-key from.
- **A history keeps its kind.** A page that collects a history of records as samples, or one of samples as records, keeps nothing and Settings says so. Delete the history to start one of the other kind, collect under another name, or change the page back.
- A changed secret, a new `account` and a missing page behave as for records.
### Limits for samples
Samples have their own limits, apart from records', so a history of samples never stops Parcel's deliveries from being kept:
| | Limit |
| --- | --- |
| One sample | 512 bytes of JSON |
| One answer | 2,000 items |
| One history of samples | 10,000 items, and 200 MB |
| Every history of samples together | 400 MB |
| A read without `key` | 100,000 samples |
- **At a limit, a history makes room in itself:** its oldest day of samples goes, across all its items, then the next, until it fits, counted as pruned for space. It never takes room from another history, and never the interval being written. Only when a history has nothing older to give does its batch wait, and Settings says History storage is full, as for records.
- A new item past 10,000 isn't kept and is counted as rejected; it never pushes another out.
- Thirty items every 5 minutes for a year are about 3.15 million samples: about 80 MB of row data, and more on disk with the database's indexes.
---
# Reading history
## Read the history on another page
A reader page names the history in a source of its own:
```json
"sources": { "kept": { "dataset": "parcel-deliveries" } }
```
It takes `derive`, as an http source does, and its cards use `ref`, `map`, `empty` and `when` as usual. There's no `every`: the source is refreshed when the history changes, without asking the service. A quiet page scan does not trigger a new read. The previously shown value stays visible while its replacement is prepared. The answer:
```json
{ "kept": {
"rows": [
{ "key": "ups:EX10000001", "date": "2026-11-04", "date_kind": "wall", "time": "14:12:00",
"first_seen": "2026-11-01T09:30:00Z", "last_seen": "2026-11-05T09:30:00Z",
"row": { "carrier_code": "ups", "tracking_number": "EX10000001", "description": "Desk lamp",
"status_code": 0, "events": [ … ] } } ],
"selected_count": 18, "total_count": 120, "undated_count": 3,
"epoch": { "number": 1, "started": "2026-08-14T16:02:11Z", "label": "parcel · api.parcel.app" },
"coverage": { "recording_since": "2026-08-14T16:02:11Z", "last_success": "2026-11-07T15:30:02Z",
"earliest_row_date": "2026-06-02",
"interruptions": [ { "from": "2026-09-20T22:00:04Z", "to": "2026-09-23T07:41:55Z" } ],
"imported": [ { "at": "2026-08-14T16:10:40Z", "rows": 32, "earliest": "2026-06-02" } ],
"imports_omitted": 0 } } }
```
| Field | Meaning |
| --- | --- |
| `rows` | The rows of the current history, in date order with undated rows last. On a page with a [period](https://legatobar.com/docs/periods.md#periods), only those dated in it. |
| `rows[].key` | The row's key. |
| `rows[].date`, `date_kind` | The row's date and its kind, `day`, `wall` or `moment` (see [Dates](https://legatobar.com/docs/history-dates.md#dates)). Undated rows have neither. |
| `rows[].time` | A `wall` date's printed time, `14:12:00`. Only on `wall` dates. |
| `rows[].first_seen`, `last_seen` | When Legato first kept the row, and when it last saw it in an answer (or had it added). |
| `rows[].row` | The item as kept: its `fields`, after `remove_after`. A field is at `row.carrier_code`, not `carrier_code`. |
| `selected_count` | How many rows `rows` has. |
| `total_count`, `undated_count` | All the rows in the current history, whatever the period, and how many of them are undated. |
| `epoch` | The current history: its `number`, when it `started`, and its `label`. |
| `coverage` | What the history covers. See [Coverage](https://legatobar.com/docs/history-coverage.md#coverage). |
Times Legato recorded (`first_seen`, `started`, `recording_since` and the rest) are ISO 8601 in UTC; the [`ago` and `day` filters](https://legatobar.com/docs/mapping.md#mapping) show them in the Mac's time.
- **The period filters the rows, not the collecting.** Picking 365 days on the reader reads more of what's kept; it doesn't change what the owner keeps. Status, gauge and fleet cards read the default choice, as with any source.
- **Every row in the period is read.** Counts, sums and averages cover all of them. A card's `limit` only shortens what it shows, and the 500-row limit of `rows list` doesn't apply to pages.
- **Undated rows come only without a period.** A reader page with no period row gets every row of the current history, undated ones included.
- **Only readers read.** A page that isn't the owner or a reader gets "This page can't read the history parcel-deliveries; the page that keeps it lists its readers" on its cards. A history nothing keeps yet gives "No page keeps the history parcel-deliveries on this Mac".
- **A reader is a page with a card on the dataset source.** Being listed in `readers`, or granted in Settings, lets a page read; it reads once a card uses the source.
- A page with [params](https://legatobar.com/docs/detail-pages.md#one-page-for-every-item) can read a history.
Cards on a dataset source can also say:
| Message | Cause |
| --- | --- |
| History is updating; trying again | The history or the page's rules changed while it was being read, often just after a page is saved. The card keeps its answer and tries again in 2 seconds. |
| History couldn't open: … | Legato couldn't open its history database, for example on a full disk. Settings → History shows the same reason. |
| Can't read history | Any other failure to read. |
### Only what the page needs: `row`
A history of large rows (a delivery with a hundred events) is slow to read whole: every card waits while Legato reads every event of every row in the period. When a page needs only a few values from each row, it says which, with `row`:
```json
"sources": { "kept": {
"dataset": "parcel-deliveries",
"row": {
"carrier": "row.carrier_code",
"description": "row.description",
"days": { "days_between": [
{ "date": { "first": "date", "of": "row.events", "where": { "path": "event", "contains": "Picked up" },
"sort": { "by": "date", "as": "date" } } },
"date" ] } },
"derive": [ { "name": "mean", "value": { "avg": "row.days", "of": "kept.rows", "round": 1 } } ] } }
```
- **Each name is a rule read on the kept row,** as a rule on `kept.rows` would read it: `row.…` for the item as kept, and `key`, `date`, `date_kind` and `time`. Each row's `row` in the answer then holds only those values: `row.carrier`, `row.description`, `row.days`.
- **Nothing else changes.** Every row in the period is still read, so counts, sums, averages, groups and lists are what they'd be without `row`. `key`, `date`, `first_seen`, `last_seen`, the counts, `epoch` and `coverage` are as before.
- **Why it's fast:** a row's values depend on nothing but the row, so Legato keeps them on this Mac beside it and reads them instead of the whole row. They're made again when the row changes, when the page's `row` changes, and after an update of Legato or a change of the Mac's time zone, language, region, calendar or 12/24-hour setting. Each read makes values in the settings it started with, whatever changes while it runs. Until then a read makes the missing ones itself, so a page's first read after one of those is as slow as without `row`, once.
- **What a row rule can't use.** Each is an error on the cards that use the source (`delivery-times.json: cards/…/source.row.days: …`); the page itself loads, except for `{param.…}`, which stops it:
- `first_seen` and `last_seen`, which change on every fetch: read them in `derive`, beside `row`;
- `{ "answer": … }` and `lookup`, which read outside the row;
- `{param.…}` and `{period.…}`: filter by them in `where` or `derive`;
- templates, anywhere in a rule (`template`, and templates in `values` or `default`): a missing value reads as "—" on a stat or facts card and as a dash inside other text, which a kept value can't know. Name the template's inputs in `row` and write the template in `derive` or the card's `map`; it then reads exactly as it did over whole rows;
- `match`, whose search runs under a time limit: a value kept after a timeout would stay wrong;
- `in_list`, which reads a [list](https://legatobar.com/docs/lists.md#lists) from Settings → Lists: the list can change there, which a kept value can't know. Test it in `derive`.
- **Up to 16 names.** `row` is worked out before `derive`, so it can't read derived values; `derive` and the cards read `row`'s.
- **Limits of the kept values, never of the history:** up to 4 different `row`s for a history; a row's values up to 1 KB; 32 MB of values for one history and 128 MB for all of them. Over a limit, the values of the `row` read longest ago go first, and what still doesn't fit is made on each read, still complete. Kept values never take space from History's own limits, and when History storage is full they're all removed first.
- **In the background,** Legato makes missing values in small batches, and gives way to a page that's reading. A value it hasn't made yet is worked out from the whole row when a page reads it, so the answer is always complete.
- **They aren't history.** Export and `rows list` show rows as kept; deleting a row or a history deletes its values, a new history (another account) starts without any, and values no page uses any more are removed. Removal overwrites them on disk as History's other deletions do.
**Details** shows "Keeps history on this Mac (parcel-deliveries)" on the source that collects and "Reads the history parcel-deliveries, kept on this Mac" on a reader's. A collecting source no card uses is listed as a source of its own, with no cards.
---
# Dates and retention
## Dates
`date` makes a history readable by period. It's a rule, read on the row as it's kept, so it can use only what `fields` keeps (after `remove_after`). Its value becomes the row's `date`. A plain path works (`"date": "date"`), and so does any rule that gives a date, such as the newest Delivered event's date in the [Parcel source](https://legatobar.com/docs/history-collect.md#collect-on-the-page-that-fetches).
A date is one of three kinds:
| Kind | Written like | Kept as | In a period |
| --- | --- | --- | --- |
| `day` | `2026-10-26`, "November 6, 2026", `02.11.2026`, `11/02/2026` | The date | When it's one of the period's days |
| `wall`, a time with no zone | `2026-11-06 10:05:00`, "Friday, November 6, 2026 10:05 AM" | The printed date and time, as printed | By its printed date, as a `day` |
| `moment`, an instant | `2026-11-06T16:46:00-08:00`, `…Z`, "November 2, 2026 03:14 PM EST", Unix seconds | The instant, in UTC | From midnight at the start of the period's first day to midnight after its last, in the Mac's time zone |
- **A wall time is never moved to the Mac's zone.** "November 6, 2026 4:46 PM" is in the 6th whichever Mac reads it, wherever it is. Parcel's dates are wall times.
- **Carriers' own words are read with fixed rules,** not the Mac's language settings: a date with slashes is month first (`11/02/2026` is November 2) and one with dots is day first (`02.11.2026` is November 2). Times like "3:14pm" and "3:14 p.m." are read as "3:14 PM".
- **A number is Unix time:** seconds, or milliseconds from 100,000,000,000 up. Digits in text aren't read as one.
- **A date that can't be read** (words like "next Tuesday", or text over 80 characters) leaves the row undated. So does an item where the rule finds nothing.
### `time_zone`
When the service's times have no zone but you know which zone they're in, say so, and they're kept as moments:
```json
"date": "reading_time", "time_zone": "America/Los_Angeles"
```
- A time the clocks pass twice when they go back (1:30 AM on the night daylight saving time ends) is the first one.
- A time the clocks skip when they go forward (2:30 AM on the night it starts) moves forward by the gap: 2:30 becomes 3:30.
- `time_zone` is a zone name from the IANA list. An unknown one stops the page loading: `time_zone is a zone name like America/Los_Angeles`.
### `date_range`
A service that sends placeholder dates, like `1970-01-01` or a year far ahead, can put rows in the wrong period. `date_range` keeps only dates within it as dates, inclusive:
```json
"date_range": { "from": "2000-01-01", "to": "+1y" }
```
Each bound is a day, or days or years from today: `+30d`, `-10y` (a sign, 1 to 4 digits, and `d` or `y`). A date outside the range leaves the row undated; the row is still kept.
### Dates in cards
Three rules work on any source, kept rows or not:
- **`{ "date": rule }`** gives the rule's value as a date, written one way: `2026-11-04` for a day, `2026-11-06T16:46:00` for a wall time (no zone), `2026-11-07T00:46:00Z` for a moment. Words it can't read leave the result missing, so `default` applies.
- **`{ "days_between": [rule, rule] }`** counts whole calendar days from the first date to the second, negative when the second is earlier. Days and wall times count by their printed date; moments by the day they fall on in the Mac's time zone. From "Picked up" on October 26 to "Delivered" on November 4 is 9.
- **`"as": "date"`** in a `sort` compares values as dates, so "November 10" comes after "November 9". Values that aren't dates go last, in either order.
```json
{ "days_between": [
{ "date": { "first": "date", "of": "row.events", "where": { "path": "event", "contains": "Picked up" },
"sort": { "by": "date", "as": "date" } } },
"date" ] }
```
Read on each of `kept.rows`, this is the days from a package's first "Picked up" event to the row's own date. Inside `kept.rows`, the item's fields are under `row.`, and the row's date is `date`.
## How long rows are kept
`keep.for` is how long a row stays, from what `keep.clock` counts:
| `clock` | A row's age counts from |
| --- | --- |
| `date_or_last_seen` (the default) | The later of its date and the last time an answer had it. A row stays while the service keeps sending it, and for `for` after both. |
| `date` | Its date. An undated row counts from when it was last seen. A row already older than `for` when it arrives isn't kept: it's counted as already past retention. |
| `last_seen` | The last time an answer had it, or it was added. |
- Legato removes rows past their time each time it keeps an answer, and at launch and once a day for every history, whether or not anything is collecting.
- **Rows added from outside count from when they're added,** unless the clock is `date`. To import old rows and have them age by their own dates, use `"clock": "date"`.
- Changing `keep` applies to every row from the next cleanup, old histories included.
### Limits
| | Limit |
| --- | --- |
| One row | 16 KB (16,384 bytes) of JSON, as kept. A larger one isn't kept, and is counted as rejected. |
| One answer, or one `rows add` | 2,000 items and 8 MB (8,388,608 bytes). A larger answer isn't kept at all; a larger `rows add` is refused. |
| The current history of one dataset | 20,000 rows and 50 MB (52,428,800 bytes) |
| Every history on the Mac, together | 500 MB (524,288,000 bytes) |
- **At a history's limit,** the oldest rows by its clock make way, in the same step, and are counted as pruned for space. The rows arriving always land. A batch that doesn't fit by itself is refused.
- **At the limit for every history,** a batch that would make storage grow isn't kept at all, including its updates to rows already kept. A batch that doesn't grow storage still is. Settings shows “History storage is full. This collection batch is paused, including updates to existing records. Delete old history to resume.” Delete old histories, or a history you don't need, to make room; the note clears after a successful collection.
- Sizes are the rows' JSON. The database, its indexes and its journal take more space on disk than that.
The other limits are in [Limits](https://legatobar.com/docs/limits.md#history).
---
# Accounts and readers
## Accounts and histories
A dataset holds one history at a time for its readers. A new one starts when the data is someone else's, and the old one is kept, out of readers' sight, until it's deleted or ages out.
- **By host.** Without `account`, whose data it is means the source's host: `api.parcel.app`. Point the source at another host and a new history starts.
- **By `account`.** For a service where one secret reaches several accounts, cars or workspaces, name the field that says which: `"account": "{account.id}"`. A value that changes starts a new history with that answer. An answer with no value there isn't kept.
- **By secret.** Legato notices when the value of the source's secret changes, without keeping it: it keeps a fingerprint (an HMAC made with a key of this Mac's own, in the Keychain). Renaming the secret in Settings → Secrets changes nothing.
### What pauses
Some changes need you to say what they mean. Until you do, the page's cards keep updating from each answer, but nothing is kept:
| Settings → History says | Because | Your choice |
| --- | --- | --- |
| Paused: the secret changed. Is this the same account's history? | The secret's value changed | **Continue this history** if it's the same account with a new key or token; **Start new history** if it's someone else's |
| Paused: the page now keys its rows differently. Re-key keeps this history under the new key; rows it can't key are left out. | `key` changed, with rows already kept | **Re-key this history** recomputes keys from the stored fields; **Start new history** starts an empty current history |
| Updating what's kept to the page's new rules… | Retained fields, text removal or date rules changed | Collection waits while all retained histories are updated |
| Paused: what's kept couldn't be updated to the page's new rules. Nothing was changed. | A migration failed | **Try again** retries the required changes; **Start new history** starts an empty current history; the older histories are still updated to the new rules |
- **A lost Keychain key doesn't pause.** If Legato's own key is gone or replaced, it starts checking again from the next answer, and Settings says "The check that the secret hasn't changed started again once, after Legato's key for it was replaced. Nothing was paused."
- **An unreadable key doesn't pause either.** Settings says "Can't check whether this history's secret changed right now: Legato can't read its key for that. History keeps collecting."
- **Changed rules apply to what's already kept.** A change to `fields` or `remove_after` cuts the stored rows to the new rules, and a change to `date`, `time_zone` or `date_range` works their dates out again, in every history. Collecting waits while it does. A field already left out doesn't come back by adding it to `fields`. If the update fails, nothing is changed and collecting stays paused.
- **Re-key works from the rows as kept.** A row the new key can't be made from is removed. When two rows get the same key, the one seen most recently stays, with the earlier first-seen time. Settings says how many were merged and removed. A re-key that fails is tried again, even after Legato restarts.
- **A changed secret is asked about first.** If the secret and the key both changed, continuing the same account's history still leaves the key question to answer. Starting a new history skips re-keying the old rows, but not updating them to new rules.
`legato rows add` into a paused history is refused (`paused`), with the reason.
## Readers and grants
Grants are kept on the Mac, not in page files, so editing a page can't take over someone else's history.
- **The owner** is the page that first collected the dataset, by its id (its file name without `.json`). Rewriting its file, with `legato set`, an agent or an editor, keeps it the owner.
- **Its `readers`** may read the history while it's the owner. Take a page out of the list and it can't read from the next scan, unless it was also granted in Settings → History.
- **Settings → History → Grant** lets another page read too, from a menu of the folder's pages, and **Revoke** takes that back. A grant is for the page with that id: a page saved under another id needs its own.
- **The owner can read its own history** with a dataset source, without listing itself.
### Renaming the owner, and transfer
Renaming the owner's file looks to Legato like the owner going and a new page arriving that wants the same history. The new page doesn't get it:
- Settings → History shows "Also claimed by" with "Delivery log declares it too. It may be Packages, renamed." and **Transfer to this page**. Only that button changes the owner.
- A transfer keeps the readers already granted. After it, a page added to the new owner's `readers` can read only once you grant it in Settings → History.
- The claim goes once the other page stops declaring the dataset.
### The 30-day countdown
When no page in the folder collects a dataset any more (its owner was deleted, renamed, or lost its `collect`), Settings says "The page isn't collecting it any more. Deleted in 30 days unless it comes back or it's transferred." It counts down by the day:
- **It comes back:** the owner page declares `collect` for it again. The countdown stops.
- **It's transferred,** to a page that claims it. The countdown stops.
- **Otherwise,** after 30 days the dataset is deleted, every history in it.
A page that's in the folder but can't be read (a typo, or a file half written) doesn't start the countdown: its histories wait. Nor does a license that has ended; nothing is collected without one, and the history stays.
---
# Rows from outside
## Rows from outside Legato
An agent or a script can add rows to a history whose owner says `"accepts_rows": true`. The rows go through the owner's rules, exactly as fetched ones do: its key, `fields`, `remove_after` and `date`.
### A history that only receives rows
A source of `collect` alone, with no `url` and no `kind`, keeps a history with nothing to fetch, for data that reaches the Mac some other way, such as a health export:
```json
"sources": {
"daily": { "collect": { "dataset": "health-daily", "each": "days", "key": "{date}", "fields": ["date", "steps"],
"date": "date", "keep": { "for": "400d", "clock": "date" }, "accepts_rows": true,
"readers": ["health-steps"] } },
"kept": { "dataset": "health-daily" }
}
```
- It needs `"accepts_rows": true`, and nothing beside `collect`.
- Cards read it through a dataset source, as here. A card that uses it directly says it "only receives rows; read them with a source of { "dataset": "health-daily" }".
- Details lists it as "Rows added from outside Legato", "Nothing fetched", "Keeps history on this Mac (health-daily), added with legato rows add".
### `legato rows`
The `legato` tool is in `/Applications/Legato.app/Contents/Helpers/`. It asks the app, which opens if it isn't running; only Legato itself opens the history's database.
```bash
legato rows add parcel-deliveries old-deliveries.json # or from stdin
legato rows list parcel-deliveries --limit 20
legato rows delete parcel-deliveries --key ups:EX10000001 --key usps:EX20000002
legato rows delete parcel-deliveries --epoch 1
legato rows delete parcel-deliveries --all
```
**`rows add [file] [--request-id id]`** reads a JSON array of items (or `{ "rows": [ … ] }`) shaped like the items of the owner source's answer: up to 2,000 items and 8 MB of them, in a file of up to 32 MB. Before anything is written to disk, the tool keeps only the owner's `fields`, with text removed after its markers; Legato then checks and cuts each row again itself, and dates it with the owner's `date` rule. It answers:
```json
{ "dataset": "parcel-deliveries", "accepted": 30, "rejected": 2, "expired": 0, "pruned": 0, "epoch": 1,
"request_id": "5b0c6d1e-…" }
```
- `accepted` rows are in the history; `rejected` ones had no usable key or were over 16 KB; `expired` ones were already past retention; `pruned` rows made way for them.
- Rows land in the current history. They don't change `recording_since`, and they're listed in `coverage.imported`.
- **If Legato doesn't answer in time** (30 seconds, more while it opens), the request is withdrawn, but it may have been carried out. Run the same command again with `--request-id` and the id it named: a request that was carried out answers the same again and adds nothing. Use the id for the same operation on the same dataset within 7 days; reusing it for another dataset or operation is refused (`invalid_rows`, "Request id belongs to another history"). The original result, rejected counts included, comes back even if the owner's rules have changed since. After 7 days the id is forgotten.
- If the page's rules or history changed while the rows were being prepared, the tool prepares them again from your items, once.
**`rows list [--limit n]`** gives up to 500 rows of the current history, the newest dated rows first, then undated ones: each with `key`, `date`, `date_kind`, `time`, `first_seen`, `last_seen` and `row`, with `epoch`, `total_count`, `undated_count` and `truncated`.
**`rows delete `** takes one of:
- `--key k`, one or more: those rows of the current history;
- `--epoch n`: an earlier history, whole, or the current one's rows (the history itself stays);
- `--all`: every row. Earlier histories are removed and the current one stays, empty. The dataset, its owner and its readers stay.
Given more than one, `--all` wins, then `--epoch`.
It answers `{ "dataset", "deleted" }`. Deleting can't be undone, and the page goes on collecting. If the app commits a deletion but cannot publish its answer, retrying that same queued request returns its original count; it does not delete rows collected afterward.
### Over MCP
An agent connected with `legato mcp` has the same three as tools: `add_rows` (`dataset`, `rows`, and `request_id` to run again after a timeout), `list_rows` (`dataset`, `limit` up to 500) and `delete_rows` (`dataset` and one of `keys`, `epoch` or `all`). They answer as the commands do.
`get_history` (or `legato history`) says what Settings → History says about every history: its status, whether it needs you, why, and what to do in Settings. Use it when a history page is empty. It never returns rows. See [Lists and History](https://legatobar.com/docs/mcp-tools.md#lists-and-history).
### Refusals
A refusal is `{ "error": { "code", "message", "details" } }`, with exit status 1. `details` can hold the `request_id` to run again with, and `"retryable": "true"` when trying again may work:
| `code` | Message, or cause |
| --- | --- |
| `not_found` | "No page keeps the history parcel-deliveries. Its page declares it with collect." For `list` and `delete`: "This Mac keeps no history named parcel-deliveries." |
| `rows_not_accepted` | "The page that keeps parcel-deliveries doesn't take rows from outside: its collect needs "accepts_rows": true." |
| `claimed` | "Another page keeps parcel-deliveries; Settings → History can transfer it." |
| `stale` | "The page's history changed while the rows were prepared; prepare them again." Retryable; the tool tries once more by itself. |
| `paused` | A changed secret or key needs a choice in Settings; a migration in progress asks to try again shortly (retryable); a failed migration asks to resolve it in Settings |
| `storage_full` | "History storage is full. Delete old history in Settings → History, then try again." |
| `too_large` | More than 2,000 items or 8 MB in one request: "Batch exceeds 2,000 items", "Batch exceeds 8 MB", "At most 8 MB of rows at a time." or "That's more than one request can carry: send at most 2000 rows and 8 MB at a time."; from stdin, "The rows file is larger than 32 MB." |
| `invalid_rows` | "Rows are a JSON array of objects, like the items the page's source answers with." (or "Rows are a JSON array of objects."), "Batch alone exceeds dataset capacity" for a batch larger than a history can hold, or "Request id belongs to another history" |
| `invalid_arguments` | "Name the history by its dataset, like parcel-deliveries."; a request id that isn't 1–64 letters, digits and `-`; "delete takes --key k (one or more), --epoch n or --all."; a file named on the command line that can't be read or is over 32 MB: "Couldn't read old-deliveries.json, or it's larger than 32 MB." |
| `not_answered` | For `add`: "Legato didn't answer in time, so whether the rows were added is unknown. Run it again with request id … to find out: if they were, nothing is added twice." For `delete`: "Legato didn't answer in time, so whether the rows were deleted is unknown. Inspect the history before making another delete request." For `list`: "Legato didn't answer in time. Try again." |
| `failed` | "History couldn't do that." |
| `write_failed` | The request couldn't be written to the Pages folder |
---
# Coverage and local storage
## Coverage
A history knows when it was listening. `coverage` in the reader's answer:
| Field | Meaning |
| --- | --- |
| `recording_since` | When this history first kept an answer, or null before then |
| `last_success` | When it last kept one |
| `earliest_row_date` | The earliest row date in it, which can be older than `recording_since`: Parcel's recent list, or imported rows |
| `interruptions` | Gaps in collecting, each `{ "from", "to" }`: more than twice the source's `every`, plus 2 minutes, between two kept answers. The last 200. |
| `imported` | The newest 200 import details in this history: each `{ "at", "rows", "earliest" }` |
| `imports_omitted` | How many older import details were removed from this history's coverage list; zero when the list is complete. The imported rows follow their own retention rules. |
Legato collects only while it's running, the Mac is awake and unlocked, and the service answers, so there are gaps. Show them on the reader, so a quiet week isn't read as no deliveries. A "Recording since" fact is the simplest:
```json
"items[2].key": { "template": "Recording since" },
"items[2].value": { "template": "{kept.coverage.recording_since|day}" }
```
Before the first answer is kept, it shows a dash. Imported rows give `earliest_row_date` and `imported`, never `recording_since`: an old row from an export doesn't show that nothing was missed since.
## Settings → History
**Settings → History** lists everything pages keep on this Mac: each history, under the page that keeps it, and each page's sparkline readings. The row at the top shows the space it uses. Anything that needs you comes first, and **Show** narrows the list to histories, sparkline readings or what needs attention.
A history's status is one of:
| Status | Means |
| --- | --- |
| Collecting | Rows are kept from each answer |
| Updating… | Kept rows are being changed to the page's new rules |
| Paused | The secret or the key changed, or an update failed. Select it for the choice: **Continue this history**, **Re-key this history**, **Try again** or **Start new history** |
| Storage full | Every history together is at its limit. **Delete old history** makes room |
| Deleted in N days | The page that kept it is gone. It comes back if the page does |
| Claimed by 2 pages | Another page declares the same dataset. **Transfer to this page** picks the owner |
Selecting a row shows when it started, when it last collected, which pages read it and any gaps. A page with [params](https://legatobar.com/docs/detail-pages.md#one-page-for-every-item) is named by its title without the params, or by its file name. A history of samples says its interval, items and samples in place of a row count: "Every 5 min · 30 items · 1.2M samples".
- **Export…** saves the selection as JSON: every history with its coverage and rows as kept, and the sparkline readings of the page that keeps it. For a sparkline page, just its readings. A history of samples asks where to save first, then writes its samples there a batch at a time (a year of 30 items is about 250 MB), and saves nothing if it's stopped or the history is deleted meanwhile.
- **Delete…** asks first ("Everything in it is removed from this Mac. This can't be undone.") and deletes the dataset with every history, row and grant, or a page's sparkline readings. If a page still declares `collect`, it starts a new history at its next fetch; to stop, remove `collect` from the page. A history of samples leaves every read at once, and its samples are overwritten on disk in the background, a batch at a time, within minutes.
- **Details…** opens the rest:
- the readers, "listed by the page" or "granted here", with **Revoke** for a grant made here and **Grant…** to let another page read;
- each history, with **Delete old histories**;
- what was left out (pruned for space, rejected, already past retention);
- notes such as a secret that can't be checked.
A page that starts collecting shows "Keeps history on this Mac. Settings → History" once at its foot, under every card, so nothing moves.
## On this Mac only
- **Where:** `~/Library/Application Support/Legato/Kept.sqlite`, beside the Pages folder, with sparklines' [readings](https://legatobar.com/docs/mapping-sparklines.md#sparkline-readings). Only Legato opens it. A sparkline's readings are removed five minutes after its page leaves the Pages folder, not after the 30-day countdown a dataset has. The `legato` tool hands rows to the app through short-lived files in `Pages/.rows`, already cut to the owner's `fields`; the app removes each one once it has answered, and drops any it hasn't reached in two minutes.
- **Deletion:** deleted rows are overwritten in the database, and Legato empties its journal file as soon as nothing is reading it. That's not a guarantee no trace is left on the disk. For 7 days Legato remembers a `rows` request's id and counts, so it can answer it again; never the rows themselves. Samples deleted or past their time leave every read at once and are overwritten in the background, in batches.
- **No sync.** Each Mac keeps its own histories. Legato doesn't send them to its servers, to iCloud or between Macs. Two Macs with the same pages collect two histories.
- **Copies you make.** Export history, backups of your Mac such as Time Machine, and anything you share hold their own copies. Deleting a history in Legato removes it from Legato's store, not from those.
- **Removing Legato.** Deleting the `~/Library/Application Support/Legato` folder removes every history with the pages.
---
# Parcel example
## A complete example: Parcel
**Packages** watches deliveries and keeps them; **Delivery times** reads them for the period showing. Save them as `packages.json` and `delivery-times.json` in the Pages folder, with a Parcel API key saved as the `parcel` secret.
These two are cut down to show how History works. The complete pages, with a page per carrier and only deliveries in your area counted, are the downloads on [Parcel](https://legatobar.com/services/parcel#download-the-pages).
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "Packages",
"icon": "shippingbox",
"sources": {
"parcel": {
"url": "https://api.parcel.app",
"secret": "parcel",
"auth": { "type": "header", "name": "api-key" },
"every": "30m",
"requests": {
"active": "/external/deliveries/?filter_mode=active",
"recent": "/external/deliveries/?filter_mode=recent"
},
"collect": {
"dataset": "parcel-deliveries",
"each": ["active.deliveries", "recent.deliveries"],
"key": "{carrier_code}:{tracking_number}",
"fields": ["carrier_code", "tracking_number", "description", "status_code",
"events[].date", "events[].event", "events[].location"],
"remove_after": {
"events[].event": { "markers": ["Received By:", "Delivered:"],
"keep_exact": ["Signature Not Req", "Signature Required"] }
},
"date": { "date": { "first": "date", "of": "events",
"where": { "path": "event", "contains": "Delivered" },
"sort": { "by": "date", "order": "desc", "as": "date" } } },
"keep": { "for": "400d" },
"readers": ["delivery-times"],
"accepts_rows": true
}
}
},
"cards": [
{ "id": "on-the-way", "type": "list", "label": "On the way", "items": [],
"source": { "ref": "parcel",
"map": { "items": { "each": "active.deliveries", "limit": 20,
"fields": { "text": "description", "detail": "carrier_code" } } },
"empty": { "when": { "path": "active.deliveries", "equals": [] }, "text": "Nothing on the way" } } }
]
}
```
- Every 30 minutes, both lists are fetched once; the card shows what's on the way, and each delivery in either list is kept under its carrier and tracking number.
- A delivery's date is its newest Delivered event. Parcel's dates are wall times, so a package delivered at 9:15 PM on the 4th is in the 4th wherever the Mac is. A package not delivered yet is undated: it's kept, and gets its date the first time an answer shows it delivered.
- Names after "Received By:" and "Delivered:" are removed before anything is stored.
- `accepts_rows` lets you add deliveries from before the page existed (below).
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "Delivery times",
"icon": "clock",
"sidebar": false,
"period": {
"choices": [
{ "id": "30d", "label": "30 days", "last_days": 30 },
{ "id": "90d", "label": "90 days", "last_days": 90 },
{ "id": "365d", "label": "365 days", "last_days": 365 }
]
},
"sources": {
"kept": {
"dataset": "parcel-deliveries",
"derive": [
{ "name": "times", "value": { "each": "kept.rows", "fields": {
"carrier": "row.carrier_code",
"item": "row.description",
"delivered": "date",
"days": { "days_between": [
{ "date": { "first": "date", "of": "row.events",
"where": { "path": "event", "contains": "Picked up" },
"sort": { "by": "date", "as": "date" } } },
"date" ] } } } },
{ "name": "average", "value": { "avg": "days", "of": "times", "where": { "path": "days", "gte": 0 }, "round": 1 } }
]
}
},
"cards": [
{ "id": "summary", "type": "facts", "label": "Delivered", "items": [],
"source": { "ref": "kept", "map": {
"items[0].key": { "template": "Delivered" },
"items[0].value": { "template": "{kept.selected_count}" },
"items[1].key": { "template": "Pickup to delivery" },
"items[1].value": { "template": "{average} days" },
"items[2].key": { "template": "Recording since" },
"items[2].value": { "template": "{kept.coverage.recording_since|day}" } } } },
{ "id": "by-carrier", "type": "bars", "label": "Days, by carrier", "unit": "days", "items": [],
"source": { "ref": "kept", "map": { "items": { "each": "times", "where": { "path": "days", "gte": 0 },
"group": "carrier", "fields": { "label": "key", "value": { "avg": "days", "of": "rows", "round": 1 } } } } } },
{ "id": "recent", "type": "list", "label": "Recent", "items": [],
"source": { "ref": "kept",
"map": { "items": { "each": "times", "sort": { "by": "delivered", "order": "desc", "as": "date" }, "limit": 4,
"fields": { "text": "item", "detail": { "template": "{days} days" } } } },
"empty": { "when": { "path": "kept.selected_count", "equals": 0 }, "text": "Nothing delivered in these days" } } }
]
}
```
- With a period, the reader gets only dated rows in it: here, the packages delivered in the last 30, 90 or 365 days.
- `times` gives each delivered package its carrier, its name and the days from its first "Picked up" event to its delivery. A package with no "Picked up" event has no `days`, and `"gte": 0` leaves it out of the average and the bars.
- `"sidebar": false` makes it a [detail page](https://legatobar.com/docs/detail-pages.md#detail-pages): link to it from a card on Packages with `legato://page/delivery-times`.
- "Recording since" says how far back the history goes. Until then, the page shows what Parcel's recent list held when it started.
**Deliveries from before.** Write the ones you have as Parcel-shaped items, with the carriers' dates exactly as they wrote them:
```json
[
{ "carrier_code": "ups", "tracking_number": "EX10000001", "description": "Desk lamp", "status_code": 0,
"events": [
{ "date": "October 30, 2026 2:12 PM", "event": "Delivered", "location": "Fernhollow" },
{ "date": "October 27, 2026 6:40 PM", "event": "Picked up", "location": "Kestrel Bay" } ] },
{ "carrier_code": "usps", "tracking_number": "EX20000002", "description": "Book stand", "status_code": 0,
"events": [
{ "date": "October 21, 2026 11:03 AM", "event": "Delivered, Front Door/Porch", "location": "Fernhollow" },
{ "date": "October 18, 2026 9:20 AM", "event": "Picked up", "location": "Millbrook Junction" } ] }
]
```
```bash
legato rows add parcel-deliveries old-deliveries.json
```
They join the current history with the same key, fields, removal and dates as fetched ones. A delivery Parcel still lists replaces its imported row the next time Packages fetches. Imported rows count from when they're added for retention; with `"clock": "date"` in `keep`, they'd age by their delivery dates instead.
---
# Agents and scripts
An agent writes a page by calling a tool. Legato's MCP server runs on your Mac, started by the agent's own app, and its tools write, read and delete pages, arrange the sidebar, install a service's pages from a template, and add to History and lists. Claude Code, Codex, Claude Desktop and any other client that starts a local command can use it. A chat app in a browser can't reach it.
A script does the same work with the `legato` command, which makes the same checks and gives the same answers. Either way the result is a page file in the Pages folder, so an agent can set a page up and a script can keep it current.
Use them for data that takes a few calls, some arithmetic, a command-line tool or an agent's judgement. When the data comes from one API that answers JSON, a page with [sources](https://legatobar.com/docs/sources.md) fetches it without either.
## With an agent
- [Connect an agent](https://legatobar.com/docs/connect-agent.md): Setup for Claude Code, Codex, Claude Desktop and other MCP clients.
- [MCP tools](https://legatobar.com/docs/mcp-tools.md): Every tool, with its arguments and what it returns.
- [A prompt that works](https://legatobar.com/docs/connect-agent.md#a-prompt-that-works): An example of asking for a page, card by card.
- [A scheduled agent](https://legatobar.com/docs/scripts.md#a-scheduled-agent): Claude Code run from launchd, every morning or every hour.
## With a script
- [Scripts](https://legatobar.com/docs/scripts.md): Two worked examples, free disk space and API spend, each with its page and a schedule.
- [CLI](https://legatobar.com/docs/cli.md): Every `legato` command, with its output.
---
# MCP tools
## Tools
| Tool | Arguments | Returns |
| --- | --- | --- |
| `set_page` | `page_id`, `title`, `cards`, optional `icon`, `title_from`, `sources`, `period`, `params`, `notify`, `sidebar` and `if_match` | `{id, version, changed, created, loaded}` with the page's `collection` and `placement`, sometimes with a `note` |
| `get_page` | `page_id` | `{id, version, modified, page, status}` |
| `list_pages` | none | `{folder, pages: [{id, name, title, version, modified, ok, error}]}` |
| `delete_page` | `page_id`, optional `if_match` | `{id, deleted, note}` |
| `preview_page` | `sample`, and `page_id` or `page`, optional `source` | `{source, sources, mapped, issues, valid, hidden, failed}`: the cards as a sample answer fills them. See [Checking a page's sources](https://legatobar.com/docs/mcp-tools.md#checking-a-pages-sources). |
| `get_page_schema` | optional `part`: `page`, `sources`, `rules`, `actions`, `period`, `params`, `notify`, `title_from` or a card type | Without `part`, `{parts, cards, note}`: the parts there are and every card type's fields. With one, `{part, schema}`: that part's JSON Schema, and for a card type `at_a_glance`, its fields one line each. The mapping rules and buttons that every card and source shares are the `rules` and `actions` parts. Another part names what it uses from them in `schema.elsewhere`, so an agent asks for each one once. |
| `get_sidebar` | none | `{sidebar}`: the collections, their sections and where each page sits. See [Arranging the sidebar](https://legatobar.com/docs/mcp-tools.md#arranging-the-sidebar). |
| `set_collection` | optional `collection_id`, `name`, `icon`, `position`, `new_pages` | `{collection_id, created, sidebar}` |
| `delete_collection` | `collection_id` | `{deleted, moved_to, moved, sidebar}` |
| `set_section` | optional `section_id`, `name`, `icon` (or `null`), `collapsed`, `collection_id`, `position` | `{section_id, created, sidebar}` |
| `delete_section` | `section_id` | `{deleted, moved, sidebar}` |
| `move_page` | `page_id`, and any of `collection_id`, `section_id` (or `null`), `position` | `{page_id, collection_id, section_id, sidebar}` |
| `add_rows` | `dataset`, `rows`, optional `request_id` | `{dataset, accepted, rejected, expired, pruned, epoch, request_id}`. See [History](https://legatobar.com/docs/history-rows.md#rows-from-outside-legato). |
| `list_rows` | `dataset`, optional `limit` up to 500 | The newest rows of the current history |
| `delete_rows` | `dataset` and one of `keys`, `epoch` or `all` | `{dataset, deleted}` |
| `get_history` | none | `{histories, readings, totals}`: what Settings → History says, without rows. See [Lists and History](https://legatobar.com/docs/mcp-tools.md#lists-and-history). |
| `get_lists` | none | `{lists: [{name, entries, used_by, sent_to, reads_addresses, status}]}` |
| `set_list` | `name`, `entries` | `{list, created}` |
| `delete_list` | `name` | `{deleted, list}` |
| `get_secrets` | none | `{onepassword_account, secrets: [{name, host, status, expires, used_by}]}`. See [Secrets](https://legatobar.com/docs/mcp-tools.md#secrets). |
| `set_secret_expiry` | `name`, `expires`, optional `host` | `{secret}` |
| `delete_secret` | `name`, optional `host` | `{deleted, secret}` |
Settings → [Agent Access](https://legatobar.com/docs/settings.md#agent-access) can turn groups of these tools off. A tool that's off isn't in the tool list, and a call to it gets a `turned_off` error.
`set_page`'s description lists every card type with its fields (the ones every sourced card shares are named once, at the top), and its input schema names the card types. Ask `get_page_schema` for a card type, `sources`, `period` or `notify` when you need the whole schema for it. It's the same schema the app ships, at `Pages/.schemas/page.schema.json` and [legatobar.com/schemas/page.schema.json](https://legatobar.com/schemas/page.schema.json).
### set_page
`set_page` creates or replaces a whole page. Send the complete page every time: a field you leave out is gone, and a card you leave out is removed. The rules for ids, titles and cards are in [Writing and versions](https://legatobar.com/docs/page-writing.md) and [Cards](https://legatobar.com/docs/cards.md).
What it does, in order:
1. Checks the page id and size, then validates the complete page with Legato's file parser before changing any file. Checks `if_match`, if supplied, while holding the write lock.
2. Writes the file whole (to a temporary file, then renamed into place), so Legato never reads half a page.
3. Opens Legato in the background if it isn't running.
4. Waits for Legato to load the page, up to 4 seconds (10 when it had to open Legato).
5. Reports whether Legato loaded those exact bytes. Invalid pages were already refused with `invalid_page` before writing. A different running build's rejection returns `load_failed` with `saved: "true"`; the tool never restores old content over another save.
A page Legato loaded:
```json
{
"id": "budget",
"version": "33527b6dde59dde2",
"changed": true,
"created": false,
"loaded": { "ok": true, "loaded_at": "2026-10-27T21:04:11.482Z" }
}
```
`changed` is `false` when the page is exactly what was there already. `created` is `true` for a new page.
`loaded` is `null` when Legato didn't confirm in time, with a `note` saying why. The page is saved either way; Legato loads it when it opens, and `get_page` shows its status later. If it turns out to have a mistake, Legato shows it as a page that says what's wrong.
After the [trial](https://legatobar.com/docs/license.md) ends without a license, `set_page` still saves the page, and `loaded.plan` is `"locked"` with a note: Legato shows the page again once it has a license.
To post a macOS notification, include `notify` (`{id, title, body}`) with an id the page hasn't used. Sending the same id again shows nothing. See [Notifications](https://legatobar.com/docs/notifications.md#the-notify-field).
To give the page a row for choosing Week, Month or Year, include `period`, as described in [Periods](https://legatobar.com/docs/periods.md#periods). `get_page_schema("period")` has its whole schema. A link carries the period to the page it opens, so give the detail pages an overview links to the same choices, and make their cards follow them: see [Overview and detail pages with a period](https://legatobar.com/docs/design.md#overview-and-detail-pages-with-a-period).
### get_page and list_pages
`get_page` returns the page as written (without its `$schema` line) under `page`, its `name`, its `version`, when the file was last `modified`, and `status`, what Legato last said about it: `{ok, loaded_at}` plus an `error` when the page has a mistake. `status` is `null` when Legato hasn't loaded the file yet. While Legato is running, `status.sources` says what each of the page's sources last did; see [Checking a page's sources](https://legatobar.com/docs/mcp-tools.md#checking-a-pages-sources). A file that isn't JSON at all comes back as `text` instead of `page`, so you can see what's there.
`list_pages` returns every page in the folder, ordered by file name, with the same `ok` and `error` for each. `folder` is the Pages folder's path.
`name` is what the user calls the page: its `title`, or for a page with params the title as the sidebar shows it, filled from the params' defaults. Renaming a page in Legato's sidebar writes its `title`, so keep the title you read when you rewrite a page, unless asked to rename it. When someone asks for "my Upcoming page", match `name`, then use the `id`.
### Checking a page's sources
Two tools show whether a page with sources works, before and after you save it.
`preview_page` fills the page's cards from a sample answer you give it, with the same parser and mapping Legato uses, offline: nothing is fetched or saved, and no secret is read. Give `page_id` for a saved page, or `page` for one you haven't saved yet, and `sample`: the service's answer as JSON. For a source with named `requests`, `sample` is an object with each request's answer under its name; a text answer is a string. Name the `source` when the page has more than one.
```json
{
"source": "repo",
"sources": ["repo"],
"mapped": [{"id": "stars", "type": "stat", "label": "Stars", "value": 100}],
"issues": ["Forks: no response value for value; the page's original value is retained."],
"valid": true,
"hidden": [],
"failed": null
}
```
`mapped` is the cards as the sample fills them. `issues` lists what doesn't fit: a path the answer doesn't have, a mapped card that isn't a whole card, a button that can't be filled from a row. `hidden` names the cards a `when` hides for this answer. `failed` is the reason when the source's `fail` turns this answer down. A card whose map `set_page` would refuse is still previewed, with the mistake in `issues` and `valid` set to `false`; fix it before you save. A page that can't be read at all gets `invalid_page`; a sample that isn't the source's answer gets `invalid_sample`; a page with several sources and no `source` gets `choose_source`, with their names. In Legato, the [Source Preview](https://legatobar.com/docs/source-preview.md#preview-before-polling) window shows the same preview with the cards drawn. `preview_page` works without the trial or a license, since it draws nothing.
After `set_page`, `get_page` reports the fetches themselves under `status.sources`, by source name:
```json
"sources": {
"repo": {"state": "ok", "cards": ["stars", "forks"], "fetched_at": "2026-11-19T03:30:12Z",
"error": null, "failures": 0, "next_at": "2026-11-19T04:30:12Z"}
}
```
`state` is `ok`, `error` (with the last `error` and `failures`, the fetches that failed in a row), `needs_access` (a calendar or reminders source Legato may not read yet), `not_fetched` (no answer yet, or the trial or license has ended) or `unused` (no card names it). A page you've just saved shows `not_fetched` until its first answer; ask again a few seconds later. While Legato isn't fetching at all, because the Mac is locked or asleep or the trial has ended, `status.sources_paused` says which. A page with params and no defaults fetches nothing until a link opens it: its sources show `not_fetched`, and `status.waiting_for_params` says why. `sources` is `null`, with a `sources_note` saying why, when Legato isn't running or hasn't loaded this version of the page; then `loaded_version` names the version `status` is about. `get_page` never opens Legato for this and waits at most 2 seconds for it; after a miss it doesn't ask again for 30 seconds. An error the service reported in its own answer, through the source's `fail`, is given in general words, so nothing from the answer leaves Legato.
### delete_page
`delete_page` moves the page's file to the Trash, so you can put it back from there. It answers `{"id": "budget", "deleted": true, "note": "Moved to the Trash; put it back from there to restore it."}`.
## Versions and if_match
A page's `version` is the first 16 hex characters of the SHA-256 of its file. `get_page` and `list_pages` return it, and so does `set_page` for what it wrote. Editing the file by hand, or another agent writing it, changes it.
Pass a version as `if_match` to `set_page` or `delete_page` to say "only if nobody changed it since I read it." If the page has changed, nothing is written and the answer is `version_mismatch`, with the page's `current_version` in `details` (`"none"` if the page is gone). Read it again, merge, and send the new version.
Use `if_match` when you replace a page you didn't write, or one a person might edit. An agent that owns its page can leave it out. See [Versions and if_match](https://legatobar.com/docs/page-writing.md#versions-and-if-match).
## If Legato isn't running
The tools work on the files, so they answer whether or not Legato is open.
- `set_page` opens Legato in the background and waits for it to load the page. If it can't confirm in time, the page is saved and `loaded` is `null`, with a note.
- `get_page`, `list_pages` and `delete_page` read the folder and don't open Legato. `status` is what Legato said the last time it loaded each page; `status.sources` needs Legato running.
- `preview_page` runs Legato's parser on its own, so it works whether or not Legato is open.
- `get_page_schema` reads the schema from the app. If it can't find one, it answers `schema_unavailable`: open Legato once and try again.
`legato version` says whether Legato is running and which Pages folder the tool uses.
## Errors
A failed call is a tool result with `isError: true`. Its text and its `structuredContent` both hold the error, in the same shape as [Errors](https://legatobar.com/docs/errors.md):
```json
{
"error": {
"code": "invalid_page",
"message": "budget.json: /cards/0: a pacing card needs target",
"details": { "page": "budget", "saved": "false" }
}
}
```
The `message` names what to fix. Fix it and call `set_page` again. `"saved": "false"` means nothing was written: the page on disk is what it was before the call. A `load_failed` error has `"saved": "true"`: your page is on disk, but the Legato that's running couldn't load it.
| Code | When |
| --- | --- |
| `invalid_page` | The page isn't a JSON object, has a field a page doesn't have, has no `title` or no cards, or Legato's parser rejected it before writing (the message is Legato's). |
| `invalid_page_id` | The id isn't a file name Legato can use. New pages need 1–64 lowercase letters, digits and hyphens, starting with a letter or digit. |
| `too_large` | The page is over 1 MB, or a sidebar, lists or secrets request is over 64 KB. |
| `load_failed` | The page was saved, but the running Legato couldn't load it: the app and the tool are from different builds. Reopen Legato. |
| `validation_unavailable` | The tool couldn't run Legato's page check. Nothing was written; reinstall Legato. |
| `version_mismatch` | `if_match` didn't match. `details.current_version` is the version now. |
| `not_found` | `get_page` or `delete_page` for a page that doesn't exist, `delete_list` for a list that isn't there, or `set_secret_expiry` or `delete_secret` for a secret that isn't saved. |
| `write_failed` | The file couldn't be written in the Pages folder; the message says why. |
| `delete_failed` | The file couldn't be moved to the Trash. |
| `schema_unavailable` | The page schema isn't installed. Open Legato once. |
| `unknown_part` | `get_page_schema` was asked for a part that doesn't exist; the message lists the parts. |
| `busy` | A sidebar tool was used while a new calendar event is being written in Legato. Try again once it's saved or cancelled. |
| `limit` | `set_collection` would make a tenth collection. |
| `invalid_name`, `invalid_icon`, `invalid_position` | A sidebar tool's name isn't 1–40 characters, its icon isn't an SF Symbol on this Mac, or its position isn't a nonnegative whole number that fits in an Int. Nothing changed. |
| `missing` | A sidebar tool wasn't told which collection, section or page, or where to move a page. |
| `invalid_arguments` | A list's or secret's name isn't 1–48 lowercase letters, digits and `-` starting with a letter or digit, `entries` isn't an array of strings, or `expires` isn't a date, a number of days or `null`. Nothing changed. |
| `ambiguous_host` | `set_secret_expiry` or `delete_secret` named a secret saved for more than one host without `host`. The message lists the hosts. |
| `original` | `delete_collection` for the original collection, which can't be deleted. |
| `conflict` | `move_page` named a section in another collection than its `collection_id`. |
| `not_answered` | Legato didn't answer in time. The outcome is unknown: check `get_sidebar` before retrying, especially before creating another collection or section. After `set_list` or `delete_list`, check `get_lists`; after a secret tool, `get_secrets`. |
| `turned_off` | The tool is off in Settings → [Agent Access](https://legatobar.com/docs/settings.md#agent-access). The message names the switch, as in "Turned off in Legato Settings → Agent Access → Delete pages." Only the person at the Mac can turn it on. |
| `failed` | Anything else, with the system's message. |
Protocol errors come back as JSON-RPC errors rather than tool results: `-32700` for a line that isn't JSON, `-32600` for a message that isn't a request, `-32601` for an unknown method, and `-32602` for a `tools/call` with no tool name or an unknown tool.
## Lists and History
A [list](https://legatobar.com/docs/settings.md#lists) holds your own places, names, hosts or symbols. A page checks them with `in_list`, or [sends them](https://legatobar.com/docs/lists.md#sending-a-list) to a service with `each_entry` or `all_entries`. Put them in a list, never in the page file, so the page stays safe to share. An agent sets one with `set_list`:
```json
{"name": "delivery-area", "entries": ["Fernhollow, ST", "Kestrel Bay, ST"]}
```
Entries are trimmed and blank ones dropped. Legato saves the list as Settings → Lists does, so pages read it again at once. The answer is the list as `get_lists` shows it, and whether it's new:
```json
{"list": {"name": "delivery-area", "entries": ["Fernhollow, ST", "Kestrel Bay, ST"],
"used_by": ["Deliveries"], "sent_to": [], "reads_addresses": false, "status": "ready"}, "created": true}
```
`status` is `ready`, `empty` (saved with no entries) or `not_set` (a page names it but it isn't saved). `sent_to` lists the hosts pages send the list's entries to, and `reads_addresses` is `true` when a page reads each entry as an address ([a host list](https://legatobar.com/docs/source-requests.md#several-hosts-from-a-list)). `get_lists` includes the lists pages name that aren't saved. `delete_list` removes a list, and can't be undone; a list that isn't there is `not_found`. If a page still checks it, the answer's `list` shows it `not_set`.
`get_history` says what Settings → History says, so an agent can find out why a history page is empty. It never returns rows:
```json
{"histories": [{"dataset": "parcel-deliveries", "page": "Parcel", "page_id": "parcel",
"status": "Paused", "needs_attention": true,
"reason": "Paused: the secret changed. Is this the same account's history?",
"fix": "In Settings → History, choose Continue this history or Start new history",
"rows": 214, "bytes": 88412, "readers": ["Delivery times"],
"recording_since": "2026-08-02T14:00:00Z", "last_collected": "2026-11-07T22:54:00Z", "gaps": 0}],
"readings": [{"page": "Weather", "page_id": "weather", "cards": 2, "readings": 288}],
"totals": {"row_bytes": 88412, "disk_bytes": 225280}}
```
`status` is one of the words Settings uses: Collecting, Paused, Storage full, Updating…, Deleted in N days or Claimed by N pages. `reason` and `fix` are `null` when nothing needs you. When History can't open, the answer adds `unavailable` with why, and still lists this session's sparkline readings.
## Secrets
The secret tools show Settings → [Secrets](https://legatobar.com/docs/secrets.md) without values. An agent can see what a page still needs, keep expiry dates current and remove a secret that's no longer used. None of them reads or saves a value or a 1Password reference: the person saves those in Settings → Secrets, or an agent pipes one into [`Legato secret set`](https://legatobar.com/docs/secrets.md#from-the-command-line-or-an-agent).
`get_secrets` lists every saved secret and every one a page names that isn't saved:
```json
{"onepassword_account": "saved",
"secrets": [{"name": "pihole", "host": "pi.hole", "status": "saved", "expires": "2027-02-09", "used_by": ["pihole"]},
{"name": "lunch-money", "host": "api.lunchmoney.dev", "status": "from_1password", "expires": null, "used_by": ["budget"]},
{"name": "glances", "host": "glances.example.com", "status": "needed", "expires": null, "used_by": ["glances"]}]}
```
`status` is `saved`, `from_1password` (Legato reads it from 1Password), `connected` (a [connection](https://legatobar.com/docs/source-requests.md#connections) made in Settings → Secrets) or `needed` (a page names it, and it isn't saved). `used_by` lists page ids. `onepassword_account` says whether a 1Password service account is saved.
`set_secret_expiry` changes only the date, so Legato can [warn before it passes](https://legatobar.com/docs/secrets.md#expiry-dates). `expires` is a day such as `2027-02-09`, a number of days such as `90d`, or `null` to clear it. `delete_secret` removes a saved secret, and can't be undone. Pages that use it stop until it's saved again, and the answer's `secret` shows it `needed` while a page names it. Both find the host from the name; give `host` when the name is saved for more than one.
## Arranging the sidebar
The sidebar's arrangement isn't in the pages: collections, sections and where each page sits are Legato's own settings on this Mac. The sidebar tools ask the running Legato to change them, as its menus would, and open it if it isn't running. Each answer carries the whole sidebar as it now is:
```json
{"sidebar": {
"collections": [
{"id": "…", "name": "Pages", "icon": "folder", "original": true, "new_pages": true,
"pages": [{"id": "budget", "title": "Budget", "icon": "dollarsign.circle"}],
"sections": [{"id": "…", "name": "Home", "icon": "house", "collapsed": false, "pages": [ … ]}]}
],
"current_collection": "…", "max_collections": 9}}
```
`pages` are a collection's ungrouped pages in sidebar order; a section's are its own. `original` marks the collection whose pages and sections take in a deleted collection's; it can't be deleted. `new_pages` marks where new sidebar pages appear. Starter pages have `"starter": true`. Without collections, `collections` is empty and `pages` and `sections` sit beside it. Detail pages (`"sidebar": false`) aren't in the sidebar.
- **`set_collection`** without `collection_id` makes a collection; the first one also makes **Pages**, the original, holding everything there is. With it, it changes that collection's `name`, `icon` (an SF Symbol), `position` among the icons, or `new_pages`. Legato has at most nine.
- **`set_section`** without `section_id` makes a section in `collection_id`, or where new pages appear. With it, it changes the section's `name`, `icon` (`null` for none), `collapsed`, its collection, or its `position` among that collection's sections.
- **`move_page`** puts a page in a section (`null` for ungrouped), a collection or a position. A section takes the page to its collection; a collection alone puts it ungrouped there; a position alone reorders it where it is. A new place without a position is the end.
- **`delete_collection`** and **`delete_section`** remove only the collection or section. A deleted collection's sections and pages go to the original; a deleted section's pages stay in its collection, ungrouped. No page file is changed or deleted, and the user can undo a deleted collection from the collections menu.
Page names and icons belong to the page: change them with `set_page`. `list_pages`, `get_page` and `set_page` also give each page's collection and placement: `recorded`, `pending` (where Legato will put a page it hasn't loaded yet), `detail` or `ungrouped`. Don't add a collection field to page JSON.
A request made while Legato is opening waits until it has read its pages. [Errors](https://legatobar.com/docs/mcp-tools.md#errors) lists the refusals.
Sidebar tools validate all supplied arguments before changing the arrangement. Boolean fields take `true` or `false`, not strings or numbers; unexpected fields and invalid types return `invalid_arguments`. Positions count from zero in the visible destination group, including pages that have not been manually reordered. A position beyond the group’s end appends the item.
## Templates
`get_templates` lists the bundled services. Pass `service` to get its inputs,
secret names and lists. `install_template` takes `service`, `answers`, and
optional `dry_run` and `copy` booleans. Answers contain setup choices, never secret values.
Use `dry_run: true` to validate all pages and see the hosts, polling intervals,
card actions, row actions and setup steps. It makes no source requests and saves
nothing. Installation refuses with `already_installed` if any page already
exists, and names those pages. With `copy: true` it adds a numbered set beside
them instead, for a second server or account: Pi-hole 2, with page ids
`pihole-2` and so on. A copy's links point at its own pages, it keeps its own
history, and its sidebar pages and section take the number. It signs in with its
own secrets too, named with the number (`pihole-2`), so save those for it even
when it uses the same token as the first. The result then has `copy`, the
number, `page_ids`, each template page's new id, and `secret_names`, each
secret's new name.
Pages install in template order. Detail pages stay out of the sidebar. A template
that adds two or more sidebar pages puts them in a section named after its title,
reusing a section of that name in the same collection; the result then has
`section`, that name.
The result includes `preview`, `setup_steps`, `setup_commands` and `written_pages`. `setupSteps` is the same list under its older name, kept for scripts that read it.
Save each named secret for its host in Settings → Secrets, or run the returned
secret command yourself. Create the listed names in Settings → Lists using the
suggested entries. Agents do not read or send secret values.
The CLI uses JSON output too: `legato templates [service]` and
`legato install --set name=value ... [--dry-run] [--copy]`.
For installs, the CLI prints the preview before saving and setup lines after
saving on stderr. The complete JSON result stays on stdout.
---
# Scripts
Each example here is a page, plus a way to keep it current on the Mac that runs Legato: a script that writes it with `legato set`, run by launchd or cron, or a prompt for an agent with Legato's [MCP tools](https://legatobar.com/docs/mcp-tools.md). Both write the same page file, with the same checks; see [Pages](https://legatobar.com/docs/pages.md) and [Cards](https://legatobar.com/docs/cards.md).
If the data comes from one HTTP API that answers JSON, you may not need a script at all: a page can name [sources](https://legatobar.com/docs/sources.md) that Legato fetches on a schedule itself. Scripts and agents are for the rest: data that needs a few calls, some arithmetic, a command-line tool, or an agent's judgement.
## The legato tool in scripts
`legato` ships inside the app, at `/Applications/Legato.app/Contents/Helpers/legato`. Scripts run from launchd or cron get a short `PATH`, so call it by that full path. For your own shell, a link on your `PATH` works too:
```bash
mkdir -p ~/bin
ln -s /Applications/Legato.app/Contents/Helpers/legato ~/bin/legato
```
`legato set ` reads the whole page from a file or stdin, writes it, and waits for Legato to load it. It prints JSON and exits with status 0, or prints an `{"error": …}` and exits with status 1, so a script can tell a refused page from a saved one. If Legato isn't running, `set` opens it. See [The legato command](https://legatobar.com/docs/cli.md#the-legato-command) for every command.
## Free disk space
The smallest useful example: a shell script that puts the startup disk's free space on a page called `disk`.
```sh
#!/bin/sh
# Free space on the startup disk, as the Legato page "disk".
legato=/Applications/Legato.app/Contents/Helpers/legato
free=$(df -g / | awk 'NR==2 {print $4}')
"$legato" set disk < ~/.config/legato/api-spend.env <<'EOF'
export ANTHROPIC_ADMIN_KEY='sk-ant-admin01-…'
EOF
chmod 600 ~/.config/legato/api-spend.env
```
The jobs below read that file each time they run. If you keep the script in a dotfiles repository, keep the `.env` file out of it. Legato itself needs no key: `legato` writes to your own Pages folder.
### Run it every hour
The report updates within minutes and Anthropic allows polling as often as once a minute, so you can run this job hourly. The page's footer says how long ago it was written, so a page that reads "updated 2 days ago" means the job has stopped.
**With launchd.** Save the script as `~/bin/api-spend.py`, then this as `~/Library/LaunchAgents/com.legatobar.api-spend.plist`, with your own home folder and budget:
```xml
Labelcom.legatobar.api-spendProgramArguments/bin/sh-c. "$HOME/.config/legato/api-spend.env" && exec /usr/bin/python3 -I "$HOME/bin/api-spend.py" --budget 500StartInterval3600RunAtLoadStandardErrorPath/Users/you/Library/Logs/api-spend.log
```
Load it, and it runs now and every hour after, catching up after the Mac wakes:
```bash
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.legatobar.api-spend.plist
```
The key stays in the `.env` file, not in the plist. `/usr/bin/python3` needs the Xcode Command Line Tools; use the path `which python3` prints if yours comes from elsewhere. To stop the job, run `launchctl bootout gui/$(id -u)/com.legatobar.api-spend`.
**With cron.** cron on the same Mac works too. Run `crontab -e` and add a line:
```text
7 * * * * . "$HOME/.config/legato/api-spend.env" && python3 -I "$HOME/bin/api-spend.py" --budget 500 >> "$HOME/api-spend.log" 2>&1
```
Unlike launchd, cron doesn't catch up on a run it missed while the Mac slept.
### Or let an agent keep it
An agent on this Mac with Legato's [MCP tools](https://legatobar.com/docs/mcp-tools.md) and a way to call the Admin API, such as Claude Code with shell access and `ANTHROPIC_ADMIN_KEY` in its environment, can do the same job. Give it something like this, in a scheduled task, a `claude -p` job, or by hand:
> You keep my Legato "ai-spend" page current. Call Anthropic's cost report: `GET https://api.anthropic.com/v1/organizations/cost_report` with `starting_at` set to midnight UTC on the 1st of this month, `bucket_width=1d` and `limit=31`, headers `x-api-key: $ANTHROPIC_ADMIN_KEY` and `anthropic-version: 2023-06-01`; follow `next_page` while `has_more` is true. Each bucket is one UTC day, and each result's `amount` is a decimal string in cents, so divide by 100. Then call `set_page` with page_id "ai-spend": title "API spend", icon "sparkles", a `pacing` card with id "month", label the month's name, `value` the month's total in dollars, `target` 500, `elapsed` the fraction of the month gone and unit "USD"; a `sparkline` with id "daily" of each day's spend so far if there are at least two days; and, only if value ÷ target is more than elapsed, a `text` note with id "note" and tone "warning" saying where the month ends at this rate. Use only that documented endpoint. Always send the whole page. If you get an error, fix what its message names and try again.
The script is the cheaper way to run it every hour, since it uses no model at all. The prompt suits an agent that already runs on a schedule and can add the page to its rounds. [A scheduled agent](#a-scheduled-agent) shows how to run one from launchd.
## A scheduled agent
Any job an agent can do by hand, it can do on a schedule. With Claude Code connected to Legato (see [Connect an agent](https://legatobar.com/docs/connect-agent.md#claude-code), with `--scope user` so every folder has it), `claude -p` runs one prompt and exits, and `--allowedTools` lets it call `set_page` without asking:
```bash
cd ~/src/app && claude -p "List the open pull requests waiting on my review with gh, and keep my Legato page \"reviews\" current: a list of them, newest first, each linking to its pull request. Always send the whole page." \
--allowedTools "mcp__legato__set_page" "Bash(gh pr list:*)"
```
Put that line in a launch agent's `ProgramArguments` (through `/bin/sh -c`, as in [Run it every hour](#run-it-every-hour)) to run it every morning or every hour. launchd's `PATH` is short, so use the path `which claude` prints instead of plain `claude`. Each run starts fresh, so put everything the agent needs in the prompt: which page id, which cards, and where the data comes from. Allow only the tools the job needs: here, writing pages and listing pull requests.
---
# CLI
Legato comes with a command-line tool, `legato`, inside the app. A shell script, a launchd or cron job, or you at a terminal can use it to write and read pages, arrange the sidebar, add a service's pages from a template, and add to History and lists. It takes a page as JSON from a file or stdin and answers in JSON, so a script can check what happened.
Secrets are the exception. `legato secret` passes its arguments to the app's own `secret` command, which answers in plain text. You can also run that command as `/Applications/Legato.app/Contents/MacOS/Legato secret`.
The table below lists every command. Each group has a page with its arguments, its output and an example:
- [Pages](https://legatobar.com/docs/cli-pages.md): `set`, `get`, `list`, `delete` and `schema`.
- [Sidebar](https://legatobar.com/docs/cli-sidebar.md): `sidebar` prints the arrangement, and `arrange` changes it.
- [Templates and install](https://legatobar.com/docs/cli-templates.md): `templates` and `install`, with a dry run.
- [History and rows](https://legatobar.com/docs/cli-history.md): `history` reports what's kept, and `rows` adds, lists and deletes rows.
- [Lists](https://legatobar.com/docs/cli-lists.md): `lists`, `lists set` and `lists delete`.
- [legato mcp](https://legatobar.com/docs/cli-mcp.md): The server an agent's app starts.
- [legato secret](https://legatobar.com/docs/cli-secret.md): Credentials in the Keychain, or linked from 1Password.
## The legato command
The `legato` command works from a shell or a script. It makes the same checks as the [MCP tools](https://legatobar.com/docs/mcp-tools.md) and gives the same answers:
| Command | Does |
| --- | --- |
| `legato set [file]` | Writes a page from a JSON file, or from stdin. Same as `set_page`. |
| `legato get ` | Prints a page with its version and status. |
| `legato list` | Lists the pages. |
| `legato delete ` | Moves a page to the Trash. |
| `legato schema [part]` | The page format: `page`, `sources`, `rules`, `actions`, `period`, `params`, `notify`, `title_from` or a card type. |
| `legato preview [file]` | Fills a page's cards from a sample answer, offline, as [`preview_page`](https://legatobar.com/docs/mcp-tools.md#checking-a-pages-sources) does. It reads `{"page_id" or "page", "source", "sample"}` from the file or stdin. |
| `legato sidebar` | How the sidebar is arranged. Same as `get_sidebar`. |
| `legato arrange [file]` | Changes the arrangement from a JSON object in a file or stdin: `op` names the tool (`set_collection`, `delete_collection`, `set_section`, `delete_section` or `move_page`), and the rest are its arguments. |
| `legato templates [service]` | Lists the bundled templates, or shows one service's template with its inputs. Same as `get_templates`. |
| `legato install --set name=value ... [--dry-run] [--copy]` | Adds a service's pages from its template. With `--dry-run` it shows what it would do and writes nothing. With `--copy` it adds a numbered set beside pages already there. Same as `install_template`. |
| `legato rows add\|list\|delete ` | Adds, lists or deletes a history's rows. Same as `add_rows`, `list_rows` and `delete_rows`; see [History](https://legatobar.com/docs/history-rows.md#legato-rows). |
| `legato history` | Every history's status and size, and every page's sparkline readings. Same as `get_history`. |
| `legato lists` | Every list, with its entries and the pages that check it. Same as `get_lists`. |
| `legato lists set [--if-missing] [file\|-]` | Creates or replaces a list from a file or stdin: one entry per line, or a JSON array of strings. With `--if-missing`, a list that already exists is kept. Same as `set_list`. |
| `legato lists delete ` | Deletes a list. Same as `delete_list`. |
| `legato version` | The version of `legato`, the app it belongs to, whether the app is running, and the Pages folder. |
| `legato mcp` | Runs the MCP server on stdio. |
| `legato secret ...` | Saves, lists or deletes a source's secret. It runs the app's own `secret` command with the same arguments, and answers in plain text; see [legato secret](https://legatobar.com/docs/cli-secret.md). |
`--if-match ` with `set` or `delete` acts only if the page is still at that version. `legato help` prints the usage.
See [Your first page from a shell](#your-first-page-from-a-shell) below, and [Scripts](https://legatobar.com/docs/scripts.md) for worked examples that keep pages current.
## Your first page from a shell
You don't need an agent to write a page. Save one as `budget.json`:
```json
{
"title": "Budget",
"icon": "dollarsign.circle",
"cards": [
{ "id": "month", "type": "pacing", "label": "October spend",
"value": 2140, "target": 3200, "elapsed": 0.55, "unit": "USD" },
{ "id": "top", "type": "list", "label": "Largest this week",
"items": ["Costco · $212", "Delta Air Lines · $189"] },
{ "id": "note", "type": "text", "body": "Dining is 18% over pace.", "tone": "warning" }
]
}
```
and write it with `legato set`:
```bash
/Applications/Legato.app/Contents/Helpers/legato set budget budget.json
```
```json
{
"changed" : true,
"collection" : null,
"created" : true,
"id" : "budget",
"loaded" : {
"loaded_at" : "2026-10-27T21:04:11.482Z",
"ok" : true
},
"placement" : "ungrouped",
"version" : "33527b6dde59dde2"
}
```
`legato set budget` with no file reads the page from stdin, so a script can pipe one in. If Legato refuses the page, `legato` prints `{"error": {"code", "message"}}` and exits with status 1, and the page stays as it was. `legato get budget` prints it back, `legato list` lists your pages, and `legato --help` lists the rest. See [The legato command](https://legatobar.com/docs/cli.md#the-legato-command).
To keep the page current, run the same command whenever the numbers change, from launchd, cron or a script. Every write replaces the whole page. Writing an identical page again keeps its version, and `changed` is `false`; the page's update time moves on, so its footer shows the job is still running. [Scripts](https://legatobar.com/docs/scripts.md) has complete examples.
You can also skip `legato` and save the file yourself in `~/Library/Application Support/Legato/Pages`, as `budget.json`. Write it to a temporary file in the same folder and rename it into place, so Legato never reads half a file. Legato shows the page as soon as the file appears; if the file has a mistake, the page says what's wrong.
## Executable, output and status
The `legato` command is at `/Applications/Legato.app/Contents/Helpers/legato`. The examples in these pages write `legato` for that path. Pages live in `~/Library/Application Support/Legato/Pages`.
Answers are JSON on stdout, printed over several lines with the keys in alphabetical order. `legato help` prints plain text, and `legato mcp` speaks the MCP protocol. A command that works exits with status 0.
A refusal is `{"error": {...}}` on stdout with exit status 1. The error has a `code` and a `message`, and sometimes `details`. A command with a missing argument is refused with `invalid_arguments`. For `templates` and `install` the code is `failed`, and the message says how to call them. `legato secret` keeps the app command's output and exit status; see [legato secret](https://legatobar.com/docs/cli-secret.md#output-and-exit-status). A command that `legato` doesn't know prints an error and the usage to stderr and exits with status 2.
A command that takes a `[file]` reads stdin when the file is left out. `lists set` also reads stdin when the file is `-`. `set`, `arrange` and `rows add` look for a file named `-`.
## Example
```bash
legato version
legato help
```
`version` prints where `legato` found the app and its pages:
```json
{
"app" : "/Applications/Legato.app",
"bundle_id" : "com.legatobar.mac",
"pages" : "/Users/you/Library/Application Support/Legato/Pages",
"running" : true,
"version" : "1.0"
}
```
`app` is `null` when `legato` can't find the app. `help` prints the usage, which begins with `Usage:`. So do `legato --help` and `legato` with no arguments.
---
# Pages
## Commands
| Command | Result |
| --- | --- |
| `legato set [file]` | Checks a page, then replaces the whole of it with the JSON object in a file, or on stdin when there is no file. |
| `legato get ` | Prints the page with its version and status. |
| `legato list` | Lists the pages. |
| `legato delete ` | Moves the page to the Trash. |
| `legato schema [part]` | Prints the page format, or one part of it: `page`, `sources`, `rules`, `actions`, `period`, `params`, `notify`, `title_from` or a card type. |
| `legato preview [file]` | Fills a page's cards from a sample answer, offline, as [`preview_page`](https://legatobar.com/docs/mcp-tools.md#checking-a-pages-sources) does. It reads `{"page_id" or "page", "source", "sample"}` from the file or stdin. |
`--if-match ` works with `set` and `delete`. The command acts only if the page is still at that version, and is refused with `version_mismatch` if it has changed. With `set`, `--if-match none` writes the page only if no page has that id yet.
The input to `set` must be a JSON object. A refusal prints `{"error": {...}}` on stdout and exits with status 1. See [Writing and versions](https://legatobar.com/docs/page-writing.md).
## Examples and success output
```bash
printf '%s\n' '{"title":"Example","cards":[{"id":"note","type":"text","body":"Hello"}]}' | legato set example --if-match none
legato get example
legato list
legato schema stat
legato delete example
```
The first command adds a page called Example to your sidebar, and the last one moves it to the Trash. Each command prints a JSON object with these fields:
| Command | Success output |
| --- | --- |
| `set` | `id`, `version`, `changed`, `created`, `loaded`, `collection` and `placement`. `loaded` is what Legato said when it loaded the page, or `null` if it hasn't loaded it yet. A `note` explains a `null`, or a page that is saved but not shown. |
| `get` | `id`, `version`, `modified`, `page`, `name`, `status`, `collection` and `placement`. If the file isn't a JSON object, `text` holds its contents, and `page`, `name`, `collection` and `placement` are left out. |
| `list` | `folder` and `pages`. Each page has `id`, `version`, `modified`, `title`, `name`, `collection` and `placement`. Once Legato has read the page it also has `ok`, with `error` when the page couldn't be loaded. |
| `schema stat` | `part`, which is `stat`, and its `schema`. Without a part, the answer has `parts`, `cards` and `note`. |
| `delete` | `id`, `deleted` and `note`. |
`collection` and `placement` say where the page sits in the sidebar. `placement` is one of:
- `recorded`: the page is in `collection`.
- `pending`: Legato hasn't loaded the page yet. `collection` is where it will go, and `placement_note` says so.
- `ungrouped`: there are no collections.
- `detail`: the page has `"sidebar": false`, so it isn't in the sidebar.
The `delete` in the example prints:
```json
{
"deleted" : true,
"id" : "example",
"note" : "Moved to the Trash; put it back from there to restore it."
}
```
---
# Sidebar
## Commands
`legato sidebar` prints the sidebar as JSON: its collections, their sections and the pages in each.
`legato arrange [file]` changes the arrangement. It reads a JSON object from the file, or from stdin when there is no file. The object's `op` is one of `set_collection`, `delete_collection`, `set_section`, `delete_section` or `move_page`. Its other fields are the arguments of the [MCP tool](https://legatobar.com/docs/mcp-tools.md#arranging-the-sidebar) of that name. This object takes the page `budget` out of its section:
```json
{"op": "move_page", "page_id": "budget", "section_id": null}
```
Answers and refusals are JSON on stdout. Success exits with status 0, and a refusal with status 1.
Every answer has `sidebar`, the whole arrangement as it now is. `legato arrange` adds fields that depend on the `op`:
| `op` | Adds |
| --- | --- |
| `set_collection` | `collection_id` and `created` |
| `set_section` | `section_id` and `created` |
| `move_page` | `page_id`, `collection_id` and `section_id` |
| `delete_collection` | `deleted`, `moved_to`, `moved` and `note` |
| `delete_section` | `deleted`, `moved` and `note` |
`set_section` without a `section_id` makes a new section every time it runs, and `set_collection` without a `collection_id` makes a new collection. Keep the id from the answer to change or delete it later.
## Reading and moving a page
This example adds a page and a section to your sidebar, moves the page into the section, then removes both. Start with the page and the section:
```bash
printf '%s\n' '{"title":"Example","cards":[{"id":"note","type":"text","body":"Hello"}]}' | legato set example --if-match none
legato sidebar
printf '%s\n' '{"op":"set_section","name":"Example"}' | legato arrange
```
`legato sidebar` prints `{"sidebar": {...}}`. The `set_section` answer has `created`, which is `true`, the new section's `section_id`, and `sidebar`. Use that `section_id` to move the page:
```bash
printf '%s\n' '{"op":"move_page","page_id":"example","section_id":"example-section-id"}' | legato arrange
```
Replace `example-section-id` with the id from the answer. The move prints `page_id`, `collection_id`, `section_id` and the sidebar with the page in its new place.
To remove the section and the page:
```bash
printf '%s\n' '{"op":"delete_section","section_id":"example-section-id"}' | legato arrange
legato delete example
```
Deleting a section deletes no pages. Its pages stay in the same collection, outside any section, and the answer names them in `moved`. `legato delete` then moves the example page to the Trash.
---
# Templates and install
## Commands
`legato templates` lists the bundled templates. `legato templates ` prints one service's template, with the inputs it asks for.
`legato install --set name=value ... [--dry-run] [--copy]` adds a service's pages from its template. Give `--set` once for each input. A value can contain `=`. With `--dry-run` the command prints what it would do and writes nothing.
If one of the template's pages is already in your Pages folder, `install` is refused with `already_installed`, and the message names the pages. `--dry-run` is refused the same way. Add `--copy` to install a numbered set beside them, such as a second Pi-hole: its pages are titled Pi-hole 2, their ids end in `-2`, and their links and history are their own. It signs in with its own secret, `pihole-2`, which the setup commands name.
`templates` and `install --dry-run` print JSON on stdout. An install prints its result as JSON on stdout too, and also writes the preview and the setup commands to stderr. A refusal prints `{"error": {...}}` on stdout and exits with status 1. A `templates` or `install` command with a missing or extra argument is refused with the code `failed`.
See [Add a page from a template](https://legatobar.com/docs/templates.md).
## Examples and success output
```bash
legato templates
legato templates portainer
legato install portainer --set url=https://example.com --set env=1 --dry-run
```
The first command prints `{"templates": [...]}`, with each template's `service`, `title`, `category`, `summary`, `version` and `pages`. The second prints the whole Portainer template, including its `inputs`, `secrets` and `lists`.
The dry run prints `service`, `dry_run`, `preview`, `setupSteps`, `setup_commands` and `written_pages`, which is empty. A template that adds two or more pages to the sidebar also has `section`: the name of the section they go in, the template's title. `preview` has four parts:
- `pages`: the pages the install would write.
- `hosts`: the hosts those pages contact.
- `polling`: how often each source checks.
- `actions`: the buttons that send a request.
`setup_commands` holds one command for each thing the pages need from you:
- For each secret, `/Applications/Legato.app/Contents/MacOS/Legato secret set NAME --host HOST`. Run it and type the credential, or pipe it in. See [Legato secret](https://legatobar.com/docs/cli-secret.md).
- For each list the pages check, a `legato lists set NAME --if-missing -` command that creates the list with the template's suggested entries. A list you already have is kept. See [Lists](https://legatobar.com/docs/cli-lists.md).
To install, run the command without `--dry-run`, with your own Portainer address and environment id in place of the example values:
```bash
legato install portainer --set url=https://example.com --set env=1
```
This writes two pages, `portainer-container` and `portainer`. The result has the same fields as the dry run, with `dry_run` set to `false` and the two ids in `written_pages`. Then run the `setup_commands`. If a page can't be written partway through, the error is `install_failed`, and `details.written_pages` names the pages that were written.
To remove the pages again:
```bash
legato delete portainer
legato delete portainer-container
```
This moves the two pages to the Trash. A secret or a list that you made with the `setup_commands` stays. Remove those with `Legato secret delete` and `legato lists delete`, unless the list was yours before the install.
---
# History and rows
## Commands
| Command | Input and result |
| --- | --- |
| `legato history` | Prints every history's status and size, and every page's sparkline readings. |
| `legato rows add [file] [--request-id id]` | Adds rows from a JSON array of items, or from `{"rows": [...]}`, in a file or on stdin when there is no file. It takes up to 2,000 items and 8 MB of them at a time, in input of up to 32 MB. With `--request-id`, you can run the same command again after a timeout without adding the rows twice. An id is 1–64 letters, digits and `-`. |
| `legato rows list [--limit n]` | Prints the newest rows, up to 500. |
| `legato rows delete --key k ...` | Deletes the rows with those keys from the current history. Repeat `--key` for each one. |
| `legato rows delete --epoch n` | Deletes one history by its number: an earlier history, whole, or the current one's rows. The number is the `epoch` in the answers of `rows add` and `rows list`. |
| `legato rows delete --all` | Deletes every row. |
Deleting can't be undone. Give one of `--key`, `--epoch` or `--all`. If you give more than one, `--all` wins, then `--epoch`. Answers and refusals are JSON on stdout. Success exits with status 0, and a refusal with status 1. See [Rows from outside](https://legatobar.com/docs/history-rows.md) for which histories accept rows, how request ids work, and the refusals.
## Examples and success output
These commands assume you have a history named `example-daily` that accepts rows, is keyed by `date`, and keeps the fields `date` and `steps`.
```bash
legato history
printf '%s\n' '[{"date":"2026-11-10","steps":4200}]' | legato rows add example-daily --request-id example-import-1
legato rows list example-daily --limit 10
legato rows delete example-daily --key 2026-11-10
```
The last command deletes the example row. A row that is already past the history's retention is counted in `expired` and isn't added.
| Command | Success output |
| --- | --- |
| `history` | `histories`, `readings` and `totals`, which has `row_bytes` and `disk_bytes`. When History can't be opened, `unavailable` says why. |
| `rows add` | `dataset`, `accepted`, `rejected`, `expired`, `pruned`, `epoch` and `request_id`. |
| `rows list` | `dataset`, `epoch`, `total_count`, `undated_count`, `rows` and `truncated`. Each row has `key`, `row`, `first_seen` and `last_seen`, and `date` and `date_kind` when the row has a date, with `time` when it has one. In a history of samples, each row has `key`, `at` and `row`. |
| `rows delete` | `dataset` and `deleted`, the number of rows removed. |
`rows add` exits with status 0 even when rows were rejected or expired, so check the counts. The `rows delete` in the example prints:
```json
{
"dataset" : "example-daily",
"deleted" : 1
}
```
---
# Lists
## Commands
`legato lists` prints every list, with its entries and the pages that check it.
`legato lists set [--if-missing] [file|-]` creates a list, or replaces the entries of one you have. The input is one entry per line, or a JSON array of strings, up to 64 KB. Leave out the file, or give `-`, to read stdin. With `--if-missing`, a list that already exists is kept as it is.
A name is 1–48 characters: `a–z`, `0–9` and `-`, starting with a letter or digit.
`legato lists delete ` deletes a list. This can't be undone. A list that doesn't exist is refused with `not_found`.
Answers and refusals are JSON on stdout. Success exits with status 0, and a refusal with status 1. See [Lists](https://legatobar.com/docs/lists.md).
## Examples and success output
```bash
printf '%s\n' 'example.com' | legato lists set allowed-hosts --if-missing -
legato lists
legato lists delete allowed-hosts
```
The first command creates a list named `allowed-hosts`, unless you already have one. The last command deletes `allowed-hosts`, so leave it out if the list was yours before.
For a new list that no page checks yet, the first command prints:
```json
{
"created" : true,
"list" : {
"entries" : [
"example.com"
],
"name" : "allowed-hosts",
"reads_addresses" : false,
"sent_to" : [
],
"status" : "ready",
"used_by" : [
]
}
}
```
If the list was already there, `created` is `false`, `kept` is `true`, and `list` is the list as it was saved.
`legato lists` prints `{"lists": [...]}`, with each list in the same form.
`lists delete` prints `deleted`, which is the list's name, and `list`, which is `null`. If a page still checks the deleted list, `list` shows it with the status `not_set`.
---
# legato mcp
## Run the server
```bash
/Applications/Legato.app/Contents/Helpers/legato mcp
```
This runs Legato's MCP server over stdio for an agent. It reads protocol requests on stdin and writes its responses on stdout, one JSON message to a line, until stdin closes. Then it exits with status 0. See [Connect an agent](https://legatobar.com/docs/connect-agent.md) to set up a client, and [MCP tools](https://legatobar.com/docs/mcp-tools.md) for the tools and their errors.
## Protocol example
A client normally starts this process and talks to it. To check from a shell that the server answers, send it one ping:
```bash
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"ping"}' | /Applications/Legato.app/Contents/Helpers/legato mcp
```
The server prints one line of JSON with `"jsonrpc":"2.0"`, `"id":1` and an empty `result`. The order of the three can vary. It then exits with status 0, because stdin has closed.
A protocol error is a JSON-RPC error response. The server keeps running after one, and still exits with status 0. A line that isn't JSON gets the error code `-32700`.
---
# legato secret
## Executable
`secret` is a command of the app itself, and the [`legato` command](https://legatobar.com/docs/cli.md) passes it on. These two do the same thing:
```bash
legato secret list
/Applications/Legato.app/Contents/MacOS/Legato secret list
```
`legato secret` hands everything after `secret` to the app unchanged. It reads the same stdin and prints the same output, with the same exit status. The examples on this page use `legato`, which is at `/Applications/Legato.app/Contents/Helpers/legato`.
## Commands
| Command | Behavior |
| --- | --- |
| `legato secret set NAME [--host HOST] [--replace]` | Saves the value read from stdin in the Keychain. |
| `legato secret set NAME --1password REFERENCE [--1password REFERENCE] [--host HOST] [--replace]` | Links a 1Password reference (`op://Vault/Item/field`) in place of a value, after checking that it can be read. Give it twice for a [secret in two fields](https://legatobar.com/docs/1password.md#a-secret-in-two-fields), first field first: Legato sends them as `first:second`. Reads nothing from stdin. |
| `legato secret expires NAME DATE\|none [--host HOST]` | Changes or clears only a saved secret's expiry date. The value isn't read or changed. |
| `legato secret list` | Prints the saved secrets with their hosts, expiry dates and the pages that use them, then the secrets your pages name that aren't saved yet. Also says whether a service account token is saved. Values are never printed. |
| `legato secret delete NAME [--host HOST]` | Removes a saved secret, or a [connection](https://legatobar.com/docs/source-requests.md#connections) from this Mac without signing it out of the service. `set` and `expires` refuse a connection: change it in Settings → Secrets. |
| `legato secret token set [--replace]` | Saves the 1Password service account token read from stdin. |
| `legato secret token delete` | Removes the service account token. |
| `legato secret help` | Prints the usage. |
Both forms of `set` also take `--expires DATE`, the day the token stops working: `2027-02-09`, or `90d` for 90 days from today on this Mac. A secret saved without it has no expiry date, even if the one it replaces had one. See [Expiry dates](https://legatobar.com/docs/secrets.md#expiry-dates).
`NAME` is the name a page's source gives its secret: 1–48 lowercase letters, digits and hyphens, starting with a letter or digit. `HOST` is a hostname, with no URL or port. Leave it out when the name goes with one host, counting the pages that name it and the secrets already saved under it. For a new secret, that is the host of the page that names it, so write the page first. If nothing uses the name yet, or it goes with more than one host, give `--host`. A secret or token that is already saved is replaced only with `--replace`.
## Stdin and 1Password
At a terminal, you type the value and it isn't echoed. A piped value is read to the end, and a trailing newline from the pipe is dropped. An empty value is refused. A service account token starts with `ops_`.
For `--1password`, the `OP_SERVICE_ACCOUNT_TOKEN` in your shell must be the same token that is saved in Legato. Legato checks the reference by reading it before it saves anything (both of them, for a secret in two fields). A different token, an app sign-in or no token is refused. Use Settings → Secrets for those setups. See [Secrets from 1Password](https://legatobar.com/docs/1password.md#from-the-command-line-or-an-agent).
After a change, cards that were waiting for the secret try again at once.
## Output and exit status
Success and help print plain text on stdout and exit with status 0. A failure prints plain text on stderr. The exit status is 1 when the command couldn't do what you asked: the name isn't valid, the host can't be worked out, the secret isn't saved, or the Keychain refused. It is 2 when the command line itself is wrong. If `legato` can't find the app it came with, it says so on stderr and exits with status 1. `legato secret` with nothing after it prints the usage to stderr and exits with status 2.
## Examples and success output
Save a secret in the Keychain by typing its value at the prompt:
```bash
legato secret set pihole --host example.com
legato secret list
```
Saving prints `Saved pihole for example.com.`, followed by ` It expires on 2027-02-09.` when `--expires` was given. The list starts with `1Password service account: saved` or `1Password service account: not saved`. Each saved secret then has a line with its name, its host and `saved`, or `from 1Password` for a reference. If pages name the secret, `used by` and their file names follow. With a page file `pihole.json` that names this secret, the list is:
```text
1Password service account: not saved
pihole example.com saved used by pihole.json
```
A secret with an expiry date shows it after where it's kept: `tailscale api.tailscale.com saved expires 2027-02-09 used by tailscale.json`. To change only the date, or clear it:
```bash
legato secret expires pihole 2027-02-09 --host example.com
legato secret expires pihole none --host example.com
```
These print `pihole for example.com expires on 2027-02-09.` and `Cleared the expiry date of pihole for example.com.`
A secret that a page names and that isn't saved yet has a line of the form `NAME HOST needed by FILES`. With nothing to list, the command prints `No secrets saved, and no page names one.`
A script can pipe the value in. This one reads it from 1Password with the `op` tool. `--replace` is there because the secret was saved above:
```bash
op read 'op://Example/Pihole/password' | legato secret set pihole --host example.com --replace
```
To link a 1Password reference, save the service account token first. Then link the reference from a shell that has the same token in `OP_SERVICE_ACCOUNT_TOKEN`:
```bash
printenv OP_SERVICE_ACCOUNT_TOKEN | legato secret token set
legato secret set pihole --host example.com --1password op://Example/Pihole/password --replace
```
The first command prints `Saved the 1Password service account.`. If a token is already saved, it is refused unless you add `--replace`. The second prints `Saved pihole for example.com, read from 1Password (op://Example/Pihole/password).`.
To remove the example secret and the service account token:
```bash
legato secret delete pihole --host example.com
legato secret token delete
```
These print `Removed pihole for example.com.` and `Removed the 1Password service account. Secrets from 1Password stop until one is saved again.` Run `token delete` only if you saved the token for this example. Every secret that Legato reads from 1Password needs it.
---
# Limits
## Pages
| | Limit |
| --- | --- |
| Page file | 1 MB. Most pages are a few KB; the limit stops a runaway script from slowing the panel. Larger, Legato shows the page as [Can't read this page](https://legatobar.com/docs/errors.md#the-whole-page) and `legato set` refuses it with `too_large`. |
| Page id | The file name without `.json`. A new page's id is 1–64 characters, `a–z`, `0–9` and `-`, starting with a letter or digit. |
| Cards on a page | 1 to 24, a `tabs` card counting as one; 120 at most counting the cards in tabs |
| `title` | 1–60 characters |
| `icon` | Up to 64 characters, an SF Symbol name such as `chart.bar.fill` |
| `schema_version` | `1`, or left out |
| Source names (keys of `sources`) | `a–z`, `0–9`, `_` and `-` |
| `notify` id | 1–64 characters: letters, digits, `.`, `_`, `:` and `-`, starting with a letter or digit |
| `notify` title / body | 1–60 / 1–200 characters |
There's no limit on how many pages the folder holds.
## Cards
Card ids are 1–64 characters, `a–z`, `0–9`, `-` and `_`, starting with a letter or digit, and unique on the page. Every card but `heading` and `tabs` has a `label` of 1–60 characters, and a card can have up to 6 buttons (`actions`).
| | Limit |
| --- | --- |
| `unit` (stat, sparkline, gauge, bars, breakdown, ranges, columns, pacing) | 1–16 characters; a `tiles` unit up to 16, or empty |
| `stat` value / delta as a string | Up to 32 / 16 characters |
| `pacing` elapsed / detail | 0 to 1 / up to 120 characters |
| `list` items | Up to 500, each 1–160 characters, with an optional `detail` of 1–40 |
| `table` | 1–4 columns (headings 1–32 characters), up to 10 rows, cells up to 60 characters |
| `sparkline` points | 2–240 |
| `status` detail | Up to 120 characters |
| `text` body | 1–500 characters |
| `link` url / detail | `https://` only, up to 2,048 characters / up to 120 |
| `countdown` at / detail | ISO 8601 with seconds and a zone / up to 120 characters |
| `map` pins | Up to 10, labels 1–40 characters, a `place` 1–200. This Mac keeps up to 2,000 places it looked up. |
| `facts` items | 1–12, keys 1–40 characters, values 1–80 |
| `gauge` bands | 1–6 |
| `bars` items | 1–20, labels 1–40 characters |
| `pacing` items | 1–20, labels 1–40 characters, each with a target above 0 |
| `pacing` details | up to 500 lines, text 1–80 characters, detail up to 40 |
| `breakdown` items / detail | 2–6, labels 1–40 characters, values 0 or more / up to 120 characters |
| `ranges` items / detail | 1–14, labels 1–24 characters, up to 2 `info` notes of 10 characters / up to 200 characters |
| `columns` series / items / detail | 1–3 names of 1–24 characters / 1–48, labels 1–12 characters, one value per series / up to 200 characters |
| `fleet` items | 1–60, names 1–24 characters, details up to 80, groups 1–24 characters; `max_items` 1–60 |
| `tiles` items | Up to 60, labels 1–16 characters, values up to 24, details up to 80; `decimals` 0–4, `scale` above 0, `max_items` 1–60 |
| `heatmap` items | Up to 371, dates spanning at most 371 days, labels up to 80 characters; `thresholds` 4 ascending numbers |
| `checklist` items | Up to 20, text 1–120 characters, details up to 120 |
| `agenda` days / items | 1–30 / up to 60, titles 1–80 characters, details up to 120 |
| `month` items | Up to 120, titles 1–80 characters, details up to 120 |
| `code` code / language | 1–4,000 characters / up to 24: `a–z`, `0–9`, `+`, `#`, `.` and `-` |
| `heading` text / detail | 1–80 / up to 120 characters |
| `tabs` tabs / cards | 2–5, labels 1–24 characters / 1–12 cards in each, any type but `tabs` and `heading` |
| An item's `icon` | Up to 80 characters |
Lengths count Unicode code points, as JSON Schema does.
These limits come from the [page schema](https://legatobar.com/docs/page-writing.md#the-schema), which `legato schema`, `get_page_schema` and any editor that reads the file's `$schema` check against. When it loads a file, Legato itself checks the counts in the [Pages](#pages) table, the number of tabs and cards in them, unique card ids, required fields and their types, dates and colours. Keep text within the lengths above: they're what the cards are designed to show.
## Sources
See [Sources](https://legatobar.com/docs/sources.md).
| | Limit |
| --- | --- |
| How often (`every`) | At least `1m`; `5m` when left out |
| A request | 10 seconds without data, or 20 seconds in all |
| A button's request | 60 seconds, or the button's `timeout`, up to 30 minutes |
| A button's GraphQL query (`graphql.query`) | 20,000 characters |
| A response | 1 MB; Legato stops reading past it |
| Named requests | 8 a source |
| Requests in one fetch | 64, counting a request with `each_entry`, `each_row` or `follow` as its `max` |
| A request for each entry (`each_entry`) | Up to 50 entries sent (`max`, 20 when left out), 4 at a time, 0.1 seconds apart to one service; each entry's answer up to 256 KB; a list of more than 200 entries fails the request |
| A request with every entry (`all_entries`) | Up to 100 entries (`max`, 50 when left out) |
| A list across pages (`follow`) | Up to 20 pages (`max`, 10 when left out), one after another; at most 10,000 items and 8 MB joined |
| Days in a list by day (`by_day`) | Up to 400, `from` through `through` |
| A request for each row (`each_row`) | Up to 50 rows sent (`max`, 20 when left out), as `each_entry` sends; a kept answer (`keep`) for 1 minute to 24 hours |
| A feed list (`feeds`) | Up to 30 feeds read, 4 at a time, each answer up to 1 MB; the newest 50 posts kept from each, and 200 in the merged `items` |
| After a failure | The wait doubles each time, up to 30 minutes (or the source's own `every`, if that's longer) |
| A server's `Retry-After` | Honored, for up to 24 hours |
| Buttons on a card | 4 |
| Secret names | 1–48 characters: `a–z`, `0–9` and `-`, starting with a letter or digit |
| List names (Settings → Lists) | 1–48 characters: `a–z`, `0–9` and `-`, starting with a letter or digit |
| A list set by an agent (`set_list`, `legato lists set`) | 64 KB (65,536 bytes) of entries in one request |
Legato also scans the Pages folder every 15 seconds, behind its file watch, so a change it wasn't told about (on a network volume, say) still shows within that time.
## History
These apply on each Mac. See [History](https://legatobar.com/docs/history.md).
| | Limit |
| --- | --- |
| `dataset` name | 1–64 characters, `a–z`, `0–9` and `-`, starting with a letter or digit |
| `each` | One path, or 2–4 |
| `key` | Up to 256 characters, with at least one `{…}`; each field it uses must be text |
| `fields` | 1–64 different paths |
| `remove_after` | 1–16 fields, each with 1–16 markers of 1–64 characters, and up to 32 `keep_exact` phrases of 1–64 |
| `keep.for` | `1d` to `9999d` |
| `readers` | Up to 32 page ids |
| A date's text | Up to 80 characters; longer is undated |
| One row | 16 KB (16,384 bytes) of JSON, as kept; a larger one isn't kept |
| One answer kept, or one `rows add` | 2,000 items and 8 MB (8,388,608 bytes) |
| A dataset's current history | 20,000 rows and 50 MB (52,428,800 bytes); the oldest rows make way |
| Every history on the Mac | 500 MB (524,288,000 bytes); a batch that would grow storage past it isn't kept |
| Gaps in collecting | More than twice the source's `every`, plus 2 minutes; the last 200 are kept for each history |
| A dataset whose page stops collecting it | Deleted after 30 days, unless the page comes back or it's transferred |
| A `rows add` file | 32 MB (33,554,432 bytes) before it's read; the items in it, 2,000 and 8 MB |
| A rows request | 10 MB (10,485,760 bytes); one Legato hasn't reached in 2 minutes is dropped unanswered |
| `rows list` | Up to 500 rows |
| Waiting for an answer to `legato rows` | 30 seconds, more while Legato opens |
| `row` on a dataset source | 16 names; 4 different `row`s per history; 1 KB of values per row; 32 MB of values per history and 128 MB in all |
| Older histories with no rows | The newest 20 of each dataset are kept |
| Import details in `coverage.imported` | The newest 200 of each history |
| A request id | 1–64 letters, digits and `-`; answered again for 7 days, for the same dataset and operation |
| `sample.every` | Minutes that divide an hour, `1m` to `1h`; not shorter than the source's `every` |
| Sample `fields` | 1–16 names; a value is text of up to 256 characters, a number or true/false |
| One sample | 512 bytes of JSON; kept 365 days unless `keep` says |
| A history of samples | 10,000 items and 200 MB; its oldest day makes way, never another history's |
| Every history of samples | 400 MB, apart from records' 500 MB |
| A read of samples without `key` | 100,000 samples |
| A rows answer the tool hasn't picked up | Removed after 1 minute |
Sizes are the rows' JSON, not the database file, which takes more on disk.
The 500-row limit is for `rows list` only: a page reading a history gets every row in its period.
## Notifications
These apply on each Mac. See [Notifications](https://legatobar.com/docs/notifications.md).
| | Limit |
| --- | --- |
| Notifications per page | 4 in any 10 minutes |
| Notifications in all | 20 in any 10 minutes |
| A `notify` | Shown once per id per page; skipped if the file was last modified more than 24 hours before Legato sees it |
| `notify` ids remembered per page | The last 50 |
| Quiet time after launch and wake | 30 seconds, then one summary if several things happened |
| Recent activity | The last 50 level changes per page, from the last 7 days |
Notifications over a limit are dropped, not delayed.
## Macs
A license runs on up to 5 Macs at once. **Settings → License** lists them and can release one. Legato checks the license with the licensing server about once a day; it keeps working offline for 30 days after the last check, and 7 more if the server can't be reached. See [License](https://legatobar.com/docs/license.md).
---
# Errors
There are two places a mistake shows up:
- **The `legato` tool and its MCP server** refuse a write or a read with an error envelope. See [Tool errors](#tool-errors).
- **The page itself.** Legato reads every file in the Pages folder, however it was written. A file it can't use still shows in the sidebar, as a page that says what's wrong. See [Problems on a page](#problems-on-a-page).
## Tool errors
Every refusal has the same shape. Check `code` to decide what to do; `message` says what happened in plain language:
```json
{
"error": {
"code": "version_mismatch",
"message": "The page has changed since that version; read it again before replacing it.",
"details": { "current_version": "9f2c41d07ab35e88" }
}
}
```
- `code` is stable. Branch on it.
- `message` is for people and may change. For `invalid_page` it's often Legato's own description of the problem, which is what to fix.
- `details` is there only for some codes. It's an object of strings: `current_version` for `version_mismatch`, and `page` and `saved` for validation or loading failures. `saved: "false"` means validation refused the write; `saved: "true"` means the file was written but the running app rejected it.
How each way of calling the tool returns it:
| Called as | A refusal is |
| --- | --- |
| `legato set`, `get`, `list`, `delete`, `schema` | The envelope on stdout, and exit status 1. |
| An [MCP tool](https://legatobar.com/docs/mcp.md) (`set_page`, `get_page`, …) | A tool result with `isError: true`, carrying the envelope as its text and as `structuredContent`. |
An unknown `legato` subcommand isn't a refusal: the tool prints its usage on stderr and exits with status 2, with nothing on stdout.
### Codes
| `code` | Means | Do |
| --- | --- | --- |
| `invalid_page_id` | The id isn't a page id: it has a path, starts with a dot, or ends in `.json`. Or it names a new page and isn't 1–64 lowercase letters, digits and hyphens, starting with a letter or digit. An existing file with another name, such as `Budget 2.json`, can still be read, replaced and deleted by that name. | Pick an id like `budget`. See [Limits](https://legatobar.com/docs/limits.md#pages). |
| `invalid_page` | The page can't be used. Before writing: a top-level key that isn't a page field, no `title`, no `cards` (or an empty list), or, from `legato set`, input that isn't a JSON object. Or Legato's own parser, run before anything is written, found a mistake, and `message` is its description, as in `budget.json: /cards/2: a stat card needs value`. Nothing was written (`details.saved` is `"false"`). | Fix what the message names and send the whole page again. |
| `load_failed` | The page passed the check and was saved, but the Legato that's running couldn't load it (a running app older or newer than the tool). `details.saved` is `"true"`: the file holds your page. | Quit and reopen Legato so the app and the tool match, or fix what the message names and send the page again. |
| `validation_unavailable` | The tool couldn't run Legato's page check (the app beside the tool is missing or damaged). Nothing was written. | Reinstall Legato, so the app and its `legato` tool come from the same build. |
| `too_large` | The page is over 1 MB once written as a file. `get_page` gives the same code for a file in the folder that's already over 1 MB. | Send less: shorter lists, fewer cards. |
| `version_mismatch` | You sent `--if-match` (or `if_match`), and the page isn't at that version. `details.current_version` is its version now, or `none` if there's no such page any more. | Read the page again, rebuild, and retry with the new version. |
| `not_found` | `get` or `delete` named a page that isn't in the folder. | Check the id; `list` shows the pages there are. |
| `write_failed` | The file couldn't be saved in the Pages folder (permissions, a full disk). `message` gives the system's reason. | Fix the folder, then retry. |
| `delete_failed` | The file couldn't be moved to the Trash. | Retry, or remove it in Finder. |
| `schema_unavailable` | `schema` (`get_page_schema`) found no copy of the page schema. | Open Legato once, so it installs the schema, and retry. |
| `unknown_part` | `schema` was asked for a part that doesn't exist. `message` lists the parts. | Ask for `page`, `sources`, `notify` or a card type. |
| `invalid_arguments` | The arguments don't fit: on the command line, `--if-match` without a version, a command without a page id, or a file that can't be read; from `preview_page`, both or neither of `page_id` and `page`, or no `sample`. | Fix the command, or the call. |
| `no_sources` | `preview_page` (`legato preview`) was given a page with no named sources to fill its cards from. | Give the page `sources`, and its cards a `source` with `ref`, or skip the preview for a page you write yourself. |
| `choose_source` | `preview_page` was given a page with more than one source and no `source`. `details.sources` names them. | Call again with `source` set to one of them. |
| `unknown_source` | `preview_page`'s `source` isn't one of the page's sources. `details.sources` names them. | Use one of those names. |
| `invalid_sample` | `preview_page`'s `sample` isn't that source's answer: for named requests, an object with each request's answer under its name; for a text answer, a string. | Send the answer in that shape. `message` says which part is missing. |
| `preview_unavailable` | The tool couldn't run Legato's source preview (the app beside the tool is missing or damaged). Nothing was saved. | Reinstall Legato, so the app and its `legato` tool come from the same build. |
| `turned_off` | From the MCP server only: the tool is off in Settings → [Agent Access](https://legatobar.com/docs/settings.md#agent-access), and the message names the switch. The `legato` command never gives it. | Ask the person at the Mac to turn it on. |
| `failed` | Anything else, with the system's message. | Retry; if it keeps happening, the message says why. |
### Validation and loading
`set` and `set_page` validate the complete page with the bundled app's file parser before changing a file. That includes each card's `source`, `actions` and `itemAction`: a card Legato would show as an error, such as one whose source sets `empty` on the shared source instead of its own, is refused too. Invalid pages return `invalid_page` with `details` `{"page": "", "saved": "false"}`. If the validator is missing or fails, `validation_unavailable` leaves the file unchanged; reinstall the matching app and tool.
After a valid save, the tool opens Legato in the background if needed and waits for its load result: about 4 seconds, or 10 when it had to open the app. If a different running build rejects the validated bytes, `load_failed` reports `{"page": "", "saved": "true"}`. Read the current page and fix the reported problem. The tool never rolls back a save, so it cannot overwrite another writer's changes while undoing its own.
Two answers aren't errors, but say the page isn't showing yet:
| Answer | Means | Do |
| --- | --- | --- |
| `"loaded": null`, with a `note` | Legato didn't confirm the load in time, or isn't running (it loads the page when it opens). The page is saved. | Call `get_page` later: its `status` says whether Legato loaded it. |
| `"loaded": {"ok": true, "plan": "locked", …}` | Saved and loaded, but Legato isn't showing pages: the trial hasn't started, it has ended, or the license has. | Nothing to fix in the page. Tell the person to open **Settings → License**. See [License](https://legatobar.com/docs/license.md). |
`list` (`list_pages`) leaves out a file over 1 MB; `get` on it answers `too_large`.
### MCP protocol errors
Before a tool runs, the MCP server can answer with a JSON-RPC error:
| Code | Means |
| --- | --- |
| `-32700` | A line that isn't JSON. |
| `-32600` | A message that isn't a request. |
| `-32601` | An unknown method. |
| `-32602` | `tools/call` without a tool name, or with a tool that doesn't exist. |
The server reads one JSON-RPC message per line on stdin and writes one per line on stdout.
## Problems on a page
Legato never drops a file it can't use. After each load it writes `Pages/.status/.json`, which is what the tool reads:
```json
{ "ok": false, "error": "budget.json: title must be 1–60 characters", "loadedAt": "2026-10-27T14:02:11.204Z", "page": "local:budget" }
```
`ok` is `true` for a page that loaded, with `"error": null`. `"plan": "locked"` is added while Legato needs a license. `version` (the first 16 hex characters of the SHA-256 of the bytes Legato read) says which save the status is about. A program that writes files directly can wait for its own version here to see whether its write took. `legato get` returns the same thing as `status`, and `legato list` as `ok` and `error` on each page.
A mistake shows in one of two ways: the whole page, or one card.
### The whole page
When the file can't be used at all, the page keeps its sidebar row, named after the file, and shows one warning card, **Can't read this page**, with the file name and what's wrong. Paths are JSON Pointers into the file, so `/cards/2` is the third card.
| Message | Fix |
| --- | --- |
| `larger than 1 MB` | Make the file smaller. |
| `not valid JSON`, `a page is a JSON object` | Fix the JSON. |
| `“light” isn't a page field; …` | Remove the key. A page has `title`, `icon`, `cards`, `sources`, `notify`, `$schema` and `schema_version`, and nothing else. |
| `title must be 1–60 characters` | Add or shorten the title. |
| `cards must list 1 to 24 cards` | Add a card, or remove some. |
| `a page holds 120 cards at most, counting those in tabs; …` | Every card counts toward the 120, those in tabs included. Split the page. |
| `schema_version must be 1 (or omitted)` | Use `1`, or leave it out. |
| `sources must be an object of named sources` | `sources` is an object keyed by name, not a list. |
| `sources. must be an object under a lowercase source name` | Source names are lowercase letters, digits, `_` and `-`. |
| `sources. defines a source; put ref and map on its cards` | A shared source can't have `ref` or `map`; those go on the cards that use it. See [Source fields](https://legatobar.com/docs/source-reference.md#source-and-page-reference). |
| `notify needs an id (…) and a body of 1–200 characters, …` | See [the notify field](https://legatobar.com/docs/notifications.md#the-notify-field). |
| `/cards/2 must be an object`, `/cards/2 needs an id` | Each card is an object with an `id`. |
| `/cards/2: duplicate id "spend"` | Card ids are unique on the page, including cards in tabs. |
| `/cards/2: “stats” isn't a card type; the types are …` | Use one of the [card types](https://legatobar.com/docs/cards.md). |
| `/cards/2: a stat card needs value` | A required field is missing. |
| `/cards/2: label is the wrong kind of value for a stat card` | A field has the wrong type, such as a number where text goes. |
| `/cards/2: items/0: start must be a date (YYYY-MM-DD) or a date-time with seconds and a zone` | A value is in the wrong format. Other examples: `color must be #RRGGBB`. |
| `/cards/2/tabs must list 2 to 5 tabs` | See [`tabs`](https://legatobar.com/docs/card-text.md#tabs). |
| `/cards/2/tabs/0 needs a label of 1–24 characters and 1 to 12 cards` | Each tab has a `label` and `cards`, and nothing else. |
| `/cards/2/tabs/0/cards/1: a tab holds any card but tabs and heading` | Move that card out of the tab. |
| `/cards/2: a tabs card has no source or actions; …` | Put the source and buttons on the cards inside its tabs. |
Fields a card fills from a source aren't checked here, since the source supplies them. They're checked when the answer arrives (see below).
### One card
A mistake in a card's `source`, `actions` or `itemAction` leaves the rest of the page working. That card shows as a warning with the message in place of its content:
| Message | Fix |
| --- | --- |
| `/cards/1/source.ref must name an entry in this page's sources` | Add the source under `sources`, or fix the name. |
| `/cards/1/source.ref allows only map and empty; …` | Connection settings and `every` go in `sources.`. |
| `/cards/1/source.every must be at least 1m` | Sources refresh at most once a minute. |
| `/cards/1/actions need a source on the same card` | A button acts on the card's source, so the card needs one. |
| `/cards/1/actions must list up to 6 buttons, or 16 in the corner` | At most six buttons on a card, or sixteen in its corner. A `"|"` doesn't count. |
| `/cards/1/actions/2: "|" goes between two buttons` | A `"|"` can't be first, last or next to another. |
| `/cards/1/actions/0: add-event needs a calendar source` | Add Event works only on a card with a calendar source. |
| `/cards/1/actions/0: complete-reminder is only for a checklist's itemAction` | Use it as the checklist's `itemAction`. |
| `/cards/1/itemAction is only for checklist cards` | Move it to a `checklist`. |
| `/cards/1/itemAction needs map.items to be an each rule, …` | Map the checklist's rows from the answer, so each row has fields to fill. |
Other `source` messages follow the same pattern and name the field to fix. [Source fields](https://legatobar.com/docs/source-reference.md#source-and-page-reference) describes each field.
### After a source answers
These aren't mistakes in the file, but they show on the card:
- **`Waiting for …`** until the source's first answer arrives.
- **Why a fetch failed**, such as `No secret named pihole for 192.168.1.2 in Settings → Secrets` or `192.168.1.2 didn't answer in time`. Before the first answer it replaces the card; after that the card keeps its last values with the message as a note under it.
- **`'s answer didn't fill every field this stat card needs.`** The `map` points at fields the answer doesn't have. [Preview Source…](https://legatobar.com/docs/source-preview.md#preview-before-polling) in the page's right-click menu shows the answer and what each card gets from it.
[Polling and failures](https://legatobar.com/docs/source-polling.md) covers fetch failures and retries.
---
# Pi-hole in your Mac’s menu bar
Legato shows your Pi-hole in the Mac’s menu bar: whether blocking is on, the last 24 hours of queries, how many were blocked, each hour’s traffic and the top domains, with a menu to pause blocking for 5 minutes, 30 minutes, an hour or 8 hours. Four more pages open from it: recent queries, clients, local DNS and the server itself. Legato reads Pi-hole v6’s API from your Mac, signed in with an app password kept in the Keychain or 1Password.
## What you’ll see
- **Pi-hole:** whether ad blocking is on is in Details, with a note from Pi-hole when there is one, which opens Servers. The health card turns orange while Pi-hole has a note. A pause doesn’t count as a problem. The page opens with the queries and blocked queries in the last 24 hours, with how many clients are active beside the query rate. In the corner of Last 24 hours is a Pause menu (5 minutes, 30 minutes, 1 hour or 8 hours), or Resume blocking while it’s paused. Below them are allowed and blocked queries for each of the last 12 complete hours, and the most blocked and most allowed domains. Explore opens the other four pages and Pi-hole’s own web interface.
- **Queries:** the query rate and the blocked count, then the latest queries in three tabs: blocked, all, and blocked for this Mac. Each row shows the domain, the client and how it was answered, and can be copied.
- **Clients:** how many clients are active and which is busiest, the top clients’ allowed and blocked queries as a flow, each one’s share blocked, and the devices Pi-hole has seen on the network.
- **Local DNS:** your local DNS records: the names with their addresses, and the aliases (CNAME records).
- **Servers:** where answers came from (cache, blocklist or upstream), how fast each upstream server answers, and any notes from Pi-hole. In the corner of Upstream response is an Upstream DNS menu, titled with the preset Pi-hole uses now (Cloudflare, Quad9 or Google), and a pencil for up to three servers of your own, such as `127.0.0.1#5335` for Unbound. Its form opens on the servers Pi-hole uses now. Either one replaces Pi-hole’s whole list of upstream servers. Closed sections hold your blocklists with the domains each gives, and the host: versions, uptime, CPU, memory and the upstreams configured.
### Status
- Watches ad blocking and Pi-hole’s notes.
- Orange while Pi-hole has a note.
- Pausing blocking never counts as a problem.
- Notifies you when it turns orange or red.
## How it connects
Every page signs in to Pi-hole with the same app password, and one session serves all five. The requests go from your Mac straight to your Pi-hole: nothing passes through Legato’s servers, and the password is sent only to the Pi-hole’s address.
| Request | Page | When | What it does |
| --- | --- | --- | --- |
| `POST /api/auth` | All five | When a session is needed | Signs in with the app password. Pi-hole answers with a session ID, which Legato sends as the `X-FTL-SID` header and reuses. `DELETE /api/auth` releases it when Legato signs out. |
| `GET /api/dns/blocking` | Pi-hole | Every minute | Whether blocking is on, and how long a pause has left. |
| `GET /api/stats/summary` | Pi-hole, Queries, Clients, Servers | Every minute; every 15 minutes on Servers | Queries, blocked queries, the rate, active clients and the blocklist’s size. |
| `GET /api/history` | Pi-hole | Every minute | Allowed and blocked queries over time, grouped into hours. |
| `GET /api/info/messages` | Pi-hole, Servers | Every minute | Notes from Pi-hole. |
| `GET /api/stats/top_domains?count=5` | Pi-hole | Every minute | The most allowed domains. |
| `GET /api/stats/top_domains?blocked=true&count=5` | Pi-hole | Every minute | The most blocked domains. |
| `POST /api/dns/blocking` | Pi-hole | When you pick a length from Pause, or press Resume blocking | Pause sends `{"blocking": false, "timer": 300}`, with the seconds you picked; Resume sends `{"blocking": true, "timer": null}`. |
| `GET /api/queries?length=8` | Queries | Every minute | The latest queries. |
| `GET /api/queries?length=8&upstream=blocklist` | Queries | Every minute | The latest blocked queries. |
| `GET /api/queries?length=8&upstream=blocklist&client_ip=192.0.2.10` | Queries | Every minute | The latest blocked queries from this Mac. Put your Mac’s address in place of `192.0.2.10`. |
| `GET /api/stats/top_clients?count=6` | Clients | Every minute | The busiest clients. |
| `GET /api/stats/top_clients?blocked=true&count=50` | Clients | Every minute | Each client’s blocked queries. |
| `GET /api/network/devices?max_devices=20&max_addresses=1` | Clients | Every minute | Devices Pi-hole has seen, with an address and when each was last seen. |
| `GET /api/config/dns/hosts` | Local DNS | Every 15 minutes | Your local names and their addresses. |
| `GET /api/config/dns/cnameRecords` | Local DNS | Every 15 minutes | Your aliases. |
| `GET /api/stats/upstreams` | Servers | Every minute | Where answers came from, and each upstream server’s response time. |
| `GET /api/config/dns/upstreams` | Servers | Every minute | The upstream servers set now, which tick the Upstream DNS menu. |
| `PATCH /api/config` | Servers | When you pick from Upstream DNS, or press Save in the pencil’s form | Sends the servers you picked in `{"config": {"dns": {"upstreams": […]}}}`, with three slots for a preset (Quad9 goes as `["9.9.9.9", "149.112.112.112", ""]`; Pi-hole drops the empty one). Pi-hole uses them at once. |
| `GET /api/lists` | Servers | Every 15 minutes | Your blocklists and the domains each gives. |
| `GET /api/info/version` | Servers | Every 15 minutes | Core, FTL, web and Docker image versions, and the latest of each. |
| `GET /api/info/system` | Servers | Every 15 minutes | Uptime, CPU and memory. |
| `GET /api/config/dns/upstreams` | Servers | Every 15 minutes | The upstream servers configured, for the Host section. |
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make an app password.** In Pi-hole’s web interface, open Settings → Web interface / API and create an app password. Legato needs it to sign in, and it’s safer to give out than your admin password. Pi-hole lets an app password read its settings but not change them, so the Upstream DNS menu and its pencil answer with an error until you allow it (see [Can I change the upstream DNS servers?](#can-i-change-the-upstream-dns-servers)). Pause, Resume and every reading work without that.
2. **Add the pages.** Paste the prompt into your agent, or download the five pages and run `/Applications/Legato.app/Contents/Helpers/legato set pihole pihole.json`, then the same for `pihole-queries`, `pihole-clients`, `pihole-dns` and `pihole-servers`. Keep those page IDs: the overview opens the others by them, so with another ID, change the matching `legato://page/` link. Don’t replace an existing page without reading it first.
3. **Point them at your Pi-hole.** The pages use `http://pi.hole`, which works when your Mac uses Pi-hole for DNS. Otherwise, change each source’s `url` to your Pi-hole’s address, such as `http://192.168.1.2`; Servers has two sources. The links to Pi-hole’s web interface use `pi.hole` too: change them to match. The three on Queries, Local DNS and Servers open over HTTPS, as Legato opens a card’s link only over HTTPS. For HTTPS with the certificate Pi-hole makes itself, use its IP address, such as `https://192.168.1.2`, and trust the certificate once when Legato shows it. If your Pi-hole answers only over HTTP on its own port, such as `http://192.168.1.2:8080`, those three won’t open; the web interface row in the overview’s Explore list still does.
4. **Set this Mac’s address** on Queries, in place of `192.0.2.10`, or remove the This Mac tab. `ipconfig getifaddr en0` shows the address.
5. **Save the password** in Legato’s Settings → Secrets under the name `pihole`, or link it from [1Password](https://legatobar.com/docs/1password.md). From a shell, the app reads it from standard input, so it stays out of your history:
```bash
/Applications/Legato.app/Contents/MacOS/Legato secret set pihole
```
The cards fill within a minute while Legato is running and Pi-hole is reachable. The overview is in the sidebar; the other four pages open from it. The HTTP address sends credentials without transport encryption: use it only on a trusted local network, and prefer HTTPS when it’s set up.
### Prompt for your agent
```prompt
Add 5 Legato pages for Pi-hole, starting from https://legatobar.com/examples/pihole.json, https://legatobar.com/examples/pihole-queries.json, https://legatobar.com/examples/pihole-clients.json, https://legatobar.com/examples/pihole-dns.json, https://legatobar.com/examples/pihole-servers.json. Use the page IDs pihole, pihole-queries, pihole-clients, pihole-dns, pihole-servers if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Change only the url of each source to my Pi-hole’s address (Servers has two sources) and keep the source and secret names. On Queries, replace 192.0.2.10 in the This Mac request with this Mac’s address on my network (ipconfig getifaddr en0), or remove that tab. I’ll save the app password as pihole in Settings → Secrets myself. Don’t press Pause, Resume or the Upstream DNS menu to test it.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Pi-hole (pihole.json)](https://legatobar.com/examples/pihole.json)
- [Download Queries (pihole-queries.json)](https://legatobar.com/examples/pihole-queries.json)
- [Download Clients (pihole-clients.json)](https://legatobar.com/examples/pihole-clients.json)
- [Download Local DNS (pihole-dns.json)](https://legatobar.com/examples/pihole-dns.json)
- [Download Servers (pihole-servers.json)](https://legatobar.com/examples/pihole-servers.json)
## Questions
### Does it work with Pi-hole v5?
No. The pages use the REST API that Pi-hole added in version 6. Pi-hole v5’s `api.php` works differently, so update Pi-hole first.
### Can I pause ad blocking from the menu bar?
Yes. Pick 5 minutes, 30 minutes, 1 hour or 8 hours from the Pause menu, and Pi-hole turns blocking back on when the timer ends, even if your Mac is asleep. Resume blocking turns it back on sooner. To offer other lengths, change the `choices` on the Pause button: each `value` is seconds.
### Can I change the upstream DNS servers?
Yes, on Servers. Pick Cloudflare, Quad9 or Google from the Upstream DNS menu, or press the pencil and enter up to three servers of your own, with `#port` when it isn’t 53. Pi-hole switches straight away, and every device using it follows. The menu doesn’t ask first, and Spotlight lists each preset as a button, so a pick there changes your DNS too. If none of the servers you pick answers, Pi-hole can’t look up anything it hasn’t cached until you pick others.
Pi-hole only takes this change from an app password once its `webserver.api.app_sudo` setting is on. On the Pi-hole, `pihole-FTL --config webserver.api.app_sudo true` turns it on. That lets anything holding the app password change any of Pi-hole’s settings, so turn it on only if you want the menu. To offer other presets, change the `choices` on the Upstream DNS button: each `value` is up to three addresses separated by spaces, such as `9.9.9.9 149.112.112.112`.
### Is “Last 24 hours” since midnight?
No. Pi-hole keeps the last 24 hours in memory and answers from that window, so the count rolls forward with the clock rather than starting again at midnight.
### How often do the pages update?
Every minute. Local DNS, and the blocklists, versions and host on Servers, every 15 minutes, since they rarely change. A press of a button fetches again at once, so the card shows the new state. After an upstream change the Host section can show the old servers for up to 15 minutes; the menu shows the new ones at once, and each server gets a bar in Upstream response once it has answered a query.
### Why is the This Mac tab empty?
The tab asks Pi-hole for blocked queries from one address. If it’s still `192.0.2.10`, or your Mac’s address has changed, it finds none: put the current address in the Queries page.
### Where is the password kept?
In your Mac’s Keychain, or in 1Password if you link it from there. Legato sends it only to the Pi-hole’s address, and the page files hold just the name `pihole`, so they’re safe to share.
### Do I need to keep a browser or script running?
No. Legato fetches the data itself while it’s running. To keep pages current with a script instead, see [Scripts](https://legatobar.com/docs/scripts.md).
*Checked against a real Pi-hole v6 (Core 6.5, FTL 6.8) on November 5, 2026: the five pages sign in and fill every card. Pause and Resume weren’t pressed in that check. On November 19, 2026, each preset and the form went through Legato’s sign-in and requests to a separate Pi-hole (2026.10.1), which switched servers each time. They weren’t pressed in the panel in that check. Illustrations use made-up readings. Pi-hole is a trademark of Pi-hole LLC. Legato isn’t affiliated with or endorsed by Pi-hole.*
---
# AdGuard Home in your Mac’s menu bar
Legato shows your AdGuard Home in the Mac’s menu bar: whether protection is on, a menu to pause it for 5 minutes to 8 hours, switches for Safe Browsing and parental filtering, queries per hour, how many were blocked, and the top domains. Four more pages open from it: recent queries, clients, blocklists and local DNS. Legato reads AdGuard Home’s API from your Mac, signed in with a username and password kept in the Keychain or 1Password.
## What you’ll see
- **AdGuard Home:** protection is in Details. The health card turns orange while filtering is turned off, and red when the DNS server isn’t running. A pause doesn’t count as a problem. The page opens with Controls: a Pause menu (5 minutes, 30 minutes, 1 hour or 8 hours), or Resume while it’s paused; Safe Browsing and parental filtering on or off; and Clear DNS cache, which asks first. Queries for each of the last 23 complete hours, the queries and blocked queries in the last 24 hours, a Server card with your clients, upstream, the rules your blocklists hold, version and answer time, and the most blocked and most queried domains. Explore opens the other four pages.
- **Queries:** the latest queries and the latest blocked ones, in two tabs. Each row shows the domain, the device and why it was answered as it was: allowed, blocked by a list, a blocked service, Safe Search or a rewrite.
- **Clients:** the busiest devices in the last 24 hours, by the names you gave them in AdGuard Home, and the clients you’ve named, with the ones that have their own settings marked.
- **Blocklists:** each list with its rule count and when it last updated, a button to update them, and your custom rules.
- **Local DNS:** your DNS rewrites, the upstream servers, bootstrap servers, mode, cache and DNSSEC, with Clear DNS cache, and how fast each upstream answers.
### Status
- Watches protection, filtering and the DNS server.
- Orange while filtering is turned off.
- Pausing or turning off protection never counts as a problem.
- Red when the DNS server isn’t running or AdGuard Home isn’t answering.
- Notifies you when it turns orange or red.
## How it connects
Every request goes from your Mac straight to your AdGuard Home with the username and password in an `Authorization` header (HTTP Basic). Nothing passes through Legato’s servers, and the password is sent only to AdGuard Home’s address.
| Request | Page | When | What it does |
| --- | --- | --- | --- |
| `GET /control/status` | All five | Every minute | Whether the DNS server is running and protection is on, how long a pause has left, and the version. |
| `GET /control/stats` | All five | Every minute | The last 24 hours: queries and blocked queries, each hour’s queries, the top domains, clients and upstreams, and the average processing time. |
| `GET /control/clients` | All five | Every minute | The clients you’ve named, so the busiest show by name rather than address. |
| `GET /control/filtering/status` | All five | Every minute | Whether filtering is on, your blocklists and your custom rules. |
| `GET /control/safebrowsing/status` | All five | Every minute | Whether Safe Browsing is on. |
| `GET /control/parental/status` | All five | Every minute | Whether parental filtering is on. |
| `GET /control/querylog?limit=25` | All five | Every minute | The latest queries. |
| `GET /control/querylog?limit=25&response_status=blocked` | All five | Every minute | The latest blocked queries. |
| `GET /control/dns_info` | Local DNS | Every 15 minutes | The upstream and bootstrap servers, the mode, the cache and DNSSEC. |
| `GET /control/rewrite/list` | Local DNS | Every 15 minutes | Your DNS rewrites. |
| `POST /control/protection` | AdGuard Home | When you pick a length from Pause, or press Resume | Pause sends `{"enabled": false, "duration": 300000}`, with the milliseconds you picked; Resume sends `{"enabled": true}`. |
| `POST /control/safebrowsing/enable` | AdGuard Home | When you press Turn on Safe Browsing | Turns Safe Browsing on for everyone. |
| `POST /control/safebrowsing/disable` | AdGuard Home | When you press Turn off Safe Browsing | Turns it off. |
| `POST /control/parental/enable` | AdGuard Home | When you press Turn on parental filter | Turns parental filtering on for everyone. |
| `POST /control/parental/disable` | AdGuard Home | When you press Turn off parental filter | Turns it off. |
| `POST /control/cache_clear` | AdGuard Home, Local DNS | When you press Clear DNS cache, and confirm | Empties the DNS cache, so the next answers come from the upstream servers. |
| `POST /control/filtering/refresh` | Blocklists | When you press Update the lists | Downloads your blocklists again now (`{"whitelist": false}`). |
All the pages read the same eight requests, so Legato fetches them once a minute for all five. [Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Add the pages.** Paste the prompt into your agent, or download the five pages and run `/Applications/Legato.app/Contents/Helpers/legato set adguard-home-queries adguard-home-queries.json`, then the same for `adguard-home-clients`, `adguard-home-filtering`, `adguard-home-dns` and, last, `adguard-home`. Keep those page IDs: the overview opens the others by them, so with another ID, change the matching `legato://page/` link. Don’t replace an existing page without reading it first.
2. **Point them at your AdGuard Home.** The pages use `http://192.0.2.53`, an address that goes nowhere. Change each source’s `url` to the address and port you open AdGuard Home’s web interface at, such as `http://192.168.1.2` or `http://192.168.1.2:3000`; Local DNS has two sources.
3. **Save the username and password** in Legato’s Settings → Secrets under the name `adguard-home`, as `username:password`, or link it from [1Password](https://legatobar.com/docs/1password.md). From a shell, the app reads it from standard input, so it stays out of your history:
```bash
/Applications/Legato.app/Contents/MacOS/Legato secret set adguard-home
```
The cards fill within a minute while Legato is running and AdGuard Home is reachable. The overview is in the sidebar; the other four pages open from it. The HTTP address sends the password without transport encryption: use it only on a trusted local network, and prefer HTTPS when it’s set up in AdGuard Home (Settings → Encryption settings).
### Prompt for your agent
```prompt
Add 5 Legato pages for AdGuard Home, starting from https://legatobar.com/examples/adguard-home.json, https://legatobar.com/examples/adguard-home-queries.json, https://legatobar.com/examples/adguard-home-clients.json, https://legatobar.com/examples/adguard-home-filtering.json, https://legatobar.com/examples/adguard-home-dns.json. Use the page IDs adguard-home, adguard-home-queries, adguard-home-clients, adguard-home-filtering, adguard-home-dns if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Change only the url of each source to my AdGuard Home’s address and port, as I open its web interface (Local DNS has two sources), and keep the source and secret names. I’ll save the username and password as adguard-home in Settings → Secrets myself. Don’t press Pause, Resume or any switch to test it.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download AdGuard Home (adguard-home.json)](https://legatobar.com/examples/adguard-home.json)
- [Download Queries (adguard-home-queries.json)](https://legatobar.com/examples/adguard-home-queries.json)
- [Download Clients (adguard-home-clients.json)](https://legatobar.com/examples/adguard-home-clients.json)
- [Download Blocklists (adguard-home-filtering.json)](https://legatobar.com/examples/adguard-home-filtering.json)
- [Download Local DNS (adguard-home-dns.json)](https://legatobar.com/examples/adguard-home-dns.json)
## Questions
### Can I pause protection from the menu bar?
Yes. Pick 5 minutes, 30 minutes, 1 hour or 8 hours from the Pause menu, and AdGuard Home turns protection back on when the time is up, even if your Mac is asleep. Resume turns it back on sooner. To offer other lengths, change the `choices` on the Pause button: each `value` is milliseconds.
### Does AdGuard Home have an API key?
No. Its API signs in with the same username and password as the web interface, and every user can change every setting. To give Legato its own login, add a second user under `users` in `AdGuardHome.yaml` (the password is a bcrypt hash), then restart AdGuard Home.
### Is “Last 24 hours” since midnight?
No. AdGuard Home keeps statistics by the hour and answers for the last 24 of them, so the count rolls forward with the clock. If you’ve set its statistics to keep less than a day, the pages show what it keeps.
### Why are some domains blocked for one device and not another?
AdGuard Home can give a client its own settings: its own filtering, Safe Search, parental filtering and blocked services. Clients marks those. The overview’s Safe Browsing and parental switches change the settings everyone else uses.
### How often do the pages update?
Every minute. The rewrites and upstream settings on Local DNS every 15 minutes, since they rarely change. A press of a button fetches again at once, so the card shows the new state.
### Where is the password kept?
In your Mac’s Keychain, or in 1Password if you link it from there. Legato sends it only to AdGuard Home’s address, and the page files hold just the name `adguard-home`, so they’re safe to share.
*Checked against AdGuard Home v0.107.80 on November 6, 2026, on a test instance with made-up devices: the five pages sign in and fill every card, Pause and Resume were sent there, and the Safe Browsing and parental requests were tried there by hand. Illustrations use made-up readings. AdGuard is a trademark of AdGuard Software Ltd. Legato isn’t affiliated with or endorsed by AdGuard.*
---
# Uptime Kuma in your Mac’s menu bar
See which monitors need you without opening Uptime Kuma: every monitor as a dot, certificates before they expire, response times and uptime, and a page for each monitor. Uptime Kuma keeps doing the monitoring; Legato reads its results once a minute while your Mac is awake.
## What you’ll see
- **Uptime:**
- **Monitors:** every monitor as a named dot, by name, grouped as Services, Jobs and backups, and DNS. Up to 40 show at once, what needs attention first, with **Show N more** past that. Red when it’s down or its certificate has expired, orange while it’s pending or its certificate is 14 days or less from expiring, grey while it’s in maintenance. A dot that changes sends a notification. Pointing at a dot shows its response time and uptime, or what’s wrong. A click opens its monitor page.
- **Web response, average:** your web services’ average response time over the last 24 hours, one reading an hour. Kuma doesn’t keep this history, so Legato records it from the day you add the page.
- **Uptime:** over the last 24 hours, 30 days and 365 days, as Kuma measures them, and the certificate that expires next.
- **Explore:** Certificates, Response times, and your Uptime Kuma.
- **Monitor:** one page for every monitor, opened from its dot and titled with its name: its state now, a strip of its last 24 hours and a chart of its response time (from samples Legato keeps, below), uptime over 24 hours and its response now, then uptime over 30 and 365 days, its certificate, its average response over 30 days, what it checks and its type.
- **Certificates:** every HTTPS monitor’s certificate, the soonest to expire first.
- **Response times:** your web services’ response now, slowest first.
### Status
- Watches every monitor.
- Red when one is down or a certificate has expired, orange while one is pending or a certificate is 14 days from expiring.
- Grey for maintenance, which never needs attention.
- Notifies you when it turns orange or red.
## How it connects
One request fills each page. Legato reads Uptime Kuma’s [Prometheus metrics](https://github.com/louislam/uptime-kuma/wiki/Prometheus-Integration), groups them by monitor ID and separates the time windows Kuma measures (24 hours, 30 days, 365 days).
| Request | Pages | When | What it supplies |
| --- | --- | --- | --- |
| `GET /metrics` | All four | Once a minute | Each monitor’s status, name, type and address, its response time now and its average and uptime over each window, and its certificate’s days left and validity. |
The pages make the same request, so opening a monitor page or Certificates adds none. They use HTTP Basic authentication with an empty username and your API key as the password. Save just the key in Legato; it constructs the header. This is the [API-key format Uptime Kuma documents](https://github.com/louislam/uptime-kuma/wiki/Prometheus-API-Keys), not your web-login password.
The pages have no buttons: Uptime Kuma’s API can’t pause a monitor or start maintenance. Requests go from your Mac to your Uptime Kuma, so its address must be reachable from the Mac.
## Set it up
1. Install Legato and connect your local agent, or use the bundled `legato` command. See [Quickstart](https://legatobar.com/docs/quickstart.md).
2. Download the four pages and change `url` on each to your Uptime Kuma’s address, and the Uptime Kuma row at the bottom of the overview. Keep the `/metrics` request and its grouping as they are.
3. Add them using the agent prompt, or run `/Applications/Legato.app/Contents/Helpers/legato set uptime-monitor uptime-monitor.json`, `legato set uptime-certificates uptime-certificates.json` and `legato set uptime-response uptime-response.json`, then `legato set uptime uptime.json`. Keep the ID `uptime-monitor`: every dot opens it with its monitor’s ID.
4. In Settings → Secrets, save the key under `kuma`, bound to your Uptime Kuma’s host. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
5. Open Uptime. The dots fill within a minute. A missing key or an unreachable address is the usual reason they don’t: the page then notes that Uptime Kuma didn’t answer.
For a local HTTP address, requests and credentials are unencrypted in transit. Use it only on a trusted network; prefer HTTPS when configured. Don’t expose a local service to the internet just to use these pages.
### Prompt for your agent
```prompt
Add 4 Legato pages for Uptime Kuma, starting from https://legatobar.com/examples/uptime.json, https://legatobar.com/examples/uptime-monitor.json, https://legatobar.com/examples/uptime-certificates.json, https://legatobar.com/examples/uptime-response.json. Use the page IDs uptime, uptime-monitor, uptime-certificates, uptime-response if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Set sources.kuma.url on all four pages to my Uptime Kuma’s address, and the Uptime Kuma row in Explore on the overview, and keep the /metrics request and its grouping. I’ll save the API key as kuma in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Uptime (uptime.json)](https://legatobar.com/examples/uptime.json)
- [Download Monitor (uptime-monitor.json)](https://legatobar.com/examples/uptime-monitor.json)
- [Download Certificates (uptime-certificates.json)](https://legatobar.com/examples/uptime-certificates.json)
- [Download Response times (uptime-response.json)](https://legatobar.com/examples/uptime-response.json)
## Questions
### Will it catch every outage?
The dots are a snapshot taken once a minute. A monitor can go down and recover between reads, and Legato stops polling while your Mac sleeps or the app is closed. Keep Uptime Kuma’s own notifications for outages you need to hear about immediately. The uptime figures come from Kuma’s metrics, not from counting Legato’s reads.
### Why are the monitors on the page and not in Details?
The dots are the status. Each one notifies when it changes, so a summary line above them would only repeat them.
### Why does the response chart say it’s collecting readings?
Uptime Kuma’s metrics give the response time now, not its history, so Legato keeps a reading an hour from the day you add the page. The chart appears once it has two, and shows the last 24 hours. Push jobs and DNS lookups are left out of the average, since they’d skew it.
### Where do a monitor’s strip and chart come from?
Uptime Kuma’s metrics say how each monitor is now, not how it was. Every 5 minutes the Uptime page keeps a sample of each monitor’s state and response time in [History](https://legatobar.com/docs/history-collect.md#samples), on your Mac, for a year, and each monitor’s page draws its own. They start empty and fill from the day you add the pages; Settings → History lists them, with Export and Delete.
### Why is a monitor grey?
It’s in maintenance in Uptime Kuma. A monitor in maintenance never needs attention, so it doesn’t count as a problem.
### Why do I get an authentication error?
Check the key in Uptime Kuma’s Settings → API Keys: it may be disabled or expired. Keep `auth.type` set to `basic` in the pages. If a reverse proxy puts a browser sign-in in front of `/metrics`, Legato also needs a route that accepts the API request.
### Can Legato pause a monitor?
No. Uptime Kuma’s HTTP API only reports metrics. Use Uptime Kuma to pause or edit a monitor, or to start maintenance.
Legato is independent and isn’t affiliated with or endorsed by Uptime Kuma.
## Verification
The pages were filled from a real Uptime Kuma on 8 Nov 2026, and the example pages have tests with made-up metrics. Illustrations use made-up monitors and readings. See the [service index](https://legatobar.com/services/) for other examples.
---
# Home Assistant in your Mac’s menu bar
Every home is set up differently, so we highly recommend having [an agent](https://legatobar.com/docs/connect-agent) build your Home Assistant pages: it can read your entities and lay out the rooms and devices you actually have. This starter is the place to begin. It lists the lights that are on, reads your instance once a minute, and needs only your address and a token: no entity IDs, switches or changes to your dashboards.
## What you’ll see
- **Lights on:** the name of each light that’s on.
## How it connects
The page sends one Jinja template to Home Assistant’s [REST API](https://developers.home-assistant.io/docs/api/rest/) template endpoint for the lights that are on.
| Request | When | What it supplies |
| --- | --- | --- |
| `POST /api/template` | Once a minute | `lights`, a list of names whose `light` state is `on`. |
Legato sends the saved token in the Authorization header as a Bearer token. The page makes no `/api/services/…` calls. Its use of POST evaluates the template; it does not turn anything on or off. The token still grants the access of its Home Assistant user, so keep it private even though this page only reads. [Sources and buttons](https://legatobar.com/docs/sources.md) describes the supported authentication methods.
Your Mac needs a route to the instance: the same local network, a VPN or an existing remote-access address. Fetches stop while the Mac sleeps or Legato is closed.
## Set it up
1. Install Legato and connect your local agent, or use the bundled `legato` command. See [Quickstart](https://legatobar.com/docs/quickstart.md).
2. Create a long-lived access token in your Home Assistant user profile. Never paste the token into an agent chat.
3. Download the page. If your Home Assistant isn’t at `http://homeassistant.local:8123`, change the source’s `url` to its address, keeping `/api/template`.
4. Add it using the agent prompt, or run `/Applications/Legato.app/Contents/Helpers/legato set home-assistant-starter home-assistant-starter.json` with an unused page ID. Don’t replace an existing page without reading it first.
5. In Settings → Secrets, save the token under `home-assistant`, bound to the service’s host. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
6. Open the page and check its source status. Missing credentials or an unreachable address need fixing before the list can fill.
For a local HTTP address, requests and credentials are unencrypted in transit. Use it only on a trusted network; prefer HTTPS when configured. Don’t expose a local service to the internet just to use this page.
### Prompt for your agent
```prompt
Add a Legato page for Home Assistant, starting from https://legatobar.com/examples/home-assistant-starter.json.
Change the source’s url to my Home Assistant’s address, keeping /api/template. I’ll save the token as home-assistant in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the page
[Download home-assistant-starter.json](https://legatobar.com/examples/home-assistant-starter.json)
```json
{
"$schema": "https://legatobar.com/schemas/page.schema.json",
"title": "Home Assistant",
"icon": "house",
"sources": {
"home": {
"url": "http://homeassistant.local:8123/api/template",
"secret": "home-assistant",
"every": "1m",
"method": "POST",
"body": {
"template": "{{ {\"lights\": states.light | selectattr(\"state\", \"eq\", \"on\") | map(attribute=\"name\") | list} | tojson }}"
}
}
},
"cards": [
{
"id": "lights",
"type": "list",
"label": "Lights on",
"source": {
"ref": "home",
"map": {
"items": {
"each": "lights",
"template": "{$}"
}
}
}
}
]
}
```
## Questions
### Does an empty Lights on list mean every light is off?
It means no `light` entity was reported as `on`. Unavailable and unknown lights are left out, as are lights represented only as `switch` entities. Light groups can also appear alongside their members. This starter is a list of reported activity, not an availability check or an exact fixture count.
### Do I need Home Assistant Cloud?
No, if the Mac can reach Home Assistant directly. Away from home, use your existing remote-access arrangement. There is no need to expose the instance to the internet just for this page.
### Why does the source fail before the list fills?
Check the address, including `/api/template`, and the saved secret’s host binding. A rejected token needs replacing in Settings → Secrets. A template error usually points to an edit in the JSON body; try the same template in Home Assistant’s Developer tools → Template.
Legato is independent and isn’t affiliated with or endorsed by Home Assistant.
## Verification
On 31 October 2026, the starter’s unchanged template was evaluated against a real Home Assistant instance. It returned a list of light names. The returned data was also checked through Legato’s page renderer. This verifies the template and card mappings, not setup through the installed app or its saved token. No devices were controlled. Illustrations use made-up readings. See the [service index](https://legatobar.com/services/) for other examples.
---
# Proxmox in your Mac’s menu bar
Legato shows your Proxmox VE host in the Mac’s menu bar: whether the host and its nightly backup are healthy, its CPU and memory over the last hour, day, week or month, and every guest as a dot. Four more pages open from it: the guests side by side, backups, package updates and the host’s own controls, and a page for each guest, with its console, power and backup buttons: one page that the overview fills in with whichever guest you open. Legato reads Proxmox’s API from your Mac with an API token kept in the Keychain or 1Password.
## What you’ll see
- **Proxmox:** the host’s state (it links to the web interface) and the nightly backup are in Details, and the health card turns orange or red when either needs a look. The page shows the host’s CPU and memory side by side for the period you pick, then a Host card with the package changes (that row opens Maintenance), the running and newest kernels and the uptime. Then every guest as a dot that opens its page, and Explore for Guests and Backups.
- **Guests:** how many are running, the host’s memory, and each guest’s CPU and memory as bars.
- **Backups:** how long the last run took, the schedule, how full the backup and `local-lvm` storages are, the newest backup of each guest, and the guests no job backs up.
- **Maintenance:** Controls to refresh the package index, and restart or shut down the host (only when the token may), the software status, and the packages waiting to update.
- **A guest:** titled with the guest’s name. Controls (Open console; Start, Force stop, Reboot, Shut down or Resume, whichever apply; Back up now), a Running strip of when it was up over the period (from samples the overview keeps in [History](https://legatobar.com/docs/history-collect.md#samples), every 5 minutes, for a year), its CPU and memory for the period you pick, its state, memory on the host and uptime, recent tasks and latest backups.
A guest you keep stopped on purpose shows grey and counts as fine: tag it `standby` in Proxmox. Any other stopped guest shows red.
### Status
- Watches the host, the nightly backup and every guest.
- Orange when the host is busy (CPU from 85%, memory from 90%) or the last backup failed or is over 26 hours old.
- Red when the host is offline or very busy, or a guest that should run has stopped.
- Notifies you when it turns orange or red.
## How it connects
Every request goes from your Mac to your Proxmox host with the token in an `Authorization` header. Nothing passes through Legato’s servers. Legato needs HTTPS. With the self-signed certificate Proxmox starts with, use the host’s IP address, such as `https://192.168.1.2:8006`, and trust the certificate once when Legato shows it; compare its fingerprint with the one under the node’s System → Certificates. A host name other than a `.local` one needs a certificate macOS trusts: turn on Let’s Encrypt in Proxmox (Datacenter → ACME), or put the host behind a reverse proxy with one.
| Request | Page | When | What it does |
| --- | --- | --- | --- |
| `GET /api2/json/nodes/pve1/rrddata?timeframe={period.id}&cf=AVERAGE` | Proxmox | Every minute | The host’s CPU and memory over the hour, day, week or month you pick. |
| `GET /api2/json/nodes/pve1/time` | All four | Every minute | The host’s clock, so ages read right. |
| `GET /api2/json/nodes/pve1/apt/versions` | Proxmox, Maintenance | Every minute | Installed Proxmox packages, the candidates waiting and the running kernel. |
| `GET /api2/json/nodes/pve1/status` | Proxmox, Guests, Backups | Every minute | The host’s uptime, CPU and memory. |
| `GET /api2/json/cluster/resources` | Proxmox, Guests, Backups | Every minute | Every guest, with its state, CPU and memory, and the host’s state. |
| `GET /api2/json/version` | Proxmox, Guests, Backups | Every minute | The Proxmox VE version. |
| `GET /api2/json/nodes/pve1/tasks?source=active` | Proxmox, Backups | Every minute | Tasks running now, so a backup in progress shows as running. |
| `GET /api2/json/nodes/pve1/tasks?typefilter=vzdump&limit=1` | Proxmox, Backups | Every minute | The last backup run and how it ended. |
| `GET /api2/json/nodes/pve1/storage/backup-nas/content?content=backup` | Proxmox, Guests, Backups | Every 15 minutes | The backups on the `backup-nas` storage. |
| `GET /api2/json/cluster/backup` | Proxmox, Guests, Backups | Every 15 minutes | The backup jobs and their schedules. |
| `GET /api2/json/cluster/backup-info/not-backed-up` | Proxmox, Guests, Backups | Every 15 minutes | Guests in no backup job. |
| `GET /api2/json/nodes/pve1/storage` | Proxmox, Guests, Backups | Every 15 minutes | How full each storage is. |
| `GET /api2/json/access/permissions?path=/nodes/pve1` | Maintenance | Every minute | What the token may do on the host, so the host buttons show only when they would work. |
| `POST /api2/json/nodes/pve1/apt/update` | Maintenance | When you press Refresh package index | Refreshes the host’s package index, and follows the task until it ends. |
| `POST /api2/json/nodes/pve1/status` | Maintenance | When you press Restart host or Shut down host, and confirm | Restarts or shuts down the host (`{"command": "reboot"}` or `"shutdown"`). Both ask first, with the host’s name to type: every guest stops. |
| `GET /api2/json/nodes/pve1/storage/backup-nas/content?content=backup&vmid={param.vmid}` | Guest | Every minute | This guest’s backups. |
| `GET /api2/json/nodes/pve1/qemu/{param.vmid}/status/current` | Guest | Every minute | This guest’s state, memory and uptime. |
| `GET /api2/json/nodes/pve1/qemu/{param.vmid}/config` | Guest | Every minute | When the guest was made, so its backups since then count. |
| `GET /api2/json/nodes/pve1/tasks?vmid={param.vmid}&source=all&limit=12` | Guest | Every minute | This guest’s recent tasks. |
| `GET /api2/json/nodes/pve1/qemu/{param.vmid}/rrddata?timeframe={period.id}&cf=AVERAGE` | Guest | Every minute | This guest’s CPU and memory over the period you pick. |
| `POST /api2/json/nodes/pve1/qemu/{param.vmid}/status/start` | Guest | When you press Start | Starts the guest, and follows the task. |
| `POST /api2/json/nodes/pve1/qemu/{param.vmid}/status/stop` | Guest | When you press Force stop, and confirm | Stops the guest at once, like pulling the plug. |
| `POST /api2/json/nodes/pve1/qemu/{param.vmid}/status/reboot` | Guest | When you press Reboot, and confirm | Restarts the guest through its own operating system. |
| `POST /api2/json/nodes/pve1/qemu/{param.vmid}/status/shutdown` | Guest | When you press Shut down, and confirm | Shuts the guest down through its own operating system. |
| `POST /api2/json/nodes/pve1/qemu/{param.vmid}/status/resume` | Guest | When you press Resume | Resumes a paused or suspended guest. |
| `POST /api2/json/nodes/pve1/vzdump` | Guest | When you press Back up now, and confirm | Backs the guest up to `backup-nas` (snapshot mode, zstd), and follows the task, up to an hour. |
Open console opens Proxmox’s noVNC console in your browser; it sends nothing itself. [Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make an API token.** In Proxmox, Datacenter → Permissions → API Tokens, add one for a user (such as `legato@pve`). For reading, give it `PVEAuditor` on `/`. For the guest buttons, add `PVEVMUser` on `/vms` and `PVEDatastoreUser` on the backup storage; for the host buttons, `Sys.Modify` and `Sys.PowerMgmt` on the node. Leave out what you don’t want pressed from the menu bar: a button the token can’t use either fails or, on Maintenance, doesn’t show.
2. **Add the pages.** Paste the prompt into your agent, or download the five pages. In each, replace `https://proxmox.example.com:8006` with your host’s address, `pve1` with your node’s name and `backup-nas` with your backup storage. Run `/Applications/Legato.app/Contents/Helpers/legato set proxmox proxmox.json`, then the same for `proxmox-guests`, `proxmox-backups`, `proxmox-maintenance` and `proxmox-vm`. Keep those page IDs: the pages open each other by them.
3. **The guest page.** `proxmox-vm.json` is one page for every guest, made with [params](https://legatobar.com/docs/detail-pages.md#one-page-for-every-item): the overview’s guest dots open it as `legato://page/proxmox-vm?vmid=101&name=home-assistant`, and it fills in that guest’s ID and name. There’s no copy to make per guest. It’s for virtual machines, the guests the overview lists; containers aren’t shown.
4. **Save the token** in Legato’s Settings → Secrets under the name `proxmox`, as Proxmox writes it: `PVEAPIToken=legato@pve!panel=`. Or link it from [1Password](https://legatobar.com/docs/1password.md). From a shell:
```bash
/Applications/Legato.app/Contents/MacOS/Legato secret set proxmox
```
The cards fill within a minute while Legato is running and the host is reachable. The overview is in the sidebar; the other pages open from it.
### Prompt for your agent
```prompt
Add 5 Legato pages for Proxmox, starting from https://legatobar.com/examples/proxmox.json, https://legatobar.com/examples/proxmox-guests.json, https://legatobar.com/examples/proxmox-backups.json, https://legatobar.com/examples/proxmox-maintenance.json, https://legatobar.com/examples/proxmox-vm.json. Use the page IDs proxmox, proxmox-guests, proxmox-backups, proxmox-maintenance, proxmox-vm if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Replace https://proxmox.example.com:8006 with my host’s address, pve1 with my node’s name and backup-nas with my backup storage’s name, in every page. Add proxmox-vm once, as it is: it’s one page for every guest, and the overview opens it with each guest’s ID and name. I’ll save the token as proxmox in Settings → Secrets myself. Don’t press any guest or host button to test it.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Proxmox (proxmox.json)](https://legatobar.com/examples/proxmox.json)
- [Download Guests (proxmox-guests.json)](https://legatobar.com/examples/proxmox-guests.json)
- [Download Backups (proxmox-backups.json)](https://legatobar.com/examples/proxmox-backups.json)
- [Download Proxmox maintenance (proxmox-maintenance.json)](https://legatobar.com/examples/proxmox-maintenance.json)
- [Download Guest (proxmox-vm.json)](https://legatobar.com/examples/proxmox-vm.json)
## Questions
### Does it work with a cluster?
The pages watch one node, named in every path. For a second node, make a second set of pages with unused page IDs and that node’s name.
### Why don’t I see the host buttons on Maintenance?
They show only when the token has `Sys.Modify` (Refresh package index) or `Sys.PowerMgmt` (Restart and Shut down) on the node. Without them the Controls card stays hidden, and the rest of the page works as before.
### Do the buttons ask first?
Force stop, Reboot, Shut down and Back up now ask in the panel before they run, and Restart host and Shut down host ask you to type the host’s name. Spotlight presses a page’s buttons without asking, so leave out any you don’t want there.
### How often do the pages update?
Every minute, and the backups and storage every 15 minutes. A press of a button follows its task in Proxmox and reads the page again when it ends.
### Where is the token kept?
In your Mac’s Keychain, or in 1Password if you link it from there. Legato sends it only to your host, and the page files hold just the name `proxmox`.
*These are the pages running against a real Proxmox VE 9 host on November 6, 2026, with its address and names replaced; they fill every card there. The guest and host buttons weren’t pressed in that check. Illustrations use made-up readings. Proxmox is a trademark of Proxmox Server Solutions GmbH. Legato isn’t affiliated with or endorsed by Proxmox.*
---
# Tesla via Tessie in your Mac’s menu bar
Legato shows your Tesla in the Mac’s menu bar: whether it’s locked and awake, the controls you’d reach for in the app, the last 24 hours of battery against the charge limit, and the car’s charging, temperatures, tires, software and odometer. Two more pages open from it: charging, with recent charges and what they cost, and trips by week, month or year. Charging opens every session over 30 days, 90 days or a year. Legato reads Tessie’s API from your Mac, with your Tessie token kept in the Keychain or 1Password.
## What you’ll see
- **Tesla:** a Status section with the car’s state (locked or not, anything open, asleep or awake, and when it last reported), which opens Charging and Trips. Controls has menus for the charge limit and the charging current, Start or Stop charging while plugged in, then cabin overheat protection, Sentry, and Lock while the car is unlocked. Climate has climate, defrost and steering wheel heat, a menu for the cabin temperature, then the front seats’ heat. Under them, the battery over the last 24 hours, in percent and in miles, with the charge limit as a line, and a Car card: charging, tires, temperatures inside and out, software and odometer. A software update shows while one is waiting, and recent alerts close the page.
- **Charging:** the charge now (state, battery, power, current, energy added and the charge port), with Start and Stop charging and Close charge port. The schedule window while a charge is planned, what the car has used since its last charge, and recent charges with each one’s energy and cost. Its Explore list opens Charging sessions.
- **Charging sessions:** the energy added and its cost over 30 days, 90 days or a year, each session’s energy on a chart, then the sessions, the miles added, the average session, the cost per kWh and how many were fast charges, and each session with its energy, cost and battery range.
- **Trips:** distance, drives, efficiency and the share on FSD for the week, month or year you pick, and the drives themselves.
### Status
- Watches the locks, doors, windows, trunks, tires and battery.
- Orange when the car is unlocked or something is open, a tire is low or the battery is under 20%.
- Red when a tire is very low.
- Notifies you when it turns orange or red.
## How it connects
Every request goes from your Mac to `api.tessie.com` with your Tessie token in a Bearer header. Nothing passes through Legato’s servers. Reads ask for the state Tessie already has, so they don’t wake the car.
| Request | Page | When | What it does |
| --- | --- | --- | --- |
| `GET /YOUR_VIN/state` | Tesla, Charging | Every five minutes | The car’s charge, climate, doors, tires and software, as Tessie last heard them. |
| `GET /YOUR_VIN/states?from={date.hours_ago_24_unix}&to={date.now_unix}&interval=900` | Tesla | Every 15 minutes | The last 24 hours of battery, every 15 minutes while the car was awake. |
| `GET /YOUR_VIN/state?use_cache=true` | Tesla | Every 15 minutes | The same report, read with the day’s battery for the charge limit and the miles in each percent. |
| `GET /YOUR_VIN/firmware_alerts` | Tesla | Every hour | Alerts from the car. |
| `GET /YOUR_VIN/charges?limit=10` | Charging | Every 30 minutes | Recent charges, with energy and cost. |
| `GET /YOUR_VIN/charges?from={period.start_unix}&to={period.end_unix}` | Charging sessions | Every hour | Every charge in the 30 days, 90 days or year you pick. |
| `GET /YOUR_VIN/consumption_since_charge` | Charging | Every 30 minutes | What the car has used since its last charge. |
| `GET /YOUR_VIN/drives` | Trips | Every 30 minutes | The drives in the week, month or year you pick (`from`, `to` and `limit=500` in the query). |
| `POST /YOUR_VIN/command/set_charge_limit?percent={choice}` | Tesla | When you pick a charge limit | Sets the limit: 70, 80, 90 or 100%. |
| `POST /YOUR_VIN/command/set_charging_amps?amps={choice}` | Tesla | When you pick a current | Sets the current the car asks for: 16 to 48 A. |
| `POST /YOUR_VIN/command/start_charging` | Tesla, Charging | When you press Start charging | Starts a charge while plugged in. |
| `POST /YOUR_VIN/command/stop_charging` | Tesla, Charging | When you press Stop charging | Stops the charge. |
| `POST /YOUR_VIN/command/set_cabin_overheat_protection?on=true&fan_only=false` | Tesla | When you press Turn on heat protection | Turns on cabin overheat protection, with air conditioning. |
| `POST /YOUR_VIN/command/set_cabin_overheat_protection?on=false` | Tesla | When you press Turn off heat protection | Turns it off. |
| `POST /YOUR_VIN/command/enable_sentry` | Tesla | When you press Turn on Sentry | Turns on Sentry Mode. |
| `POST /YOUR_VIN/command/disable_sentry` | Tesla | When you press Turn off Sentry | Turns it off. |
| `POST /YOUR_VIN/command/lock` | Tesla | When you press Lock | Locks the car. The button shows only while it’s unlocked. |
| `POST /YOUR_VIN/command/start_climate` | Tesla | When you press Start climate | Starts climate. |
| `POST /YOUR_VIN/command/stop_climate` | Tesla | When you press Stop climate | Stops climate. |
| `POST /YOUR_VIN/command/start_max_defrost` | Tesla | When you press Start defrost | Starts defrost. |
| `POST /YOUR_VIN/command/stop_max_defrost` | Tesla | When you press Stop defrost | Stops defrost. |
| `POST /YOUR_VIN/command/start_steering_wheel_heater` | Tesla | When you press Start wheel heat | Turns on the steering wheel heater. |
| `POST /YOUR_VIN/command/stop_steering_wheel_heater` | Tesla | When you press Stop wheel heat | Turns it off. |
| `POST /YOUR_VIN/command/set_temperatures?temperature={choice}` | Tesla | When you pick a temperature | Sets the cabin temperature, 64 to 76°F. Tessie takes Celsius, so each choice sends its Celsius value. |
| `POST /YOUR_VIN/command/set_seat_heat?seat=front_left&level=3` | Tesla | When you press Start driver heat | Turns the driver’s seat heat to high. |
| `POST /YOUR_VIN/command/set_seat_heat?seat=front_left&level=0` | Tesla | When you press Stop driver heat | Turns it off. |
| `POST /YOUR_VIN/command/set_seat_heat?seat=front_right&level=3` | Tesla | When you press Start passenger heat | Turns the passenger’s seat heat to high. |
| `POST /YOUR_VIN/command/set_seat_heat?seat=front_right&level=0` | Tesla | When you press Stop passenger heat | Turns it off. |
| `POST /YOUR_VIN/command/close_charge_port` | Charging | When you press Close charge port | Closes the port while nothing’s plugged in. |
The buttons and menus act on the real car, and each shows only when it would change something. Remove a card’s `actions` for a page that only shows. There’s no Unlock, trunk or Open charge port button: Spotlight runs a page’s buttons without asking. [Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make a Tessie token.** In [Tessie’s developer settings](https://developer.tessie.com/reference/authentication), create an access token. Never paste it into an agent chat.
2. **Add the pages.** Paste the prompt into your agent, or download the four pages, replace `YOUR_VIN` with your car’s VIN everywhere in each, and run `/Applications/Legato.app/Contents/Helpers/legato set tesla tesla.json`, then the same for `tesla-charging`, `tesla-charging-sessions` and `tesla-trips`. Keep those page IDs: the overview opens the others by them. Don’t replace an existing page without reading it first.
3. **Save the token** in Legato’s Settings → Secrets under the name `tessie`, or link it from [1Password](https://legatobar.com/docs/1password.md). From a shell, the app reads it from standard input, so it stays out of your history:
```bash
/Applications/Legato.app/Contents/MacOS/Legato secret set tessie
```
The cards fill within a few minutes while Legato is running. The overview is in the sidebar; Charging and Trips open from it, and Charging sessions from Charging.
### Prompt for your agent
```prompt
Add 4 Legato pages for Tesla via Tessie, starting from https://legatobar.com/examples/tesla.json, https://legatobar.com/examples/tesla-charging.json, https://legatobar.com/examples/tesla-charging-sessions.json, https://legatobar.com/examples/tesla-trips.json. Use the page IDs tesla, tesla-charging, tesla-charging-sessions, tesla-trips if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Replace YOUR_VIN in every source and every button’s path on all four pages with the VIN I give you, and keep the page IDs and the secret name. I’ll save the Tessie token as tessie in Settings → Secrets myself. Don’t press any of the car’s buttons or menus to test it.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Tesla (tesla.json)](https://legatobar.com/examples/tesla.json)
- [Download Charging (tesla-charging.json)](https://legatobar.com/examples/tesla-charging.json)
- [Download Charging sessions (tesla-charging-sessions.json)](https://legatobar.com/examples/tesla-charging-sessions.json)
- [Download Trips (tesla-trips.json)](https://legatobar.com/examples/tesla-trips.json)
## Questions
### Do I need a Tessie account as well as a Tesla?
Yes. The car must be in your Tessie account, with API access. A Tesla password or a Tesla Fleet API token isn’t a substitute for the Tessie token.
### Does each refresh wake the car?
No. Every read asks for the state Tessie already has (`use_cache=true`) and none asks the car to wake, so a sleeping car shows when it last reported. The buttons and menus are different: a command wakes the car to carry it out.
### Why does the battery line have gaps?
Tessie records the car only while it’s awake. The line breaks while it sleeps, with a faint dashed line across the gap, and the points sit at the times they were read.
### Where do the charging costs come from?
From Tessie. Set your electricity rates in Tessie for your charging locations, and each charge from then on shows its cost on Charging. Tessie’s API sets a cost one charge at a time, not a rate.
### Can I use kilometres and Celsius?
Yes, but change the calculations as well as the labels. The pages show miles and convert temperatures from Celsius to Fahrenheit and tire pressure from bar to psi. The temperature menu’s choices already send Celsius: change their labels to match.
### Can I show a second car?
Make a second set of pages with unused page IDs, change the `legato://page/` links on the overview to match, and replace the VIN throughout. Keep the same secret name if the Tessie account can see both cars.
### Do I need to keep a browser or script running?
No. Legato fetches the data itself while it’s running. To keep pages current with a script instead, see [Scripts](https://legatobar.com/docs/scripts.md).
*Checked against a real Tesla through Tessie on November 6, 2026: the three pages fill every card from Tessie’s API. Charging sessions was checked the same way on November 7, against 90 days of real charges. None of the buttons or menus were pressed in that check. Illustrations use made-up readings. Tesla is a trademark of Tesla, Inc. Legato is independent and isn’t affiliated with or endorsed by Tesla or Tessie.*
---
# Lunch Money in your Mac’s menu bar
Legato shows your Lunch Money net worth, this month’s budget and the bills still to come in your Mac’s menu bar, read from Lunch Money’s API once an hour. Three ready-made pages do it: Net Worth, Budget and Upcoming. Nothing on them changes your transactions or budgets; the one button asks Lunch Money to sync your banks.
## What you’ll see
- **Net Worth:** your assets and liabilities, a daily net-worth chart, income against spending for each month this year, and what your assets are made of. Below that, every account by type (cash, investments, liabilities and other), and a closed Bank connections section with each linked account’s balance age and Request bank sync. Whether a connection needs attention is in Details, and the health card turns orange while one does. Clicking Liabilities opens the liabilities tab.
- **Budget:** each budgeted category against its limit for the month, with that month’s transactions under it, pending ones marked, each opening in Lunch Money. A Spending tab shows recurring and everyday spending flowing into your largest categories. Categories with a zero limit or no budget are listed underneath. The arrows step to earlier months.
- **Upcoming:** the expected expenses and income left this month, how much of this month’s recurring expenses has matched a transaction, and the payments and income expected over the next 7 or 30 days.
### Status
- Watches each bank connection.
- Orange when one needs attention.
- Shows on Net Worth and notifies you when it turns orange or red.
## How it connects
Legato connects to `api.lunchmoney.dev` with your saved API token in a Bearer header, using Lunch Money’s [v2 API](https://lunchmoney.dev/introduction). Each page makes its own requests with the one token. Amounts are Lunch Money’s `to_base` values, in your primary currency, which the `primary_currency` from `/v2/me` labels.
| Request | Page | When | What it does |
| --- | --- | --- | --- |
| `GET /v2/plaid_accounts` | Net Worth | Every hour | Linked accounts: status, type, balance and when the balance last changed. |
| `GET /v2/manual_accounts` | Net Worth | Every hour | Accounts you track by hand, such as property or collectibles. |
| `GET /v2/summary?start_date={date.year_start}&end_date={date.month_end}&include_occurrences=true` | Net Worth | Every hour | Income and spending for each month this year. |
| `GET /v2/categories?format=flattened` | Net Worth, Budget | Every hour | Category names and groups, and which are income or left out of totals. |
| `GET /v2/me` | All three | Every hour | Your primary currency, which labels the amounts. |
| `GET /v2/summary?start_date={period.start}&end_date={period.end}&include_totals=true&include_occurrences=true` | Budget | Every hour, and for each month you step to | Each category’s budget and spending, split into recurring and other. |
| `GET /v2/transactions?start_date={period.start}&end_date={period.end}&include_pending=true&limit=1000` | Budget | Every hour, and for each month you step to | That month’s transactions, pending ones included. |
| `GET /v2/me/account/settings` | Budget | Every hour | Whether your pending transactions count toward totals. |
| `GET /v2/summary?start_date={date.month_start}&end_date={date.month_end}&include_totals=true` | Upcoming | Every hour | This month’s expected and matched recurring amounts. |
| `GET /v2/recurring_items?start_date={date.today}&end_date={date.days_ahead_29}&include_suggested=false` | Upcoming | Every hour | Your reviewed recurring items and the dates each is still expected in the next 30 days. |
| `POST /v2/plaid_accounts/fetch` | Net Worth | When you press Request bank sync | Asks Lunch Money to fetch from Plaid for eligible accounts. |
The pages don’t add, edit or categorize transactions, change budgets or move money. Request bank sync on Net Worth only asks Lunch Money to fetch new data from Plaid, and nothing is fetched from your bank directly. Lunch Money’s own app stays the place to make changes.
An hourly read does not ask your bank for a fresh balance. Request bank sync asks for that extra work, but completion still depends on Lunch Money, Plaid and the bank. See [Lunch Money’s syncing guidance](https://support.lunchmoney.app/guides/automatic-imports/handling-syncing-issues). The Mac must be awake and Legato running to fetch the pages.
[Sources and buttons](https://legatobar.com/docs/sources.md) describes the supported authentication methods.
## Set it up
1. Install Legato and connect your local agent, or use the bundled `legato` command. See [Quickstart](https://legatobar.com/docs/quickstart.md).
2. Create an API token in your Lunch Money account’s developer settings at [my.lunchmoney.app/developers](https://my.lunchmoney.app/developers). Never paste it into an agent chat.
3. Download the three pages. They work as they are: keep the API address and the mappings.
4. Add them using the agent prompt, or run `/Applications/Legato.app/Contents/Helpers/legato set lunch-money-net-worth lunch-money-net-worth.json`, then the same for `lunch-money-budget` and `lunch-money-upcoming`. Keep those page IDs: the Liabilities card links to `legato://page/lunch-money-net-worth#cards`, so with another ID, change that link to match. Don’t replace an existing page without reading it first.
5. In Settings → Secrets, save the token under `lunch-money`, bound to the service’s host. All three pages use it. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
6. Open each page and check its source status. A missing or mistyped token is the usual reason the readings don’t fill.
### Prompt for your agent
```prompt
Add 3 Legato pages for Lunch Money, starting from https://legatobar.com/examples/lunch-money-net-worth.json, https://legatobar.com/examples/lunch-money-budget.json, https://legatobar.com/examples/lunch-money-upcoming.json. Use the page IDs lunch-money-net-worth, lunch-money-budget, lunch-money-upcoming if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Keep the API address and mappings. I’ll save the API token as lunch-money in Settings → Secrets myself. Don’t press Request bank sync to test it.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Net Worth (lunch-money-net-worth.json)](https://legatobar.com/examples/lunch-money-net-worth.json)
- [Download Budget (lunch-money-budget.json)](https://legatobar.com/examples/lunch-money-budget.json)
- [Download Upcoming (lunch-money-upcoming.json)](https://legatobar.com/examples/lunch-money-upcoming.json)
## Questions
### Does Net Worth include manually tracked accounts?
Yes. It reads your linked accounts from `/v2/plaid_accounts` and the ones you track by hand from `/v2/manual_accounts`, and leaves out closed accounts. Crypto balances aren’t read, so they aren’t in the totals.
### What currency are the amounts in?
Your primary currency. The pages total Lunch Money’s [`to_base`](https://lunchmoney.dev/amounts-and-balances) amounts, which are each balance converted to your primary currency, and the cards label them with the `primary_currency` from `/v2/me`. The lines inside lists, such as a transaction’s amount, are written with a $ sign: if your primary currency isn’t dollars, change the $ in those templates.
### Why does the net-worth chart start empty?
Legato draws it from its own readings, one a day while it’s running, starting the day you add the page. It doesn’t read past balances from Lunch Money. Until there are two readings a day apart, the card says it’s collecting them.
### Why doesn’t Spending match Budgeted spending?
Budgeted spending counts only categories with a budget. The Spending tab counts every category except income and those excluded from totals, budgeted or not, and leaves out refunds. Both follow the month the page is on.
### Why can a healthy connection show an old balance?
Bank connections in Details checks each account’s `status`, not the age of its balance. An active connection can still be waiting for new bank data. The Bank connections section on the page shows when each linked account’s balance last changed, oldest first.
### Will Request bank sync repair a broken connection?
It requests another fetch; it cannot fix a bank login or a connection that needs relinking. Deal with those in Lunch Money. Avoid repeatedly pressing the button while waiting for a bank to respond. Remove the card’s `actions` array if you want the page to read only.
### Which categories get an icon?
Common category names, such as Groceries, Restaurants, Utilities and Travel, each have a symbol; any other category shows a tag. To choose your own, edit the `values` map under `icon` in the Budget page.
Legato is independent and isn’t affiliated with or endorsed by Lunch Money.
## Verification
On November 5, 2026, the three pages were checked against a real Lunch Money account, for October and for November: every card filled. Request bank sync wasn’t pressed. Illustrations use made-up readings. See the [service index](https://legatobar.com/services/) for other examples.
---
# YNAB in your Mac’s menu bar
Legato reads your YNAB plan through YNAB’s API and shows it in your Mac’s menu bar on three pages: Budget, Accounts and Upcoming. Budget has the month’s numbers and what’s waiting for your approval. Accounts has your balances and bank links. Upcoming has your scheduled transactions. The pages don’t assign money, move it or change categories. The one button approves a transaction.
## What you’ll see
- **Budget:** Ready to Assign and Age of Money for the month, then what you assigned, your activity and income, and how many categories are overspent or underfunded. Each category has a bar: what it spent this month against what it had to spend, overspent ones first, then those that have used the most of their money. Click a category to see its transactions, with each piece of a split under its own category. Spending from a category with nothing assigned is listed under its own heading. Below that, the transactions waiting for your approval, newest first, each with an Approve button. The arrows step to earlier months; the approval list always shows what’s waiting now.
- **Accounts:** cash in your budget accounts, what’s on your credit cards, and your net worth over the last 60 days. Below that, each open account with its balance: budget accounts first, then tracking accounts. Details says whether any account linked to a bank needs reconnecting, and the health card turns orange while one does. That account comes first in the list.
- **Upcoming:** what’s scheduled to go out and come in over the next 30 days, and each scheduled transaction on its next date for the next 7 or 30 days.
### Status
- Watches the bank links on your accounts.
- Orange when one needs reconnecting in YNAB.
- Shows on Accounts and notifies you when it turns orange or red.
## How it connects
Legato connects to `api.ynab.com` with your personal access token in a Bearer header, using [YNAB’s API](https://api.ynab.com/). `last-used` stands for the plan you opened most recently in YNAB. Amounts are the `_currency` and `_formatted` values YNAB sends beside each milliunit amount, labelled with your plan’s currency from its settings.
| Request | Page | When | What it does |
| --- | --- | --- | --- |
| `GET /v1/plans/last-used/months/{month}` | Budget | Every 15 and every 30 minutes, and for each month you step to | That month’s Ready to Assign, Age of Money and totals, and every category’s assigned, activity and available amounts. |
| `GET /v1/plans/last-used/months/{month}/transactions?since_date={month}` | Budget | Every 30 minutes, and for each month you step to | That month’s transactions, for the list under each category. |
| `GET /v1/plans/last-used/transactions?type=unapproved&since_date=2000-01-01` | Budget | Every 15 minutes | The transactions waiting for approval, dated 2000 or later. |
| `GET /v1/plans/last-used/accounts` | Accounts | Every hour | Each account’s type, balance, and whether its bank link needs attention. |
| `GET /v1/plans/last-used/scheduled_transactions` | Upcoming | Every hour | Each scheduled transaction’s next date, amount and frequency. |
| `GET /v1/plans/last-used/settings` | All three | With each of the others | Your plan’s currency, which labels the amounts. |
| `PUT /v1/plans/last-used/transactions/{id}` | Budget | When you press Approve and confirm | Marks that one transaction approved, the same as approving it in YNAB. |
A personal access token can read and change everything in your YNAB account, so treat it like a password. YNAB doesn’t offer read-only personal tokens. These pages only read, apart from Approve, which sends YNAB `approved: true` for that one transaction and nothing else. Make your budget changes in YNAB itself.
Together the pages use about 22 of the 200 requests an hour YNAB allows each token, plus a few more for each month you step to. Other tools that use the same token share that allowance. The Mac must be awake and Legato running to fetch the pages.
[Sources and buttons](https://legatobar.com/docs/sources.md) describes the supported authentication methods.
## Set it up
1. Install Legato and connect your local agent, or use the bundled `legato` command. See [Quickstart](https://legatobar.com/docs/quickstart.md).
2. In YNAB, open Account Settings, then Developer Settings, and under Personal Access Tokens click New Token. YNAB shows it once. Never paste it into an agent chat.
3. Download the three pages. They work as they are: keep the API address and the mappings.
4. Add them using the agent prompt, or run `/Applications/Legato.app/Contents/Helpers/legato set ynab-budget ynab-budget.json`, then the same for `ynab-accounts` and `ynab-upcoming`. Keep those page IDs: the pages link to each other by them. Don’t replace an existing page without reading it first.
5. In Settings → Secrets, save the token under `ynab`, bound to `api.ynab.com`. All three pages use it. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
6. If you have more than one plan, replace `last-used` in every path with your plan’s ID, the long code after `app.ynab.com/` when the plan is open.
7. Open each page and check its source status. A missing or mistyped token is the usual reason the readings don’t fill.
### Prompt for your agent
```prompt
Add 3 Legato pages for YNAB, starting from https://legatobar.com/examples/ynab-budget.json, https://legatobar.com/examples/ynab-accounts.json, https://legatobar.com/examples/ynab-upcoming.json. Use the page IDs ynab-budget, ynab-accounts, ynab-upcoming if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add the pages as they are, keeping their page IDs. I’ll save my YNAB personal access token as ynab in Settings → Secrets myself. If I have more than one plan, ask me for the plan ID and put it in place of last-used in every path. Don’t press Approve to test it.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Budget (ynab-budget.json)](https://legatobar.com/examples/ynab-budget.json)
- [Download Accounts (ynab-accounts.json)](https://legatobar.com/examples/ynab-accounts.json)
- [Download Upcoming (ynab-upcoming.json)](https://legatobar.com/examples/ynab-upcoming.json)
## Questions
### Which plan do the pages show?
The one you opened most recently in a YNAB app, which YNAB calls `last-used`. With one plan that’s always yours. With two, the pages follow whichever you opened last, and the net-worth chart would mix both. Put your plan’s ID in place of `last-used` to keep them on one plan.
### What does a category’s bar measure?
What the category spent this month against what it had to spend: its Available plus what went out, so money rolled over, assigned and moved in all count. A bar past its end is overspent. A category with nothing to spend, one whose only activity this month is a refund, and Credit Card Payments categories get no bar, since their activity isn’t spending. Overspending from a category with nothing assigned is listed under its own heading instead. The bars use YNAB’s own figures; the transactions under a bar are listed, not added up. The page shows 20 categories: overspent ones first, then those that have used the most of their money. A note says so when there are more.
### Why does a weekly bill show only once in Upcoming?
YNAB gives each scheduled transaction’s next date and how often it repeats, not every date ahead. The pages show that next date and don’t work out the ones after it, so the 30-day totals count each schedule once. A note says so while a schedule repeats within the month. Transfers between your accounts aren’t counted as money in or out.
### Are pending transactions included?
No. YNAB’s API leaves pending transactions out until they post. Uncleared transactions that have posted are included.
### What does Approve do?
It marks that transaction approved in YNAB, as the check in YNAB’s own list does, after you confirm. It doesn’t clear, categorize or reconcile it. To undo it, unapprove the transaction in YNAB. To make the page read only, remove the card’s `row_actions`.
### Why does the net-worth chart start empty?
Legato draws it from its own readings, one a day while it’s running, starting the day you add the page. YNAB’s API doesn’t give past balances. Until there are two readings a day apart, the card says it’s collecting them.
We are not affiliated, associated, or in any way officially connected with YNAB or any of its subsidiaries or affiliates. The official YNAB website can be found at [www.ynab.com](https://www.ynab.com). The names YNAB and You Need A Budget, as well as related names, tradenames, marks, trademarks, emblems, and images are registered trademarks of YNAB.
## Verification
On November 11, 2026, every request the pages make went through Legato’s own fetcher to YNAB’s API (v1.91.0) for a real but new plan, with no accounts or transactions yet. That checked the sign-in, each answer’s fields, the empty pages, and that asking for a month before the plan began fails instead of answering with another month. A busy month, with overspending, splits, transfers, unapproved transactions, bank links that need attention and scheduled transactions, is checked by tests with made-up answers. Approve wasn’t pressed on a real transaction. Illustrations use made-up readings. See the [service index](https://legatobar.com/services/) for other examples.
---
# Todoist in your Mac’s menu bar
Legato shows your Todoist tasks in the Mac’s menu bar: what’s due, what’s coming up and your Inbox, to tick off without opening Todoist, your projects with how many tasks each has open, and what you’ve completed this week. Each project opens a page of its own, with its open tasks under their sections, as Todoist shows them.
## What you’ll see
- **Todoist:**
- **Due, Upcoming and Inbox**, one tab each, every row a task you can tick. Due is today’s tasks, then the overdue ones. Upcoming is the next 7 days after today, under each day. Seven show at a time, with **Show N more** for the rest.
- Each row says its day, its time when it has one, and its project; a subtask names its parent instead (`↳ Clean the gutters`). A repeating task has a small repeat mark after its name.
- **Projects:** the projects with open tasks, the most first, each with its count. Each one opens its own page.
- **Completed**, a closed section: what you’ve completed today and in the last 7 days, each day’s count, and the latest ones.
- **Project:** one page for every project. It shows the project’s open tasks under their sections, in Todoist’s order, fifteen at a time, to tick off as on Due.
When Todoist has more than Legato reads (see below), a note says so and links to Todoist.
### Status
Nothing counts as a problem: a to-do list is its own status, so overdue tasks don’t turn the page orange.
## How it connects
Legato asks Todoist’s API v1 at `https://api.todoist.com`, sending the access token from your [connection](https://legatobar.com/docs/source-requests.md#connections), or your API token, in an `Authorization` header. Everything goes from your Mac to Todoist; nothing passes through Legato’s servers.
| Request | Page | When | What it does |
| --- | --- | --- | --- |
| `GET /api/v1/tasks/filter?query=today` | Todoist | Every 5 minutes | Today’s tasks, the start of Due. |
| `GET /api/v1/tasks/filter?query=overdue` | Todoist | Every 5 minutes | Overdue tasks, after today’s in Due. |
| `GET /api/v1/tasks/filter?query=7 days & !today & !overdue` | Todoist | Every 5 minutes | Upcoming: the next 7 days after today. |
| `GET /api/v1/tasks/filter?query=#Inbox` | Todoist | Every 5 minutes | The Inbox. |
| `GET /api/v1/tasks` | Todoist | Every 5 minutes | Every open task: each project’s count, and a subtask’s parent. |
| `GET /api/v1/projects` | Todoist | Every 5 minutes | Your projects’ names. |
| `GET /api/v1/tasks/completed/stats` | Todoist | Every 5 minutes | Tasks completed each day. |
| `GET /api/v1/activities?event_type=completed` | Todoist | Every 5 minutes | The latest completed tasks. |
| `GET /api/v1/projects/`, `/tasks?project_id=`, `/sections?project_id=` | Project | Every 5 minutes while it’s open | One project: its name, open tasks and sections. |
| `POST /api/v1/tasks//close` | Both | When you tick a task | Completes the task, as ticking it in Todoist does: a repeating task moves to its next date. |
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Add the pages.** Paste the prompt into your agent, or download both pages and run `/Applications/Legato.app/Contents/Helpers/legato set todoist-project todoist-project.json`, then the same for `todoist`. Keep those page IDs: each project on Todoist opens its page by `todoist-project`.
2. **Connect Todoist.** In Settings → Secrets, choose **Connect Todoist** on the `todoist` row. Sign in to Todoist in your browser and allow access. Legato asks to read and change your tasks, so you can tick them off.
The cards fill within a minute.
To use an API token instead, open Settings → Integrations → Developer in Todoist and copy the token. In Settings → Secrets, set `todoist` to it for `api.todoist.com`. A [1Password reference](https://legatobar.com/docs/1password.md) works too.
### Prompt for your agent
```prompt
Add 2 Legato pages for Todoist, starting from https://legatobar.com/examples/todoist.json, https://legatobar.com/examples/todoist-project.json. Use the page IDs todoist, todoist-project if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add both pages as they are, keeping their IDs and the API address. I’ll connect Todoist, or save an API token as todoist, in Settings → Secrets myself. Don’t tick any task to test it.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Todoist (todoist.json)](https://legatobar.com/examples/todoist.json)
- [Download Project (todoist-project.json)](https://legatobar.com/examples/todoist-project.json)
## Questions
### Why is Due today’s tasks, then overdue?
So what’s due today stays at the top, however many overdue tasks there are. Each group has its own heading, Today and Overdue.
### What does ticking a repeating task do?
What ticking it in Todoist does: Todoist moves it to its next date, and the row goes when the page next reads Todoist.
### Why does a project show a lot of tasks at once?
Its page lists every open task, including those due later and those with no date, as Todoist’s project view does. Fifteen show at a time, with **Show N more** for the rest.
### What if I have a lot of tasks?
Each request reads Todoist’s first page of answers, up to 200 tasks, and each list shows up to 60. Todoist says when it has more, and then the page does too: a note links to Todoist for the full list, and project counts read “At least”. A count without “At least” is complete.
### Why is Recently completed empty?
On Todoist’s free plan, the activity log behind it keeps only a short history. **Done each day** comes from your completion stats and still counts.
*Checked against Todoist’s API v1 on November 6, 2026, with a live free-plan account: both pages fill, Due, Upcoming and the Inbox list the account’s tasks, and a project’s page groups its tasks under their sections in Todoist’s order. Ticking was tried only against saved answers, not the live account. Illustrations use made-up tasks. Todoist is a trademark of Doist Inc. Legato isn’t affiliated with or endorsed by Doist.*
---
# Parcel in your Mac’s menu bar
Legato shows your Parcel deliveries in the Mac’s menu bar: what’s on the way and when, with anything that needs you first, such as a missed delivery or a package waiting at the post office, and what was delivered lately. Each package opens a page of its own with the carrier’s tracking history. Legato reads Parcel’s API from your Mac with an API key kept in the Keychain or 1Password.
## What you’ll see
- **Packages:**
- **On the way:** every active package, with its carrier’s logo. Anything that needs you comes first, then what’s out for delivery, then the rest by expected day; a package with no estimate goes last. The right side says the state when it isn’t routine (Delivery attempted, Ready for pickup, Out for delivery, Label created, Tracking not found), and otherwise the expected day. Seven show at a time, with **Show N more** for the rest.
- **Delivered**, a closed section: the latest four packages delivered. With nothing on the way, they show open instead, under “No active deliveries”.
- **Package:** one page for every package, opened from its row and titled with the package’s name. It shows the latest update, a map of the towns the package was scanned in, joined in order, the tracking history on a timeline (newest first, by day, with places, the expected delivery or window above it, and a note when the carrier has gone quiet for days), the carrier and the tracking number. A click on the latest update opens the carrier’s tracking page for UPS, FedEx, USPS and DHL. The map only shows the way, so clicking it opens nothing.
- **Delivery times:** how many days each carrier takes, from its pickup scan to delivery, over the last 30, 90 or 180 days. It counts only deliveries in your delivery area, so a package sent to someone else doesn’t skew it.
- **Delivery times for one carrier:** one page for every carrier, opened from its row on Delivery times, with that carrier’s deliveries in the period.
Packages keeps each delivery in [History](https://legatobar.com/docs/history.md) on your Mac as `parcel-deliveries`, and the two Delivery times pages read it. Parcel forgets a delivery soon after it arrives, so this is how the pages can look back 180 days.
The footer of each page says when Legato last asked Parcel, kept apart from when the carrier last reported.
### Status
- No health card.
- What needs you sorts to the top of On the way, with its state in the row.
- A note on the page when Parcel doesn’t answer.
## How it connects
Legato asks Parcel’s API at `https://api.parcel.app` with your API key in an `api-key` header. Everything goes from your Mac to Parcel; nothing passes through Legato’s servers.
| Request | Page | When | What it does |
| --- | --- | --- | --- |
| `GET /external/deliveries/?filter_mode=active` | Packages, Package | Every 30 minutes | The deliveries still on the way. |
| `GET /external/deliveries/?filter_mode=recent` | Packages, Package | Every 30 minutes | Recent deliveries, including the ones delivered. |
| `POST /external/add-delivery/` | Packages | When you add a tracking number | Adds the delivery to Parcel. |
Packages and Package make the same two requests, so opening a package doesn’t add any. That’s 4 requests an hour, inside Parcel’s limit of 20. The Delivery times pages make no requests: they read the deliveries Packages keeps on your Mac. **Add tracking**, in the corner of On the way, opens a short form (the tracking number, the carrier, which it guesses from the number, and a description) and sends it to `POST /external/add-delivery/`.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Get an API key.** Sign in at [web.parcelapp.net](https://web.parcelapp.net) with your Parcel account, and generate an API key. The API needs Parcel Premium.
2. **Save it in Legato.** In Settings → Secrets, save it under `parcel`, bound to `api.parcel.app`. Packages and Package use it. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download the pages and run `/Applications/Legato.app/Contents/Helpers/legato set parcel-package parcel-package.json`, `legato set delivery-times-carrier delivery-times-carrier.json` and `legato set delivery-times delivery-times.json`, then `legato set parcel parcel.json`. Keep the ID `parcel-package`: every row opens it with its package’s tracking number.
4. **Say where your deliveries arrive.** For Delivery times, add a list named `delivery-area` in Settings → Lists, with your town as the carriers write it, such as “Fernhollow, ST”. FedEx doesn’t print where it delivered, so also add the town its last out-for-delivery scan names, if that’s a different one. A delivery counts when its delivered place is in the list or, when it has none, its last out-for-delivery place is. Until the list exists, Delivery times says to add it.
The cards fill within a minute. A missing or mistyped key is the usual reason they don’t: the page then notes that Parcel didn’t answer.
Delivery times starts with what Parcel’s recent list holds when Packages first fetches, and grows from there. To add older deliveries, export them from Parcel as Parcel-shaped items and run `legato rows add parcel-deliveries old-deliveries.json`; [History](https://legatobar.com/docs/history-parcel.md#a-complete-example-parcel) shows the shape.
### Prompt for your agent
```prompt
Add 4 Legato pages for Parcel, starting from https://legatobar.com/examples/parcel.json, https://legatobar.com/examples/parcel-package.json, https://legatobar.com/examples/delivery-times.json, https://legatobar.com/examples/delivery-times-carrier.json. Use the page IDs parcel, parcel-package, delivery-times, delivery-times-carrier if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add the pages as they are, keeping their page IDs and the API address. I’ll save the API key as parcel in Settings → Secrets myself. Don’t add a tracking number to test it.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Packages (parcel.json)](https://legatobar.com/examples/parcel.json)
- [Download Package (parcel-package.json)](https://legatobar.com/examples/parcel-package.json)
- [Download Delivery times (delivery-times.json)](https://legatobar.com/examples/delivery-times.json)
- [Download {param.name} (delivery-times-carrier.json)](https://legatobar.com/examples/delivery-times-carrier.json)
## Questions
### Why does a new package say “Tracking not found”?
That’s Parcel’s word for a number the carrier doesn’t know yet. A label just made often isn’t in the carrier’s system for a few hours. If it still says so after a few days, the number or the carrier may be wrong.
### What’s the difference between “Label created” and “In transit”?
Label created means the carrier has the shipment’s details but hasn’t scanned the box yet. Once it does, the package shows its expected day.
### Why don’t the pages update faster than every 30 minutes?
Parcel’s API answers from the app’s own cache, which Parcel refreshes from the carriers on its own schedule, so asking more often wouldn’t bring news sooner. Its limit is 20 requests an hour.
### Can I add a tracking number from Legato?
Yes: **Add tracking** on On the way. Parcel allows 20 adds a day, including ones it refuses, and a new number shows on the page the next time Legato asks, often as “Tracking not found” until the carrier scans it.
### Why doesn’t Delivery times count every package?
It counts only deliveries in your `delivery-area` list, so a gift sent to another town doesn’t make your carrier look slow. A package with no pickup scan has no start to count from, so it’s left out too.
### Why does Delivery times show so few deliveries?
History starts with what Parcel’s recent list held when Packages first fetched. Each delivery after that is kept, so the 90- and 180-day views fill in as time goes on, or at once with older deliveries added by `legato rows add`.
### What if Parcel doesn’t answer?
The page keeps what Parcel last said, with a note saying the fetch failed. When Parcel answers but turns the request down (a mistyped key, or more than 20 requests in an hour), the note gives Parcel’s reason, such as “api.parcel.app reported an error: Too many requests”, and History keeps nothing from that answer. An empty list always means Parcel said so, never a failed request.
*Checked against Parcel’s API on November 7, 2026, with a live Premium account that had no deliveries at the time: both pages load. The Delivery times pages were checked on November 8, 2026 against a real delivery history and against made-up deliveries. The filled pages were checked only against made-up answers in the documented shape. Illustrations use made-up packages. Parcel is made by Ivan Pavlov. Legato isn’t affiliated with or endorsed by Parcel.*
---
# GitHub in your Mac’s menu bar
See what’s waiting for you on GitHub without opening a browser: pull requests to review, your own pull requests with their CI, your notifications, and whether each repository’s default branch is passing. A year of contributions sits underneath, and every repository opens a page of its own with its CI, its numbers, its recent workflow runs and Re-run failed jobs.
## What you’ll see
- **GitHub:**
- **Reviews | My PRs | Notifications**, three tabs at one height:
- **Reviews:** pull requests waiting for your review, with their repository and when they last changed.
- **My PRs:** your open pull requests, each saying what it’s waiting on: CI failing, Changes requested, Draft or Approved.
- **Notifications:** your unread notifications with their repository and why you got them (Review requested, Mention, Comment, Workflow…). **Mark all read** sits under the list.
Each shows 7, with **Show N more**.
When GitHub has more than the pages read (40 repositories, 20 pull requests of each kind, 50 notifications), a note under the tabs says so and links to GitHub.
- **Repositories:** your repositories and your organisations’, most recently pushed first, as dots coloured by CI on the default branch. Red is failing, orange running, green passing, and grey has no CI. A dot that changes sends a notification. Review requests and notifications never count as a problem the page. Each dot opens its repository’s page.
- **Contributions:** your past year, a day to a square, with the year’s total.
- **Repository:** one page for every repository, opened from its dot and titled with its name:
- **CI on main** (or whichever default branch), with **Re-run failed jobs** in its corner while the newest run on that branch has failed. It asks first.
- Stars, open pull requests, open issues, the latest release, forks and the last push.
- The latest workflow runs and open pull requests, four of each with **Show N more** up to ten. Past ten, a note links to the rest on GitHub.
### Status
- Watches CI on each repository’s default branch.
- Red when it’s failing, orange while it’s running.
- Grey for a repository with no CI, which never needs attention.
- Review requests and notifications never count as a problem.
- Notifies you when it turns orange or red.
## How it connects
The pages read GitHub’s GraphQL API for pull requests, repositories, CI and the contribution calendar, and its REST API for notifications and workflow runs, with a classic personal access token.
| Request | Pages | When | What it supplies |
| --- | --- | --- | --- |
| `POST /graphql` | GitHub, Repository | Once a minute; contributions once an hour | Review requests and your pull requests (GitHub’s search, which doesn’t use the REST search allowance), your repositories with CI on each default branch, the contribution calendar, and a repository’s counts, release and pull requests. |
| `GET /notifications?per_page=50` | GitHub | Once a minute | Your unread notifications. |
| `GET /repos/{param.owner}/{param.repo}/actions/runs?per_page=10` | Repository | Every 2 minutes | The repository’s latest workflow runs. |
| `PUT /notifications` | GitHub | When you press Mark all read | Marks every notification read. |
| `POST /repos/{param.owner}/{param.repo}/actions/runs/{answer.failed_run_id}/rerun-failed-jobs` | Repository | When you press Re-run failed jobs | Runs the failed jobs of the newest run on the default branch again. |
That’s about 90 GraphQL points and 90 REST requests an hour with the overview and one repository page open, well inside GitHub’s 5,000 of each. A GraphQL answer can carry errors with a 200; the pages count it as a failed fetch only when it brings back none of what they need, so one repository GitHub can’t read doesn’t blank the rest.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make a token.** In GitHub, open Settings → Developer settings → Personal access tokens → Tokens (classic) and generate one with the `repo`, `notifications` and `read:user` scopes. Notifications need a classic token; fine-grained tokens can’t read them.
2. **Save it in Legato.** In Settings → Secrets, save it under `github`, bound to `api.github.com`. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download the two pages and run `/Applications/Legato.app/Contents/Helpers/legato set github-repo github-repo.json`, then `legato set github github.json`. Keep the ID `github-repo`: every dot opens it with its repository’s owner and name.
The cards fill within a minute. A missing or mistyped token is the usual reason they don’t: the page then notes that api.github.com didn’t answer.
For a GitHub Enterprise server, change `url` on every source to your server’s API address.
### Prompt for your agent
```prompt
Add 2 Legato pages for GitHub, starting from https://legatobar.com/examples/github.json, https://legatobar.com/examples/github-repo.json. Use the page IDs github, github-repo if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add the pages as they are, keeping their page IDs. I’ll save my GitHub token as github in Settings → Secrets myself. Don’t press Mark all read or Re-run failed jobs to test them.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download GitHub (github.json)](https://legatobar.com/examples/github.json)
- [Download Repository (github-repo.json)](https://legatobar.com/examples/github-repo.json)
## Questions
### Why does a repository show grey?
Grey means its default branch has no CI: no GitHub Actions run and no other check reports on it. A grey repository never needs attention, so it doesn’t count as a problem.
### When does Re-run failed jobs appear?
Only while the newest workflow run on the repository’s default branch has failed or timed out. It runs that run’s failed jobs again, after asking. GitHub allows a re-run for 30 days after the run. If GitHub turns it down, the button says why.
### Why a classic token?
GitHub’s notifications API only accepts classic tokens. `repo` covers your private repositories and re-running a workflow, `notifications` the notifications, and `read:user` the private contributions in your calendar. Keep the token in Legato or 1Password only; delete it on GitHub’s token page to cut Legato off.
### Can it show a repository I don’t push to?
The overview lists repositories you own, collaborate on or belong to an organisation that owns. Any public repository’s page opens with `legato://page/github-repo?owner=…&repo=…`, from a link on another page.
### Why are the contributions blue?
Legato draws the year in your Mac’s accent colour, so it sits with the rest of the panel.
Legato is independent and isn’t affiliated with or endorsed by GitHub.
## Verification
The pages were filled from a real GitHub account on 8 Nov 2026, and from public repositories for a busy repository page. The example pages have tests with made-up answers for a busy day. Illustrations use made-up repositories, people and numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# Jellyfin and Emby in your Mac’s menu bar
See what’s playing on your media server without opening it: each stream with its poster, how far along it is and who’s watching on what, a shelf of what was just added, how much each library holds, and whether the server needs you. One page set serves Jellyfin and Emby: both take the same sign-in and the same requests.
## What you’ll see
- **Jellyfin:**
- **Health:** in Details, a row for each scheduled task and each plugin, grouped as the server groups them, and Restart pending while the server waits for one. A task whose last run failed, a plugin that’s malfunctioned and a restart pending are orange. The worst sets the health card's colour, and a change sends a notification. When the server stops answering, the rows give way to one red Server row.
- **Now playing:** each stream with its poster (a show’s, or an album’s cover; a film, show or note icon when the server has none), its title and episode, a bar with "31 of 47 min", who’s watching on which device, and whether it plays directly or is transcoding. A paused stream says Paused. Point at a row for **Message** and **Stop**; Stop asks first. A live TV channel or an idle app isn’t listed. Someone watching never counts as a problem.
- **Recently added:** a shelf of the four newest films, episodes and albums, with their posters. Each opens in Jellyfin’s web app.
- **Libraries:** each library with what it holds ("1,204 movies", "312 shows · 9,870 episodes"). The server counts by kind, so two libraries of the same kind (Shows and Kids, say) each just say Shows; their own pages have their counts. Each row opens that library’s page.
- **Library:** one page for every library, titled with its name: how many titles it holds, its kind and folder, and the latest fifteen added.
### Status
- Watches the server, not who’s watching.
- Orange for a task whose last run failed, a plugin that’s broken or a restart pending.
- Red once the server stops answering.
- Someone watching or transcoding never counts as a problem.
- Notifies you when it turns orange or red.
## How it connects
The pages read the server’s own API with an API key, sent as `Authorization: MediaBrowser Token="…"`, the form Jellyfin 10.10 and later and Emby both accept.
| Request | Pages | When | What it supplies |
| --- | --- | --- | --- |
| `GET /Sessions?activeWithinSeconds=960` | Jellyfin | Once a minute | Who’s playing what, where it’s up to, and how it plays. |
| `GET /Items/Counts` | Jellyfin | Every 15 minutes | How many films, shows, episodes, albums and songs the server holds. |
| `GET /Library/VirtualFolders` | Jellyfin, Library | Every 15 minutes | The libraries, their kinds and folders, and whether one is being scanned. |
| `GET /Items?Recursive=true&SortBy=DateCreated&SortOrder=Descending&IncludeItemTypes=Movie,Episode,MusicAlbum&Fields=DateCreated&Limit=8` | Jellyfin | Every 15 minutes | What was added most recently. |
| `GET /ScheduledTasks?IsHidden=false` | Jellyfin | Every 5 minutes | Each task’s last run. |
| `GET /System/Info` | Jellyfin | Every 5 minutes | A pending restart (and Emby’s maintenance mode). |
| `GET /Plugins` | Jellyfin | Every 5 minutes | Each plugin’s status. |
| `GET /Items?ParentId={param.id}&Recursive=true&Limit=0&EnableTotalRecordCount=true&IncludeItemTypes=Movie,Series,MusicAlbum,Book,MusicVideo` | Library | Every 15 minutes | How many titles the library holds. |
| `GET /Items?ParentId={param.id}&Recursive=true&SortBy=DateCreated&SortOrder=Descending&IncludeItemTypes=Movie,Episode,MusicAlbum,Book,MusicVideo&Fields=DateCreated&Limit=15` | Library | Every 15 minutes | What was added to it most recently. |
| `GET /Items/{id}/Images/Primary` | Jellyfin, Library | While the panel shows the row | Posters and covers the server says it has, kept on this Mac. |
| `POST /Sessions/{id}/Message` | Jellyfin | When you send a message | Shows your words on that screen for 10 seconds. |
| `POST /Sessions/{id}/Playing/Stop` | Jellyfin | When you press Stop and confirm | Stops that stream. |
That’s about 108 requests an hour with the overview open, plus a poster the first time each one shows. Posters come only from your server, never from another site, and **Load icons from the web** in Settings doesn’t affect them.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make an API key.** In Jellyfin, open Dashboard → API Keys and add one named Legato; in Emby, Settings → Advanced → API Keys. An API key acts as an administrator, which the tasks, plugins and Stop need.
2. **Save it in Legato.** In Settings → Secrets, save just the key under `jellyfin`, bound to your server’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download the two pages and run `/Applications/Legato.app/Contents/Helpers/legato set jellyfin-library jellyfin-library.json`, then `legato set jellyfin jellyfin.json`. Keep the ID `jellyfin-library`: every library row opens it with that library’s id.
4. **Point them at your server.** Change `http://jellyfin.local:8096` to your server’s address on every source of both pages, and in the Recently added links. A server behind a path such as `/jellyfin` needs that path at the start of each request too.
The cards fill within a minute. A mistyped key is the usual reason they don’t: the page then notes that the server refused it.
### Prompt for your agent
```prompt
Add 2 Legato pages for Jellyfin and Emby, starting from https://legatobar.com/examples/jellyfin.json, https://legatobar.com/examples/jellyfin-library.json. Use the page IDs jellyfin, jellyfin-library if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add the pages as they are, keeping their page IDs, and change http://jellyfin.local:8096 on every source to my server’s address. I’ll save my API key as jellyfin in Settings → Secrets myself. Don’t press Stop or Message to test them.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Jellyfin (jellyfin.json)](https://legatobar.com/examples/jellyfin.json)
- [Download Library (jellyfin-library.json)](https://legatobar.com/examples/jellyfin-library.json)
## Questions
### Does it work with Emby?
Yes. Emby 4.x takes the same sign-in, and every request the pages make. The title says Jellyfin; change `title` to Emby if you like. Emby’s Server dots include its maintenance mode.
### Why don’t I see Stop or Message on a row?
They show only for apps that take remote commands, as the server reports. Some music apps and TVs don’t, and Stop would do nothing there.
### Why isn’t transcoding a warning?
Transcoding is the server doing its job: a phone that can’t play a film’s format still gets it. The row says Transcoding so you can see it; it never counts as a problem.
### What happens to the posters?
Legato fetches each poster from your server with your key, only while it’s on screen, and keeps up to 50 MB of them on this Mac, the oldest going first. They never go anywhere else.
Legato is independent and isn’t affiliated with or endorsed by Jellyfin or Emby.
## Verification
The pages were filled from Jellyfin 12.4.0 and Emby 4.10.2 servers on 8 Nov 2026, with made-up viewers playing open films, a made-up series and album, and a real transcoding stream. Message and Stop were checked to be accepted by both. The example pages have tests with made-up answers for a busy evening. Illustrations use made-up titles, people and numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# The weather in your Mac’s menu bar
See the weather where you are without opening an app: the temperature and what it feels like, the day in one line, whether rain is about to start, the next 24 hours and the week. Air quality, UV, wind, humidity, the moon, pressure and visibility sit in one card. When the National Weather Service or your country’s weather office issues an alert, it’s at the top of the page and in the menu bar until it ends.
## What you’ll see
- **Weather alerts** while one is on: what it is, when it starts and ends, and who issued it. It sends a notification. With two or more, a list of all of them follows.
- **Now:** the temperature, what it feels like and the sky.
- **Today:** the high and low, and OpenWeather’s summary of the day ("Storms through the afternoon, clearing by evening").
- **Next hour,** only while rain or snow is coming: a column for every five minutes, each at its heaviest, titled "Rain starting in 12m", "Rain stopping in 25m" or "Rain all hour". OpenWeather has minute-by-minute rain for most places, not all; where it has none, this card never shows.
- **Next 24 hours:** the temperature every other hour.
- **Conditions:** air quality in OpenWeather’s words (Good, Fair, Moderate, Poor, Very poor), the UV index now and its highest today and when, wind with its direction and gusts, humidity and dew point, the moon, pressure and visibility.
- **Daylight left,** or the time until sunrise.
- **This week:** each day’s low and high on one scale, with its sky, wind and any chance of rain.
- **Notable this week,** only while something is: the first day ahead with gusts of 46 mph or more (a common National Weather Service advisory level), the worst air from tomorrow if OpenWeather rates it Moderate or worse, a low at or below freezing, or an inch of rain or of snow. These never count as a problem the page. Each number sits in the page’s rules, where you can change it.
The page takes its title from the place’s name in OpenWeather’s geocoding.
### More than one place
The page shows one place at a time. Opened from the sidebar, it shows its default place, and that’s the place whose alerts send notifications. A link with other coordinates shows another place on the same page, without sending notifications: `legato://page/weather?lat=40.71&lon=-74.01`. Put such links in a list on another page, one row for each place you check.
### Status
- Watches weather alerts for your place.
- Orange while an alert is on, with a notification when it starts.
- A storm with no alert doesn’t count as a problem.
- Notifies you when it turns orange or red.
## How it connects
The page reads OpenWeather with your API key, sent as `appid` in the address.
| Request | When | What it supplies |
| --- | --- | --- |
| `GET /data/3.0/onecall?lat={param.lat}&lon={param.lon}&units=imperial` | Every 20 minutes | The weather now, every minute of the next hour, the next 48 hours, eight days, and alerts. |
| `GET /data/2.5/air_pollution?lat={param.lat}&lon={param.lon}` | Every 20 minutes | Air quality now. |
| `GET /data/2.5/air_pollution/forecast?lat={param.lat}&lon={param.lon}` | Every 20 minutes | Air quality for the next four days. |
| `GET /geo/1.0/reverse?lat={param.lat}&lon={param.lon}&limit=1` | Once a day | The place’s name, for the page’s title. |
That’s 72 One Call calls a day for each place you keep open, well inside the 1,000 a day One Call by Call gives free. Air quality and place names are on OpenWeather’s free plan and don’t count toward them.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Get a key with One Call 3.0.** Sign up at openweathermap.org, then subscribe to **One Call by Call** under Pricing. It asks for a card, but the first 1,000 calls each day are free. Set the daily limit in your account to 1,000 and it never charges. Your key is under **My API keys**. A new key can take a couple of hours to start working.
2. **Save it in Legato.** In Settings → Secrets, save the key under `openweather`, bound to `api.openweathermap.org`. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the page.** Paste the prompt into your agent, or download the page and run `/Applications/Legato.app/Contents/Helpers/legato set weather weather.json`.
4. **Set your place.** Under `params`, change the `default` of `lat` and `lon` to your place’s latitude and longitude, to two decimals or more. The download starts at OpenWeather’s example place.
The cards fill within a minute. A new key that hasn’t started working yet is the usual reason they don’t: the page then notes that OpenWeather refused it.
### In °C
The page asks for °F and miles per hour. For °C and metres a second, change `units=imperial` to `units=metric` in the first request, `°F` to `°C` on the Now, Next 24 hours and This week cards, and `mph` to `m/s` in the Wind row. Pressure and visibility are worked out from OpenWeather’s own units; change their scale and words too if you’d rather see hPa and km.
### Prompt for your agent
```prompt
Add a Legato page for OpenWeather, starting from https://legatobar.com/examples/weather.json.
Add the page as it is, keeping its page ID, and change the default lat and lon under params to my place. I’ll save my OpenWeather key as openweather in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the page
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "Weather",
"icon": "cloud.sun",
"params": {
"lat": {
"pattern": "-?[0-9]{1,3}(\\.[0-9]{1,6})?",
"example": "33.44",
"default": "33.44"
},
"lon": {
"pattern": "-?[0-9]{1,3}(\\.[0-9]{1,6})?",
"example": "-94.04",
"default": "-94.04"
}
},
"title_from": {
"ref": "place",
"value": "places[0].name"
},
"sources": {
"weather": {
"url": "https://api.openweathermap.org",
"secret": "openweather",
"auth": {
"type": "query",
"name": "appid"
},
"every": "20m",
"requests": {
"one": "/data/3.0/onecall?lat={param.lat}&lon={param.lon}&units=imperial",
"air": "/data/2.5/air_pollution?lat={param.lat}&lon={param.lon}",
"air_ahead": "/data/2.5/air_pollution/forecast?lat={param.lat}&lon={param.lon}"
},
"derive": [
{
"name": "alert_count",
"value": {
"count": "one.alerts",
"default": 0
}
},
{
"name": "wet_minutes",
"value": {
"count": "one.minutely",
"where": {
"path": "precipitation",
"gt": 0
},
"default": 0
}
},
{
"name": "rain",
"value": {
"each": "one.minutely",
"value": "precipitation",
"buckets": 12,
"keep": "max"
}
},
{
"name": "rain_starts",
"value": {
"first": "dt",
"of": "one.minutely",
"where": {
"path": "precipitation",
"gt": 0
}
}
},
{
"name": "rain_stops",
"value": {
"first": "dt",
"of": "one.minutely",
"where": {
"path": "precipitation",
"equals": 0
}
}
},
{
"name": "pressure_inhg",
"value": {
"path": "one.current.pressure",
"scale": 0.02953,
"round": 2
}
},
{
"name": "visibility_mi",
"value": {
"path": "one.current.visibility",
"scale": 0.000621371,
"round": 0
}
},
{
"name": "n_gusts",
"value": {
"each": "one.daily",
"where": {
"all": [
{
"path": "dt",
"gt": {
"answer": "one.daily[0].dt"
}
},
{
"path": "wind_gust",
"gte": 46
}
]
},
"limit": 1,
"fields": {
"dt": "dt",
"text": {
"template": "Gusts to {wind_gust|round} mph {dt|weekday}"
},
"icon": {
"template": "wind"
}
}
}
},
{
"name": "n_air_0",
"value": {
"each": "air_ahead.list",
"where": {
"all": [
{
"path": "dt",
"gte": {
"answer": "one.daily[1].sunrise"
}
},
{
"path": "main.aqi",
"gte": 3
}
]
},
"limit": 1,
"fields": {
"dt": "dt",
"word": {
"path": "main.aqi",
"values": {
"1": "Good",
"2": "Fair",
"3": "Moderate",
"4": "Poor",
"5": "Very poor"
}
}
},
"sort": {
"by": "main.aqi",
"order": "desc"
}
}
},
{
"name": "n_air",
"value": {
"each": "n_air_0",
"fields": {
"dt": "dt",
"text": {
"template": "{word} air {dt|weekday}"
},
"icon": {
"template": "lungs"
}
}
}
},
{
"name": "n_freeze",
"value": {
"each": "one.daily",
"where": {
"all": [
{
"path": "dt",
"gt": {
"answer": "one.daily[0].dt"
}
},
{
"path": "temp.min",
"lte": 32
}
]
},
"limit": 1,
"fields": {
"dt": "dt",
"text": {
"template": "Freezing {dt|weekday} night, {temp.min|round}°"
},
"icon": {
"template": "snowflake"
}
}
}
},
{
"name": "n_rain_0",
"value": {
"each": "one.daily",
"where": {
"all": [
{
"path": "dt",
"gt": {
"answer": "one.daily[0].dt"
}
},
{
"path": "rain",
"gte": 25.4
}
]
},
"limit": 1,
"fields": {
"dt": "dt",
"inches": {
"path": "rain",
"scale": 0.03937,
"round": 1
}
}
}
},
{
"name": "n_rain",
"value": {
"each": "n_rain_0",
"fields": {
"dt": "dt",
"text": {
"template": "{inches} in of rain {dt|weekday}"
},
"icon": {
"template": "cloud.rain"
}
}
}
},
{
"name": "n_snow",
"value": {
"each": "one.daily",
"where": {
"all": [
{
"path": "dt",
"gt": {
"answer": "one.daily[0].dt"
}
},
{
"path": "snow",
"gte": 25.4
}
]
},
"limit": 1,
"fields": {
"dt": "dt",
"text": {
"template": "Snow {dt|weekday}"
},
"icon": {
"template": "snowflake"
}
}
}
},
{
"name": "n_some",
"value": {
"each": [
"n_gusts",
"n_air",
"n_freeze",
"n_rain"
],
"fields": {
"dt": "dt",
"text": "text",
"icon": "icon"
}
}
},
{
"name": "notables",
"value": {
"each": [
"n_some",
"n_snow"
],
"sort": {
"by": "dt"
},
"fields": {
"text": "text",
"icon": "icon"
}
}
},
{
"name": "notable_count",
"value": {
"count": "notables",
"default": 0
}
},
{
"name": "uv_peak",
"value": {
"each": "one.hourly",
"limit": 1,
"where": {
"path": "dt",
"lte": {
"answer": "one.daily[0].sunset"
}
},
"sort": {
"by": "uvi",
"order": "desc"
},
"fields": {
"dt": "dt",
"uvi": {
"path": "uvi",
"round": 0
}
}
}
}
]
},
"place": {
"url": "https://api.openweathermap.org",
"secret": "openweather",
"auth": {
"type": "query",
"name": "appid"
},
"every": "1d",
"requests": {
"places": "/geo/1.0/reverse?lat={param.lat}&lon={param.lon}&limit=1"
}
}
},
"cards": [
{
"id": "alerts",
"type": "status",
"label": "Weather alerts",
"state": "unknown",
"width": "full",
"source": {
"ref": "weather",
"when": {
"path": "alert_count",
"gt": 0
},
"map": {
"label": {
"template": "{one.alerts[0].event}"
},
"state": {
"path": "alert_count",
"values": {
"0": "ok"
},
"default": "warning"
},
"detail": {
"if": {
"path": "one.alerts[0].start",
"gt": {
"path": "one.current.dt"
}
},
"then": {
"template": "{one.alerts[0].start|day} {one.alerts[0].start|clock} – {one.alerts[0].end|clock} · {one.alerts[0].sender_name}"
},
"else": {
"template": "Until {one.alerts[0].end|clock} · {one.alerts[0].sender_name}"
}
}
}
}
},
{
"id": "alert-list",
"type": "list",
"label": "All alerts",
"items": [
"—"
],
"source": {
"ref": "weather",
"when": {
"path": "alert_count",
"gt": 1
},
"map": {
"items": {
"each": "one.alerts",
"sort": {
"by": "start"
},
"limit": 4,
"fields": {
"text": "event",
"detail": {
"template": "{start|weekday} {start|clock} – {end|clock}"
}
}
}
}
}
},
{
"id": "now",
"type": "stat",
"label": "Now",
"value": 0,
"unit": "°F",
"source": {
"ref": "weather",
"map": {
"value": {
"path": "one.current.temp",
"round": 0
},
"delta": {
"template": "Feels like {one.current.feels_like|round}° · {one.current.weather[0].description|title}"
}
}
}
},
{
"id": "today",
"type": "stat",
"label": "Today",
"value": "—",
"source": {
"ref": "weather",
"map": {
"value": {
"template": "{one.daily[0].temp.max|round}° / {one.daily[0].temp.min|round}°"
},
"delta": {
"if": {
"path": "one.daily[0].summary",
"exists": true
},
"then": {
"template": "{one.daily[0].summary}"
},
"else": {
"template": "{one.daily[0].pop|percent:0} chance of rain"
}
}
}
}
},
{
"id": "rain",
"type": "columns",
"label": "Next hour",
"unit": "mm/h",
"series": [
"Rain"
],
"baseline": "zero",
"items": [
{
"label": "Now",
"values": [
0
]
},
{
"label": "5m",
"values": [
0
]
},
{
"label": "10m",
"values": [
0
]
},
{
"label": "15m",
"values": [
0
]
},
{
"label": "20m",
"values": [
0
]
},
{
"label": "25m",
"values": [
0
]
},
{
"label": "30m",
"values": [
0
]
},
{
"label": "35m",
"values": [
0
]
},
{
"label": "40m",
"values": [
0
]
},
{
"label": "45m",
"values": [
0
]
},
{
"label": "50m",
"values": [
0
]
},
{
"label": "55m",
"values": [
0
]
}
],
"source": {
"ref": "weather",
"when": {
"path": "wet_minutes",
"gt": 0
},
"map": {
"label": {
"if": {
"path": "one.minutely[0].precipitation",
"gt": 0
},
"then": {
"if": {
"path": "rain_stops",
"exists": true
},
"then": {
"template": "Rain stopping {rain_stops|in}"
},
"else": {
"template": "Rain all hour"
}
},
"else": {
"template": "Rain starting {rain_starts|in}"
}
},
"items[0].values[0]": {
"path": "rain[0]",
"round": 1
},
"items[1].values[0]": {
"path": "rain[1]",
"round": 1
},
"items[2].values[0]": {
"path": "rain[2]",
"round": 1
},
"items[3].values[0]": {
"path": "rain[3]",
"round": 1
},
"items[4].values[0]": {
"path": "rain[4]",
"round": 1
},
"items[5].values[0]": {
"path": "rain[5]",
"round": 1
},
"items[6].values[0]": {
"path": "rain[6]",
"round": 1
},
"items[7].values[0]": {
"path": "rain[7]",
"round": 1
},
"items[8].values[0]": {
"path": "rain[8]",
"round": 1
},
"items[9].values[0]": {
"path": "rain[9]",
"round": 1
},
"items[10].values[0]": {
"path": "rain[10]",
"round": 1
},
"items[11].values[0]": {
"path": "rain[11]",
"round": 1
}
}
}
},
{
"id": "hours",
"type": "columns",
"label": "Next 24 hours",
"unit": "°F",
"series": [
"Temperature"
],
"baseline": "auto",
"values_on_top": true,
"items": [],
"source": {
"ref": "weather",
"map": {
"highlight": {
"template": "{one.hourly[0].dt|hour}"
},
"items": {
"each": "one.hourly",
"limit": 24,
"buckets": 12,
"keep": {
"min": "dt"
},
"fields": {
"label": {
"template": "{dt|hour}"
},
"values[0]": {
"path": "temp",
"round": 0
}
}
}
}
}
},
{
"id": "conditions",
"type": "facts",
"label": "Conditions",
"items": [
{
"key": "Air quality",
"value": "—"
},
{
"key": "UV index",
"value": "—"
},
{
"key": "Wind",
"value": "—"
},
{
"key": "Humidity",
"value": "—"
},
{
"key": "Moon",
"value": "—"
},
{
"key": "Pressure",
"value": "—"
},
{
"key": "Visibility",
"value": "—"
}
],
"source": {
"ref": "weather",
"map": {
"items[0].value": {
"path": "air.list[0].main.aqi",
"values": {
"1": "Good",
"2": "Fair",
"3": "Moderate",
"4": "Poor",
"5": "Very poor"
},
"default": "—"
},
"items[1].value": {
"if": {
"path": "uv_peak[0].dt",
"exists": true
},
"then": {
"template": "{one.current.uvi|round} now · {uv_peak[0].uvi} at {uv_peak[0].dt|clock_hour}"
},
"else": {
"template": "{one.current.uvi|round} now"
}
},
"items[2].value": {
"if": {
"path": "one.current.wind_gust",
"exists": true
},
"then": {
"template": "{one.current.wind_speed|round} mph {one.current.wind_deg|compass} · gusts {one.current.wind_gust|round}"
},
"else": {
"template": "{one.current.wind_speed|round} mph {one.current.wind_deg|compass}"
}
},
"items[3].value": {
"template": "{one.current.humidity}% · dew point {one.current.dew_point|round}°"
},
"items[4].value": {
"if": {
"path": "one.daily[0].moon_phase",
"lt": 0.03
},
"then": {
"template": "New moon"
},
"else": {
"if": {
"path": "one.daily[0].moon_phase",
"lt": 0.22
},
"then": {
"template": "Waxing crescent"
},
"else": {
"if": {
"path": "one.daily[0].moon_phase",
"lt": 0.28
},
"then": {
"template": "First quarter"
},
"else": {
"if": {
"path": "one.daily[0].moon_phase",
"lt": 0.47
},
"then": {
"template": "Waxing gibbous"
},
"else": {
"if": {
"path": "one.daily[0].moon_phase",
"lt": 0.53
},
"then": {
"template": "Full moon"
},
"else": {
"if": {
"path": "one.daily[0].moon_phase",
"lt": 0.72
},
"then": {
"template": "Waning gibbous"
},
"else": {
"if": {
"path": "one.daily[0].moon_phase",
"lt": 0.78
},
"then": {
"template": "Last quarter"
},
"else": {
"if": {
"path": "one.daily[0].moon_phase",
"lt": 0.97
},
"then": {
"template": "Waning crescent"
},
"else": {
"template": "New moon"
}
}
}
}
}
}
}
}
},
"items[5].value": {
"template": "{pressure_inhg} inHg"
},
"items[6].value": {
"template": "{visibility_mi} mi"
}
}
}
},
{
"id": "daylight",
"type": "window",
"label": "Daylight left",
"start": "2026-01-01T12:00:00Z",
"end": "2026-01-01T23:00:00Z",
"start_label": "Sunrise",
"end_label": "Sunset",
"before_label": "Until sunrise",
"after_label": "Until sunrise",
"source": {
"ref": "weather",
"map": {
"start": "one.daily[0].sunrise",
"end": "one.daily[0].sunset",
"next_start": "one.daily[1].sunrise"
}
}
},
{
"id": "week",
"type": "ranges",
"label": "This week",
"unit": "°F",
"colors": "temperature",
"info_colors": [
"green",
"blue"
],
"muted": false,
"items": [
{
"label": "Today",
"low": 0,
"high": 1
}
],
"source": {
"ref": "weather",
"map": {
"items": {
"each": "one.daily",
"limit": 8,
"fields": {
"label": {
"template": "{dt|weekday}"
},
"low": {
"path": "temp.min",
"round": 0
},
"high": {
"path": "temp.max",
"round": 0
},
"icon": {
"path": "weather[0].icon",
"values": {
"01d": "sun.max",
"01n": "moon.stars",
"02d": "cloud.sun",
"02n": "cloud.moon",
"03d": "cloud",
"03n": "cloud",
"04d": "cloud",
"04n": "cloud",
"09d": "cloud.drizzle",
"09n": "cloud.drizzle",
"10d": "cloud.rain",
"10n": "cloud.rain",
"11d": "cloud.bolt.rain",
"11n": "cloud.bolt.rain",
"13d": "snowflake",
"13n": "snowflake",
"50d": "cloud.fog",
"50n": "cloud.fog"
},
"default": "cloud"
},
"info[0]": {
"template": "{wind_speed|round} {wind_deg|compass}"
},
"info[1]": {
"if": {
"path": "pop",
"gte": 0.1
},
"then": {
"template": "{pop|percent:0}"
},
"else": {
"template": ""
}
}
}
},
"items[0].now": {
"path": "one.current.temp",
"round": 0
}
}
}
},
{
"id": "notable",
"type": "list",
"layout": "chips",
"max_items": 3,
"items": [],
"source": {
"ref": "weather",
"when": {
"path": "notable_count",
"gt": 0
},
"map": {
"items": {
"each": "notables",
"fields": {
"text": "text",
"icon": "icon"
}
}
}
}
}
]
}
```
## Questions
### Why didn’t a storm count as a problem?
Only an official alert does. Rain in the forecast shows on the page and never changes its colour.
### Is there a version without a key?
Yes: the [Open-Meteo page](https://legatobar.com/services/open-meteo) has the same cards with no account, for non-commercial use, and US alerts from the National Weather Service.
### Why isn’t there an alert where I am?
OpenWeather passes on alerts from national weather services, and not every country sends them. When yours doesn’t, the page never shows the alert card.
### Can I see the AI summary OpenWeather offers?
Not on this page. It’s a paragraph long, and the day’s one-line summary already sits under Today.
Legato is independent and isn’t affiliated with or endorsed by OpenWeather.
## Verification
The page was filled from OpenWeather’s One Call 3.0, Air Pollution and Geocoding APIs on 9 Nov 2026. The example page has tests with made-up answers for a stormy morning. The illustration uses a made-up place, readings and alert. See the [service index](https://legatobar.com/services/) for other examples.
---
# The weather in your Mac’s menu bar, with no key
Open-Meteo is a free weather service you can use without an account. This page reads it for one place: the temperature and what it feels like, rain in the next two hours, the next 24 hours and the week. Air quality, UV, wind, humidity, pressure and visibility sit in one card, with pollen too in Europe. In the US, alerts from the National Weather Service go at the top of the page and send a notification.
## What you’ll see
- **Weather alerts,** in the US, while one is on: what it is, until when, and which Weather Service office issued it. It sends a notification. With two or more, a list of all of them follows.
- **Now:** the temperature, what it feels like and the sky.
- **Today:** the high and low, and the chance of rain.
- **Next 2 hours,** only while rain or snow is coming: a column for every 15 minutes, titled "Rain starting in 13m", "Rain stopping in 45m" or "Rain for the next 2 hours". Open-Meteo forecasts in 15-minute steps, so the time is when that step starts.
- **Next 24 hours:** the temperature every other hour.
- **Conditions:** air quality in the EPA’s words (Good, Moderate, Unhealthy for sensitive groups and so on), the UV index now and its highest still to come today, wind with its direction and gusts, humidity and dew point, pressure and visibility.
- **Pollen,** only where Open-Meteo has it (Europe) and while some is in the air: grass, birch, alder, ragweed, mugwort and olive, the most first, in grains per cubic metre.
- **Daylight left,** or the time until sunrise.
- **This week:** each day’s low and high on one scale, with its sky, wind and any chance of rain.
- **Notable this week,** only while something is: the first day ahead with gusts of 46 mph or more (a common Weather Service advisory level), the worst air from tomorrow if it’s unhealthy for sensitive groups or worse, a low at or below freezing, or an inch of rain or of snow. These never count as a problem the page. Each number sits in the page’s rules, where you can change it.
The page is titled with the name you give its place.
### More than one place
The page shows one place at a time. Opened from the sidebar, it shows its default place, and that’s the place whose alerts send notifications. A link with other coordinates and a name shows another place on the same page, without sending notifications: `legato://page/open-meteo?lat=40.71&lon=-74.01&name=New%20York`. Put such links in a list on another page, one row for each place you check.
### Status
- Watches US weather alerts for your place.
- Orange while an alert is on, with a notification when it starts.
- A storm with no alert doesn’t count as a problem.
- Notifies you when it turns orange or red.
## How it connects
The page asks for no key. Legato sends its name as the User-Agent, which the Weather Service requires.
| Request | When | What it supplies |
| --- | --- | --- |
| `GET /v1/forecast?latitude={param.lat}&longitude={param.lon}¤t=temperature_2m,apparent_temperature,relative_humidity_2m,dew_point_2m,weather_code,is_day,wind_speed_10m,wind_direction_10m,wind_gusts_10m,pressure_msl,visibility,uv_index&minutely_15=precipitation&forecast_minutely_15=8&hourly=temperature_2m,uv_index&forecast_hours=24&daily=weather_code,temperature_2m_max,temperature_2m_min,sunrise,sunset,rain_sum,snowfall_sum,precipitation_probability_max,wind_speed_10m_max,wind_gusts_10m_max,wind_direction_10m_dominant&forecast_days=8&temperature_unit=fahrenheit&wind_speed_unit=mph&precipitation_unit=inch&timezone=auto&timeformat=unixtime` | Every 15 minutes | The weather now, the next two hours in 15-minute steps, the next 24 hours and eight days, from api.open-meteo.com. |
| `GET https://air-quality-api.open-meteo.com/v1/air-quality?latitude={param.lat}&longitude={param.lon}¤t=us_aqi,grass_pollen,birch_pollen,alder_pollen,ragweed_pollen,mugwort_pollen,olive_pollen&hourly=us_aqi&forecast_days=4&timezone=auto&timeformat=unixtime` | Every 15 minutes | Air quality now and for four days, and pollen in Europe. |
| `GET /alerts/active?point={param.lat},{param.lon}` | Every 5 minutes | Weather alerts for the place in the US, from api.weather.gov. |
That’s a few hundred Open-Meteo calls a day for each place you keep open (it counts a request for many readings as more than one call), well inside the free API’s 10,000.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Add the page.** Paste the prompt into your agent, or download the page and run `/Applications/Legato.app/Contents/Helpers/legato set open-meteo open-meteo.json`.
2. **Set your place.** Under `params`, change the `default` of `lat` and `lon` to your place’s latitude and longitude, and `name` to what you call it ("Home"). There’s no key to save.
The cards fill within a minute.
### In °C
The page asks for °F, miles per hour and inches. For metric, take `temperature_unit=fahrenheit&wind_speed_unit=mph&precipitation_unit=inch` out of the first request, and change `°F` to `°C` on the Now, Next 24 hours and This week cards, `mph` to `km/h` in the Wind row and the gusts chip, and `in` to `mm` on Next 2 hours and the rain and snow chips. Pressure and visibility are worked out from Open-Meteo’s units; change their scale and words too if you’d rather see hPa and km.
### Prompt for your agent
```prompt
Add a Legato page for Open-Meteo, starting from https://legatobar.com/examples/open-meteo.json.
Add the page as it is, keeping its page ID, and change the default lat, lon and name under params to my place.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the page
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "{param.name}",
"icon": "cloud.sun",
"params": {
"lat": {
"pattern": "-?[0-9]{1,3}(\\.[0-9]{1,6})?",
"example": "33.44",
"default": "33.44"
},
"lon": {
"pattern": "-?[0-9]{1,3}(\\.[0-9]{1,6})?",
"example": "-94.04",
"default": "-94.04"
},
"name": {
"type": "text",
"example": "Weather",
"default": "Weather"
}
},
"sources": {
"weather": {
"url": "https://api.open-meteo.com",
"every": "15m",
"requests": {
"fc": "/v1/forecast?latitude={param.lat}&longitude={param.lon}¤t=temperature_2m,apparent_temperature,relative_humidity_2m,dew_point_2m,weather_code,is_day,wind_speed_10m,wind_direction_10m,wind_gusts_10m,pressure_msl,visibility,uv_index&minutely_15=precipitation&forecast_minutely_15=8&hourly=temperature_2m,uv_index&forecast_hours=24&daily=weather_code,temperature_2m_max,temperature_2m_min,sunrise,sunset,rain_sum,snowfall_sum,precipitation_probability_max,wind_speed_10m_max,wind_gusts_10m_max,wind_direction_10m_dominant&forecast_days=8&temperature_unit=fahrenheit&wind_speed_unit=mph&precipitation_unit=inch&timezone=auto&timeformat=unixtime",
"air": "https://air-quality-api.open-meteo.com/v1/air-quality?latitude={param.lat}&longitude={param.lon}¤t=us_aqi,grass_pollen,birch_pollen,alder_pollen,ragweed_pollen,mugwort_pollen,olive_pollen&hourly=us_aqi&forecast_days=4&timezone=auto&timeformat=unixtime"
},
"derive": [
{
"name": "sky",
"value": {
"path": "fc.current.weather_code",
"values": {
"0": "Clear sky",
"1": "Mainly clear",
"2": "Partly cloudy",
"3": "Overcast",
"45": "Fog",
"48": "Freezing fog",
"51": "Light drizzle",
"53": "Drizzle",
"55": "Heavy drizzle",
"56": "Freezing drizzle",
"57": "Freezing drizzle",
"61": "Light rain",
"63": "Rain",
"65": "Heavy rain",
"66": "Freezing rain",
"67": "Freezing rain",
"71": "Light snow",
"73": "Snow",
"75": "Heavy snow",
"77": "Snow grains",
"80": "Rain showers",
"81": "Rain showers",
"82": "Heavy showers",
"85": "Snow showers",
"86": "Snow showers",
"95": "Thunderstorm",
"96": "Thunderstorm with hail",
"99": "Thunderstorm with hail"
},
"default": ""
}
},
{
"name": "wet_slots",
"value": {
"count": "fc.minutely_15",
"zip": true,
"where": {
"path": "precipitation",
"gt": 0
},
"default": 0
}
},
{
"name": "rain",
"value": {
"each": "fc.minutely_15",
"zip": true,
"value": "precipitation"
}
},
{
"name": "rain_starts",
"value": {
"first": "time",
"of": "fc.minutely_15",
"zip": true,
"where": {
"path": "precipitation",
"gt": 0
}
}
},
{
"name": "rain_stops",
"value": {
"first": "time",
"of": "fc.minutely_15",
"zip": true,
"where": {
"path": "precipitation",
"equals": 0
}
}
},
{
"name": "uv_peak",
"value": {
"each": "fc.hourly",
"zip": true,
"limit": 1,
"where": {
"path": "time",
"lte": {
"answer": "fc.daily.sunset[0]"
}
},
"sort": {
"by": "uv_index",
"order": "desc"
},
"fields": {
"time": "time",
"uvi": {
"path": "uv_index",
"round": 0
}
}
}
},
{
"name": "pressure_inhg",
"value": {
"path": "fc.current.pressure_msl",
"scale": 0.02953,
"round": 2
}
},
{
"name": "visibility_mi",
"value": {
"path": "fc.current.visibility",
"scale": 0.0001893939393939394,
"round": 0
}
},
{
"name": "pollen",
"value": {
"each": "air.current",
"entries": true,
"where": {
"all": [
{
"path": "key",
"in": [
"grass_pollen",
"birch_pollen",
"alder_pollen",
"ragweed_pollen",
"mugwort_pollen",
"olive_pollen"
]
},
{
"path": "value",
"gt": 0
}
]
},
"sort": {
"by": "value",
"order": "desc"
},
"fields": {
"key": {
"path": "key",
"values": {
"grass_pollen": "Grass",
"birch_pollen": "Birch",
"alder_pollen": "Alder",
"ragweed_pollen": "Ragweed",
"mugwort_pollen": "Mugwort",
"olive_pollen": "Olive"
}
},
"grains": {
"path": "value",
"round": 0
}
}
}
},
{
"name": "pollen_count",
"value": {
"count": "pollen",
"default": 0
}
},
{
"name": "n_gusts",
"value": {
"each": "fc.daily",
"zip": true,
"where": {
"all": [
{
"path": "time",
"gt": {
"answer": "fc.daily.time[0]"
}
},
{
"path": "wind_gusts_10m_max",
"gte": 46
}
]
},
"limit": 1,
"fields": {
"time": "time",
"text": {
"template": "Gusts to {wind_gusts_10m_max|round} mph {time|weekday}"
},
"icon": {
"template": "wind"
}
}
}
},
{
"name": "n_air_0",
"value": {
"each": "air.hourly",
"zip": true,
"where": {
"all": [
{
"path": "time",
"gte": {
"answer": "fc.daily.sunrise[1]"
}
},
{
"path": "us_aqi",
"gte": 101
}
]
},
"limit": 1,
"fields": {
"time": "time",
"words": {
"if": {
"path": "us_aqi",
"lt": 151
},
"then": {
"template": "Air unhealthy for sensitive groups"
},
"else": {
"template": "Unhealthy air"
}
}
},
"sort": {
"by": "us_aqi",
"order": "desc"
}
}
},
{
"name": "n_air",
"value": {
"each": "n_air_0",
"fields": {
"time": "time",
"text": {
"template": "{words} {time|weekday}"
},
"icon": {
"template": "lungs"
}
}
}
},
{
"name": "n_freeze",
"value": {
"each": "fc.daily",
"zip": true,
"where": {
"all": [
{
"path": "time",
"gt": {
"answer": "fc.daily.time[0]"
}
},
{
"path": "temperature_2m_min",
"lte": 32
}
]
},
"limit": 1,
"fields": {
"time": "time",
"text": {
"template": "Freezing {time|weekday} night, {temperature_2m_min|round}°"
},
"icon": {
"template": "snowflake"
}
}
}
},
{
"name": "n_rain",
"value": {
"each": "fc.daily",
"zip": true,
"where": {
"all": [
{
"path": "time",
"gt": {
"answer": "fc.daily.time[0]"
}
},
{
"path": "rain_sum",
"gte": 1
}
]
},
"limit": 1,
"fields": {
"time": "time",
"text": {
"template": "{rain_sum|round:1} in of rain {time|weekday}"
},
"icon": {
"template": "cloud.rain"
}
}
}
},
{
"name": "n_snow",
"value": {
"each": "fc.daily",
"zip": true,
"where": {
"all": [
{
"path": "time",
"gt": {
"answer": "fc.daily.time[0]"
}
},
{
"path": "snowfall_sum",
"gte": 1
}
]
},
"limit": 1,
"fields": {
"time": "time",
"text": {
"template": "{snowfall_sum|round:1} in of snow {time|weekday}"
},
"icon": {
"template": "snowflake"
}
}
}
},
{
"name": "n_some",
"value": {
"each": [
"n_gusts",
"n_air",
"n_freeze",
"n_rain"
],
"fields": {
"time": "time",
"text": "text",
"icon": "icon"
}
}
},
{
"name": "notables",
"value": {
"each": [
"n_some",
"n_snow"
],
"sort": {
"by": "time"
},
"fields": {
"text": "text",
"icon": "icon"
}
}
},
{
"name": "notable_count",
"value": {
"count": "notables",
"default": 0
}
}
]
},
"alerts": {
"url": "https://api.weather.gov",
"every": "5m",
"requests": {
"nws": "/alerts/active?point={param.lat},{param.lon}"
},
"derive": [
{
"name": "alert_count",
"value": {
"count": "nws.features",
"default": 0
}
}
]
}
},
"cards": [
{
"id": "alerts",
"type": "status",
"label": "Weather alerts",
"state": "unknown",
"width": "full",
"source": {
"ref": "alerts",
"when": {
"path": "alert_count",
"gt": 0
},
"map": {
"label": {
"template": "{nws.features[0].properties.event}"
},
"state": {
"path": "alert_count",
"values": {
"0": "ok"
},
"default": "warning"
},
"detail": {
"if": {
"path": "nws.features[0].properties.ends",
"exists": true
},
"then": {
"template": "Until {nws.features[0].properties.ends|day} {nws.features[0].properties.ends|clock} · {nws.features[0].properties.senderName}"
},
"else": {
"template": "Until {nws.features[0].properties.expires|day} {nws.features[0].properties.expires|clock} · {nws.features[0].properties.senderName}"
}
}
}
}
},
{
"id": "alert-list",
"type": "list",
"label": "All alerts",
"items": [
"—"
],
"source": {
"ref": "alerts",
"when": {
"path": "alert_count",
"gt": 1
},
"map": {
"items": {
"each": "nws.features",
"limit": 4,
"fields": {
"text": "properties.event",
"detail": {
"template": "{properties.onset|weekday} {properties.onset|clock} · {properties.severity}"
}
}
}
}
}
},
{
"id": "now",
"type": "stat",
"label": "Now",
"value": 0,
"unit": "°F",
"url": "https://open-meteo.com",
"source": {
"ref": "weather",
"map": {
"value": {
"path": "fc.current.temperature_2m",
"round": 0
},
"delta": {
"template": "Feels like {fc.current.apparent_temperature|round}° · {sky}"
}
}
}
},
{
"id": "today",
"type": "stat",
"label": "Today",
"value": "—",
"source": {
"ref": "weather",
"map": {
"value": {
"template": "{fc.daily.temperature_2m_max[0]|round}° / {fc.daily.temperature_2m_min[0]|round}°"
},
"delta": {
"template": "{fc.daily.precipitation_probability_max[0]}% chance of rain"
}
}
}
},
{
"id": "rain",
"type": "columns",
"label": "Next 2 hours",
"unit": "in",
"series": [
"Rain"
],
"baseline": "zero",
"items": [
{
"label": "Now",
"values": [
0
]
},
{
"label": "15m",
"values": [
0
]
},
{
"label": "30m",
"values": [
0
]
},
{
"label": "45m",
"values": [
0
]
},
{
"label": "1h",
"values": [
0
]
},
{
"label": "1h 15",
"values": [
0
]
},
{
"label": "1h 30",
"values": [
0
]
},
{
"label": "1h 45",
"values": [
0
]
}
],
"source": {
"ref": "weather",
"when": {
"path": "wet_slots",
"gt": 0
},
"map": {
"label": {
"if": {
"path": "fc.minutely_15.precipitation[0]",
"gt": 0
},
"then": {
"if": {
"path": "rain_stops",
"exists": true
},
"then": {
"template": "Rain stopping {rain_stops|in}"
},
"else": {
"template": "Rain for the next 2 hours"
}
},
"else": {
"template": "Rain starting {rain_starts|in}"
}
},
"items[0].values[0]": {
"path": "rain[0]",
"round": 2
},
"items[1].values[0]": {
"path": "rain[1]",
"round": 2
},
"items[2].values[0]": {
"path": "rain[2]",
"round": 2
},
"items[3].values[0]": {
"path": "rain[3]",
"round": 2
},
"items[4].values[0]": {
"path": "rain[4]",
"round": 2
},
"items[5].values[0]": {
"path": "rain[5]",
"round": 2
},
"items[6].values[0]": {
"path": "rain[6]",
"round": 2
},
"items[7].values[0]": {
"path": "rain[7]",
"round": 2
}
}
}
},
{
"id": "hours",
"type": "columns",
"label": "Next 24 hours",
"unit": "°F",
"series": [
"Temperature"
],
"baseline": "auto",
"values_on_top": true,
"items": [],
"source": {
"ref": "weather",
"map": {
"highlight": {
"template": "{fc.hourly.time[0]|hour}"
},
"items": {
"each": "fc.hourly",
"zip": true,
"limit": 24,
"buckets": 12,
"keep": {
"min": "time"
},
"fields": {
"label": {
"template": "{time|hour}"
},
"values[0]": {
"path": "temperature_2m",
"round": 0
}
}
}
}
}
},
{
"id": "conditions",
"type": "facts",
"label": "Conditions",
"items": [
{
"key": "Air quality",
"value": "—"
},
{
"key": "UV index",
"value": "—"
},
{
"key": "Wind",
"value": "—"
},
{
"key": "Humidity",
"value": "—"
},
{
"key": "Pressure",
"value": "—"
},
{
"key": "Visibility",
"value": "—"
}
],
"source": {
"ref": "weather",
"map": {
"items[0].value": {
"if": {
"path": "air.current.us_aqi",
"lt": 51
},
"then": {
"template": "Good"
},
"else": {
"if": {
"path": "air.current.us_aqi",
"lt": 101
},
"then": {
"template": "Moderate"
},
"else": {
"if": {
"path": "air.current.us_aqi",
"lt": 151
},
"then": {
"template": "Unhealthy for sensitive groups"
},
"else": {
"if": {
"path": "air.current.us_aqi",
"lt": 201
},
"then": {
"template": "Unhealthy"
},
"else": {
"if": {
"path": "air.current.us_aqi",
"lt": 301
},
"then": {
"template": "Very unhealthy"
},
"else": {
"template": "Hazardous"
}
}
}
}
}
},
"items[1].value": {
"if": {
"path": "uv_peak[0].time",
"exists": true
},
"then": {
"template": "{fc.current.uv_index|round} now · {uv_peak[0].uvi} at {uv_peak[0].time|clock_hour}"
},
"else": {
"template": "{fc.current.uv_index|round} now"
}
},
"items[2].value": {
"template": "{fc.current.wind_speed_10m|round} mph {fc.current.wind_direction_10m|compass} · gusts {fc.current.wind_gusts_10m|round}"
},
"items[3].value": {
"template": "{fc.current.relative_humidity_2m}% · dew point {fc.current.dew_point_2m|round}°"
},
"items[4].value": {
"template": "{pressure_inhg} inHg"
},
"items[5].value": {
"template": "{visibility_mi} mi"
}
}
}
},
{
"id": "pollen",
"type": "facts",
"label": "Pollen",
"items": [],
"source": {
"ref": "weather",
"when": {
"path": "pollen_count",
"gt": 0
},
"map": {
"items": {
"each": "pollen",
"fields": {
"key": "key",
"value": {
"template": "{grains} grains/m³"
}
}
}
}
}
},
{
"id": "daylight",
"type": "window",
"label": "Daylight left",
"start": "2026-01-01T12:00:00Z",
"end": "2026-01-01T23:00:00Z",
"start_label": "Sunrise",
"end_label": "Sunset",
"before_label": "Until sunrise",
"after_label": "Until sunrise",
"source": {
"ref": "weather",
"map": {
"start": "fc.daily.sunrise[0]",
"end": "fc.daily.sunset[0]",
"next_start": "fc.daily.sunrise[1]"
}
}
},
{
"id": "week",
"type": "ranges",
"label": "This week",
"unit": "°F",
"colors": "temperature",
"info_colors": [
"green",
"blue"
],
"muted": false,
"items": [
{
"label": "Today",
"low": 0,
"high": 1
}
],
"source": {
"ref": "weather",
"map": {
"items": {
"each": "fc.daily",
"zip": true,
"limit": 8,
"fields": {
"label": {
"template": "{time|weekday}"
},
"low": {
"path": "temperature_2m_min",
"round": 0
},
"high": {
"path": "temperature_2m_max",
"round": 0
},
"icon": {
"path": "weather_code",
"values": {
"0": "sun.max",
"1": "sun.max",
"2": "cloud.sun",
"3": "cloud",
"45": "cloud.fog",
"48": "cloud.fog",
"51": "cloud.drizzle",
"53": "cloud.drizzle",
"55": "cloud.drizzle",
"56": "cloud.sleet",
"57": "cloud.sleet",
"61": "cloud.rain",
"63": "cloud.rain",
"65": "cloud.heavyrain",
"66": "cloud.sleet",
"67": "cloud.sleet",
"71": "cloud.snow",
"73": "cloud.snow",
"75": "cloud.snow",
"77": "cloud.snow",
"80": "cloud.sun.rain",
"81": "cloud.rain",
"82": "cloud.heavyrain",
"85": "cloud.snow",
"86": "cloud.snow",
"95": "cloud.bolt",
"96": "cloud.bolt.rain",
"99": "cloud.bolt.rain"
},
"default": "cloud"
},
"info[0]": {
"template": "{wind_speed_10m_max|round} {wind_direction_10m_dominant|compass}"
},
"info[1]": {
"if": {
"path": "precipitation_probability_max",
"gte": 10
},
"then": {
"template": "{precipitation_probability_max}%"
},
"else": {
"template": ""
}
}
}
},
"items[0].now": {
"path": "fc.current.temperature_2m",
"round": 0
}
}
}
},
{
"id": "notable",
"type": "list",
"layout": "chips",
"max_items": 3,
"items": [],
"source": {
"ref": "weather",
"when": {
"path": "notable_count",
"gt": 0
},
"map": {
"items": {
"each": "notables",
"fields": {
"text": "text",
"icon": "icon"
}
}
}
}
}
]
}
```
## Questions
### Can I use it for free?
For your own weather, yes. Open-Meteo’s free API is for non-commercial use, which its terms say includes personal home automation, and allows 10,000 calls a day. For anything commercial, Open-Meteo sells API plans; with one, change the first two requests to its `customer-` hosts and add your key as `apikey`.
### Where does the data come from?
Open-Meteo combines national weather models and publishes the result under CC BY 4.0: weather data by [Open-Meteo.com](https://open-meteo.com). The Now card links there. Air quality and pollen come from the EU’s Copernicus service, through Open-Meteo. Alerts come from the US National Weather Service.
### Why are there no alerts where I live?
They come from the US National Weather Service, so outside the US the alert card never shows. Open-Meteo itself has no alerts. The [OpenWeather page](https://legatobar.com/services/weather) passes on alerts from other countries’ weather services, with a free key.
Legato is independent and isn’t affiliated with or endorsed by Open-Meteo or the National Weather Service.
## Verification
The page was filled from Open-Meteo’s forecast and air-quality APIs and the National Weather Service’s alerts API on 9 Nov 2026. The example page has tests with made-up answers for a stormy morning. The illustration uses a made-up place, readings and alert. See the [service index](https://legatobar.com/services/) for other examples.
---
# Plex in your Mac’s menu bar
See what’s playing on your Plex server without opening it: each stream with its poster, how far along it is and who’s watching on what, a shelf of what was just added, and how much each library holds. The page turns red only if the server stops answering.
## What you’ll see
- **Plex:**
- **Health:** in Details, the server’s name and version, and "Update ready" when Plex has an update waiting. Once the server stops answering, the health card turns red, and Legato sends a notification. Nothing else counts as a problem.
- **Now playing:** each stream with its poster (a show’s, or an album’s cover; a film, show or note icon when there’s none), its title and episode, a bar with "31 of 47 min", who’s watching on which player, and whether it plays directly or is transcoding. A paused stream says Paused. On a server with Plex Pass, point at a row for **Stop**, which asks first. A live channel or a photo slideshow isn’t listed. Someone watching never counts as a problem.
- **Recently added:** a shelf of the four newest films, seasons and albums, with their posters. Each opens in Plex Web.
- **Libraries:** each library with what it holds ("1,204 movies", "312 shows · 9,870 episodes"). Plex counts by kind across the server, so two libraries of the same kind (Shows and Kids, say) each just say Shows; their own pages have their counts. Each row opens that library’s page.
- **Library:** one page for every library, titled with its name: how many titles it holds, its kind and folder, and the latest fifteen added, each opening in Plex Web.
### Status
- Watches whether the server answers, not who’s watching.
- Red once the server stops answering.
- An update waiting, someone watching or a transcode never counts as a problem.
- Notifies you when it turns orange or red.
## How it connects
The pages read your server’s own API with your Plex token, sent as `X-Plex-Token`, and ask for JSON with `Accept: application/json`.
| Request | Pages | When | What it supplies |
| --- | --- | --- | --- |
| `GET /status/sessions` | Plex | Once a minute | Who’s playing what, where it’s up to, and how it plays. |
| `GET /` | Plex, Library | Once a minute, and every 5 and 15 minutes | The server’s name, version and id (for links into Plex Web), and whether it has Plex Pass, which Stop needs. |
| `GET /updater/status` | Plex | Every 5 minutes | Whether an update is waiting. |
| `GET /library/sections` | Plex, Library | Every 15 minutes | The libraries, their kinds and folders. |
| `GET /library/recentlyAdded?X-Plex-Container-Start=0&X-Plex-Container-Size=8` | Plex | Every 15 minutes | What was added most recently. |
| `GET /library/all?type=1&X-Plex-Container-Start=0&X-Plex-Container-Size=0` | Plex | Every 15 minutes | How many films the server holds (and `type=2`, `4`, `9`, `10` for shows, episodes, albums and songs). |
| `GET /library/all?type=2&X-Plex-Container-Start=0&X-Plex-Container-Size=0` | Plex | Every 15 minutes | How many shows. |
| `GET /library/all?type=4&X-Plex-Container-Start=0&X-Plex-Container-Size=0` | Plex | Every 15 minutes | How many episodes. |
| `GET /library/all?type=9&X-Plex-Container-Start=0&X-Plex-Container-Size=0` | Plex | Every 15 minutes | How many albums. |
| `GET /library/all?type=10&X-Plex-Container-Start=0&X-Plex-Container-Size=0` | Plex | Every 15 minutes | How many songs. |
| `GET /library/sections/{param.id}/all?X-Plex-Container-Start=0&X-Plex-Container-Size=0` | Library | Every 15 minutes | How many titles the library holds. |
| `GET /library/sections/{param.id}/recentlyAdded` | Library | Every 15 minutes | What was added to it most recently. |
| `GET /library/metadata/{id}/thumb/{time}` | Plex, Library | While the panel shows the row | Posters and covers the server has, kept on this Mac. |
| `POST /status/sessions/terminate?sessionId={id}&reason=Stopped%20from%20Legato` | Plex | When you press Stop and confirm | Stops that stream; the viewer sees "Stopped from Legato". |
That’s about 180 requests an hour with the overview open, plus a poster the first time each one shows. Posters come only from your server, never from another site, and **Load icons from the web** in Settings doesn’t affect them.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Find your token.** Plex’s guide, [Finding an authentication token](https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/), shows where: sign in to Plex Web as the server’s owner, open any item’s **Get Info → View XML**, and copy the `X-Plex-Token` at the end of the address. Use the classic token that way; Plex’s newer sign-in tokens last only 7 days.
2. **Save it in Legato.** In Settings → Secrets, save the token under `plex`, bound to your server’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download the two pages and run `/Applications/Legato.app/Contents/Helpers/legato set plex-library plex-library.json`, then `legato set plex plex.json`. Keep the ID `plex-library`: every library row opens it with that library’s key.
4. **Point them at your server.** Change `http://plex.local:32400` to your server’s local address on every source of both pages. Use plain `http://` with the server’s address on your network: an `https://` address by IP fails Plex’s certificate.
The cards fill within a minute. A mistyped token is the usual reason they don’t: the page then notes that the server refused it.
### Prompt for your agent
```prompt
Add 2 Legato pages for Plex, starting from https://legatobar.com/examples/plex.json, https://legatobar.com/examples/plex-library.json. Use the page IDs plex, plex-library if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add the pages as they are, keeping their page IDs, and change http://plex.local:32400 on every source to my server’s address. I’ll save my Plex token as plex in Settings → Secrets myself. Don’t press Stop to test it.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Plex (plex.json)](https://legatobar.com/examples/plex.json)
- [Download Library (plex-library.json)](https://legatobar.com/examples/plex-library.json)
## Questions
### Why don’t I see Stop on a row?
Stopping someone’s stream is a Plex Pass feature, so Stop shows only when the server has Plex Pass. Plex has no other way to message a viewer; when you stop a stream, they see "Stopped from Legato".
### Why isn’t transcoding a warning?
Transcoding is the server doing its job: a phone that can’t play a film’s format still gets it. The row says Transcoding so you can see it; it never counts as a problem.
### Why does an update waiting not count as a problem?
An update can wait until it suits you, so the status card just says "Update ready". The page counts it as a problem only when the server stops answering.
### What happens to the posters?
Legato fetches each poster from your server with your token, only while it’s on screen, and keeps up to 50 MB of them on this Mac, the oldest going first. They never go anywhere else.
Legato is independent and isn’t affiliated with or endorsed by Plex.
## Verification
The pages were filled from a Plex Media Server 1.43.5 on 9 Nov 2026 with made-up players reporting playback, open films, and a made-up series and album. That server wasn’t signed in to Plex, so Stop and viewers’ names are checked by tests with made-up answers rather than live. Illustrations use made-up titles, people and numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# Sonarr in your Mac’s menu bar
See what Sonarr is doing without opening it: what’s downloading and how far along it is, what airs this week, which episodes it still hasn’t found, and whether its own health checks have found a problem.
## What you’ll see
- **Health:** in Details, Sonarr’s version, or its worst health check in its own words ("No indexers available with RSS sync enabled…") and how many others there are. An error turns the health card red and a warning turns it orange, and either sends a notification. A notice, such as an update being ready, doesn’t. It also turns red once Sonarr stops answering.
- **Queue:** each download with its show’s poster, the episode, a bar with "3.1 of 4.2 GB", the download client and when it should finish. A download that needs you comes first and says so ("Import blocked", "Failed"); a paused or queued one says Paused or Queued. The card draws up to 20. Any past those, and any whose size isn’t known yet, are counted underneath ("3 more in Sonarr"). Point at a row for **Remove**, which asks first: it takes the download off the client and blocks that release, so Sonarr looks for another.
- **Upcoming:** the next 7 days of episodes, grouped by day, with each episode’s number and title.
- **Recently missing:** the four most recently aired episodes Sonarr hasn’t found. Point at a row for **Search**, which asks Sonarr to search for that episode now.
- **Library:** how many episodes are missing, how many are on disk out of those aired, how many series you have, and the free space on your root folder.
### Status
- Shows Sonarr’s own health checks.
- Red for an error, orange for a warning.
- A notice never counts as a problem.
- Red once Sonarr stops answering.
- Notifies you when it turns orange or red.
## How it connects
The page reads Sonarr’s v3 API with your API key, sent as `X-Api-Key`.
| Request | When | What it supplies |
| --- | --- | --- |
| `GET /api/v3/system/status` | Every 5 minutes | Sonarr’s version and instance name. |
| `GET /api/v3/health` | Every 5 minutes | Sonarr’s own health checks. |
| `GET /api/v3/queue?page=1&pageSize=20&includeSeries=true&includeEpisode=true` | Once a minute | What’s downloading, how far along it is, and what needs you. |
| `GET /api/v3/calendar?start={date.today}&end={date.days_ahead_7}&includeSeries=true` | Every 15 minutes | Episodes airing in the next 7 days. |
| `GET /api/v3/wanted/missing?page=1&pageSize=4&sortKey=episodes.airDateUtc&sortDirection=descending&includeSeries=true` | Every 15 minutes | The most recently aired missing episodes, and how many are missing. |
| `GET /api/v3/series` | Every 15 minutes | How many series, and their episode counts. |
| `GET /api/v3/rootfolder` | Every 15 minutes | Your root folder and its free space. |
| `GET /api/v3/mediacover/{seriesId}/poster-250.jpg` | While the panel shows the row | Each show’s poster, kept on this Mac. |
| `DELETE /api/v3/queue/{id}?removeFromClient=true&blocklist=true` | When you press Remove and confirm | Removes the download from the client and blocks that release. |
| `POST /api/v3/command` | When you press Search | Starts an `EpisodeSearch` for that episode. |
That’s about 100 requests an hour with the page open, plus a poster the first time each one shows. Posters come only from your Sonarr, and **Load icons from the web** in Settings doesn’t affect them.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Find your API key.** In Sonarr, open **Settings → General**. The key is under **Security**.
2. **Save it in Legato.** In Settings → Secrets, save the key under `sonarr`, bound to your Sonarr’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the page.** Paste the prompt into your agent, or download the page and run `/Applications/Legato.app/Contents/Helpers/legato set sonarr sonarr.json`.
4. **Point it at Sonarr.** Change `http://sonarr.local:8989` to your Sonarr’s address on every source. If Sonarr sits behind a reverse proxy at a path, such as `https://media.example.com/sonarr`, set the source’s `url` to `https://media.example.com` and add `"base": "/sonarr"`.
The cards fill within a minute. A mistyped key is the usual reason they don’t: the page then notes that Sonarr refused it.
### Prompt for your agent
```prompt
Add a Legato page for Sonarr, starting from https://legatobar.com/examples/sonarr.json.
Add the page as it is and change http://sonarr.local:8989 on every source to my Sonarr’s address. I’ll save my API key as sonarr in Settings → Secrets myself. Don’t press Remove or Search to test them.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the page
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "Sonarr",
"icon": "tv",
"sources": {
"health": {
"url": "http://sonarr.local:8989",
"secret": "sonarr",
"auth": {
"type": "header",
"name": "X-Api-Key"
},
"every": "5m",
"requests": {
"status": "/api/v3/system/status",
"health": "/api/v3/health"
},
"derive": [
{
"name": "errors",
"value": {
"count": "health",
"where": {
"path": "type",
"equals": "error"
},
"default": 0
}
},
{
"name": "warnings",
"value": {
"count": "health",
"where": {
"path": "type",
"equals": "warning"
},
"default": 0
}
},
{
"name": "problems",
"value": {
"count": "health",
"where": {
"path": "type",
"in": [
"error",
"warning"
]
},
"default": 0
}
},
{
"name": "worst",
"value": {
"if": {
"path": "errors",
"gt": 0
},
"then": {
"first": "message",
"of": "health",
"where": {
"path": "type",
"equals": "error"
}
},
"else": {
"first": "message",
"of": "health",
"where": {
"path": "type",
"equals": "warning"
}
}
}
},
{
"name": "problems_more",
"value": {
"subtract": [
"problems",
1
]
}
}
]
},
"queue": {
"url": "http://sonarr.local:8989",
"secret": "sonarr",
"auth": {
"type": "header",
"name": "X-Api-Key"
},
"every": "1m",
"requests": {
"queue": "/api/v3/queue?page=1&pageSize=20&includeSeries=true&includeEpisode=true"
},
"derive": [
{
"name": "queue_first",
"value": {
"each": "queue.records",
"fields": {
"id": "id",
"title": {
"if": {
"path": "series.title",
"exists": true
},
"then": {
"template": "{series.title}"
},
"else": {
"template": "{title|clip:60}"
}
},
"subtitle": {
"if": {
"path": "episode",
"exists": true
},
"then": {
"template": "S{episode.seasonNumber|pad:2}E{episode.episodeNumber|pad:2} · {episode.title|clip:50}"
},
"else": {
"template": ""
}
},
"client": {
"if": {
"path": "downloadClient",
"exists": true
},
"then": {
"template": "{downloadClient}"
},
"else": {
"template": "{protocol|title}"
}
},
"done": {
"subtract": [
"size",
"sizeleft"
],
"scale": 1e-09,
"round": 1
},
"total": {
"path": "size",
"scale": 1e-09,
"round": 1
},
"state": {
"if": {
"path": "trackedDownloadState",
"equals": "importBlocked"
},
"then": {
"template": "Import blocked"
},
"else": {
"if": {
"path": "trackedDownloadState",
"equals": "importPending"
},
"then": {
"template": "Waiting to import"
},
"else": {
"if": {
"path": "trackedDownloadStatus",
"equals": "error"
},
"then": {
"template": "Failed"
},
"else": {
"path": "status",
"values": {
"paused": "Paused",
"queued": "Queued",
"delay": "Delayed",
"warning": "Needs attention"
},
"default": ""
}
}
}
},
"eta": {
"if": {
"path": "estimatedCompletionTime",
"exists": true
},
"then": {
"template": " · {estimatedCompletionTime|in}"
},
"else": {
"template": ""
}
},
"image": {
"template": "/api/v3/mediacover/{seriesId|raw}/poster-250.jpg"
}
},
"where": {
"all": [
{
"path": "size",
"gt": 0
},
{
"path": "trackedDownloadStatus",
"in": [
"warning",
"error"
]
}
]
}
}
},
{
"name": "queue_rest",
"value": {
"each": "queue.records",
"fields": {
"id": "id",
"title": {
"if": {
"path": "series.title",
"exists": true
},
"then": {
"template": "{series.title}"
},
"else": {
"template": "{title|clip:60}"
}
},
"subtitle": {
"if": {
"path": "episode",
"exists": true
},
"then": {
"template": "S{episode.seasonNumber|pad:2}E{episode.episodeNumber|pad:2} · {episode.title|clip:50}"
},
"else": {
"template": ""
}
},
"client": {
"if": {
"path": "downloadClient",
"exists": true
},
"then": {
"template": "{downloadClient}"
},
"else": {
"template": "{protocol|title}"
}
},
"done": {
"subtract": [
"size",
"sizeleft"
],
"scale": 1e-09,
"round": 1
},
"total": {
"path": "size",
"scale": 1e-09,
"round": 1
},
"state": {
"if": {
"path": "trackedDownloadState",
"equals": "importBlocked"
},
"then": {
"template": "Import blocked"
},
"else": {
"if": {
"path": "trackedDownloadState",
"equals": "importPending"
},
"then": {
"template": "Waiting to import"
},
"else": {
"if": {
"path": "trackedDownloadStatus",
"equals": "error"
},
"then": {
"template": "Failed"
},
"else": {
"path": "status",
"values": {
"paused": "Paused",
"queued": "Queued",
"delay": "Delayed",
"warning": "Needs attention"
},
"default": ""
}
}
}
},
"eta": {
"if": {
"path": "estimatedCompletionTime",
"exists": true
},
"then": {
"template": " · {estimatedCompletionTime|in}"
},
"else": {
"template": ""
}
},
"image": {
"template": "/api/v3/mediacover/{seriesId|raw}/poster-250.jpg"
}
},
"where": {
"all": [
{
"path": "size",
"gt": 0
},
{
"path": "trackedDownloadStatus",
"not": "warning"
},
{
"path": "trackedDownloadStatus",
"not": "error"
}
]
}
}
},
{
"name": "queue_rows",
"value": {
"each": [
"queue_first",
"queue_rest"
],
"fields": {
"id": "id",
"title": "title",
"subtitle": "subtitle",
"client": "client",
"done": "done",
"total": "total",
"state": "state",
"eta": "eta",
"image": "image"
}
}
},
{
"name": "drawn",
"value": {
"count": "queue_rows",
"default": 0
}
},
{
"name": "others",
"value": {
"subtract": [
{
"path": "queue.totalRecords",
"default": 0
},
"drawn"
],
"default": 0
}
},
{
"name": "sizeless",
"value": {
"count": "queue.records",
"where": {
"path": "size",
"lte": 0
},
"default": 0
}
},
{
"name": "empty_text",
"value": {
"if": {
"path": "sizeless",
"gt": 0
},
"then": {
"template": "{sizeless} with no size yet"
},
"else": {
"template": "Nothing in the queue"
}
}
}
]
},
"library": {
"url": "http://sonarr.local:8989",
"secret": "sonarr",
"auth": {
"type": "header",
"name": "X-Api-Key"
},
"every": "15m",
"requests": {
"calendar": "/api/v3/calendar?start={date.today}&end={date.days_ahead_7}&includeSeries=true",
"missing": "/api/v3/wanted/missing?page=1&pageSize=4&sortKey=episodes.airDateUtc&sortDirection=descending&includeSeries=true",
"series": "/api/v3/series",
"roots": "/api/v3/rootfolder"
},
"derive": [
{
"name": "free_gb",
"value": {
"first": "freeSpace",
"of": "roots",
"scale": 1e-09,
"round": 0
}
},
{
"name": "root_path",
"value": {
"first": "path",
"of": "roots"
}
},
{
"name": "missing_count",
"value": {
"count": "missing.records",
"default": 0
}
},
{
"name": "series_count",
"value": {
"count": "series",
"default": 0
}
},
{
"name": "files",
"value": {
"sum": "statistics.episodeFileCount",
"of": "series",
"default": 0
}
},
{
"name": "episodes",
"value": {
"sum": "statistics.episodeCount",
"of": "series",
"default": 0
}
}
]
}
},
"cards": [
{
"id": "health",
"type": "status",
"placement": "page_info",
"label": "Sonarr",
"state": "unknown",
"width": "full",
"source": {
"ref": "health",
"map": {
"label": {
"if": {
"path": "status.instanceName",
"exists": true
},
"then": {
"template": "{status.instanceName}"
},
"else": {
"template": "Sonarr"
}
},
"state": {
"if": {
"path": "errors",
"gt": 0
},
"then": {
"template": "critical"
},
"else": {
"if": {
"path": "warnings",
"gt": 0
},
"then": {
"template": "warning"
},
"else": {
"template": "ok"
}
}
},
"detail": {
"if": {
"path": "problems",
"equals": 0
},
"then": {
"template": "Sonarr {status.version} · No problems"
},
"else": {
"if": {
"path": "problems",
"equals": 1
},
"then": {
"template": "{worst|clip:110}"
},
"else": {
"template": "{worst|clip:90} · and {problems_more} more"
}
}
}
},
"failed": {
"state": "critical",
"detail": "The server isn't answering",
"after": 3
}
}
},
{
"id": "queue",
"type": "pacing",
"label": "Queue",
"unit": "GB",
"items": [],
"source": {
"ref": "queue",
"empty": {
"text": "{empty_text}",
"when": {
"path": "drawn",
"equals": 0
}
},
"map": {
"items": {
"each": "queue_rows",
"fields": {
"key": "id",
"label": "title",
"subtitle": "subtitle",
"state": "state",
"detail": {
"template": "{client}{eta}"
},
"value": "done",
"target": "total",
"image": "image",
"image_shape": {
"template": "poster"
}
}
},
"detail": {
"if": {
"path": "others",
"gt": 0
},
"then": {
"template": "{others} more in Sonarr"
}
}
}
},
"row_actions": [
{
"label": "Remove",
"icon": "xmark",
"method": "DELETE",
"path": "/api/v3/queue/{id}?removeFromClient=true&blocklist=true",
"confirm": {
"message": "Remove {title} from {client} and block this release? Sonarr will look for another.",
"button": "Remove"
}
}
]
},
{
"id": "upcoming",
"type": "agenda",
"label": "Upcoming",
"days": 7,
"max_events": 7,
"hide_empty_days": true,
"items": [],
"source": {
"ref": "library",
"map": {
"items": {
"each": "calendar",
"fields": {
"title": {
"template": "{series.title}"
},
"start": "airDateUtc",
"detail": {
"template": "S{seasonNumber|pad:2}E{episodeNumber|pad:2} · {title|clip:70}"
}
}
}
}
}
},
{
"id": "missing",
"type": "list",
"label": "Recently missing",
"max_items": 4,
"items": [],
"source": {
"ref": "library",
"empty": {
"text": "Nothing missing",
"when": {
"path": "missing_count",
"equals": 0
}
},
"map": {
"items": {
"each": "missing.records",
"fields": {
"key": "id",
"text": {
"template": "{series.title} · S{seasonNumber|pad:2}E{episodeNumber|pad:2}"
},
"detail": {
"template": "Aired {airDateUtc|ago}"
}
}
}
}
},
"row_actions": [
{
"label": "Search",
"icon": "magnifyingglass",
"method": "POST",
"path": "/api/v3/command",
"body": {
"name": "EpisodeSearch",
"episodeIds": [
"{id}"
]
}
}
]
},
{
"id": "library",
"type": "facts",
"label": "Library",
"items": [
{
"key": "Missing",
"value": "—"
},
{
"key": "Episodes on disk",
"value": "—"
},
{
"key": "Series",
"value": "—"
},
{
"key": "Free space",
"value": "—"
}
],
"source": {
"ref": "library",
"map": {
"items[0].value": {
"template": "{missing.totalRecords} episodes"
},
"items[1].value": {
"template": "{files} of {episodes}"
},
"items[2].value": "series_count",
"items[3].value": {
"template": "{free_gb} GB on {root_path}"
}
}
}
}
]
}
```
## Questions
### Why is the page red when everything downloads fine?
Sonarr reports its own problems, and the page shows them as Sonarr rates them. A fresh install with no indexers or download client reports an error until you add them.
### Why does Remove block the release?
So Sonarr doesn’t grab the same broken or wrong release again. It looks for another one straight away. To take a download off without blocking it, use Sonarr itself.
### Why isn’t there a Search all?
Searching for every missing episode at once can send hundreds of searches to your indexers. Search on a row asks for one episode; Sonarr’s own **Wanted** page can search for all of them when you mean to.
### Does it work with Radarr?
Yes: the [Radarr page](https://legatobar.com/services/radarr) has the same layout for films.
Legato is independent and isn’t affiliated with or endorsed by Sonarr.
## Verification
The page was filled from Sonarr 4.0.20 on 9 Nov 2026, following four series with no download client, so the queue and Remove are checked by tests with made-up answers rather than live. Illustrations use made-up titles, clients and numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# Radarr in your Mac’s menu bar
See what Radarr is doing without opening it: what’s downloading and how far along it is, which films come out this month, which ones it still hasn’t found, and whether its own health checks have found a problem.
## What you’ll see
- **Health:** in Details, Radarr’s version, or its worst health check in its own words and how many others there are. An error turns the health card red and a warning turns it orange, and either sends a notification. A notice, such as an update being ready, doesn’t. It also turns red once Radarr stops answering.
- **Queue:** each download with its film’s poster and year, a bar with "6.4 of 11.2 GB", the download client and when it should finish. A download that needs you comes first and says so ("Import blocked", "Failed"). The card draws up to 20. Any past those, and any whose size isn’t known yet, are counted underneath ("3 more in Radarr"). Point at a row for **Remove**, which asks first: it takes the download off the client and blocks that release, so Radarr looks for another.
- **Upcoming:** the next 30 days of releases, each on its own day: In cinemas, Digital release or On disc. A film with all three shows up three times.
- **Recently missing:** four films Radarr hasn’t found, the most recent digital releases first. Point at a row for **Search**, which asks Radarr to search for that film now.
- **Library:** how many films are missing and the free space on your root folder.
### Status
- Shows Radarr’s own health checks.
- Red for an error, orange for a warning.
- A notice never counts as a problem.
- Red once Radarr stops answering.
- Notifies you when it turns orange or red.
## How it connects
The page reads Radarr’s v3 API with your API key, sent as `X-Api-Key`.
| Request | When | What it supplies |
| --- | --- | --- |
| `GET /api/v3/system/status` | Every 5 minutes | Radarr’s version and instance name. |
| `GET /api/v3/health` | Every 5 minutes | Radarr’s own health checks. |
| `GET /api/v3/queue?page=1&pageSize=20&includeMovie=true` | Once a minute | What’s downloading, how far along it is, and what needs you. |
| `GET /api/v3/calendar?start={date.today}&end={date.days_ahead_30}` | Every 15 minutes | Films with a cinema, digital or disc release in the next 30 days. |
| `GET /api/v3/wanted/missing?page=1&pageSize=4&sortKey=movies.digitalRelease&sortDirection=descending` | Every 15 minutes | Four missing films, and how many are missing. |
| `GET /api/v3/rootfolder` | Every 15 minutes | Your root folder and its free space. |
| `GET /api/v3/mediacover/{movieId}/poster-250.jpg` | While the panel shows the row | Each film’s poster, kept on this Mac. |
| `DELETE /api/v3/queue/{id}?removeFromClient=true&blocklist=true` | When you press Remove and confirm | Removes the download from the client and blocks that release. |
| `POST /api/v3/command` | When you press Search | Starts a `MoviesSearch` for that film. |
That’s about 96 requests an hour with the page open, plus a poster the first time each one shows. Posters come only from your Radarr, and **Load icons from the web** in Settings doesn’t affect them.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Find your API key.** In Radarr, open **Settings → General**. The key is under **Security**.
2. **Save it in Legato.** In Settings → Secrets, save the key under `radarr`, bound to your Radarr’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the page.** Paste the prompt into your agent, or download the page and run `/Applications/Legato.app/Contents/Helpers/legato set radarr radarr.json`.
4. **Point it at Radarr.** Change `http://radarr.local:7878` to your Radarr’s address on every source. If Radarr sits behind a reverse proxy at a path, such as `https://media.example.com/radarr`, set the source’s `url` to `https://media.example.com` and add `"base": "/radarr"`.
The cards fill within a minute. A mistyped key is the usual reason they don’t: the page then notes that Radarr refused it.
### Prompt for your agent
```prompt
Add a Legato page for Radarr, starting from https://legatobar.com/examples/radarr.json.
Add the page as it is and change http://radarr.local:7878 on every source to my Radarr’s address. I’ll save my API key as radarr in Settings → Secrets myself. Don’t press Remove or Search to test them.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the page
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "Radarr",
"icon": "film",
"sources": {
"health": {
"url": "http://radarr.local:7878",
"secret": "radarr",
"auth": {
"type": "header",
"name": "X-Api-Key"
},
"every": "5m",
"requests": {
"status": "/api/v3/system/status",
"health": "/api/v3/health"
},
"derive": [
{
"name": "errors",
"value": {
"count": "health",
"where": {
"path": "type",
"equals": "error"
},
"default": 0
}
},
{
"name": "warnings",
"value": {
"count": "health",
"where": {
"path": "type",
"equals": "warning"
},
"default": 0
}
},
{
"name": "problems",
"value": {
"count": "health",
"where": {
"path": "type",
"in": [
"error",
"warning"
]
},
"default": 0
}
},
{
"name": "worst",
"value": {
"if": {
"path": "errors",
"gt": 0
},
"then": {
"first": "message",
"of": "health",
"where": {
"path": "type",
"equals": "error"
}
},
"else": {
"first": "message",
"of": "health",
"where": {
"path": "type",
"equals": "warning"
}
}
}
},
{
"name": "problems_more",
"value": {
"subtract": [
"problems",
1
]
}
}
]
},
"queue": {
"url": "http://radarr.local:7878",
"secret": "radarr",
"auth": {
"type": "header",
"name": "X-Api-Key"
},
"every": "1m",
"requests": {
"queue": "/api/v3/queue?page=1&pageSize=20&includeMovie=true"
},
"derive": [
{
"name": "queue_first",
"value": {
"each": "queue.records",
"fields": {
"id": "id",
"title": {
"if": {
"path": "movie.title",
"exists": true
},
"then": {
"template": "{movie.title}"
},
"else": {
"template": "{title|clip:60}"
}
},
"subtitle": {
"if": {
"path": "movie.year",
"exists": true
},
"then": {
"template": "{movie.year|raw}"
},
"else": {
"template": ""
}
},
"client": {
"if": {
"path": "downloadClient",
"exists": true
},
"then": {
"template": "{downloadClient}"
},
"else": {
"template": "{protocol|title}"
}
},
"done": {
"subtract": [
"size",
"sizeleft"
],
"scale": 1e-09,
"round": 1
},
"total": {
"path": "size",
"scale": 1e-09,
"round": 1
},
"state": {
"if": {
"path": "trackedDownloadState",
"equals": "importBlocked"
},
"then": {
"template": "Import blocked"
},
"else": {
"if": {
"path": "trackedDownloadState",
"equals": "importPending"
},
"then": {
"template": "Waiting to import"
},
"else": {
"if": {
"path": "trackedDownloadStatus",
"equals": "error"
},
"then": {
"template": "Failed"
},
"else": {
"path": "status",
"values": {
"paused": "Paused",
"queued": "Queued",
"delay": "Delayed",
"warning": "Needs attention"
},
"default": ""
}
}
}
},
"eta": {
"if": {
"path": "estimatedCompletionTime",
"exists": true
},
"then": {
"template": " · {estimatedCompletionTime|in}"
},
"else": {
"template": ""
}
},
"image": {
"template": "/api/v3/mediacover/{movieId|raw}/poster-250.jpg"
}
},
"where": {
"all": [
{
"path": "size",
"gt": 0
},
{
"path": "trackedDownloadStatus",
"in": [
"warning",
"error"
]
}
]
}
}
},
{
"name": "queue_rest",
"value": {
"each": "queue.records",
"fields": {
"id": "id",
"title": {
"if": {
"path": "movie.title",
"exists": true
},
"then": {
"template": "{movie.title}"
},
"else": {
"template": "{title|clip:60}"
}
},
"subtitle": {
"if": {
"path": "movie.year",
"exists": true
},
"then": {
"template": "{movie.year|raw}"
},
"else": {
"template": ""
}
},
"client": {
"if": {
"path": "downloadClient",
"exists": true
},
"then": {
"template": "{downloadClient}"
},
"else": {
"template": "{protocol|title}"
}
},
"done": {
"subtract": [
"size",
"sizeleft"
],
"scale": 1e-09,
"round": 1
},
"total": {
"path": "size",
"scale": 1e-09,
"round": 1
},
"state": {
"if": {
"path": "trackedDownloadState",
"equals": "importBlocked"
},
"then": {
"template": "Import blocked"
},
"else": {
"if": {
"path": "trackedDownloadState",
"equals": "importPending"
},
"then": {
"template": "Waiting to import"
},
"else": {
"if": {
"path": "trackedDownloadStatus",
"equals": "error"
},
"then": {
"template": "Failed"
},
"else": {
"path": "status",
"values": {
"paused": "Paused",
"queued": "Queued",
"delay": "Delayed",
"warning": "Needs attention"
},
"default": ""
}
}
}
},
"eta": {
"if": {
"path": "estimatedCompletionTime",
"exists": true
},
"then": {
"template": " · {estimatedCompletionTime|in}"
},
"else": {
"template": ""
}
},
"image": {
"template": "/api/v3/mediacover/{movieId|raw}/poster-250.jpg"
}
},
"where": {
"all": [
{
"path": "size",
"gt": 0
},
{
"path": "trackedDownloadStatus",
"not": "warning"
},
{
"path": "trackedDownloadStatus",
"not": "error"
}
]
}
}
},
{
"name": "queue_rows",
"value": {
"each": [
"queue_first",
"queue_rest"
],
"fields": {
"id": "id",
"title": "title",
"subtitle": "subtitle",
"client": "client",
"done": "done",
"total": "total",
"state": "state",
"eta": "eta",
"image": "image"
}
}
},
{
"name": "drawn",
"value": {
"count": "queue_rows",
"default": 0
}
},
{
"name": "others",
"value": {
"subtract": [
{
"path": "queue.totalRecords",
"default": 0
},
"drawn"
],
"default": 0
}
},
{
"name": "sizeless",
"value": {
"count": "queue.records",
"where": {
"path": "size",
"lte": 0
},
"default": 0
}
},
{
"name": "empty_text",
"value": {
"if": {
"path": "sizeless",
"gt": 0
},
"then": {
"template": "{sizeless} with no size yet"
},
"else": {
"template": "Nothing in the queue"
}
}
}
]
},
"library": {
"url": "http://radarr.local:7878",
"secret": "radarr",
"auth": {
"type": "header",
"name": "X-Api-Key"
},
"every": "15m",
"requests": {
"calendar": "/api/v3/calendar?start={date.today}&end={date.days_ahead_30}",
"missing": "/api/v3/wanted/missing?page=1&pageSize=4&sortKey=movies.digitalRelease&sortDirection=descending",
"roots": "/api/v3/rootfolder"
},
"derive": [
{
"name": "free_gb",
"value": {
"first": "freeSpace",
"of": "roots",
"scale": 1e-09,
"round": 0
}
},
{
"name": "root_path",
"value": {
"first": "path",
"of": "roots"
}
},
{
"name": "missing_count",
"value": {
"count": "missing.records",
"default": 0
}
},
{
"name": "cinema",
"value": {
"each": "calendar",
"where": {
"path": "inCinemas",
"exists": true
},
"fields": {
"title": "title",
"start": {
"path": "inCinemas",
"match": "^([0-9]{4}-[0-9]{2}-[0-9]{2})"
},
"detail": {
"template": "In cinemas"
}
}
}
},
{
"name": "digital",
"value": {
"each": "calendar",
"where": {
"path": "digitalRelease",
"exists": true
},
"fields": {
"title": "title",
"start": {
"path": "digitalRelease",
"match": "^([0-9]{4}-[0-9]{2}-[0-9]{2})"
},
"detail": {
"template": "Digital release"
}
}
}
},
{
"name": "disc",
"value": {
"each": "calendar",
"where": {
"path": "physicalRelease",
"exists": true
},
"fields": {
"title": "title",
"start": {
"path": "physicalRelease",
"match": "^([0-9]{4}-[0-9]{2}-[0-9]{2})"
},
"detail": {
"template": "On disc"
}
}
}
},
{
"name": "releases",
"value": {
"each": [
"cinema",
"digital",
"disc"
],
"sort": {
"by": "start"
},
"fields": {
"title": "title",
"start": "start",
"detail": "detail"
}
}
}
]
}
},
"cards": [
{
"id": "health",
"type": "status",
"placement": "page_info",
"label": "Radarr",
"state": "unknown",
"width": "full",
"source": {
"ref": "health",
"map": {
"label": {
"if": {
"path": "status.instanceName",
"exists": true
},
"then": {
"template": "{status.instanceName}"
},
"else": {
"template": "Radarr"
}
},
"state": {
"if": {
"path": "errors",
"gt": 0
},
"then": {
"template": "critical"
},
"else": {
"if": {
"path": "warnings",
"gt": 0
},
"then": {
"template": "warning"
},
"else": {
"template": "ok"
}
}
},
"detail": {
"if": {
"path": "problems",
"equals": 0
},
"then": {
"template": "Radarr {status.version} · No problems"
},
"else": {
"if": {
"path": "problems",
"equals": 1
},
"then": {
"template": "{worst|clip:110}"
},
"else": {
"template": "{worst|clip:90} · and {problems_more} more"
}
}
}
},
"failed": {
"state": "critical",
"detail": "The server isn't answering",
"after": 3
}
}
},
{
"id": "queue",
"type": "pacing",
"label": "Queue",
"unit": "GB",
"items": [],
"source": {
"ref": "queue",
"empty": {
"text": "{empty_text}",
"when": {
"path": "drawn",
"equals": 0
}
},
"map": {
"items": {
"each": "queue_rows",
"fields": {
"key": "id",
"label": "title",
"subtitle": "subtitle",
"state": "state",
"detail": {
"template": "{client}{eta}"
},
"value": "done",
"target": "total",
"image": "image",
"image_shape": {
"template": "poster"
}
}
},
"detail": {
"if": {
"path": "others",
"gt": 0
},
"then": {
"template": "{others} more in Radarr"
}
}
}
},
"row_actions": [
{
"label": "Remove",
"icon": "xmark",
"method": "DELETE",
"path": "/api/v3/queue/{id}?removeFromClient=true&blocklist=true",
"confirm": {
"message": "Remove {title} from {client} and block this release? Radarr will look for another.",
"button": "Remove"
}
}
]
},
{
"id": "upcoming",
"type": "agenda",
"label": "Upcoming",
"days": 30,
"max_events": 7,
"hide_empty_days": true,
"hide_all_day_label": true,
"items": [],
"source": {
"ref": "library",
"map": {
"items": {
"each": "releases",
"fields": {
"title": "title",
"start": "start",
"detail": "detail"
}
}
}
}
},
{
"id": "missing",
"type": "list",
"label": "Recently missing",
"max_items": 4,
"items": [],
"source": {
"ref": "library",
"empty": {
"text": "Nothing missing",
"when": {
"path": "missing_count",
"equals": 0
}
},
"map": {
"items": {
"each": "missing.records",
"fields": {
"key": "id",
"text": {
"template": "{title}"
},
"detail": {
"if": {
"path": "year",
"exists": true
},
"then": {
"template": "{year|raw}"
},
"else": {
"template": ""
}
}
}
}
}
},
"row_actions": [
{
"label": "Search",
"icon": "magnifyingglass",
"method": "POST",
"path": "/api/v3/command",
"body": {
"name": "MoviesSearch",
"movieIds": [
"{id}"
]
}
}
]
},
{
"id": "library",
"type": "facts",
"label": "Library",
"items": [
{
"key": "Missing",
"value": "—"
},
{
"key": "Free space",
"value": "—"
}
],
"source": {
"ref": "library",
"map": {
"items[0].value": {
"template": "{missing.totalRecords} films"
},
"items[1].value": {
"template": "{free_gb} GB on {root_path}"
}
}
}
}
]
}
```
## Questions
### Why is the page red when everything downloads fine?
Radarr reports its own problems, and the page shows them as Radarr rates them. A fresh install with no indexers or download client reports an error until you add them.
### Why does Remove block the release?
So Radarr doesn’t grab the same broken or wrong release again. It looks for another one straight away. To take a download off without blocking it, use Radarr itself.
### Does it work with Sonarr?
Yes: the [Sonarr page](https://legatobar.com/services/sonarr) has the same layout for TV.
Legato is independent and isn’t affiliated with or endorsed by Radarr.
## Verification
The page was filled from Radarr 6.4.4 on 9 Nov 2026, following six films with no download client, so the queue and Remove are checked by tests with made-up answers rather than live. Illustrations use made-up titles, clients and numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# Docker containers in your Mac’s menu bar, through Portainer
See how every container on your Docker host is doing without opening Portainer: which need you, which have health checks, how many were running through the day, and each container’s CPU, memory and health checks on its own page. Docker’s own socket isn’t a web API, so the pages read it through Portainer CE.
## What you’ll see
- **Portainer:**
- **Containers:** every container as a dot, under Needs attention, Healthy, No health check and Stopped. A dot is red for an unhealthy container, one that exited with an error code, or one on your **keep-running** list that isn’t running. It’s orange while one restarts, and for 10 minutes after one that’s been around a while starts again, whether it crashed or you restarted it: that’s how a container that keeps crashing shows. A container that was stopped cleanly is grey and never counts as a problem, unless it’s on your keep-running list. Each dot opens that container’s page.
- **Running:** how many containers were running, over the last day.
- **Docker:** how many containers, in how many compose projects; the images, the space they take and how much of it belongs only to images no container uses; the Docker version, CPUs and memory; the volumes and the networks. **Remove unused images** in its corner asks first, then frees at least that much; the images can be pulled again.
- **Container:** one page for every container, titled with its name:
- how it stands now, with Start, Stop, Restart and **Pull and recreate** (the newest image, the same settings) in the card’s corner;
- its CPU and memory over the last hour, and its state over the last day;
- **Open:** a link to each port it publishes, on your environment’s Public IP, or to its `homepage.href` label;
- **Logs:** its last 10 log lines, errors marked;
- its image, compose project, restart policy, restarts and when it last started, its last four health checks, and its mounts.
Stop never shows for a container on your **keep-running** list. Without the list, every container has Stop.
### Status
- Watches every container.
- Red for an unhealthy container, one that exited with an error, or one on your keep-running list that isn’t running.
- Orange while one restarts, for 10 minutes after one starts again, or while its health check is starting.
- A container stopped cleanly never counts as a problem, unless it’s on your keep-running list.
- Red once Portainer stops answering.
- Notifies you when it turns orange or red.
## How it connects
The pages read Portainer CE’s API with your access token, sent as `X-API-Key`. Requests for containers go through Portainer to Docker on your host.
| Request | Pages | When | What it supplies |
| --- | --- | --- | --- |
| `GET /api/endpoints/1/docker/containers/json?all=1` | Portainer | Once a minute | Every container, its state and Docker’s own status words. The page shows up to 60, and says so when there are more. |
| `GET /api/docker/1/dashboard` | Portainer | Every 15 minutes | How many containers, images, volumes, networks and compose projects. |
| `GET /api/endpoints/1` | Portainer | Every 15 minutes | The Docker version, CPUs and memory. |
| `GET /api/endpoints/1/docker/system/df` | Portainer | Every 15 minutes | Which images no container uses, and their size. |
| `GET /api/system/version` | Portainer | Every hour | Whether a newer Portainer is out. Portainer asks GitHub each time, so it’s hourly. |
| `POST /api/endpoints/1/docker/images/prune?filters=%7B%22dangling%22%3A%7B%22false%22%3Atrue%7D%7D` | Portainer | When you press Remove unused images and confirm | Removes every image no container uses. |
| `GET /api/endpoints/{param.env}/docker/containers/{param.id}/json` | Container | Once a minute while open | The container’s state, health checks, restarts, ports and mounts. |
| `GET /api/endpoints/{param.env}` | Container | Once a minute while open | The environment’s Public IP, for the port links. |
| `GET /api/endpoints/{param.env}/docker/containers/{param.id}/stats?stream=false` | Container | Once a minute while open | Its CPU and memory. |
| `GET /api/endpoints/{param.env}/docker/containers/{param.id}/logs?stdout=1&stderr=1&tail=20×tamps=1` | Container | Once a minute while open | Its latest log lines. |
| `POST /api/endpoints/{param.env}/docker/containers/{param.id}/start` | Container | When you press Start and confirm | Starts the container. |
| `POST /api/endpoints/{param.env}/docker/containers/{param.id}/stop?t=10` | Container | When you press Stop and confirm | Stops it. |
| `POST /api/endpoints/{param.env}/docker/containers/{param.id}/restart?t=10` | Container | When you press Restart and confirm | Restarts it. |
| `POST /api/docker/{param.env}/containers/{answer.c.Id}/recreate` | Container | When you press Pull and recreate and confirm | Pulls the newest image and recreates the container with the same settings. |
That’s about 75 requests an hour with the Portainer page open, plus 240 an hour while a container’s page is open. Legato also keeps each container’s state every 5 minutes in [History](https://legatobar.com/docs/history.md), for its page’s day.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make an access token.** In Portainer, open **My account → Access tokens → Add access token**, as an administrator. Portainer CE has no read-only role, so a token can also stop and remove containers: keep it to Legato.
2. **Save it in Legato.** In Settings → Secrets, save the token under `portainer`, bound to your Portainer’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **List what must keep running (optional).** In Settings → Lists, add a list called `keep-running` with the containers you never want to stop by accident, such as your reverse proxy and DNS. Their Stop button never shows.
4. **Add the pages.** Paste the prompt into your agent, or download the two pages and run `/Applications/Legato.app/Contents/Helpers/legato set portainer-container portainer-container.json`, then `legato set portainer portainer.json`. Keep the ID `portainer-container`: every dot and row opens it.
5. **Give your environment a Public IP** (optional). In Portainer, open **Environments**, choose yours and fill in **Public IP** with your host’s address. Each container’s page then links to the ports it publishes.
6. **Point them at Portainer.** Change `https://portainer.example.com` to your Portainer’s address on every source, and the environment id `1` on the Portainer page to yours: it’s the number in Portainer’s address when you open your environment (`#!/3/docker/dashboard` is 3).
The cards fill within a minute. A mistyped token is the usual reason they don’t: the page then notes that Portainer refused it.
### Prompt for your agent
```prompt
Add 2 Legato pages for Portainer, starting from https://legatobar.com/examples/portainer.json, https://legatobar.com/examples/portainer-container.json. Use the page IDs portainer, portainer-container if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add the pages as they are, keeping their page IDs. Change https://portainer.example.com on every source of both pages to my Portainer’s address, and the environment id 1 on the Portainer page to mine. I’ll save my access token as portainer in Settings → Secrets, and add a keep-running list in Settings → Lists, myself. Don’t press Start, Stop, Restart, Pull and recreate or Remove unused images to test them.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Portainer (portainer.json)](https://legatobar.com/examples/portainer.json)
- [Download Container (portainer-container.json)](https://legatobar.com/examples/portainer-container.json)
## Questions
### Why does a stopped container sometimes not count as a problem?
Docker tells a clean stop (exit code 0) from a crash. A container that stopped cleanly, such as a one-off job, is grey. One that exited with an error, or one on your keep-running list, is red.
### Why can’t I see when an image has an update?
Portainer CE doesn’t check: that’s in Portainer’s Business Edition, so the pages can’t show it.
### Does Spotlight ask before it removes images?
No. Spotlight presses a button you choose by name without asking, as it does for every button, so **Remove unused images** goes straight through from there. The images can be pulled again. Start, Stop, Restart and Pull and recreate aren’t in Spotlight, since it couldn’t say which container they’d act on.
### Does it work with several Docker hosts?
The Portainer page shows one environment. For another, add a copy of the page with its own ID, that environment’s id in its paths, and no `collect`: only one page can keep the containers’ History. Each dot still opens the one container page, which then shows no day for that host’s containers.
Legato is independent and isn’t affiliated with or endorsed by Portainer or Docker.
## Verification
The pages were filled from Portainer CE 2.45.3 on 9 Nov 2026, managing a Docker 29.8 host with 27 containers. A container that’s unhealthy, crashed or restarting, and the buttons, are checked by tests with made-up answers. Illustrations use made-up containers and numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# Immich in your Mac’s menu bar
See how your Immich server is doing without opening it: how big the library is and how full the disk is, how many photos you took each month, what Immich is still working through after an import, and your latest photos.
## What you’ll see
- **Immich:**
- **Health:** in Details, your photo and video counts and how full the disk is, or "Processing 3,522 jobs" while Immich works through an import. The health card turns orange when jobs have failed or the disk is 90% full, and red once Immich stops answering.
- **Taken each month:** photos and videos for the last 12 months, by the date they were taken. A month with none shows as an empty column.
- **Library:** the library’s size, the disk Immich stores it on, the version you run (and the newest one, when Immich has seen a newer release), and the photo and video counts.
- **Processing:** the queues with work to do, up to 7. Failed jobs come first, then a paused queue, then the busiest. It says "Nothing processing" when Immich is idle. Each row opens the Jobs page.
- **Latest photos:** your four newest photos by the date they were taken, each opening in Immich.
- **Jobs:** every queue, the ones with work first. Point at a row for **Pause** or **Resume**, and for **Clear failed** where jobs failed, which asks first.
- **Albums:** your albums, the most recently changed first, with their cover, how many items they hold and the date of the newest one.
### Status
- Watches the server, its jobs and its disk.
- Orange when jobs have failed, or when the disk is 90% full.
- Red once Immich stops answering, or refuses the key.
- Notifies you when it turns orange or red.
## How it connects
The pages read Immich’s API with your API key, sent as `x-api-key`.
| Request | When | What it supplies |
| --- | --- | --- |
| `GET /api/server/statistics` | Once a minute | Photo and video counts and the library’s size, for the whole server. |
| `GET /api/server/storage` | Once a minute | The disk’s size and how much is used. |
| `GET /api/queues` | Once a minute | Each queue’s waiting, running and failed jobs, and whether it’s paused. |
| `GET /api/server/about` | Once a minute | The version you run. |
| `GET /api/server/version-check` | Once a minute | The newest release Immich has seen, if its version check is on. |
| `GET /api/timeline/buckets?visibility=timeline` | Every 15 minutes | How many photos and videos you took each month. |
| `POST /api/search/metadata` | Every 15 minutes | Your four newest photos by the date they were taken. |
| `GET /api/assets/{id}/thumbnail?size=thumbnail` | While the panel shows the photo | Each thumbnail, kept on this Mac. |
| `GET /api/albums` | Every 15 minutes, while Albums is open | Your albums and their covers. |
| `PUT /api/queues/{name}` | When you press Pause or Resume | Pauses or resumes that queue. |
| `PUT /api/jobs/{name}` | When you press Clear failed and confirm | Clears that queue’s failed jobs. |
That’s about 300 requests an hour with the overview open. Thumbnails come only from your Immich, and **Load icons from the web** in Settings doesn’t affect them.
The counts, disk and jobs cover the whole server. The months, latest photos and albums are the library of the account the key belongs to.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Check your version.** The pages need Immich 2.4 or later, the first with the queue requests they read. On an older server the status turns red.
2. **Make an API key on an admin account.** In Immich, open **Account Settings → API Keys** and choose **New API Key**. Immich shows server totals and jobs only to admins, so a key from any other account is refused there.
3. **Give it these permissions:** `server.about`, `server.statistics`, `server.storage`, `server.versionCheck`, `asset.read`, `asset.view`, `album.read`, `queue.read`, `queue.update` and `job.create`. The last two are for Pause, Resume and Clear failed; leave them off and those buttons are refused. A key with **all** works too, but it can also delete your library.
4. **Save it in Legato.** In Settings → Secrets, save the key under `immich`, bound to your Immich’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
5. **Add the pages.** Use **Install in Legato**, paste the prompt into your agent, or download the pages and run `/Applications/Legato.app/Contents/Helpers/legato set immich immich.json` for each one.
6. **Point them at Immich.** Use the address you open Immich at. Immich listens on port 2283 over plain http, as in `http://192.168.1.20:2283`. Behind a reverse proxy it’s your own address, such as `https://photos.example.com`. Immich can’t run on a path like `/immich`, so the address is never more than a host and a port.
The cards fill within a minute. If Immich has a self-signed certificate, Legato can trust it only at an IP address or a `.local` name.
### Prompt for your agent
```prompt
Add 3 Legato pages for Immich, starting from https://legatobar.com/examples/immich.json, https://legatobar.com/examples/immich-jobs.json, https://legatobar.com/examples/immich-albums.json. Use the page IDs immich, immich-jobs, immich-albums if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add the pages as they are, keeping their page IDs. Change http://192.0.2.40:2283 on every source and link of all three pages to my Immich’s address. I’ll save my API key as immich in Settings → Secrets myself. Don’t press Pause, Resume or Clear failed to test them.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Immich (immich.json)](https://legatobar.com/examples/immich.json)
- [Download Jobs (immich-jobs.json)](https://legatobar.com/examples/immich-jobs.json)
- [Download Albums (immich-albums.json)](https://legatobar.com/examples/immich-albums.json)
## Questions
### Why does the page stay green when machine learning is down?
Immich doesn’t report it. When its machine-learning container stops, face detection, smart search and text recognition still count their jobs as done, so nothing in its API shows a problem. Immich’s own logs say so.
### Why “Latest photos” and not “Recently uploaded”?
Immich sorts searches by when a photo was taken, not when it arrived. A phone that backs up an old photo puts it in the middle of the timeline, and the page shows what Immich’s own timeline shows first.
### Why does Clear failed use an older request?
Immich’s newer request for this also empties every job still waiting in that queue. The older one clears only the failed jobs, so an import keeps going.
Legato is independent and isn’t affiliated with or endorsed by Immich.
## Verification
The pages were filled from Immich 3.4.1 on 11 Nov 2026, with a made-up library of about 180 photos and videos in six albums. A paused queue’s backlog showed on the overview and the Jobs page. The requests behind Pause, Resume and Clear failed were sent to that server by hand, and tests check the buttons build them. Failed jobs, which Immich rarely reports, were checked only with made-up answers. Illustrations use made-up photos, albums and numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# Ollama models in your Mac’s menu bar
See what Ollama has in memory without opening Terminal: which models are loaded, how much memory each takes, whether any part runs on the CPU, and when it unloads. Every model you’ve installed is one click from its own page, with Load, Unload and Delete.
## What you’ll see
- **Ollama:**
- **The facts:** memory in use by loaded models and how many there are, how many models are installed and the disk space they take, and Ollama’s version.
- **Models:** **Load a model** is a menu of your installed models (an embedding model loads by itself when an app uses it, so it isn’t listed), and **Pull a model** asks for a name, such as `qwen3:8b`, and downloads it.
- **In memory:** each loaded model with its size in memory and when it unloads (“unloads in 25m”, or “stays loaded” for one kept in memory with `keep_alive: -1`). A model that doesn’t fit on the GPU says where it runs, in Ollama’s own words: “100% CPU”, or “48%/52% CPU/GPU” when it’s split. On a Mac with Apple silicon a model normally runs all on the GPU, so that goes unsaid. **Unload** at the end of each row frees its memory now.
- **Installed:** every model, newest first, with its parameter count, quantization and size on disk.
- **Model:** one page for every installed model, titled with its name: whether it’s in memory and until when, what it can do (completion, tools, thinking, vision, embedding), how much context it’s loaded with and the most it takes, its parameters, quantization, size, family and when you pulled it. Its **Model** row has **Load** or **Unload**, and **Delete model**, which asks first.
### Status
- No health card.
- When Ollama doesn’t answer, as when its app is quit, the cards say so and the page stays grey.
## How it connects
The pages read Ollama’s local API. It has no sign-in, so there’s nothing to save in Settings → Secrets.
| Request | Pages | When | What it supplies |
| --- | --- | --- | --- |
| `GET /api/ps` | Ollama, Model | Once a minute | The models in memory, their size, how much is on the GPU (`size_vram`), their context and when they unload (`expires_at`). |
| `GET /api/tags` | Ollama, Model | Once a minute | Every installed model, its size on disk, parameters, quantization, context and what it can do. |
| `GET /api/version` | Ollama | Once a minute | Ollama’s version. |
| `POST /api/generate` `{"model": …}`, or `POST /api/embed` `{"model": …, "input": []}` for an embedding model | Ollama, Model | When you pick Load a model or press Load | Loads the model, for Ollama’s keep-alive time (5 minutes unless you’ve changed it). The button waits up to 5 minutes for a large model to load. |
| `POST /api/generate` `{"model": …, "keep_alive": 0}` | Ollama, Model | When you press Unload | Unloads the model now. |
| `POST /api/pull` `{"model": …, "stream": false}` | Ollama | When you press Pull a model and send its form | Downloads the model. The button spins until it’s done, for up to 30 minutes. |
| `DELETE /api/delete` `{"model": …}` | Model | When you press Delete model and confirm | Deletes the model from Ollama. |
That’s 180 requests an hour with the Ollama page open, all to your own Ollama.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Ollama on this Mac:** nothing to set up. The pages read `http://localhost:11434`, where Ollama’s app answers.
2. **Ollama on another computer:** Ollama answers only on its own computer until it’s told to listen on the network, with `OLLAMA_HOST=0.0.0.0:11434` ([how, in Ollama’s FAQ](https://docs.ollama.com/faq#how-do-i-configure-ollama-server)). The official Docker image listens on the network already. Anyone who can reach that port can use and delete your models, since Ollama has no sign-in: keep it on your own network.
3. **Add the pages.** Paste the prompt into your agent, or download the two pages and run `/Applications/Legato.app/Contents/Helpers/legato set ollama-model ollama-model.json`, then `legato set ollama ollama.json`. Keep the ID `ollama-model`: every row opens it.
4. **Point them at your Ollama** if it’s on another computer: change `http://localhost:11434` on both pages to its address, such as `http://192.168.1.20:11434`. macOS lets Legato use plain http only to an IP address, a `.local` name or this Mac, so `http://gpu-box.lan:11434` is refused; use its IP address or its `.local` name, or put Ollama behind https.
The cards fill within a minute. If they say Ollama isn’t answering, check it’s running (its icon is in the menu bar on a Mac) and, for another computer, that it listens on the network.
### Prompt for your agent
```prompt
Add 2 Legato pages for Ollama, starting from https://legatobar.com/examples/ollama.json, https://legatobar.com/examples/ollama-model.json. Use the page IDs ollama, ollama-model if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add the pages as they are, keeping their page IDs. If my Ollama isn’t on this Mac, change http://localhost:11434 on the source of both pages to its address. Don’t press Load a model, Unload, Pull a model, Load or Delete model to test them.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Ollama (ollama.json)](https://legatobar.com/examples/ollama.json)
- [Download Model (ollama-model.json)](https://legatobar.com/examples/ollama-model.json)
## Questions
### Why doesn’t the page turn red when Ollama stops?
On a Mac you quit Ollama’s app often, and it isn’t a problem, so the page has no health card. When Ollama doesn’t answer, the cards say so.
### Why do two models open the same page?
A model’s page is found by its digest, the fingerprint of its files, since a link can’t carry a name like `qwen3:8b`. Two names for the same files (after `ollama cp`) share one digest, so both open a page titled with the first, and Delete model deletes that name only.
### Why does Pull a model sometimes fail on a large model?
Ollama stops a download when its request closes. The button waits up to 30 minutes; a model that takes longer stops there, and Ollama keeps what it got, so pressing it again carries on. A very large model is easier to pull in Terminal with `ollama pull`.
### Why is Pull a model not in Spotlight?
A button that can take more than a minute stays in the panel, where you can see it working. Load a model is a menu of what’s installed now, so it stays in the panel too. Unload is on each row, and row buttons are never in Spotlight.
### Does it show Ollama’s cloud models?
A cloud model you’ve added to Ollama is listed under Installed with the rest, by its name. The pages don’t read your cloud usage or balance, which need your Ollama account’s key.
Legato is independent and isn’t affiliated with or endorsed by Ollama.
## Verification
The pages were filled from Ollama 0.40.16 on 11 Nov 2026, running on a Linux server with three small models, one kept loaded, one unloading after use and one unloading after an embedding. Ollama 0.35.1 on a Mac with Apple silicon gave the same shapes, with a model all on the GPU. A model split between CPU and GPU, one unloading, and the buttons are checked by tests with made-up answers. Illustrations use public model names with made-up sizes and times. See the [service index](https://legatobar.com/services/) for other examples.
---
# Linear in your Mac’s menu bar
Legato puts your Linear issues in the Mac’s menu bar: what you’re doing, what’s next and your backlog, with urgent issues at the top. Under them is how far each of your teams has got through its cycle, then your unread inbox. Each cycle opens a page of its own with the pace and the cycle’s issues by state.
## What you’ll see
- **Linear:**
- **Doing | Todo | Backlog**, three tabs at one height, holding the open issues assigned to you. Urgent issues come first (an orange mark), then high (a grey mark), medium, low and no priority. A row says its state when it isn’t the tab’s usual one, such as In Review or Triage. Otherwise it gives the due day, or the issue’s ID. Each tab shows 7, with **Show N more**, and each row opens the issue in Linear.
When Linear has more than the page reads (100 issues a tab, 50 teams, 20 running cycles, or unread notifications older than your latest 50), a note under the tabs says so and links to Linear.
- **Completed this cycle:** a bar for each of your teams with a cycle running, showing what’s done against the cycle’s scope. Teams that estimate count points; the rest count issues. Each bar opens that cycle’s page.
- **Inbox:** your unread notifications, newest first, four with **Show N more**. Snoozed ones stay out, as they do in Linear’s inbox. When Linear counts unread ones further back than your latest 50 notifications, the card says how many.
- **Completed**, closed at the bottom: how many issues you finished in the past 7 days, and the latest four.
- **Cycle:** one page for every team’s active cycle, titled with the team and cycle (APP · Cycle 18):
- **Completed:** the scope done so far, with a tick where you’d be if the cycle were on pace and a line saying how far ahead or behind it is. Under it are the end day and what’s left. For a team with cycles turned off, or between two cycles, the page says so instead.
- **Issues:** the cycle’s issues grouped by state in Linear’s board order, each with who it’s assigned to. A state with only one issue goes under Others at the end. 15 show, with **Show N more**.
### Status
Nothing counts as a problem: your issues are their own status, so an urgent issue or a cycle behind pace doesn’t turn the page orange.
## How it connects
The pages read Linear’s GraphQL API with your personal API key. Linear takes the key as the whole `Authorization` header, without `Bearer`, so each source has `"auth": { "type": "header", "name": "Authorization" }`.
| Request | Pages | When | What it supplies |
| --- | --- | --- | --- |
| `POST /graphql` | Linear | Every 2 minutes | Your open issues by state, your teams with their active cycles, your inbox and what you completed in the past 7 days, in one query. |
| `POST /graphql` | Cycle | Every 2 minutes while it’s open | One team’s active cycle (by its key, `?team=APP`), with its day-by-day scope and its issues. |
The overview’s query measured 496 of Linear’s complexity points on a quiet workspace. With the cycle page open too, that’s about 60 requests and roughly 30,000 points an hour, against Linear’s 2,500 requests and 3,000,000 points for an API key. Linear can answer a 200 with an `errors` list, such as for a team that doesn’t exist. The pages count any such answer as a failed fetch, so each card keeps its last answer, with Linear’s reason under it.
The pages only read; they have no buttons.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make a key.** In Linear, open Settings → Account → [Security & access](https://linear.app/settings/account/security) and create a personal API key with Read access to all your teams. If your workspace doesn’t let members make keys, ask an admin.
2. **Save it in Legato.** In Settings → Secrets, save it under `linear`, bound to `api.linear.app`. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download the two pages and run `/Applications/Legato.app/Contents/Helpers/legato set linear-cycle linear-cycle.json`, then `legato set linear linear.json`. Keep the ID `linear-cycle`: every cycle bar opens it with its team’s key.
The cards fill within a couple of minutes. If they don’t, the key is usually missing or mistyped, and the page says Linear refused the request.
### Prompt for your agent
```prompt
Add 2 Legato pages for Linear, starting from https://legatobar.com/examples/linear.json, https://legatobar.com/examples/linear-cycle.json. Use the page IDs linear, linear-cycle if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add both pages as they are, keeping their IDs. I’ll save my personal API key as linear in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Linear (linear.json)](https://legatobar.com/examples/linear.json)
- [Download Cycle (linear-cycle.json)](https://legatobar.com/examples/linear-cycle.json)
## Questions
### Why doesn’t the overview’s cycle bar have a pace tick?
A Legato bar card has one pace for all its rows, and your teams’ cycles can start on different days. Each team’s cycle page has its own bar with the tick and the ahead or behind line.
### Is “Completed this cycle” Linear’s progress?
No. It’s the scope marked done. Linear’s own progress figure also counts a quarter of the work in progress. The bar measures what’s done against the scope.
### Can I tick an issue done from Legato?
Not yet. The pages only read, and each row opens the issue in Linear.
### Can it show a cycle for a team I’m not on?
The overview shows the teams you’re a member of. Any team’s cycle page opens with `legato://page/linear-cycle?team=…`, using the team’s key, from a link on another page, if your key can read that team.
Legato is independent and isn’t affiliated with or endorsed by Linear.
## Verification
The pages were checked against Linear’s API on 11 Nov 2026 with a read-only key: the answers’ shapes, a refused key, the error for a missing team, and the rate limits. The workspace had no cycle running, so the cycle pages were checked only against made-up answers. The example pages have tests with made-up answers for a busy day. Illustrations use made-up teams, people and issues. See the [service index](https://legatobar.com/services/) for other examples.
---
# Stock prices in your Mac’s menu bar
The Stocks page shows the symbols you follow, each with its price and how much it moved today, in the order you list them. A second tab puts every symbol’s day side by side: how far it ranged and where it is now, measured from yesterday’s close. Click a symbol for its own page with its last 24 hours, where today and the past year sit in their ranges, a few facts and recent headlines. The prices come from Finnhub.
The pages show market data only. They can’t buy or sell, and they don’t suggest what to do.
## What you’ll see
- **Stocks:**
- **Market:** the US market’s session, always at the top: Market open, Pre-market, After hours, Market closed, or closed for a holiday by name. Closed is grey.
- **Watchlist | Today’s moves**, two tabs at one height:
- **Watchlist:** a tile for each symbol on your list, in your order, with its price and its change today. A tile is green when the symbol is up and red when it’s down, with the change in the same colour, and the bigger the move, the deeper the tile. Twelve show, with Show N more for the rest, and resting the pointer on a tile shows the company’s name. A symbol Finnhub has no price for says “No quote” instead of $0.00, one whose request failed says “Didn’t load”, and symbols past the first 20 say so. Each tile opens that symbol’s page.
- **Today’s moves:** one row per symbol on one shared scale in percent. Each bar runs from the day’s low to its high against yesterday’s close, and the dot is the price now, so a wide bar is a busy day and a dot left of zero is down. Rows run from the biggest rise to the biggest fall, the 14 furthest moves at most; with more on your list, the chart says how many it shows, such as “14 furthest of 22”.
- **Stock:** one page for every symbol, titled with the company’s name (a fund without one is titled by its symbol):
- **Price:** a line of the last 24 hours, from the prices Legato keeps every 5 minutes for the symbols on your list. Its headline is the latest price, and its title gives the day’s change in dollars and percent. It’s mostly flat while the market is closed, and it starts once the symbol is on your list.
- **Range:** today’s low to high and the past 52 weeks, on one scale, with a dot at the price now.
- **Facts:** when Finnhub quoted it, the previous close, the open, the next earnings date, the market cap and the industry.
- **News:** four recent headlines with their source, each opening the story. The words are the publishers’.
Price changes aren’t coloured green or red. A rise isn’t good news for everyone, and the page doesn’t say how to read it.
### Status
- Never counts as a problem.
- The US market’s session shows at the top of the page.
- Prices never turn anything orange or red.
## How it connects
The pages read Finnhub’s API at finnhub.io with your own key. The Stocks page asks every 5 minutes, once for the market and once for each symbol on your list (its price and its company name), up to 20 symbols. A symbol’s page asks every 5 minutes for its range and facts and every 30 minutes for headlines, while it’s open; its price comes from what the Stocks page keeps.
Your list stays in Settings → Lists on your Mac, and the page files never hold it. The symbols on it are sent to finnhub.io to get their prices, and Settings → Lists says so beside the list.
What Finnhub’s API offers, which markets and data each plan covers, its limits and the terms for using it are Finnhub’s to describe: see its [API documentation](https://finnhub.io/docs/api), [pricing](https://finnhub.io/pricing) and [terms of service](https://finnhub.io/terms-of-service). When Finnhub turns a request away, the cards keep their last prices and say the update failed.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make a key.** Sign in to your [Finnhub dashboard](https://finnhub.io/dashboard) and copy your API key.
2. **Save it in Legato.** In Settings → Secrets, save it under `finnhub`, bound to `finnhub.io`. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download both pages and run `/Applications/Legato.app/Contents/Helpers/legato set finnhub-symbol finnhub-symbol.json`, then `legato set finnhub finnhub.json`. Keep the ID `finnhub-symbol`: every tile opens it with its symbol.
4. **List your symbols.** In Settings → Lists, add a list called `stock-watchlist` with the stock symbols you follow, one to a line, in the order you want them. Use the symbol as Finnhub writes it, in capitals, such as a class of shares with a dot.
The cards fill within a few minutes. Until the list has symbols, the Stocks page says where to add them.
### Prompt for your agent
```prompt
Add 2 Legato pages for Finnhub, starting from https://legatobar.com/examples/finnhub.json, https://legatobar.com/examples/finnhub-symbol.json. Use the page IDs finnhub, finnhub-symbol if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add both pages as they are, keeping their page IDs. I’ll save my Finnhub key as finnhub in Settings → Secrets myself. Make a list called stock-watchlist in Settings → Lists with the stock symbols I follow, one to a line; ask me which ones, and don’t suggest any.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Stocks (finnhub.json)](https://legatobar.com/examples/finnhub.json)
- [Download Stock (finnhub-symbol.json)](https://legatobar.com/examples/finnhub-symbol.json)
## Questions
### Why does a symbol say “No quote”?
Finnhub answered without a price for it. Check the symbol is written as Finnhub writes it.
### Why does a symbol say “Didn’t load”?
Finnhub turned down or didn’t answer that symbol’s request, often because the symbol is outside what your plan covers; see Finnhub’s [pricing](https://finnhub.io/pricing). The other symbols still show. If Finnhub turns down every symbol on the list, the whole page says it didn’t allow the request.
### Why doesn’t a symbol’s page have a price line yet?
The line is made from the prices the Stocks page keeps every 5 minutes, so it’s there only for symbols on your list, once Legato has kept two. Hours when your Mac was asleep or Legato wasn’t running have no prices.
### Why is the 52-week row missing?
The page shows the past year only when the figures it gets include today’s price. Otherwise it leaves that row out, and today’s range still shows.
### Where do the headlines come from?
Finnhub collects them from news publishers. Legato shows four from the last two days, each with its source, as the publisher wrote it.
Legato is independent and isn’t affiliated with or endorsed by Finnhub.
## Verification
The pages were filled from Finnhub on 11 Nov 2026 with a watchlist of well-known symbols, including a fund, a class of shares, a symbol Finnhub doesn’t know and one outside its plan. The example pages have tests with made-up answers for a busy day, a market holiday and a new high. The illustrations use made-up companies, tickers and prices. See the [service index](https://legatobar.com/services/) for other examples.
---
# Tailscale in your Mac’s menu bar
See your whole tailnet from the menu bar: which devices are online, when the others were last seen, and whose key is about to expire. Every device opens a page of its own with its day online, its address and owner, and buttons to approve it or turn key expiry off.
## What you’ll see
- **Tailscale:**
- **Tailnet:** how many devices are online, the next device key to expire, how many expire within 14 days, and how many devices have a Tailscale update waiting.
- **Devices:** every device as a dot, under Tagged, Personal and Shared with you. Green is online. Grey is offline, which laptops and phones are whenever they sleep. Orange is a key that expires within 14 days or a device waiting for approval, and red is a key that has expired or expires today. Hover over a dot for its reason or when it was last seen; click it for the device’s page. Devices with key expiry turned off never count as a problem for it, and neither do devices shared with you, whose keys belong to their own tailnet.
- **Device:** one page for every device, opened from its dot and titled with its name:
- **Now:** online, or when it was last seen, and its key expiry when it’s close. In the corner, **Turn off key expiry** or **Turn on key expiry** (whichever applies), and **Approve device** while it waits for approval. Both Approve and turning expiry back on ask first.
- **Online, last 24 hours:** a strip of the day, from Legato’s own checks every 5 minutes, which it keeps in History. It starts filling when you add the pages.
- **Details:** key expiry, its Tailscale address and MagicDNS name, its owner or tags, its Tailscale version, its subnet routes and exit node, and its system.
### Status
- Watches each device’s key and approval.
- Red when a device’s key has expired or expires today, orange when it expires within 14 days or the device is waiting for approval.
- Grey for a device that’s offline, which never needs attention.
- Notifies you when it turns orange or red.
## How it connects
The pages read Tailscale’s API at `api.tailscale.com`, signed in as an OAuth client. Legato trades the client’s ID and secret for a short-lived access token and gets a new one as it runs out ([Tailscale’s OAuth clients](https://tailscale.com/docs/features/oauth-clients)). They use `-` for the tailnet, which means the client’s own tailnet.
| Request | Pages | When | What it supplies |
| --- | --- | --- | --- |
| `POST /api/v2/oauth/token` | Both | When the access token runs out | An access token for the client. |
| `GET /api/v2/tailnet/-/devices?fields=all` | Tailscale | Once a minute | Every device with its online state, last seen, key expiry, approval, tags and version. |
| `GET /api/v2/device/{param.id}?fields=all` | Device | Once a minute | One device. |
| `POST /api/v2/device/{param.id}/key` | Device | When you press Turn off key expiry or Turn on key expiry | Turns the device’s key expiry off or back on. |
| `POST /api/v2/device/{param.id}/authorized` | Device | When you press Approve device | Lets a device that’s waiting join the tailnet. |
Online means the device is connected to Tailscale’s control server, as the admin console shows it. Tailscale doesn’t publish a rate limit for its API; the pages make about 120 requests an hour with the overview and one device open. Tailscale answers every device at once, and the 1 MB cap on an answer is reached at a few hundred devices.
The client can do only what its scopes allow. Devices Core set to Read is enough for every card. The buttons need Devices Core set to Write, and Tailscale asks you to pick a tag when you choose that. With a read-only client the buttons don’t work.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make an OAuth client.** In the Tailscale admin console, open the [Trust credentials](https://console.tailscale.com/admin/settings/trust-credentials) page, choose **Credential**, then **OAuth**. Set Devices Core to Read, or to Write with a tag if you want the buttons, and choose **Generate credential**. Copy the client ID and the client secret before you close the page.
2. **Save it in Legato.** In Settings → Secrets, save it under `tailscale-client`, bound to `api.tailscale.com`, as the client ID and the secret joined by a colon: `client-id:client-secret`. If you keep the client in 1Password, link [two references](https://legatobar.com/docs/1password.md#a-secret-in-two-fields), one to the client ID field and one to the client secret field. Installing from Legato’s gallery asks for the two in their own fields.
3. **Add the pages.** Paste the prompt into your agent, or download the two pages and run `/Applications/Legato.app/Contents/Helpers/legato set tailscale-device tailscale-device.json`, then `legato set tailscale tailscale.json`. Keep the ID `tailscale-device`: every dot opens it with its device’s ID.
The cards fill within a minute. A mistyped or revoked client is the usual reason they don’t: the card says Tailscale refused the OAuth client, and after a few tries the devices turn into one red dot.
A client doesn’t expire, so there’s nothing to renew. To stop Legato’s access, revoke the client on the Trust credentials page.
### Prompt for your agent
```prompt
Add 2 Legato pages for Tailscale, starting from https://legatobar.com/examples/tailscale.json, https://legatobar.com/examples/tailscale-device.json. Use the page IDs tailscale, tailscale-device if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add the pages as they are, keeping their page IDs. I’ll save my Tailscale OAuth client as tailscale-client in Settings → Secrets myself. Don’t press Approve device or the key expiry buttons to test them.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Tailscale (tailscale.json)](https://legatobar.com/examples/tailscale.json)
- [Download Device (tailscale-device.json)](https://legatobar.com/examples/tailscale-device.json)
## Questions
### Can I use an API access token instead?
The pages installed from the gallery sign in with an OAuth client, because an API access token runs out and every card stops until you make a new one. If you’d rather use a token, change each source’s `auth` to `{ "type": "bearer" }` and save the token under the source’s secret name. Nothing then warns you before it expires.
### Why is an offline device grey and not red?
Phones and laptops go offline whenever they sleep, so offline isn’t a problem by itself. A device counts as a problem only for things that need you: a key about to expire, or a device waiting for approval.
### Why can’t I connect, disconnect or pick an exit node?
Those belong to the Tailscale app on this Mac, and Tailscale’s API can’t change them. The pages work with your tailnet as the admin console does.
### Does it work with Headscale?
No. Headscale has its own API, which these pages don’t read.
Legato is independent and isn’t affiliated with or endorsed by Tailscale.
## Verification
The pages were filled from a real tailnet on 11 Nov 2026, first with an API access token and later with an OAuth client. A made-up client was refused. Offline devices, expiring and expired keys, devices waiting for approval and shared devices were checked with made-up answers in the example pages’ tests, since the tailnet had none of them. Illustrations use made-up devices, people and addresses. See the [service index](https://legatobar.com/services/) for other examples.
---
# The status of the services you rely on, in your Mac’s menu bar
When 1Password, Dropbox, Discord or an AI service has trouble, its status page usually says so first. This page reads the status pages you list and gives each service a dot, coloured as the service rates itself. Below the dots are open incidents from all of them, and the ones that ended lately. Most status pages are built on Atlassian Statuspage or incident.io, and both answer at the same address, so one page covers them all. There’s no key or account.
## What you’ll see
- **Services:** one dot for each status page on your list, in the list’s order, named by the page itself. The colour is the service’s own rating: green when it says all is well, orange for minor trouble, red for a major or critical outage and grey while it’s in maintenance. A status page that misses a read or two keeps its colour, and its hover says why. After three missed reads in a row it turns grey, and its incidents leave the list. On hover, a dot names the newest open incident or the service’s own words, or why the page couldn’t be read, such as a redirect to another address. A click opens that status page.
- **Open incidents,** only while there are any: every open incident from every service, the worst first. Each row has the incident’s name, the service and the start of its newest update, and says how the service rates it and where it stands (Investigating, Identified, Monitoring). A click opens the service’s notice.
- **Recent incidents,** in a closed section at the end: the latest ones that were resolved, from every service, newest first, with how long each lasted.
An open incident shows as a row but isn’t a problem for the page on its own. The page’s status follows each service’s rating, so they change when the service says so.
### Status
- Watches each status page’s own rating.
- Orange when a service rates itself minor.
- Red when it rates itself major or critical.
- Under maintenance never counts as a problem.
- Grey once a status page has missed three reads in a row.
- An open incident isn’t a problem until the service’s rating changes.
- Notifies you when it turns orange or red.
## How it connects
The page asks for no key. Legato asks each status page on your list for the same two things, with no sign-in:
| Request | When | What it supplies |
| --- | --- | --- |
| `GET /api/v2/summary.json` | Every 2 minutes | The service’s name, its rating and open incidents with their updates. |
| `GET /api/v2/incidents.json` | Every 15 minutes | The service’s most recent incidents. |
Statuspage documents these requests on every page it hosts at `/api`, such as [GitHub’s](https://www.githubstatus.com/api). Each status page is read on its own, four at a time, so one that doesn’t answer affects only its own dot. [Several hosts from a list](https://legatobar.com/docs/source-requests.md#several-hosts-from-a-list) explains how a page reads a list of addresses.
### Statuspage and incident.io pages
Status pages hosted by incident.io work today, with fewer details. They include OpenAI, Linear, Notion, Fly.io, Supabase, HashiCorp, Docker, Tailscale and Plaid. incident.io doesn’t document this address, so it may change. Their incidents have no short link, so a row opens the status page itself.
## Set it up
1. **Find each status page’s address.** Open the service’s status page and copy its address as it ends up in your browser. Legato doesn’t follow a redirect to another address, so status.anthropic.com won’t work, but the status.claude.com it redirects to will. To check one, add `/api/v2/summary.json` to the address and open that in a browser. You should see text starting with `{"page":`.
2. **Make the list.** In Settings → Lists, make a list named `status-pages` with one address to a line: `www.githubstatus.com`, or `https://status.example.com:8443` when a page uses a port. The page reads up to 30.
3. **Add the page.** Paste the prompt into your agent, or download the page and run `/Applications/Legato.app/Contents/Helpers/legato set statuspage statuspage.json`.
The dots fill within a minute. When you add the page from Legato, it suggests the first ten addresses below, and you pick the ones you want. All of these work today:
| Service | Address |
| --- | --- |
| GitHub | `www.githubstatus.com` |
| Claude | `status.claude.com` |
| OpenAI | `status.openai.com` |
| Tailscale | `status.tailscale.com` |
| Ubiquiti (UniFi) | `status.ui.com` |
| 1Password | `status.1password.com` |
| Dropbox | `status.dropbox.com` |
| Reddit | `www.redditstatus.com` |
| Plaid | `status.plaid.com` |
| Discord | `status.discord.com` |
| Canva | `www.canvastatus.com` |
| Zoom | `www.zoomstatus.com` |
| Twitch | `status.twitch.com` |
| Cloudflare | `www.cloudflarestatus.com` |
| Vercel | `www.vercel-status.com` |
| Netlify | `www.netlifystatus.com` |
| DigitalOcean | `status.digitalocean.com` |
| npm | `status.npmjs.org` |
| Linear | `linearstatus.com` |
| Twilio | `status.twilio.com` |
Some big services run their own kind of status page, which this page can’t read. Slack is one, and so are AWS, Google Cloud, Azure and Stripe.
### Prompt for your agent
```prompt
Add a Legato page for Service status, starting from https://legatobar.com/examples/statuspage.json.
Add the page as it is, keeping its page ID. Make a list named status-pages in Settings → Lists with the status pages I give you, one address to a line, like www.githubstatus.com.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the page
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "Service status",
"icon": "waveform.path.ecg",
"sources": {
"status": {
"hosts": {
"list": "status-pages",
"max": 30
},
"every": "2m",
"requests": {
"summary": "/api/v2/summary.json"
},
"derive": [
{
"name": "name",
"value": "summary.page.name"
},
{
"name": "url",
"value": "summary.page.url"
},
{
"name": "rating",
"value": {
"path": "summary.status.indicator",
"values": {
"none": "ok",
"minor": "warning",
"major": "critical",
"critical": "critical",
"maintenance": "off"
},
"default": "unknown"
}
},
{
"name": "words",
"value": "summary.status.description"
},
{
"name": "open",
"value": {
"each": "summary.incidents",
"limit": 20,
"fields": {
"id": "id",
"name": "name",
"status": "status",
"rank": {
"path": "impact",
"values": {
"critical": 0,
"major": 1,
"minor": 2,
"none": 3
},
"default": 3
},
"impact": {
"path": "impact",
"values": {
"critical": "Critical",
"major": "Major",
"minor": "Minor",
"none": "No impact"
},
"default": {
"template": "{impact|title}"
}
},
"latest": "incident_updates[0].body",
"link": {
"if": {
"path": "shortlink",
"exists": true
},
"then": "shortlink"
}
}
}
},
{
"name": "newest",
"value": "summary.incidents[0].name"
}
],
"fail": {
"when": {
"path": "summary.page.id",
"exists": false
},
"message": {
"template": "not a status page"
}
}
},
"history": {
"hosts": {
"list": "status-pages",
"max": 30
},
"every": "15m",
"requests": {
"incidents": "/api/v2/incidents.json"
},
"derive": [
{
"name": "name",
"value": "incidents.page.name"
},
{
"name": "url",
"value": "incidents.page.url"
},
{
"name": "past",
"value": {
"each": "incidents.incidents",
"where": {
"path": "status",
"in": [
"resolved",
"postmortem"
]
},
"limit": 5,
"fields": {
"id": "id",
"name": "name",
"impact": {
"path": "impact",
"values": {
"critical": "Critical",
"major": "Major",
"minor": "Minor",
"none": "No impact"
},
"default": {
"template": "{impact|title}"
}
},
"resolved_at": "resolved_at",
"link": {
"if": {
"path": "shortlink",
"exists": true
},
"then": "shortlink"
},
"mins": {
"subtract": [
{
"if": {
"path": "started_at",
"exists": true
},
"then": {
"since": "started_at"
},
"else": {
"since": "created_at"
}
},
{
"since": "resolved_at"
}
],
"scale": 0.016666666666666666,
"round": 0
}
}
}
}
],
"fail": {
"when": {
"path": "incidents.page.id",
"exists": false
},
"message": {
"template": "not a status page"
}
}
}
},
"cards": [
{
"id": "vendors",
"type": "fleet",
"label": "Services",
"max_items": 24,
"items": [],
"source": {
"ref": "status",
"map": {
"items": {
"each": "hosts",
"fields": {
"name": {
"if": {
"path": "answer.name",
"exists": true
},
"then": {
"template": "{answer.name|clip:24}"
},
"else": {
"template": "{entry|clip:24}"
}
},
"state": {
"if": {
"any": [
{
"path": "state",
"equals": "answered"
},
{
"all": [
{
"path": "answer.name",
"exists": true
},
{
"path": "fails",
"lt": 3
}
]
}
]
},
"then": "answer.rating",
"else": {
"template": "unknown"
}
},
"detail": {
"if": {
"path": "state",
"equals": "answered"
},
"then": {
"if": {
"path": "answer.newest",
"exists": true
},
"then": {
"template": "{answer.newest|clip:80}"
},
"else": {
"if": {
"path": "answer.rating",
"not": "ok"
},
"then": {
"template": "{answer.words|clip:80}"
}
}
},
"else": {
"template": "{error|clip:80}"
}
},
"url": "origin"
}
}
}
}
},
{
"id": "incidents",
"type": "list",
"label": "Open incidents",
"max_items": 7,
"items": [],
"source": {
"ref": "status",
"when": {
"value": {
"count": "hosts",
"where": {
"all": [
{
"any": [
{
"path": "state",
"equals": "answered"
},
{
"all": [
{
"path": "answer.name",
"exists": true
},
{
"path": "fails",
"lt": 3
}
]
}
]
},
{
"path": "answer.open[0].id",
"exists": true
}
]
}
},
"gt": 0
},
"map": {
"items": {
"each": "hosts",
"where": {
"any": [
{
"path": "state",
"equals": "answered"
},
{
"all": [
{
"path": "answer.name",
"exists": true
},
{
"path": "fails",
"lt": 3
}
]
}
]
},
"flatten": "answer.open",
"sort": "rank",
"limit": 60,
"fields": {
"key": {
"template": "{parent.key}-{id}"
},
"text": {
"template": "{name|clip:160}"
},
"subtitle": {
"template": "{parent.answer.name|clip:24} · {latest|clip:50}"
},
"detail": {
"template": "{impact} · {status|title}"
},
"url": {
"if": {
"path": "link",
"exists": true
},
"then": "link",
"else": "parent.answer.url"
}
}
}
}
}
},
{
"id": "recent-heading",
"type": "heading",
"text": "Recent incidents",
"collapsed": true,
"cards": [
"recent"
],
"source": {
"ref": "history",
"when": {
"value": {
"count": "hosts",
"where": {
"all": [
{
"any": [
{
"path": "state",
"equals": "answered"
},
{
"all": [
{
"path": "answer.name",
"exists": true
},
{
"path": "fails",
"lt": 3
}
]
}
]
},
{
"path": "answer.past[0].id",
"exists": true
}
]
}
},
"gt": 0
}
}
},
{
"id": "recent",
"type": "list",
"label": "Recent incidents",
"max_items": 4,
"items": [],
"source": {
"ref": "history",
"when": {
"value": {
"count": "hosts",
"where": {
"all": [
{
"any": [
{
"path": "state",
"equals": "answered"
},
{
"all": [
{
"path": "answer.name",
"exists": true
},
{
"path": "fails",
"lt": 3
}
]
}
]
},
{
"path": "answer.past[0].id",
"exists": true
}
]
}
},
"gt": 0
},
"map": {
"items": {
"each": "hosts",
"where": {
"any": [
{
"path": "state",
"equals": "answered"
},
{
"all": [
{
"path": "answer.name",
"exists": true
},
{
"path": "fails",
"lt": 3
}
]
}
]
},
"flatten": "answer.past",
"sort": {
"by": "resolved_at",
"order": "desc",
"as": "date"
},
"limit": 20,
"fields": {
"key": {
"template": "{parent.key}-{id}"
},
"text": {
"template": "{name|clip:160}"
},
"subtitle": {
"if": {
"path": "mins",
"gte": 1
},
"then": {
"template": "{parent.answer.name|clip:24} · {impact} · {mins|duration:min}"
},
"else": {
"template": "{parent.answer.name|clip:24} · {impact}"
}
},
"detail": {
"template": "{resolved_at|ago}"
},
"url": {
"if": {
"path": "link",
"exists": true
},
"then": "link",
"else": "parent.answer.url"
}
}
}
}
}
}
]
}
```
## Questions
### Why is a dot orange when the service works for me?
The colour is the service’s own rating. A service that lists every region or data centre as a component, as Cloudflare does, often has one of them in trouble somewhere, and its rating says so. Take it off the list if you’d rather it didn’t count as a problem.
### Can I see a service’s components or uptime bars?
Not on this page: a dot opens the service’s own status page, which has both. The 90-day uptime bars aren’t in the public API that Legato reads.
### Does it work with a private status page?
No. A status page that asks you to sign in on the web doesn’t answer these requests, and Legato reads every status page with no sign-in.
Legato is independent and isn’t affiliated with or endorsed by Atlassian, incident.io or any service named here.
## Verification
On 12 Nov 2026, Legato read a list of 30 addresses with this page’s two requests. The 27 status pages on it answered. The other three were there on purpose: a redirect, a missing page and a name that doesn’t exist. Each greyed only its own dot. Later that day, every address in the table above answered both requests, with no redirect. The page has tests with made-up answers for a busy day, a quiet day, an incident.io page, a status page that doesn’t answer and 30 status pages. It hasn’t yet been seen in Legato’s panel, and it needs a version of Legato that reads a list of hosts. The illustrations use made-up services. See the [service index](https://legatobar.com/services/) for other examples.
---
# Glances in your Mac’s menu bar
Keep an eye on your Linux boxes without opening a browser tab. [Glances](https://github.com/nicolargo/glances) already measures each one’s CPU, memory, disks and sensors; these pages put them in the menu bar, a dot for each box, and notify you when a disk fills, memory runs short, the CPU stays flat out or something runs hot.
## What you’ll see
- **Glances:** a dot for each box on your list, named by its address there (`atlas.local`, `192.168.1.20`), coloured by the same rules as its own page, with its host name and what needs you when you point at it (“atlas · /mnt/media 96% full”). An entry the list can’t read is a grey dot that says why. One that misses a read keeps its colour; after three in a row it says it can’t read that Glances. A click opens the box’s page.
- **Box:** one page for each box, titled with its host name:
- **Health:** the box, in Details. When something needs you, it says what: a sensor past its mark, the fullest disk (“/mnt/media 96% full and 1 more”), memory in use, or “CPU 96% for 15 minutes”. The ⓘ button by the page’s title then turns orange or red. Otherwise it says how long the box has been up.
- **CPU and Memory:** two small charts from 0 to 100% of Glances’ own readings over the last 2 hours, a point for each time Legato or anything else asked.
- **Disks:** every disk Glances can see, fullest first. A disk mounted in two places is listed once, and the files Docker mounts into every container are left out.
- **System:** load over 1, 5 and 15 minutes, the CPU and its cores, the system it runs (“Debian GNU/Linux 13”), processes and threads, swap in use and how long the box has been up. **Processes** opens the box’s Processes page.
- **Temperatures:** a dot for each temperature sensor, the CPU’s and the drives’, hottest first, coloured by the marks the hardware reports, with its reading when you point at it. It’s there only when the box has sensors.
- **Recent alerts:** the latest four in Glances’ own log (the rest on its own page), such as “Memory critical”, with when it started or ended, the peak and the program Glances saw using the most. **Clear finished alerts** in the corner empties Glances’ log of the ones that are over, after asking; ones still going stay.
- **Processes:** opened from a box’s System card: the box’s running processes by CPU and by memory, the 40 busiest in each. When there are more, the list’s title says “40 of 136”. Processes of one program are added together, so postgres shows once with “14 processes”. One using more than one core reads over 100%.
### Status
- Watches every box’s disks, memory, CPU and temperatures, a dot each.
- Orange when a disk is 90% full, memory is 90% used, CPU averages 90% for 15 minutes or a sensor passes its warning mark.
- Red when a disk is 95% full, memory is 95% used, a sensor passes its critical mark or Legato can’t read that Glances three times running.
- Notifies you when it turns orange or red.
## How it connects
The pages read Glances’ REST API, version 4, on every box on the list. Glances has no sign-in unless you start it with a password.
| Request | Pages | When | What it supplies |
| --- | --- | --- | --- |
| `GET /api/4/system`, `/uptime`, `/fs`, `/sensors`, and `/mem` on Glances or `/quicklook` on a box’s page | Glances, box | Once a minute, for each box | The host name and how long it’s been up, each disk and how full it is, each sensor with the marks the hardware reports, and memory in use. |
| `GET /api/4/quicklook/cpu/history/1200` | Glances, box | Once a minute, for each box | Every reading of CPU Glances keeps, with its time: the chart of the last 2 hours, and whether the CPU has stayed high. |
| `GET /api/4/mem/percent/history/1200` | Box | Once a minute while it’s open | Glances’ readings of memory, for the chart. |
| `GET /api/4/quicklook`, `/system`, `/load`, `/memswap`, `/processcount` | Box | Once a minute while it’s open | The CPU’s name and cores, the system it runs, load, processes and threads, and swap. |
| `GET /api/4/alert`, `/cpu` | Box | Once a minute while it’s open | Glances’ log of alerts. Reading `/cpu` is also what has Glances log CPU alerts. |
| `POST /api/4/events/clear/all` | Box | When you press Clear finished alerts and confirm | Removes the finished alerts from that Glances’ log, for its web page too. |
| `GET /api/4/programlist` | Processes | Once a minute while it’s open | The running processes, added together by program, with their CPU and memory. |
That’s 360 requests an hour for each box on the list, 840 more while a box’s page is open and 60 while its Processes is, all to your own boxes. Legato reads four boxes at a time and up to 20 in all. Glances works out its numbers when it’s asked, so these requests are also what fills its history, and Glances logs CPU and load alerts only while a box’s page is open.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page. Glances’ [API documentation](https://glances.readthedocs.io/en/latest/api/restful.html) lists everything it reports.
## Set it up
1. **Run Glances as a web server** on the box, with `glances -w`, or in Docker with the `-full` image and `GLANCES_OPT="-w"`. It answers on port 61208. [Glances’ Docker guide](https://glances.readthedocs.io/en/latest/docker.html) shows the settings that let it see the host: its processes, the Docker socket and the host’s name.
2. **In Docker, mount the disks you want to see**, read-only. A container sees only its own files until you mount a disk into it, so without that the Disks card says Glances sees none.
3. **List your boxes:** in Settings → Lists, make a list named `glances-hosts` with each box’s address on its own line, such as `http://192.168.1.20:61208` or `http://atlas.local:61208`. macOS lets Legato use plain http only to an IP address, a `.local` name or a one-word name, so `http://atlas.lan:61208` isn’t read; use its IP address or its `.local` name.
4. **Add the pages.** Use **Install in Legato**, paste the prompt into your agent, or download the three pages and run `/Applications/Legato.app/Contents/Helpers/legato set glances-box-programs glances-box-programs.json`, then the same for `glances-box` and `glances-boxes`. Keep their IDs: the dots and the Processes row open them.
5. **If a Glances has a password** (`glances -w --password`): save a secret named `glances` in Settings → Secrets for that box’s address, as `glances:` and the password, or your own user name if you started Glances with `--username`. Boxes without a password need nothing, and a box that asks for one with none saved says so on its dot.
The dots fill within a minute, and the charts fill as readings come in.
### Prompt for your agent
```prompt
Add 3 Legato pages for Glances, starting from https://legatobar.com/examples/glances-boxes.json, https://legatobar.com/examples/glances-box.json, https://legatobar.com/examples/glances-box-programs.json. Use the page IDs glances-boxes, glances-box, glances-box-programs if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add the three pages as they are, keeping their page IDs. I’ll make the list glances-hosts in Settings → Lists with each box’s address, such as http://192.168.1.20:61208, and save the secret glances as glances: for any box that has a password, myself. Don’t press Clear finished alerts to test it.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Glances (glances-boxes.json)](https://legatobar.com/examples/glances-boxes.json)
- [Download Box (glances-box.json)](https://legatobar.com/examples/glances-box.json)
- [Download Processes (glances-box-programs.json)](https://legatobar.com/examples/glances-box-programs.json)
## Questions
### When does a busy CPU count as a problem?
When Glances’ readings of the last 15 minutes average 90% or more, and each five minutes of them at least 75%. A compile or a backup that runs flat out for a few minutes is the box working, and the chart shows it; a CPU that stays there for a quarter of an hour turns the page orange. It’s an average, so one reading that dips under load doesn’t reset the count, and it’s taken five minutes at a time, so a burst of readings from Glances’ own web page can’t outweigh quiet minutes. Legato needs readings reaching back at least 12 of those minutes, so a Mac that has just woken up waits until it has seen enough. It compares Glances’ times with the Mac’s clock, so keep the box’s clock set (NTP).
### Can I change when it counts as a problem?
Yes. The numbers are in the `derive` of the list’s `boxes` source and the box page’s `glances` source, and its `host` card’s `state`, the same on both: 90 and 95 for disks, 90 and 95 for memory, and an average of 90% over 900 seconds, 75% each third, for the CPU. Temperatures use the marks the hardware reports, so a sensor without marks never counts as a problem.
### Why does Recent alerts show a warning when the page isn’t lit?
Recent alerts is Glances’ own log, at Glances’ own levels, which are lower than the page’s unless you’ve changed them, and it logs one as soon as a reading crosses them. It counts as a problem later, at 90% memory, or CPU averaging 90% for 15 minutes. So the list can say “Memory warning” with a peak of 78% while the page stays quiet. Glances logs CPU, memory, swap and load only while something reads them, and keeps the last ten. To change its levels, see [Glances’ configuration](https://glances.readthedocs.io/en/latest/config.html).
### Why is Processes out of date when I open it?
Glances works out each process’s CPU since the last time it was asked for the list. If you open it after a long while, the first reading is an average over that time, and a process that started since shows 0%. The page asks again a minute later, and from then on it’s the last minute’s.
### Why are the charts sometimes short?
Glances keeps its readings in memory and starts again when it restarts. It takes a reading each time it’s asked, so after a restart the charts fill as Legato asks, once a minute. A Glances started with `--disable-history` keeps none, so the charts aren’t shown and a busy CPU can’t count as a problem.
### Why does the page say a request failed with HTTP 400?
Glances answers 400 for a part you’ve turned off with `--disable-plugin`, and a box is read with all its requests or not at all. If you’ve turned off sensors on a box, remove the `sensors` request from the pages; the Temperatures card goes with it.
### Why does an old link to a box’s page say the address isn’t on the list?
A box’s page is opened by a key Legato makes from its address, so a link can never send a page or its password to another box. Change a box’s address in the list and it has a new key: open it again from its dot.
Legato is independent and isn’t affiliated with or endorsed by Glances.
## Verification
The pages were filled from Glances 4.5.9 on 12 Nov 2026, running in Docker on a Linux server with its disks mounted, one of them full. A load test took memory past 95%, and a 17-minute one lit the page with “CPU 94% for 15 minutes”. Clear finished alerts was pressed on it, and the alert still going stayed. Again with a password, Legato signed in, a wrong one was refused, and Clear finished alerts went through. On 13 Nov the list read both copies as two boxes: without a password saved, the one with a password said it asks for one, and with it saved both answered, and a box’s page read its box by its key. A box missing a read and one that can’t be read are checked by tests with made-up answers. With `--disable-history`, Glances answers no history, which the pages allow for. Sensors, a box with no disks visible, uptime under a day and a Glances Legato can’t read are checked by tests with made-up answers. Illustrations are of a made-up box. See the [service index](https://legatobar.com/services/) for other examples.
---
# Prowlarr in your Mac’s menu bar
See how your indexers are doing without opening Prowlarr: which ones it has stopped using after failures, how many queries and grabs each one had this week, which apps ask the most, and whether its own health checks have found a problem.
## What you’ll see
- **Health:** in Details, Prowlarr’s version, or its worst health check in its own words ("Indexers unavailable due to failures: Harbor Feed") and how many others there are. An error turns the health card red and a warning turns it orange, and either sends a notification. A notice, such as an update being ready, doesn’t. It also turns red once Prowlarr stops answering.
- **Indexers:** every indexer, with its queries (searches and RSS syncs together) and grabs over the last 7 days. One where some queries failed says how many on a second line ("10% of queries failed"). An indexer Prowlarr has stopped using after failures comes first and says Unavailable, with when it first failed and when Prowlarr will try it again. Ones you turned off come last and say Off. The card shows 7, with **Show more** for the rest. Point at a row for **Test**, Prowlarr’s own test of that indexer. If it passes, the row says Passed for two minutes, and an Unavailable indexer is back in use. If it fails, Prowlarr’s reason shows under the card.
- **Last 7 days:** grabs, the apps that asked the most (Sonarr, Radarr and so on), searches and RSS syncs, each with how many failed when any did. These are the numbers on Prowlarr’s Stats page for the last 7 days.
- **Recent grabs:** the four newest releases an app grabbed through Prowlarr, with the indexer and the app, and Failed on one that didn’t download.
### Status
- Shows Prowlarr’s own health checks.
- Red for an error, orange for a warning.
- A notice never counts as a problem.
- Red once Prowlarr stops answering.
- Notifies you when it turns orange or red.
## How it connects
The page reads Prowlarr’s v1 API with your API key, sent as `X-Api-Key`.
| Request | When | What it supplies |
| --- | --- | --- |
| `GET /api/v1/system/status` | Every 5 minutes | Prowlarr’s version and instance name. |
| `GET /api/v1/health` | Every 5 minutes | Prowlarr’s own health checks. |
| `GET /api/v1/indexer` | Every 5 minutes | Every indexer, whether it’s on, and what Test sends back. |
| `GET /api/v1/indexerstats?startDate={date.hours_ago_168_at}` | Every 5 minutes | Each indexer’s queries and grabs over the last 7 days, and which apps asked. |
| `GET /api/v1/indexerstatus` | Every 5 minutes | The indexers Prowlarr has stopped using after failures, and until when. |
| `GET /api/v1/history?page=1&pageSize=4&sortKey=date&sortDirection=descending&eventType=1` | Every 5 minutes | The four newest grabs. |
| `POST /api/v1/indexer/test` | When you press Test | Prowlarr tests that indexer, as its own Test button does. |
That’s about 70 requests an hour while your Mac is awake. The indexer list is the large one, about 12 KB for each indexer (less than 2 KB of that crosses the network, compressed), so 40 indexers are about half a megabyte each time. Past 1 MB, which takes about 80, Legato stops reading it, and the Indexers, Last 7 days and Recent grabs cards keep their last answer with a note. Prowlarr’s [API documentation](https://prowlarr.com/docs/api/) covers each request.
Each grab in Prowlarr’s history also holds the indexer’s download link, which for a private tracker carries your passkey. The page leaves it out.
The indexer list holds what each indexer signs in with. Prowlarr shows some API keys as `********`, but for most private trackers it sends the username, password, cookie or passkey as it stored them. Legato holds the list in memory so Test can send it back, the page keeps no History, and **Preview Source** shows the list like any other answer. When Prowlarr’s reason for a failed Test quotes an address, Legato leaves out the part after `?`, where a tracker’s key would be.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Find your API key.** In Prowlarr, open **Settings → General**. The key is under **Security**.
2. **Save it in Legato.** In Settings → Secrets, save the key under `prowlarr`, bound to your Prowlarr’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the page.** Paste the prompt into your agent, or download the page and run `/Applications/Legato.app/Contents/Helpers/legato set prowlarr prowlarr.json`.
4. **Point it at Prowlarr.** Change `http://prowlarr.local:9696` to your Prowlarr’s address on both sources. If Prowlarr sits behind a reverse proxy at a path, such as `https://media.example.com/prowlarr`, set each source’s `url` to `https://media.example.com` and add `"base": "/prowlarr"`.
The cards fill within a minute. A mistyped key is the usual reason they don’t: the page then notes that Prowlarr refused it.
### Prompt for your agent
```prompt
Add a Legato page for Prowlarr, starting from https://legatobar.com/examples/prowlarr.json.
Add the page as it is and change http://prowlarr.local:9696 on every source to my Prowlarr’s address. I’ll save my API key as prowlarr in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the page
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "Prowlarr",
"icon": "magnifyingglass",
"sources": {
"health": {
"url": "http://prowlarr.local:9696",
"secret": "prowlarr",
"auth": {
"type": "header",
"name": "X-Api-Key"
},
"every": "5m",
"requests": {
"status": "/api/v1/system/status",
"health": "/api/v1/health"
},
"derive": [
{
"name": "errors",
"value": {
"count": "health",
"where": {
"path": "type",
"equals": "error"
},
"default": 0
}
},
{
"name": "warnings",
"value": {
"count": "health",
"where": {
"path": "type",
"equals": "warning"
},
"default": 0
}
},
{
"name": "problems",
"value": {
"count": "health",
"where": {
"path": "type",
"in": [
"error",
"warning"
]
},
"default": 0
}
},
{
"name": "worst",
"value": {
"if": {
"path": "errors",
"gt": 0
},
"then": {
"first": "message",
"of": "health",
"where": {
"path": "type",
"equals": "error"
}
},
"else": {
"first": "message",
"of": "health",
"where": {
"path": "type",
"equals": "warning"
}
}
}
},
{
"name": "problems_more",
"value": {
"subtract": [
"problems",
1
]
}
}
]
},
"indexers": {
"url": "http://prowlarr.local:9696",
"secret": "prowlarr",
"auth": {
"type": "header",
"name": "X-Api-Key"
},
"every": "5m",
"requests": {
"list": "/api/v1/indexer",
"stats": "/api/v1/indexerstats?startDate={date.hours_ago_168_at}",
"blocked": "/api/v1/indexerstatus",
"grabs": "/api/v1/history?page=1&pageSize=4&sortKey=date&sortDirection=descending&eventType=1"
},
"derive": [
{
"name": "own",
"value": {
"each": "list",
"fields": {
"id": "id",
"name": "name",
"enabled": "enable",
"resource": "$"
}
}
},
{
"name": "all",
"value": {
"each": "own",
"lookup": {
"from": "stats.indexers",
"by": "indexerId",
"on": "id",
"as": "stat"
},
"fields": {
"id": "id",
"name": "name",
"enabled": "enabled",
"resource": "resource",
"asked": "stat.indexerId",
"q": {
"add": [
"stat.numberOfQueries",
"stat.numberOfRssQueries"
],
"default": 0
},
"g": {
"path": "stat.numberOfGrabs",
"default": 0
},
"fails": {
"add": [
"stat.numberOfFailedQueries",
"stat.numberOfFailedRssQueries"
],
"default": 0
}
}
}
},
{
"name": "marked",
"value": {
"each": "all",
"lookup": {
"from": "blocked",
"by": "indexerId",
"on": "id",
"as": "block"
},
"fields": {
"id": "id",
"name": "name",
"enabled": "enabled",
"resource": "resource",
"asked": "asked",
"q": "q",
"g": "g",
"fails": "fails",
"failed_share": {
"divide": [
"fails",
"q"
]
},
"till": "block.disabledTill",
"first": "block.initialFailure"
}
}
},
{
"name": "blocked_rows",
"value": {
"each": "marked",
"where": {
"path": "till",
"exists": true
},
"sort": "till",
"fields": {
"key": "id",
"text": "name",
"detail": {
"template": "Unavailable"
},
"enabled": "enabled",
"resource": "resource",
"subtitle": {
"if": {
"value": {
"since": "till"
},
"lt": 0
},
"then": {
"template": "First failed {first|ago} · retry {till|in}"
},
"else": {
"template": "First failed {first|ago}"
}
}
}
}
},
{
"name": "on_rows",
"value": {
"each": "marked",
"where": {
"all": [
{
"path": "till",
"exists": false
},
{
"path": "enabled",
"equals": true
}
]
},
"sort": {
"by": "q",
"order": "desc"
},
"fields": {
"key": "id",
"text": "name",
"enabled": "enabled",
"resource": "resource",
"detail": {
"if": {
"path": "asked",
"exists": true
},
"then": {
"if": {
"path": "q",
"equals": 1
},
"then": {
"if": {
"path": "g",
"equals": 1
},
"then": {
"template": "1 query · 1 grab"
},
"else": {
"template": "1 query · {g} grabs"
}
},
"else": {
"if": {
"path": "g",
"equals": 1
},
"then": {
"template": "{q} queries · 1 grab"
},
"else": {
"template": "{q} queries · {g} grabs"
}
}
},
"else": {
"template": "No queries in 7 days"
}
},
"subtitle": {
"if": {
"path": "fails",
"gt": 0
},
"then": {
"if": {
"path": "failed_share",
"lt": 0.01
},
"then": {
"template": "Under 1% of queries failed"
},
"else": {
"template": "{failed_share|percent:0} of queries failed"
}
}
}
}
}
},
{
"name": "off_rows",
"value": {
"each": "marked",
"where": {
"all": [
{
"path": "till",
"exists": false
},
{
"path": "enabled",
"not": true
}
]
},
"fields": {
"key": "id",
"text": "name",
"detail": {
"template": "Off"
},
"enabled": "enabled",
"resource": "resource"
}
}
},
{
"name": "indexer_rows",
"value": {
"each": [
"blocked_rows",
"on_rows",
"off_rows"
],
"fields": {
"key": "key",
"text": "text",
"subtitle": "subtitle",
"detail": "detail",
"enabled": "enabled",
"resource": "resource"
}
}
},
{
"name": "indexer_count",
"value": {
"count": "indexer_rows",
"default": 0
}
},
{
"name": "grab_total",
"value": {
"sum": "numberOfGrabs",
"of": "stats.indexers",
"default": 0
}
},
{
"name": "failed_grabs",
"value": {
"sum": "numberOfFailedGrabs",
"of": "stats.indexers",
"default": 0
}
},
{
"name": "searches",
"value": {
"sum": "numberOfQueries",
"of": "stats.indexers",
"default": 0
}
},
{
"name": "failed_searches",
"value": {
"sum": "numberOfFailedQueries",
"of": "stats.indexers",
"default": 0
}
},
{
"name": "rss",
"value": {
"sum": "numberOfRssQueries",
"of": "stats.indexers",
"default": 0
}
},
{
"name": "failed_rss",
"value": {
"sum": "numberOfFailedRssQueries",
"of": "stats.indexers",
"default": 0
}
},
{
"name": "apps",
"value": {
"each": "stats.userAgents",
"sort": {
"by": "numberOfQueries",
"order": "desc"
},
"limit": 3,
"where": {
"all": [
{
"path": "numberOfQueries",
"gt": 0
},
{
"path": "userAgent",
"not": ""
}
]
},
"fields": {
"t": {
"template": "{userAgent|clip:16} {numberOfQueries}"
}
}
}
},
{
"name": "by_app",
"value": {
"join": "t",
"of": "apps",
"separator": " · "
}
},
{
"name": "app_count",
"value": {
"count": "apps",
"default": 0
}
},
{
"name": "grab_rows",
"value": {
"each": "grabs.records",
"lookup": {
"from": "list",
"by": "id",
"on": "indexerId",
"as": "ix"
},
"fields": {
"key": "id",
"text": {
"if": {
"path": "data.grabTitle",
"exists": true
},
"then": {
"template": "{data.grabTitle|clip:120}"
},
"else": {
"template": "A release"
}
},
"subtitle": {
"if": {
"path": "ix.name",
"exists": true
},
"then": {
"if": {
"path": "data.source",
"exists": true
},
"then": {
"template": "{ix.name} · {data.source|clip:30}"
},
"else": {
"template": "{ix.name}"
}
},
"else": {
"if": {
"path": "data.source",
"exists": true
},
"then": {
"template": "{data.source|clip:30}"
}
}
},
"detail": {
"if": {
"path": "successful",
"equals": false
},
"then": {
"template": "Failed · {date|ago}"
},
"else": {
"template": "{date|ago}"
}
}
}
}
},
{
"name": "grab_count",
"value": {
"count": "grab_rows",
"default": 0
}
}
]
}
},
"cards": [
{
"id": "health",
"type": "status",
"placement": "page_info",
"label": "Prowlarr",
"state": "unknown",
"width": "full",
"source": {
"ref": "health",
"map": {
"label": {
"if": {
"path": "status.instanceName",
"exists": true
},
"then": {
"template": "{status.instanceName}"
},
"else": {
"template": "Prowlarr"
}
},
"state": {
"if": {
"path": "errors",
"gt": 0
},
"then": {
"template": "critical"
},
"else": {
"if": {
"path": "warnings",
"gt": 0
},
"then": {
"template": "warning"
},
"else": {
"template": "ok"
}
}
},
"detail": {
"if": {
"path": "problems",
"equals": 0
},
"then": {
"template": "Prowlarr {status.version} · No problems"
},
"else": {
"if": {
"path": "problems",
"equals": 1
},
"then": {
"template": "{worst|clip:110}"
},
"else": {
"template": "{worst|clip:90} · and {problems_more} more"
}
}
}
},
"failed": {
"state": "critical",
"detail": "The server isn't answering",
"after": 3
}
}
},
{
"id": "indexers",
"type": "list",
"label": "Indexers",
"max_items": 7,
"items": [],
"source": {
"ref": "indexers",
"empty": {
"text": "No indexers in Prowlarr yet",
"when": {
"path": "indexer_count",
"equals": 0
}
},
"map": {
"items": {
"each": "indexer_rows",
"fields": {
"key": "key",
"text": "text",
"subtitle": "subtitle",
"detail": "detail"
}
}
}
},
"row_actions": [
{
"label": "Test",
"icon": "testtube.2",
"method": "POST",
"path": "/api/v1/indexer/test",
"body": "{resource}",
"error": "[0].errorMessage",
"timeout": 120,
"done_note": "Passed",
"when": {
"path": "enabled",
"equals": true
}
}
]
},
{
"id": "week",
"type": "facts",
"label": "Last 7 days",
"items": [
{
"key": "Grabs",
"value": "—"
},
{
"key": "By app",
"value": "—"
},
{
"key": "Searches",
"value": "—"
},
{
"key": "RSS syncs",
"value": "—"
}
],
"source": {
"ref": "indexers",
"map": {
"items[0].value": {
"if": {
"path": "failed_grabs",
"gt": 0
},
"then": {
"template": "{grab_total} · {failed_grabs} failed"
},
"else": {
"template": "{grab_total}"
}
},
"items[1].value": {
"if": {
"path": "app_count",
"gt": 0
},
"then": {
"template": "{by_app}"
},
"else": {
"template": "None"
}
},
"items[2].value": {
"if": {
"path": "failed_searches",
"gt": 0
},
"then": {
"template": "{searches} · {failed_searches} failed"
},
"else": {
"template": "{searches}"
}
},
"items[3].value": {
"if": {
"path": "failed_rss",
"gt": 0
},
"then": {
"template": "{rss} · {failed_rss} failed"
},
"else": {
"template": "{rss}"
}
}
}
}
},
{
"id": "grabs",
"type": "list",
"label": "Recent grabs",
"max_items": 4,
"items": [],
"source": {
"ref": "indexers",
"empty": {
"text": "No grabs yet",
"when": {
"path": "grab_count",
"equals": 0
}
},
"map": {
"items": {
"each": "grab_rows",
"fields": {
"key": "key",
"text": "text",
"subtitle": "subtitle",
"detail": "detail"
}
}
}
}
}
]
}
```
## Questions
### What does Test do?
The same as Test on the indexer in Prowlarr: it sends one query to the indexer and reports whether it answered. A test can take up to two minutes when an indexer is slow to answer. Indexers you turned off have no Test.
### What does Unavailable mean?
Prowlarr stops sending queries to an indexer that keeps failing, and waits longer after each failure before it tries again. The row says when it first failed and when the wait ends. After that, Prowlarr tries it again on the next search, and until then the row shows its counts like the others. If it keeps failing, test the indexer in Prowlarr, which says what went wrong.
### Why does a grab have no indexer?
The indexer has been deleted from Prowlarr since. The grab then shows just the app.
### Does it work with Sonarr and Radarr?
Yes: the [Sonarr](https://legatobar.com/services/sonarr) and [Radarr](https://legatobar.com/services/radarr) pages have the same layout, for what they download.
Legato is independent and isn’t affiliated with or endorsed by Prowlarr.
## Verification
The page’s rules were checked against Prowlarr 2.7.0’s answers on 13 Nov 2026, with six indexers: four public ones and two that were made to fail, so the Unavailable rows, the warning and the recovery come from real answers. Test was pressed on every indexer through Legato: four passed, the one made to fail was refused with Prowlarr’s reason, and one public indexer timed out for real. Illustrations use made-up indexers, releases and numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# Seerr in your Mac’s menu bar
See who’s asked for what without opening Seerr: each request waiting for you with its poster, who asked and when, and Approve and Decline right on the row. One page serves Seerr, Overseerr and Jellyseerr, since all three share the same API.
## What you’ll see
- **Waiting:** the requests waiting for you, oldest first, with their posters. Each row has the title and year, who asked and how long ago, and the seasons or "4K" when the request is for those. The card shows 7 with **Show more** for the rest, and says "9 waiting", or "20 of 37 waiting" when there are more than the 20 it reads. Point at a row for **Approve** and **Decline**. Decline asks first. A request whose title Seerr couldn’t look up says "A movie" or "A show" and has no buttons.
- **Requests:** how many are processing, your version (and "Update available" when Seerr has seen a newer one), open issues, and how many requests have been made available or declined.
- **Recent:** the four latest requests that aren’t waiting, with what each is now: Approved, Processing, Partly available, Available, Declined or Failed. Point at a failed row for **Retry**, which sends it to Radarr or Sonarr again.
- **Titles and posters · TMDB:** a last line with TMDB’s logo, crediting where the titles and posters come from. It opens TMDB’s site.
Nothing on the page counts as a problem: waiting requests are work for you, like tasks in a to-do list. If the server stops answering, the cards say so.
### Status
- No health card.
- Waiting requests are work for you, oldest first on the page.
- A note on the cards when the server doesn’t answer or refuses the key.
## How it connects
The page reads the server’s API with your API key, sent as `X-Api-Key`.
| Request | When | What it supplies |
| --- | --- | --- |
| `GET /api/v1/request?filter=pending&take=20&sort=added` | Every 2 minutes | The requests waiting for you, newest 20, with who asked. |
| `GET /api/v1/movie/{id}` or `GET /api/v1/tv/{id}` | Once for each request, then kept for 6 hours | Its title, year and poster. A request names only its TMDB id. |
| `GET /api/v1/settings/public` | Every 2 and every 5 minutes | Whether the server sends posters (see below). |
| `GET /api/v1/request/count` | Every 5 minutes | How many requests are processing, available and declined. |
| `GET /api/v1/issue/count` | Every 5 minutes | How many issues are open. |
| `GET /api/v1/status` | Every 5 minutes | Your version, and whether there’s a newer one. |
| `GET /api/v1/request?filter=all&take=20&sort=modified` | Every 5 minutes | The latest changes. |
| `GET /imageproxy/tmdb/t/p/w300_and_h450_face/…` | While the panel shows the poster | Each poster, through your server, kept on this Mac. |
| `POST /api/v1/request/{id}/approve` | When you press Approve | Approves the request, and your server sends it to Radarr or Sonarr. |
| `POST /api/v1/request/{id}/decline` | When you press Decline and confirm | Declines it. |
| `POST /api/v1/request/{id}/retry` | When you press Retry | Sends a failed request again. |
That’s about 120 requests an hour, plus one for each new request’s title. After you press a button, Legato reads the waiting requests a few more times over the next minute, and the titles it already has aren’t asked for again.
Posters come only from your server, and **Load icons from the web** in Settings doesn’t affect them. Seerr sends them only while **Settings → General → Enable Image Caching** is on. With it off, each row shows a film or TV icon instead. Overseerr and Jellyseerr always send them.
Titles and posters come from TMDB. Your server looks them up with its own TMDB access, and Legato reads them from your server.
The [Seerr API documentation](https://docs.seerr.dev) has the rest. [Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Copy your API key.** In Seerr, Overseerr or Jellyseerr, open **Settings → General** and copy the **API Key**. It acts as the server’s admin, so it can approve and decline.
2. **For posters on Seerr,** turn on **Enable Image Caching** on the same page.
3. **Save it in Legato.** In Settings → Secrets, save the key under `seerr`, bound to your server’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
4. **Add the page.** Use **Install in Legato**, paste the prompt into your agent, or download the page and run `/Applications/Legato.app/Contents/Helpers/legato set seerr seerr.json`.
5. **Point it at your server.** Use the address you open Seerr at. It listens on port 5055 over plain http, as in `http://192.168.1.20:5055`. Behind a reverse proxy it’s your own address, such as `https://requests.example.com`. A server on a path like `/seerr` needs `"base": "/seerr"` on both sources.
The cards fill within two minutes. If your server has a self-signed certificate, Legato can trust it only at an IP address or a `.local` name.
### Prompt for your agent
```prompt
Add a Legato page for Seerr, starting from https://legatobar.com/examples/seerr.json.
Add the page as it is, keeping its page ID, and change http://192.0.2.50:5055 on both sources to my server’s address. I’ll save my API key as seerr in Settings → Secrets myself. Don’t press Approve, Decline or Retry to test them.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the page
```json
{
"title": "Seerr",
"icon": "film.stack",
"sources": {
"waiting": {
"url": "http://192.0.2.50:5055",
"secret": "seerr",
"auth": {
"type": "header",
"name": "X-Api-Key"
},
"every": "2m",
"requests": {
"pending": "/api/v1/request?filter=pending&take=20&sort=added",
"titles": {
"path": "/api/v1/{media.mediaType}/{media.tmdbId}",
"each_row": {
"from": "pending.results",
"key": "id",
"max": 20,
"pick": [
"title",
"name",
"releaseDate",
"firstAirDate",
"posterPath"
],
"keep": "6h"
}
},
"public": "/api/v1/settings/public"
},
"derive": [
{
"name": "posters",
"value": {
"if": {
"all": [
{
"path": "public.cacheImages",
"not": true
},
{
"path": "public.hideBlocklisted",
"exists": true
}
]
},
"then": {
"template": "off"
},
"else": {
"template": "on"
}
}
},
{
"name": "all_rows",
"value": {
"each": "pending.results",
"lookup": {
"from": "titles",
"by": "key",
"on": "id",
"as": "t"
},
"sort": {
"by": [
"createdAt",
"id"
]
},
"fields": {
"id": "id",
"type": "type",
"status": "status",
"title": {
"if": {
"path": "type",
"equals": "tv"
},
"then": "t.answer.name",
"else": "t.answer.title"
},
"year": {
"if": {
"path": "type",
"equals": "tv"
},
"then": {
"path": "t.answer.firstAirDate",
"match": "^([0-9]{4})"
},
"else": {
"path": "t.answer.releaseDate",
"match": "^([0-9]{4})"
}
},
"who": {
"path": "requestedBy.displayName",
"default": "Someone"
},
"when": {
"template": "{createdAt|ago}"
},
"hd4k": {
"path": "is4k",
"values": {
"true": "4K"
},
"default": ""
},
"seasons": {
"join": "seasonNumber",
"of": "seasons",
"separator": ", "
},
"season_count": {
"count": "seasons"
},
"media": {
"if": {
"path": "is4k",
"equals": true
},
"then": {
"path": "media.status4k",
"values": {
"2": "Approved",
"3": "Processing",
"4": "Partly available",
"5": "Available"
},
"default": "Approved"
},
"else": {
"path": "media.status",
"values": {
"2": "Approved",
"3": "Processing",
"4": "Partly available",
"5": "Available"
},
"default": "Approved"
}
},
"poster": {
"if": {
"path": "t.answer.posterPath",
"exists": true
},
"then": {
"template": "/imageproxy/tmdb/t/p/w300_and_h450_face{t.answer.posterPath}"
},
"else": {
"template": ""
}
},
"icon": {
"if": {
"path": "type",
"equals": "tv"
},
"then": {
"template": "tv"
},
"else": {
"template": "film"
}
},
"art": {
"template": "on"
},
"no_art": {
"template": "off"
}
}
}
},
{
"name": "rows_art",
"value": {
"each": "all_rows",
"where": {
"path": "art",
"equals": {
"answer": "posters"
}
},
"fields": {
"id": "id",
"type": "type",
"status": "status",
"title": "title",
"year": "year",
"who": "who",
"when": "when",
"hd4k": "hd4k",
"seasons": "seasons",
"season_count": "season_count",
"media": "media",
"icon": "icon",
"image": "poster"
}
}
},
{
"name": "rows_plain",
"value": {
"each": "all_rows",
"where": {
"path": "no_art",
"equals": {
"answer": "posters"
}
},
"fields": {
"id": "id",
"type": "type",
"status": "status",
"title": "title",
"year": "year",
"who": "who",
"when": "when",
"hd4k": "hd4k",
"seasons": "seasons",
"season_count": "season_count",
"media": "media",
"icon": "icon",
"image": {
"template": ""
}
}
}
},
{
"name": "rows_shown",
"value": {
"count": "all_rows"
}
}
]
},
"server": {
"url": "http://192.0.2.50:5055",
"secret": "seerr",
"auth": {
"type": "header",
"name": "X-Api-Key"
},
"every": "5m",
"requests": {
"count": "/api/v1/request/count",
"issues": "/api/v1/issue/count",
"status": "/api/v1/status",
"public": "/api/v1/settings/public",
"recent": "/api/v1/request?filter=all&take=20&sort=modified",
"recent_titles": {
"path": "/api/v1/{media.mediaType}/{media.tmdbId}",
"each_row": {
"from": "recent.results",
"key": "id",
"max": 20,
"pick": [
"title",
"name",
"releaseDate",
"firstAirDate",
"posterPath"
],
"keep": "6h"
}
}
},
"derive": [
{
"name": "posters",
"value": {
"if": {
"all": [
{
"path": "public.cacheImages",
"not": true
},
{
"path": "public.hideBlocklisted",
"exists": true
}
]
},
"then": {
"template": "off"
},
"else": {
"template": "on"
}
}
},
{
"name": "all_rows",
"value": {
"each": "recent.results",
"lookup": {
"from": "recent_titles",
"by": "key",
"on": "id",
"as": "t"
},
"where": {
"path": "status",
"not": 1
},
"limit": 4,
"fields": {
"id": "id",
"type": "type",
"status": "status",
"title": {
"if": {
"path": "type",
"equals": "tv"
},
"then": "t.answer.name",
"else": "t.answer.title"
},
"year": {
"if": {
"path": "type",
"equals": "tv"
},
"then": {
"path": "t.answer.firstAirDate",
"match": "^([0-9]{4})"
},
"else": {
"path": "t.answer.releaseDate",
"match": "^([0-9]{4})"
}
},
"who": {
"path": "requestedBy.displayName",
"default": "Someone"
},
"when": {
"template": "{updatedAt|ago}"
},
"hd4k": {
"path": "is4k",
"values": {
"true": "4K"
},
"default": ""
},
"seasons": {
"join": "seasonNumber",
"of": "seasons",
"separator": ", "
},
"season_count": {
"count": "seasons"
},
"media": {
"if": {
"path": "is4k",
"equals": true
},
"then": {
"path": "media.status4k",
"values": {
"2": "Approved",
"3": "Processing",
"4": "Partly available",
"5": "Available"
},
"default": "Approved"
},
"else": {
"path": "media.status",
"values": {
"2": "Approved",
"3": "Processing",
"4": "Partly available",
"5": "Available"
},
"default": "Approved"
}
},
"poster": {
"if": {
"path": "t.answer.posterPath",
"exists": true
},
"then": {
"template": "/imageproxy/tmdb/t/p/w300_and_h450_face{t.answer.posterPath}"
},
"else": {
"template": ""
}
},
"icon": {
"if": {
"path": "type",
"equals": "tv"
},
"then": {
"template": "tv"
},
"else": {
"template": "film"
}
},
"art": {
"template": "on"
},
"no_art": {
"template": "off"
}
}
}
},
{
"name": "rows_art",
"value": {
"each": "all_rows",
"where": {
"path": "art",
"equals": {
"answer": "posters"
}
},
"fields": {
"id": "id",
"type": "type",
"status": "status",
"title": "title",
"year": "year",
"who": "who",
"when": "when",
"hd4k": "hd4k",
"seasons": "seasons",
"season_count": "season_count",
"media": "media",
"icon": "icon",
"image": "poster"
}
}
},
{
"name": "rows_plain",
"value": {
"each": "all_rows",
"where": {
"path": "no_art",
"equals": {
"answer": "posters"
}
},
"fields": {
"id": "id",
"type": "type",
"status": "status",
"title": "title",
"year": "year",
"who": "who",
"when": "when",
"hd4k": "hd4k",
"seasons": "seasons",
"season_count": "season_count",
"media": "media",
"icon": "icon",
"image": {
"template": ""
}
}
}
},
{
"name": "rows_shown",
"value": {
"count": "all_rows"
}
}
]
}
},
"cards": [
{
"id": "waiting",
"type": "list",
"label": "Waiting",
"max_items": 7,
"image_shape": "poster",
"items": [],
"source": {
"ref": "waiting",
"empty": {
"text": "No requests waiting",
"when": {
"path": "pending.pageInfo.results",
"equals": 0
}
},
"map": {
"label": {
"if": {
"path": "pending.pageInfo.results",
"gt": 20
},
"then": {
"template": "{rows_shown} of {pending.pageInfo.results} waiting"
},
"else": {
"if": {
"path": "pending.pageInfo.results",
"gt": 0
},
"then": {
"template": "{pending.pageInfo.results} waiting"
},
"else": {
"template": "Waiting"
}
}
},
"items": {
"each": [
"rows_art",
"rows_plain"
],
"fields": {
"key": "id",
"text": {
"if": {
"path": "title",
"exists": true
},
"then": {
"if": {
"path": "year",
"exists": true
},
"then": {
"template": "{title} ({year|raw})"
},
"else": {
"template": "{title}"
}
},
"else": {
"if": {
"path": "type",
"equals": "tv"
},
"then": {
"template": "A show"
},
"else": {
"template": "A movie"
}
}
},
"subtitle": {
"template": "{who} · {when}"
},
"detail": {
"if": {
"path": "hd4k",
"equals": "4K"
},
"then": {
"if": {
"path": "season_count",
"gt": 3
},
"then": {
"template": "4K · {season_count} seasons"
},
"else": {
"if": {
"path": "season_count",
"gt": 1
},
"then": {
"template": "4K · Seasons {seasons}"
},
"else": {
"if": {
"path": "season_count",
"equals": 1
},
"then": {
"template": "4K · Season {seasons}"
},
"else": {
"template": "4K"
}
}
}
},
"else": {
"if": {
"path": "season_count",
"gt": 3
},
"then": {
"template": "{season_count} seasons"
},
"else": {
"if": {
"path": "season_count",
"gt": 1
},
"then": {
"template": "Seasons {seasons}"
},
"else": {
"if": {
"path": "season_count",
"equals": 1
},
"then": {
"template": "Season {seasons}"
}
}
}
}
},
"image": "image",
"icon": "icon"
}
}
}
},
"row_actions": [
{
"label": "Approve",
"icon": "checkmark",
"method": "POST",
"path": "/api/v1/request/{id}/approve",
"when": {
"path": "title",
"exists": true
}
},
{
"label": "Decline",
"icon": "xmark",
"method": "POST",
"path": "/api/v1/request/{id}/decline",
"confirm": {
"message": "Decline {title} for {who}?",
"button": "Decline"
},
"when": {
"path": "title",
"exists": true
}
}
]
},
{
"id": "requests",
"type": "facts",
"label": "Requests",
"source": {
"ref": "server",
"map": {
"items[0].value": {
"template": "{count.processing}"
},
"items[1].value": {
"if": {
"path": "status.updateAvailable",
"equals": true
},
"then": {
"template": "{status.version} · Update available"
},
"else": {
"template": "{status.version}"
}
},
"items[2].value": {
"template": "{issues.open}"
},
"items[3].value": {
"add": [
"count.available",
{
"path": "count.completed",
"default": 0
}
]
},
"items[4].value": {
"template": "{count.declined}"
}
}
},
"items": [
{
"key": "Processing",
"value": "—"
},
{
"key": "Version",
"value": "—"
},
{
"key": "Open issues",
"value": "—"
},
{
"key": "Available",
"value": "—"
},
{
"key": "Declined",
"value": "—"
}
]
},
{
"id": "recent",
"type": "list",
"label": "Recent",
"max_items": 4,
"image_shape": "poster",
"items": [],
"source": {
"ref": "server",
"empty": {
"text": "No other recent requests",
"when": {
"path": "rows_shown",
"equals": 0
}
},
"map": {
"items": {
"each": [
"rows_art",
"rows_plain"
],
"fields": {
"key": "id",
"text": {
"if": {
"path": "title",
"exists": true
},
"then": {
"if": {
"path": "year",
"exists": true
},
"then": {
"template": "{title} ({year|raw})"
},
"else": {
"template": "{title}"
}
},
"else": {
"if": {
"path": "type",
"equals": "tv"
},
"then": {
"template": "A show"
},
"else": {
"template": "A movie"
}
}
},
"subtitle": {
"template": "{who} · {when}"
},
"detail": {
"path": "status",
"values": {
"1": "Waiting",
"3": "Declined",
"4": "Failed"
},
"default": {
"template": "{media}"
}
},
"image": "image",
"icon": "icon"
}
}
}
},
"row_actions": [
{
"label": "Retry",
"icon": "arrow.uturn.forward",
"method": "POST",
"path": "/api/v1/request/{id}/retry",
"when": {
"path": "status",
"equals": 4
}
}
]
},
{
"id": "credit",
"type": "facts",
"items": [
{
"key": "Titles and posters",
"value": "TMDB",
"icon": "si:themoviedatabase",
"url": "https://www.themoviedb.org"
}
]
}
]
}
```
## Questions
### Why does the oldest waiting request sometimes not show?
Overseerr can only list its newest requests first, so the page reads the newest 20 and shows the oldest of those at the top. With more than 20 waiting, the card says "20 of 37 waiting", and the rest are in your server’s Requests page.
### What if I press Approve on a request someone else just approved?
Seerr refuses it, and the row’s button says the server answered HTTP 409. The row leaves when the page reads the server again. Overseerr and Jellyseerr accept it and change nothing.
### Why doesn’t the page show requests by user, or let me request something?
The page is for the person who approves requests. People who make requests do that in Seerr itself, where they can search.
Legato is independent and isn’t affiliated with or endorsed by Seerr, Overseerr or Jellyseerr.
This product uses TMDB and the TMDB APIs but is not endorsed, certified, or otherwise approved by TMDB.
## Verification
The page was filled from Seerr 3.5.2, Jellyseerr 2.7.3 and Overseerr 1.35.0 on 13 Nov 2026, each with five made-up users and 17 requests, connected to test Jellyfin, Emby, Radarr and Sonarr servers. Approve and Decline were pressed on all three, and Retry on Seerr after a request failed on purpose. Posters were fetched through each server’s image proxy, and with Seerr’s image caching off the page showed icons. Illustrations use made-up titles, people and numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# Nextcloud in your Mac’s menu bar
See how much room your Nextcloud has left, which updates are waiting and how many people used it today, without opening its admin pages.
## What you’ll see
- **Health:** in Details, two lines. **Nextcloud** says its version, or that it’s in maintenance mode (orange, as it is during an upgrade) or has an upgrade waiting to finish outside maintenance mode (red). **Storage** says how much space is free: orange under 10 GB and red under 2 GB, and grey when Nextcloud’s server info can’t be read. Either one turns the health card orange or red, and Nextcloud goes red once it stops answering.
- **Free space:** a week of it, one reading every 3 hours, so a disk filling up shows as a falling line. Nextcloud keeps no history of its own, so Legato records the readings while it runs. The card says it’s collecting them until it has two, up to 3 hours after you add the page.
- **Updates:** a newer Nextcloud and the apps with updates, by name ("Nextcloud 34.0.6 · Calendar, Notes"), or None waiting. A waiting update never counts as a problem.
- **Active users:** how many people used Nextcloud in the last 5 minutes, 24 hours and 7 days.
- **Shares**, with how many are public links and how many of those have no password; **Version**, Nextcloud’s and PHP’s; **Users**, how many accounts have signed in at least once and how many are disabled; and **Files**.
- **Memory** and **Load**: how much memory is in use on the machine Nextcloud runs on, and its load average over the last minute beside its number of CPU threads. In a container they’re usually the host’s.
### Status
- Shows whether Nextcloud is answering and how much space is left.
- Orange under 10 GB free or in maintenance mode, as during an upgrade.
- Red under 2 GB free, when an upgrade is left waiting outside maintenance mode, or once Nextcloud stops answering.
- Grey when Nextcloud’s server info can’t be read.
- An update waiting never counts as a problem.
- Notifies you when it turns orange or red.
## How it connects
The page reads Nextcloud’s Monitoring app (serverinfo, which comes with Nextcloud) with its monitoring token, sent as `NC-Token`. That token can read this summary and nothing else.
| Request | When | What it supplies |
| --- | --- | --- |
| `GET /status.php` | Every 5 minutes | Nextcloud’s version, and whether it’s in maintenance mode or waiting to finish an upgrade. It needs no token. |
| `GET /ocs/v2.php/apps/serverinfo/api/v1/info?format=json&skipApps=false&skipUpdate=false` | Every 5 minutes | Free space, updates waiting, active users, shares, users, memory, load and files. About 3 KB. |
That’s 24 requests an hour while your Mac is awake. In maintenance mode Nextcloud turns the second request away. The chart and facts then keep their last answer, and after three missed reads, 15 minutes, Storage turns grey and says it can’t read Nextcloud’s server info. A refused token does the same. The [Monitoring app’s own page](https://github.com/nextcloud/serverinfo) covers the request.
Updates are as of Nextcloud’s own daily check. The file count is refreshed by a background job, so it reads 0 on a new server until that job has run. Free space is for the disk that holds Nextcloud’s data folder. Nextcloud doesn’t report that disk’s size, which is why the page warns at an amount rather than a percentage. If your data is on object storage, Nextcloud can’t measure it, and Storage says so.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make a monitoring token.** In Nextcloud, open **Administration settings → System** and find **External monitoring tool**. Nextcloud 35 generates a token there; on older versions, make up a long random one. Store it by running the `occ` command shown there on your server.
2. **Save it in Legato.** In Settings → Secrets, save the token under `nextcloud`, bound to your Nextcloud’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the page.** Paste the prompt into your agent, or download the page and run `/Applications/Legato.app/Contents/Helpers/legato set nextcloud nextcloud.json`.
4. **Point it at Nextcloud.** Change `https://nextcloud.example.com` to your Nextcloud’s address on both sources. Use the address you open Nextcloud at: Nextcloud answers only the names in its `trusted_domains`, and turns the others away. If Nextcloud sits at a path, such as `https://example.com/nextcloud`, set each source’s `url` to `https://example.com` and add `"base": "/nextcloud"`.
The cards fill within a minute. A mistyped token is the usual reason they don’t: the page then notes that Nextcloud refused it. Nextcloud counts each refused token as a failed sign-in from your Mac, and after many it may slow sign-ins from your Mac’s address. Fix the token, and an admin can clear the count with `occ security:bruteforce:reset `.
To warn at other amounts, change the numbers of bytes in the Storage card’s rules: 10737418240 (10 GB) appears twice, in `state` and `detail`, and 2147483648 (2 GB) once, in `state`.
### Prompt for your agent
```prompt
Add a Legato page for Nextcloud, starting from https://legatobar.com/examples/nextcloud.json.
Add the page as it is and change https://nextcloud.example.com on both sources to my Nextcloud’s address. I’ll save my monitoring token as nextcloud in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the page
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "Nextcloud",
"icon": "cloud",
"sources": {
"server": {
"url": "https://nextcloud.example.com",
"every": "5m",
"requests": {
"status": "/status.php"
}
},
"info": {
"url": "https://nextcloud.example.com",
"secret": "nextcloud",
"auth": {
"type": "header",
"name": "NC-Token"
},
"every": "5m",
"requests": {
"info": "/ocs/v2.php/apps/serverinfo/api/v1/info?format=json&skipApps=false&skipUpdate=false"
},
"derive": [
{
"name": "free",
"value": {
"path": "info.ocs.data.nextcloud.system.freespace"
}
},
{
"name": "free_gb",
"value": {
"path": "info.ocs.data.nextcloud.system.freespace",
"scale": 9.313225746154785e-10,
"round": 1
}
},
{
"name": "core",
"value": {
"path": "info.ocs.data.nextcloud.system.update.available"
}
},
{
"name": "core_version",
"value": {
"path": "info.ocs.data.nextcloud.system.update.available_version",
"match": "^([0-9]+\\.[0-9]+\\.[0-9]+)"
}
},
{
"name": "core_words",
"value": {
"if": {
"path": "core_version",
"exists": true
},
"then": {
"template": "Nextcloud {core_version}"
},
"else": {
"template": "Nextcloud"
}
}
},
{
"name": "apps",
"value": {
"each": "info.ocs.data.nextcloud.system.apps.app_updates",
"entries": true,
"sort": "key",
"fields": {
"name": {
"path": "key",
"values": {
"calendar": "Calendar",
"contacts": "Contacts",
"mail": "Mail",
"spreed": "Talk",
"deck": "Deck",
"notes": "Notes",
"tasks": "Tasks",
"richdocuments": "Nextcloud Office",
"richdocumentscode": "Collabora Online",
"onlyoffice": "ONLYOFFICE",
"photos": "Photos",
"memories": "Memories",
"recognize": "Recognize",
"forms": "Forms",
"polls": "Polls",
"groupfolders": "Team folders",
"files_pdfviewer": "PDF viewer",
"text": "Text",
"whiteboard": "Whiteboard",
"news": "News",
"bookmarks": "Bookmarks",
"cookbook": "Cookbook",
"music": "Music",
"maps": "Maps",
"twofactor_totp": "Two-Factor TOTP",
"twofactor_webauthn": "Two-Factor WebAuthn",
"user_ldap": "LDAP user and group backend",
"user_oidc": "OpenID Connect user backend",
"integration_openai": "OpenAI integration",
"assistant": "Assistant",
"collectives": "Collectives",
"tables": "Tables",
"end_to_end_encryption": "End-to-end encryption",
"suspicious_login": "Suspicious login",
"previewgenerator": "Preview Generator",
"files_retention": "Retention",
"app_api": "AppAPI",
"serverinfo": "Monitoring",
"activity": "Activity",
"notifications": "Notifications"
},
"default": {
"template": "{key|title}"
}
}
}
}
},
{
"name": "app_count",
"value": {
"count": "apps",
"default": 0
}
},
{
"name": "first_apps",
"value": {
"each": "apps",
"limit": 2,
"fields": {
"name": "name"
}
}
},
{
"name": "app_words",
"value": {
"join": "name",
"of": "first_apps",
"separator": ", "
}
},
{
"name": "apps_more",
"value": {
"subtract": [
"app_count",
2
]
}
},
{
"name": "app_text",
"value": {
"if": {
"path": "app_count",
"gt": 2
},
"then": {
"template": "{app_words} and {apps_more} more"
},
"else": {
"template": "{app_words}"
}
}
},
{
"name": "users",
"value": {
"path": "info.ocs.data.nextcloud.storage.num_users"
}
},
{
"name": "disabled",
"value": {
"path": "info.ocs.data.nextcloud.storage.num_disabled_users",
"default": 0
}
},
{
"name": "shares",
"value": {
"path": "info.ocs.data.nextcloud.shares.num_shares",
"default": 0
}
},
{
"name": "links",
"value": {
"path": "info.ocs.data.nextcloud.shares.num_shares_link",
"default": 0
}
},
{
"name": "open_links",
"value": {
"path": "info.ocs.data.nextcloud.shares.num_shares_link_no_password",
"default": 0
}
},
{
"name": "version",
"value": {
"path": "info.ocs.data.nextcloud.system.version",
"match": "^([0-9]+\\.[0-9]+\\.[0-9]+)"
}
},
{
"name": "mem_total",
"value": {
"path": "info.ocs.data.nextcloud.system.mem_total",
"scale": 1024
}
},
{
"name": "mem_used",
"value": {
"subtract": [
"info.ocs.data.nextcloud.system.mem_total",
"info.ocs.data.nextcloud.system.mem_free"
],
"scale": 1024
}
},
{
"name": "load",
"value": {
"path": "info.ocs.data.nextcloud.system.cpuload[0]",
"round": 2
}
},
{
"name": "cores",
"value": {
"path": "info.ocs.data.nextcloud.system.cpunum"
}
}
]
}
},
"cards": [
{
"id": "server",
"type": "status",
"placement": "page_info",
"label": "Nextcloud",
"state": "unknown",
"width": "full",
"source": {
"ref": "server",
"map": {
"state": {
"if": {
"path": "status.maintenance",
"equals": true
},
"then": {
"template": "warning"
},
"else": {
"if": {
"path": "status.needsDbUpgrade",
"equals": true
},
"then": {
"template": "critical"
},
"else": {
"template": "ok"
}
}
},
"detail": {
"if": {
"path": "status.maintenance",
"equals": true
},
"then": {
"template": "In maintenance mode"
},
"else": {
"if": {
"path": "status.needsDbUpgrade",
"equals": true
},
"then": {
"template": "An upgrade is waiting to finish"
},
"else": {
"template": "Nextcloud {status.versionstring} · No problems"
}
}
}
},
"failed": {
"state": "critical",
"detail": "The server isn't answering",
"after": 3
}
}
},
{
"id": "storage",
"type": "status",
"placement": "page_info",
"label": "Storage",
"state": "unknown",
"width": "full",
"source": {
"ref": "info",
"map": {
"state": {
"if": {
"path": "free",
"exists": false
},
"then": {
"template": "off"
},
"else": {
"if": {
"path": "free",
"lt": 2147483648
},
"then": {
"template": "critical"
},
"else": {
"if": {
"path": "free",
"lt": 10737418240
},
"then": {
"template": "warning"
},
"else": {
"template": "ok"
}
}
}
},
"detail": {
"if": {
"path": "free",
"exists": false
},
"then": {
"template": "Nextcloud doesn't report free space for this storage"
},
"else": {
"if": {
"path": "free",
"lt": 10737418240
},
"then": {
"template": "Only {free|bytes} free"
},
"else": {
"template": "{free|bytes} free"
}
}
}
},
"failed": {
"state": "unknown",
"detail": "Can't read Nextcloud's server info",
"after": 3
}
}
},
{
"id": "free",
"type": "sparkline",
"label": "Free space",
"unit": "GB",
"points": [],
"source": {
"ref": "info",
"map": {
"points": {
"history": "free_gb",
"every": "3h",
"keep": 56
}
}
}
},
{
"id": "facts",
"type": "facts",
"items": [
{
"key": "Updates",
"value": "—"
},
{
"key": "Active users",
"value": "—"
},
{
"key": "Shares",
"value": "—"
},
{
"key": "Version",
"value": "—"
},
{
"key": "Memory",
"value": "—"
},
{
"key": "Load",
"value": "—"
},
{
"key": "Users",
"value": "—"
},
{
"key": "Files",
"value": "—"
}
],
"source": {
"ref": "info",
"map": {
"items[0].value": {
"if": {
"path": "core",
"equals": true
},
"then": {
"if": {
"path": "app_count",
"gt": 0
},
"then": {
"template": "{core_words} · {app_text}"
},
"else": {
"template": "{core_words}"
}
},
"else": {
"if": {
"path": "app_count",
"gt": 0
},
"then": {
"template": "{app_text}"
},
"else": {
"if": {
"path": "core",
"exists": true
},
"then": {
"template": "None waiting"
},
"else": {
"template": "Not reported"
}
}
}
},
"items[1].value": {
"template": "{info.ocs.data.activeUsers.last5minutes} in 5 minutes · {info.ocs.data.activeUsers.last24hours} in 24 hours · {info.ocs.data.activeUsers.last7days} in 7 days"
},
"items[2].value": {
"if": {
"path": "links",
"gt": 0
},
"then": {
"if": {
"path": "open_links",
"gt": 0
},
"then": {
"if": {
"path": "links",
"equals": 1
},
"then": {
"template": "{shares} · 1 link, with no password"
},
"else": {
"template": "{shares} · {links} links, {open_links} with no password"
}
},
"else": {
"if": {
"path": "links",
"equals": 1
},
"then": {
"template": "{shares} · 1 link"
},
"else": {
"template": "{shares} · {links} links"
}
}
},
"else": {
"template": "{shares}"
}
},
"items[3].value": {
"if": {
"path": "info.ocs.data.server.php.version",
"exists": true
},
"then": {
"template": "Nextcloud {version} · PHP {info.ocs.data.server.php.version}"
},
"else": {
"template": "Nextcloud {version}"
}
},
"items[4].value": {
"if": {
"all": [
{
"path": "info.ocs.data.nextcloud.system.mem_total",
"gt": 0
},
{
"path": "info.ocs.data.nextcloud.system.mem_free",
"gte": 0
}
]
},
"then": {
"template": "{mem_used|bytes} used of {mem_total|bytes}"
},
"else": {
"template": "Not reported"
}
},
"items[5].value": {
"if": {
"path": "load",
"gte": 0
},
"then": {
"if": {
"path": "cores",
"gt": 0
},
"then": {
"if": {
"path": "cores",
"equals": 1
},
"then": {
"template": "{load} on 1 thread"
},
"else": {
"template": "{load} on {cores} threads"
}
},
"else": {
"template": "{load}"
}
},
"else": {
"template": "Not reported"
}
},
"items[6].value": {
"if": {
"path": "disabled",
"gt": 0
},
"then": {
"template": "{users} active, {disabled} disabled"
},
"else": {
"template": "{users} active"
}
},
"items[7].value": {
"template": "{info.ocs.data.nextcloud.storage.num_files}"
}
}
}
}
]
}
```
## Questions
### Why does Storage say "Only 6.8 GB free" when the disk is huge?
The warning is an amount, not a share of the disk, because Nextcloud doesn’t report the disk’s size. Change the amounts as above if 10 GB is too much or too little for your disk.
### Why do some apps show by their id?
Nextcloud reports apps with updates by their id. The page names the common ones (Talk, Nextcloud Office, Calendar and so on) and shows any other by its id with a capital letter.
### Why doesn’t an update count as a problem?
Most people install updates when it suits them, and a page that stays orange for days gets ignored. The Updates row says what’s waiting.
### Can it show my files or activity?
No. The monitoring token reaches only the server summary. Showing files or activity would take an admin’s app password, which can do everything an admin can.
Legato is independent and isn’t affiliated with or endorsed by Nextcloud.
## Verification
The page was checked on 14 Nov 2026 against two Nextcloud servers with made-up users, files and shares: Nextcloud 35.0.3 with nothing waiting, and Nextcloud 34.0.5 with Nextcloud 34.0.6 and two app updates waiting and its data disk 93% full. Maintenance mode, a refused token and an address Nextcloud doesn’t trust were tried on them with direct requests, and a refused token through Legato’s install check. Illustrations use made-up numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# Paperless-ngx in your Mac’s menu bar
See what’s waiting in your Paperless inbox without opening it: how many documents are there, which ones arrived last, whether any file failed to import, and whether Paperless’s own system status has found a problem.
## What you’ll see
- **Paperless:**
- **Health:** in Details, Paperless’s version, or the first problem its system status reports, in its own words ("Classifier: No training data available."), and how many others there are. An error in the database, Redis, Celery, the search index, the classifier or the sanity check turns the health card red, as Paperless’s own status badge turns red. No Celery worker answering, or a file that didn’t import, turns it orange. Either one sends a notification. It also turns red once Paperless stops answering or refuses the status request.
- **Inbox** and **Added this month:** how many documents have an inbox tag, and how many Paperless took in since the 1st, with the whole library’s count under it. If no tag in your Paperless is an inbox tag, Inbox shows a dash.
- **Server:** free space on the disk that holds your documents, how many correspondents, tags and document types you have, and Paperless’s version, with the newer one when there’s an update.
- **Failed imports:** only while there are any, the files Paperless couldn’t take in, with its reason. Point at a row for **Dismiss**, which marks it as seen, as Dismiss on Paperless’s Tasks page does, and the page stops counting it at once. The file itself stays wherever it was.
- **Inbox:** the newest documents in the inbox, with their correspondent and type and when they arrived. The card shows 7, with **Show more** for the rest of the 25 it reads, and its title says "Inbox · 25 of 40" when there are more than that. Click a row to open the document in Paperless. Without an inbox tag, this card is **Recently added**, the four newest documents.
- **Search Paperless:** the magnifying glass in the corner of the Inbox, and in Spotlight. Type what you’d type in Paperless’s own search box (words, a phrase in quotes, `tag:bills`, `correspondent:harbor`) and press Search.
- **Search:** one page for every search, titled with what you searched for: Paperless’s 25 best matches, in its order, each with where the words matched, who it’s from and the document’s date. The list says "Results · 25 of 112" when there are more. Click a row to open the document in Paperless; Back returns to the overview.
### Status
- Shows Paperless’s own system status.
- Red when Paperless reports an error in its database, Redis, Celery, search index, classifier or sanity check, as its own status badge does.
- Orange when no Celery worker answers or a file didn’t import.
- Red once Paperless stops answering or refuses its status.
- Notifies you when it turns orange or red.
## How it connects
The page reads Paperless’s REST API with your API token, sent as `Authorization: Token …`, and asks for API version 10 on every request.
| Request | When | What it supplies |
| --- | --- | --- |
| `GET /api/status/` | Every 5 minutes | The system status, storage and version. |
| `GET /api/statistics/` | Every 5 minutes | The inbox count and the library’s counts. |
| `GET /api/remote_version/` | Every 5 minutes | Whether there’s a newer release. Paperless asks GitHub itself, at most every 15 minutes. |
| `GET /api/documents/?added__date__gte=…&page_size=1` | Every 5 minutes | How many documents arrived this month. |
| `GET /api/documents/?is_in_inbox=true&ordering=-added&page_size=25` | Every 5 minutes | The newest 25 documents in the inbox. |
| `GET /api/documents/?ordering=-added&page_size=4` | Every 5 minutes | The four newest documents, shown when there’s no inbox tag. |
| `GET /api/tasks/?task_type=consume_file&status=failure&acknowledged=false` | Every 5 minutes | Files that didn’t import and haven’t been dismissed. |
| `GET /api/correspondents/` and `GET /api/document_types/` | Every 5 minutes | Names for the inbox rows: the 1,000 most used of each. |
| `POST /api/tasks/acknowledge/` | When you press Dismiss | Marks that failed import as seen. |
| `GET /api/documents/?query=…&page_size=25` | When you search, then hourly while its page is shown | The 25 best matches, each with its excerpt. The results page reads the correspondent and type names too. |
That’s about 120 requests an hour while your Mac is awake, most of them a few hundred bytes, and three more for each search. The document requests ask only for the few fields the page shows, so the text Paperless read from each document isn’t sent. Paperless’s [API documentation](https://docs.paperless-ngx.com/api/) covers each request.
Use a **Superuser**’s token. Another account sees only the documents and imports it has access to. Paperless shows its system status only to users with **Admin** turned on or its system monitoring permission, and Dismiss needs permission to change tasks. When Paperless refuses the status, the health, counts, Server and Failed imports cards say so, and the Inbox still fills.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make a token.** In Paperless 3.0 or later, sign in as a Superuser, open the person menu, then **My Profile**, and create an **API Auth Token**.
2. **Save it in Legato.** In Settings → Secrets, save the token under `paperless`, bound to your Paperless’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download both pages and run `/Applications/Legato.app/Contents/Helpers/legato set paperless paperless.json` and `/Applications/Legato.app/Contents/Helpers/legato set paperless-search paperless-search.json`.
4. **Point them at Paperless.** Change `http://paperless.local:8000` to your Paperless’s address on the three sources and in the three document links (`…/documents/{id|raw}/details`). If Paperless sits behind a reverse proxy at a path, such as `https://docs.example.com/paperless`, set each source’s `url` to `https://docs.example.com`, add `"base": "/paperless"`, and put the path in the document links too.
The cards fill within a minute. A mistyped token is the usual reason they don’t: the page then notes that Paperless refused it.
### Prompt for your agent
```prompt
Add 2 Legato pages for Paperless-ngx, starting from https://legatobar.com/examples/paperless.json, https://legatobar.com/examples/paperless-search.json. Use the page IDs paperless, paperless-search if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add both pages as they are and change http://paperless.local:8000 to my Paperless address everywhere it appears: the three sources and the three document links. I’ll save my API token as paperless in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the page
- [Download Paperless (paperless.json)](https://legatobar.com/examples/paperless.json)
- [Download Search (paperless-search.json)](https://legatobar.com/examples/paperless-search.json)
## Questions
### Why does Inbox show a dash?
No tag in your Paperless is an inbox tag. Paperless adds inbox tags to every new document, and you take them off once you’ve filed it. To use it, edit a tag in Paperless and turn on **Inbox tag**. Until then the page shows your four newest documents instead.
### Does it work with Paperless-ngx 2.x?
No. The page needs Paperless-ngx 3.0 or later. Version 2 answers every request for API version 10 with HTTP 406, "Invalid version", and the cards show that error.
### What does Dismiss do?
The same as Dismiss on Paperless’s Tasks page: the failed import is marked as seen and leaves the list. It doesn’t delete or retry anything. Upload the file again to try it again.
### What can I search for?
What Paperless’s own search box takes: words anywhere in a document, a phrase in quotes, and fields such as `tag:bills`, `correspondent:harbor`, `type:invoice` or `created:[2025 to now]`, as [Paperless’s search help](https://docs.paperless-ngx.com/usage/#basic-usage_searching) describes. Paperless ranks the results and marks where the words matched. Search that Paperless can’t read, such as an unclosed quote, finds nothing.
### Why does a document have no correspondent?
It has none in Paperless, or it’s one of your rarer ones: the page reads the names of the 1,000 correspondents and document types with the most documents.
Legato is independent and isn’t affiliated with or endorsed by Paperless-ngx.
## Verification
The page’s rules were checked against Paperless-ngx 3.4.2’s answers on 14 Nov 2026, filled with made-up documents: an inbox tag, three files that failed to import, and a fresh install’s status, so the counts, the lists and the warnings come from real answers. Dismiss was pressed through Legato on that server, and the warning followed it. A 3.2.1 server was read as well. Tokens of narrower accounts each missed something (the status, Dismiss, or another user’s documents), and a 2.20.15 server refused API version 10. Search was run through Legato on the 3.4.2 server and on a 3.2.1 server, for words, a phrase, a tag and a search with no matches. Illustrations use made-up documents, correspondents and numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# Stripe in your Mac’s menu bar
Legato reads your Stripe account through Stripe’s API with a read-only key and shows it in your Mac’s menu bar on two pages. **Stripe** has your balance, the next payout, the month’s money and anything that needs you, like a dispute waiting for a response. **Payments** lists the month’s payments. Neither page has buttons: refunds, payouts and disputes stay in Stripe’s Dashboard, and each row opens its payment or dispute there.
## What you’ll see
- **Stripe:**
- **Health:** in Details. It turns orange while a dispute waits for your response, naming the first one’s deadline, and red when that deadline is two days away or less, when payments or payouts are off on the account (as on an account Stripe hasn’t finished setting up, or one it has paused), or when the newest payout failed.
- **Available** and **Next payout:** the balance you can be paid out, with what’s still pending under it, and the next payout on its way, with the day it should arrive.
- **Gross volume:** the month’s payments so far as a line that climbs day by day, as Stripe’s own Dashboard draws it. The arrows step back through earlier months.
- Under it, the month’s **net after fees**, Stripe’s **fees** and **refunds**. Each opens the Payments page, which has the month’s failed payments.
- **Account:** active and past-due subscriptions, what open invoices are owed and how many are overdue, and your payout schedule.
- **Disputes:** only while any wait for a response, soonest deadline first, with the amount and the reason the card holder gave.
- **Payments:** the four newest, who paid, for what, how much and when. A failed or refunded one says so. **All payments** in the corner opens the Payments page.
- **Activity:** the last 30 days of failed payments, refunds, new disputes, new and ended subscriptions, failed invoice payments and payouts.
- **Payments:** the month’s payments in three tabs: **Paid**, **Failed** (with the reason Stripe gives) and **Refunded**, which holds any payment refunded in part or in full. Above them, how many were paid and what share of tries failed.
### Status
- Watches the account, its payouts and its disputes.
- Red when payments or payouts are off on the account, when the newest payout failed, or when a dispute’s response is due within two days.
- Orange while a dispute waits for a response.
- Shows on Stripe and notifies you when it turns orange or red.
## How it connects
Legato connects to `api.stripe.com` with your restricted key in a Bearer header, using [Stripe’s API](https://docs.stripe.com/api), and asks for one API version (`2026-09-30.endive`) so the shape of its answers doesn’t change under the pages.
| Request | Page | When | What it does |
| --- | --- | --- | --- |
| `GET /v1/account` | Stripe | Every 5 and every 15 minutes | Whether payments and payouts are on, the payout schedule, and the account’s currency. Sent with each of the three groups below that need it. |
| `GET /v1/balance` | Stripe | Every 5 minutes | The available and pending balance. |
| `GET /v1/payouts?limit=20` | Stripe | Every 5 minutes | The next payout on its way, and whether the newest one failed. |
| `GET /v1/disputes?limit=100` | Stripe | Every 5 minutes | Disputes and their response deadlines, following up to 5 pages. |
| `GET /v1/subscriptions/search` | Stripe | Every 5 minutes | How many subscriptions are active and past due. Two requests that count; no subscription details. Stripe’s search isn’t offered everywhere (not in India); where it isn’t, only the Account card stays empty. |
| `GET /v1/invoices?status=open&limit=100` | Stripe | Every 5 minutes | Open invoices, what they owe and their due dates, following up to 5 pages. |
| `GET /v1/balance_transactions?created[gte]=…&created[lt]=…&limit=100` | Stripe | Every 15 minutes, and for each month you step to | The month’s balance movements: payments, refunds, disputes and fees, following up to 20 pages. |
| `GET /v1/charges?limit=4&expand[]=data.customer` | Stripe | Every 5 minutes | The four newest payments, with their customers’ names. |
| `GET /v1/events?limit=20&types[]=…` | Stripe | Every 5 minutes | Recent activity of eight kinds. Stripe keeps events for 30 days. |
| `GET /v1/charges?created[gte]=…&created[lt]=…&limit=100&expand[]=data.customer` | Payments | Every 15 minutes, and for each month you step to | The month’s payments, following up to 10 pages. |
A restricted key does only what you allow it. The pages read balances, charges, customers, disputes, events, invoices, payouts, subscriptions and your account’s own settings, so give it **Read** on those and **None** on everything else. If Stripe refuses a request, the source’s status shows Stripe’s message, which names the permission to add. A secret key would work too, but it can move money, so don’t use one. Stripe allows 100 read requests a second; these pages make about 33 every 15 minutes. The Mac must be awake and Legato running to fetch them.
Money is shown in your account’s own currency, the one Stripe pays you out in. The month’s figures come from your balance movements, which Stripe records in that currency, so a payment taken in another currency counts at what it settled for. Balances held in other currencies are left out. Amounts follow Stripe’s rules for each currency’s decimals, such as whole yen.
[Sources and buttons](https://legatobar.com/docs/sources.md) describes the supported authentication methods, and [A list across pages](https://legatobar.com/docs/source-requests.md#a-list-across-pages) how a request follows Stripe’s pages.
## Set it up
1. Install Legato and connect your local agent, or use the bundled `legato` command. See [Quickstart](https://legatobar.com/docs/quickstart.md).
2. In Stripe’s Dashboard, open **Developers → API keys** and click **Create restricted key**. Set Balance, Charges, Customers, Disputes, Events, Invoices, Payouts and Subscriptions to **Read**, leave the rest at **None**, and create it. Never paste it into an agent chat. A key made in test mode shows your test data.
3. Download the two pages. They work as they are: keep the API address and the mappings.
4. Add them using the agent prompt, or run `/Applications/Legato.app/Contents/Helpers/legato set stripe stripe.json`, then the same for `stripe-payments`. Keep those page IDs: the pages link to each other by them. Don’t replace an existing page without reading it first.
5. In Settings → Secrets, save the key under `stripe`, bound to `api.stripe.com`. Both pages use it. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
6. Open each page and check its source status. If Stripe refused a request, its message there names the permission the key is missing; add it to the key in Stripe.
### Prompt for your agent
```prompt
Add 2 Legato pages for Stripe, starting from https://legatobar.com/examples/stripe.json, https://legatobar.com/examples/stripe-payments.json. Use the page IDs stripe, stripe-payments if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add both pages as they are, keeping their page IDs. I’ll save my Stripe restricted key as stripe in Settings → Secrets myself. Don’t use a secret key, and don’t change anything in Stripe to test them.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Stripe (stripe.json)](https://legatobar.com/examples/stripe.json)
- [Download Payments (stripe-payments.json)](https://legatobar.com/examples/stripe-payments.json)
## Questions
### What counts as gross volume and net?
Gross volume is what the month’s payments took, before fees and refunds: a payment captured for less than it held counts what was captured, and a pending payment that later failed comes off. Net after fees is what those payments, refunds, disputes and Stripe’s fees left in your balance, before payouts. Both come from your balance movements, so a payment counts on the day Stripe took it. Days are your Mac’s days, so totals near midnight can differ from Stripe’s Dashboard if it’s set to another time zone.
### What happens in a very busy month?
The month’s figures read up to 2,000 balance movements, and the Payments page up to 1,000 payments. Past that, Gross volume and the month’s figures under it say they come from the newest 2,000 movements, so the month’s first days look quieter than they were, and the Payments page says so and links to Stripe’s Dashboard. Disputes and open invoices are read up to 500 each; past that, Account says the invoices owed are at least what it shows, and Details stays orange and sends you to Stripe to check the disputes. If a request fails partway, or Stripe sends a page that isn’t whole, the cards keep their last complete answer.
### Why does a dispute turn the page red?
Stripe gives you until a deadline to respond, and a dispute you don’t answer is lost. The page goes orange while one waits and red two days before its deadline. Answer it in Stripe’s Dashboard: the row opens it there.
### Why is a payout I expected missing?
Next payout shows payouts Stripe has already made and are on their way. A payout that’s still only planned by your payout schedule isn’t one yet, so the card says none is on the way until Stripe creates it.
### Can the pages refund or cancel anything?
No. They have no buttons, and a restricted key with Read access can’t change anything. Make refunds, payouts and dispute responses in Stripe.
## Verification
On November 15, 2026, every request the pages make went through Legato’s own fetcher to Stripe’s API (`2026-09-30.endive`) in test mode, with a test secret key, on an account filled with made-up customers, payments, refunds, disputes, subscriptions and an open invoice. That checked each answer’s fields, the health card with disputes waiting, every card on both pages, the month before, and following Stripe’s pages five at a time. A restricted key wasn’t tried, so the permissions above are the resources the pages read, not a tested list. A failed payout, an overdue invoice, payments that are off, other currencies, partial captures and a month past the page limits are checked by tests with made-up answers. Illustrations use made-up readings. See the [service index](https://legatobar.com/services/) for other examples.
---
# Speedtest Tracker in your Mac’s menu bar
See what your internet connection measured, without opening Speedtest Tracker: the newest test, a week of download and upload against the thresholds you set, and the last few tests. You can start a test from the panel, too.
## What you’ll see
- **Health:** in Details, the newest finished test: when it ran, with its download and upload. It turns the health card red when that test failed, with Speedtest Tracker’s reason, and orange when it was under one of the thresholds you set in Speedtest Tracker. It also turns orange when no test has finished for more than a day. Red or orange sends a notification. It turns red once Speedtest Tracker stops answering.
- **Download and Upload:** the last 7 days of completed tests, in Mbps, with the newest on top. When you’ve set thresholds in Speedtest Tracker, each chart draws its threshold as a dashed line. Point at the line for a test’s time and speed.
- **Last test:** the newest completed test’s ping and jitter, the server it tested against, your provider and its packet loss, and the averages for the last 7 days. When the newest test failed, the card says so and how long ago the last completed one ran. Its corner has **Run a test now**, which stays there before your first completed test.
- **Recent tests:** the four newest finished tests, newest first. A failed one says Failed with Speedtest Tracker’s reason. One under your thresholds says so. Click a test to open its result on Speedtest.net.
### Status
- Shows the newest finished test.
- Red when it failed.
- Orange when it was under one of your thresholds, or when no test has finished for over a day.
- Red once Speedtest Tracker stops answering.
- Notifies you when it turns orange or red.
## How it connects
The page reads Speedtest Tracker’s v1 API with an API token, sent as `Authorization: Bearer`.
| Request | When | What it supplies |
| --- | --- | --- |
| `GET /api/v1/results?sort=-created_at&page[size]=4&filter[status]=completed,failed` | Every 10 minutes | The four newest finished tests, for the health line and Recent tests. Tests still waiting or running are left out. |
| `GET /api/v1/results?sort=-created_at&page[size]=1&filter[status]=completed` | Every 10 minutes | The newest completed test, for Last test. |
| `GET /api/v1/stats?filter[start_at]={date.days_ago_6}` | Every 10 minutes | Average download, upload and ping over the last 7 days. |
| `GET /api/v1/results?sort=-created_at&page[size]=200&filter[status]=completed&filter[start_at]={date.days_ago_6}` | Every 10 minutes | The week’s completed tests, for the charts. |
| `POST /api/v1/speedtests/run` | When you press Run a test now | Adds a test to Speedtest Tracker’s queue. Legato then checks `GET /api/v1/results/{id}` every 5 seconds until it finishes. |
That’s 24 requests an hour while your Mac is awake, and the four go together, so after Run a test now the charts show the new test too. Each test Speedtest Tracker keeps includes the full speed test output, about 3.5 KB, so the week’s request is the large one: about 600 KB for a test every hour. The charts draw at most 200 tests, about 700 KB. If you test more often than every 50 minutes or so, they show the newest 200 and say so in their title. Legato doesn't read an answer over 1 MB. If the week's ever grows past that, every card keeps its last answer with a note, and after three tries the page turns red as if Speedtest Tracker had stopped answering. Speedtest Tracker’s [API documentation](https://docs.speedtest-tracker.dev/api/authorization) covers the token and its abilities.
Speedtest Tracker stores each test’s time without a time zone, in its `APP_TIMEZONE`, which its docs say to leave at UTC. Completed tests also carry the speed test’s own time, which the page reads. A failed test only has the stored time, so the page reads it as UTC. With a different `APP_TIMEZONE`, a failed test’s time is off by that zone’s difference from UTC.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make a token.** In Speedtest Tracker, open **API Tokens** and create one with **Read results**. Add **Run speedtest** if you want the Run a test now button. A token without it gets a refusal when you press the button, and the rest of the page works.
2. **Save it in Legato.** In Settings → Secrets, save the token under `speedtest-tracker`, bound to your Speedtest Tracker’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the page.** Paste the prompt into your agent, or download the page and run `/Applications/Legato.app/Contents/Helpers/legato set speedtest-tracker speedtest-tracker.json`.
4. **Point it at Speedtest Tracker.** Change `http://speedtest.local:8080` to your Speedtest Tracker’s address on both sources, with its port. If you reach it over https with a self-signed certificate, use its IP address or a `.local` name, which Legato can trust.
The cards fill within a minute. A mistyped token is the usual reason they don’t: the page then notes that Speedtest Tracker refused it.
### Prompt for your agent
```prompt
Add a Legato page for Speedtest Tracker, starting from https://legatobar.com/examples/speedtest-tracker.json.
Add the page as it is and change http://speedtest.local:8080 on both sources to my Speedtest Tracker’s address. I’ll save my API token as speedtest-tracker in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the page
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "Speedtest Tracker",
"icon": "speedometer",
"sources": {
"now": {
"url": "http://speedtest.local:8080",
"secret": "speedtest-tracker",
"auth": {
"type": "bearer"
},
"every": "10m",
"requests": {
"last": "/api/v1/results?sort=-created_at&page%5Bsize%5D=4&filter%5Bstatus%5D=completed,failed",
"good": "/api/v1/results?sort=-created_at&page%5Bsize%5D=1&filter%5Bstatus%5D=completed",
"stats": "/api/v1/stats?filter%5Bstart_at%5D={date.days_ago_6}",
"week": "/api/v1/results?sort=-created_at&page%5Bsize%5D=200&filter%5Bstatus%5D=completed&filter%5Bstart_at%5D={date.days_ago_6}"
},
"derive": [
{
"name": "any",
"value": {
"count": "last.data"
}
},
{
"name": "tests",
"value": {
"each": "last.data",
"fields": {
"id": "id",
"data": "data",
"created_at": "created_at",
"status": "status",
"healthy": "healthy",
"download_bits": "download_bits",
"upload_bits": "upload_bits",
"ping": "ping",
"utc_day": {
"path": "created_at",
"match": "^([0-9-]+) "
},
"utc_time": {
"path": "created_at",
"match": " ([0-9:]+)$"
}
}
}
},
{
"name": "last_at",
"value": {
"path": "tests[0].data.timestamp",
"default": {
"template": "{tests[0].utc_day}T{tests[0].utc_time}Z"
}
}
},
{
"name": "last_age",
"value": {
"since": "last_at"
}
},
{
"name": "last_down",
"value": {
"path": "last.data[0].download_bits",
"scale": 1e-06,
"round": 0
}
},
{
"name": "last_up",
"value": {
"path": "last.data[0].upload_bits",
"scale": 1e-06,
"round": 0
}
},
{
"name": "good_day",
"value": {
"path": "good.data[0].created_at",
"match": "^([0-9-]+) "
}
},
{
"name": "good_time",
"value": {
"path": "good.data[0].created_at",
"match": " ([0-9:]+)$"
}
},
{
"name": "good_at",
"value": {
"path": "good.data[0].data.timestamp",
"default": {
"template": "{good_day}T{good_time}Z"
}
}
},
{
"name": "avg_down",
"value": {
"path": "stats.data.download.avg_bits",
"scale": 1e-06,
"round": 0
}
},
{
"name": "avg_up",
"value": {
"path": "stats.data.upload.avg_bits",
"scale": 1e-06,
"round": 0
}
},
{
"name": "rows",
"value": {
"each": "tests",
"fields": {
"key": {
"template": "{id|raw}"
},
"at": {
"path": "data.timestamp",
"default": {
"template": "{utc_day}T{utc_time}Z"
}
},
"failed": {
"path": "status",
"values": {
"failed": 1
},
"default": 0
},
"slow": {
"path": "healthy",
"values": {
"false": 1
},
"default": 0
},
"down": {
"path": "download_bits",
"scale": 1e-06,
"round": 0
},
"up": {
"path": "upload_bits",
"scale": 1e-06,
"round": 0
},
"ping": {
"path": "ping",
"round": 0
},
"message": {
"path": "data.message",
"default": "Speedtest Tracker gave no reason"
},
"url": "data.result.url"
}
}
},
{
"name": "week_count",
"value": {
"count": "week.data"
}
}
]
}
},
"cards": [
{
"id": "health",
"type": "status",
"placement": "page_info",
"label": "Speedtest Tracker",
"state": "unknown",
"width": "full",
"source": {
"ref": "now",
"failed": {
"state": "critical",
"detail": "Speedtest Tracker isn't answering",
"after": 3
},
"map": {
"state": {
"if": {
"path": "any",
"equals": 0
},
"then": {
"template": "unknown"
},
"else": {
"if": {
"path": "last.data[0].status",
"equals": "failed"
},
"then": {
"template": "critical"
},
"else": {
"if": {
"path": "last.data[0].healthy",
"equals": false
},
"then": {
"template": "warning"
},
"else": {
"if": {
"path": "last_age",
"gt": 93600
},
"then": {
"template": "warning"
},
"else": {
"template": "ok"
}
}
}
}
},
"detail": {
"if": {
"path": "any",
"equals": 0
},
"then": {
"template": "No finished tests yet"
},
"else": {
"if": {
"path": "last.data[0].status",
"equals": "failed"
},
"then": {
"template": "Last test failed {last_at|ago}: {last.data[0].data.message|clip:70}"
},
"else": {
"if": {
"path": "last.data[0].healthy",
"equals": false
},
"then": {
"template": "Below your thresholds {last_at|ago} · {last_down} ↓ · {last_up} ↑ Mbps"
},
"else": {
"if": {
"path": "last_age",
"gt": 93600
},
"then": {
"template": "Last test {last_at|ago}"
},
"else": {
"template": "Last test {last_at|ago} · {last_down} ↓ · {last_up} ↑ Mbps"
}
}
}
}
}
}
}
},
{
"id": "download",
"type": "sparkline",
"width": "half",
"label": "Download",
"unit": "Mbps",
"points": [
0,
0
],
"change": false,
"source": {
"ref": "now",
"when": {
"path": "week_count",
"gte": 2
},
"map": {
"label": {
"if": {
"path": "week.meta.total",
"gt": 200
},
"then": {
"template": "Download · newest 200"
},
"else": {
"template": "Download"
}
},
"points": {
"each": "week.data",
"sort": "id",
"value": {
"path": "download_bits",
"scale": 1e-06,
"round": 0
}
},
"times": {
"each": "week.data",
"sort": "id",
"value": "data.timestamp"
},
"labels": {
"each": "week.data",
"sort": "id",
"template": "{data.timestamp|weekday} {data.timestamp|clock}"
},
"axis_labels": {
"each": "week.data",
"sort": "id",
"template": "{data.timestamp|weekday}"
},
"target": "week.data[0].benchmarks.download.benchmark_value"
}
},
"target_label": "Threshold"
},
{
"id": "upload",
"type": "sparkline",
"width": "half",
"label": "Upload",
"unit": "Mbps",
"points": [
0,
0
],
"change": false,
"source": {
"ref": "now",
"when": {
"path": "week_count",
"gte": 2
},
"map": {
"label": {
"if": {
"path": "week.meta.total",
"gt": 200
},
"then": {
"template": "Upload · newest 200"
},
"else": {
"template": "Upload"
}
},
"points": {
"each": "week.data",
"sort": "id",
"value": {
"path": "upload_bits",
"scale": 1e-06,
"round": 0
}
},
"times": {
"each": "week.data",
"sort": "id",
"value": "data.timestamp"
},
"labels": {
"each": "week.data",
"sort": "id",
"template": "{data.timestamp|weekday} {data.timestamp|clock}"
},
"axis_labels": {
"each": "week.data",
"sort": "id",
"template": "{data.timestamp|weekday}"
},
"target": "week.data[0].benchmarks.upload.benchmark_value"
}
},
"target_label": "Threshold"
},
{
"id": "facts",
"type": "facts",
"label": "Last test",
"items": [
{
"key": "Ping",
"value": "—"
},
{
"key": "Average, 7 days",
"value": "—"
},
{
"key": "Server",
"value": "—"
},
{
"key": "Provider",
"value": "—"
},
{
"key": "Packet loss",
"value": "—"
}
],
"actions": [
{
"label": "Run a test now",
"icon": "play.fill",
"method": "POST",
"path": "/api/v1/speedtests/run",
"completion": {
"path": "/api/v1/results/{data.id|raw}",
"done": {
"path": "data.status",
"in": [
"completed",
"failed",
"skipped"
]
},
"success": {
"path": "data.status",
"equals": "completed"
},
"interval": 5,
"timeout": 300
}
}
],
"actions_placement": "corner",
"source": {
"ref": "now",
"map": {
"label": {
"if": {
"path": "good.data[0].id",
"exists": false
},
"then": {
"template": "No completed tests yet"
},
"else": {
"if": {
"path": "last.data[0].status",
"equals": "failed"
},
"then": {
"template": "Last completed test · {good_at|ago}"
},
"else": {
"template": "Last test"
}
}
},
"items[0].value": {
"if": {
"path": "good.data[0].id",
"exists": true
},
"then": {
"if": {
"path": "good.data[0].data.ping.jitter",
"exists": true
},
"then": {
"template": "{good.data[0].ping|round} ms · jitter {good.data[0].data.ping.jitter|round:1} ms"
},
"else": {
"template": "{good.data[0].ping|round} ms"
}
},
"else": {
"template": "—"
}
},
"items[1].value": {
"if": {
"path": "good.data[0].id",
"exists": true
},
"then": {
"template": "{avg_down} ↓ · {avg_up} ↑ Mbps · {stats.data.ping.avg|round} ms"
},
"else": {
"template": "—"
}
},
"items[2].value": {
"if": {
"path": "good.data[0].id",
"exists": true
},
"then": {
"if": {
"path": "good.data[0].data.server.location",
"exists": true
},
"then": {
"template": "{good.data[0].data.server.name} · {good.data[0].data.server.location}"
},
"else": {
"template": "{good.data[0].data.server.name}"
}
},
"else": {
"template": "—"
}
},
"items[3].value": {
"if": {
"path": "good.data[0].id",
"exists": true
},
"then": {
"template": "{good.data[0].data.isp}"
},
"else": {
"template": "—"
}
},
"items[4].value": {
"if": {
"path": "good.data[0].id",
"exists": true
},
"then": {
"if": {
"path": "good.data[0].data.packetLoss",
"exists": true
},
"then": {
"if": {
"path": "good.data[0].data.packetLoss",
"equals": 0
},
"then": {
"template": "0%"
},
"else": {
"template": "{good.data[0].data.packetLoss|round:1}%"
}
},
"else": {
"template": "Not reported"
}
},
"else": {
"template": "—"
}
}
}
}
},
{
"id": "recent",
"type": "list",
"label": "Recent tests",
"max_items": 4,
"items": [],
"source": {
"ref": "now",
"empty": {
"text": "No finished tests yet",
"when": {
"path": "any",
"equals": 0
}
},
"map": {
"items": {
"each": "rows",
"fields": {
"key": "key",
"text": {
"if": {
"path": "failed",
"equals": 1
},
"then": {
"template": "Failed"
},
"else": {
"template": "{down} ↓ · {up} ↑ Mbps · {ping} ms"
}
},
"subtitle": {
"if": {
"path": "failed",
"equals": 1
},
"then": {
"template": "{message|clip:80}"
},
"else": {
"if": {
"path": "slow",
"equals": 1
},
"then": {
"template": "Below your thresholds"
}
}
},
"detail": {
"template": "{at|ago}"
},
"url": "url"
}
}
}
}
}
]
}
```
## Questions
### What does Run a test now do?
The same as Speedtest in Speedtest Tracker: it adds a test to the queue, against the server Speedtest Tracker would pick itself. The button stays busy until the test finishes, usually within a minute, and the cards update then. A test uses real bandwidth: a gigabit line moves a gigabyte or two. Spotlight and Shortcuts can press it too.
### Where do the thresholds come from?
From Speedtest Tracker’s **Thresholds** settings. The charts draw the ones the newest completed test was checked against. With thresholds off, the charts have no dashed line and only a failed test counts as a problem.
### Why is the page orange when nothing failed?
Either the newest test was under one of your thresholds, or no test has finished for more than a day. Speedtest Tracker doesn’t share its schedule, so the page can’t tell a stopped schedule from a long gap. If you only run tests by hand, the page turns orange a day after the last one.
### Which Speedtest Tracker does it need?
1.14.7 or later. Before that release, the API read a date in `filter[start_at]` as an exact match, so the charts and the week's averages would be empty. It was checked on 1.15.1.
Legato is independent and isn’t affiliated with or endorsed by Speedtest Tracker or Ookla.
## Verification
The page’s rules were checked against Speedtest Tracker 1.15.1’s answers on 15 Nov 2026, on a server filled with a month of made-up hourly results: evening dips, tests under the thresholds, failed tests and a stretch before thresholds were set. One real test was run through the API to check a test’s shape while it waits and runs. Illustrations use a made-up provider, servers and numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# SABnzbd in your Mac’s menu bar
Keep an eye on your downloads without opening SABnzbd: what’s downloading and how far along it is, how much is left and when it’ll be done, what finished or failed, and whether a news server has stopped working. Pause everything, pause one job, or slow downloads down from the menu bar.
## What you’ll see
- **Health:** in Details, SABnzbd’s version, or a news server’s error in SABnzbd’s words ("Server fernway reported: 502 Too many connections"), or a folder running out of room: "Low on space for downloads: 150 GB free of 4 TB" when the folder downloads go to, or the one they finish in, is under 5% free, and "Paused: not enough free space" when SABnzbd has paused itself because a folder is full. Any of these turns the health card orange and sends a notification. While downloading is paused it says Paused, with how long is left when you paused for a set time, and stays grey. A failed download never counts as a problem. It turns red once SABnzbd stops answering.
- **Controls:** **Pause**, or **Pause for** 30 minutes, an hour or 3 hours, and **Resume** while paused. If you’ve set **Maximum line speed** in SABnzbd (Config → General), a speed menu limits downloads to 75%, 50% or 25% of it, titled with the limit now.
- **Downloads:** what’s left in the queue and how long SABnzbd expects it to take, what it downloaded today and this month, free space where finished downloads go, and SABnzbd’s version.
- **Speed:** the download speed over the last 5 hours. Legato records it every 5 minutes while Legato is running, so the chart starts empty and fills in over the first few hours.
- **Queue:** the first 20 jobs in SABnzbd’s order, each with how much is downloaded, and under its bar its category and when it should finish. Big jobs show in GB, small ones in MB. A paused job says Paused, and one SABnzbd is holding back for a while says Delayed. Point at a row for **Pause or resume**, which pauses a job or resumes a paused one, and **Delete**, which asks first and removes the job and what it has downloaded so far. A job still fetching its NZB from a link has no size yet, so it’s counted under the card with any past the first 20.
- **History:** the four newest finished jobs, with their category, size and when they finished. A failed one comes first with SABnzbd’s reason, and **Retry** when SABnzbd can try it again. A job SABnzbd is still checking or unpacking says what it’s doing.
### Status
- Orange while a news server reports an error, a download folder is under 5% free, or SABnzbd paused itself for disk space.
- Grey while downloading is paused.
- A failed download never counts as a problem.
- Red once SABnzbd stops answering.
- Notifies you when it turns orange or red.
## How it connects
The page reads SABnzbd’s API with your API key, which SABnzbd takes in the address as `apikey`.
| Request | When | What it supplies |
| --- | --- | --- |
| `GET /api?mode=queue&limit=20` | Every minute | The queue, speed, what’s left, whether it’s paused, the speed limit, free space and the version. |
| `GET /api?mode=history&limit=4` | Every minute | The four newest finished jobs. |
| `GET /api?mode=server_stats` | Every minute | What was downloaded today and this month. |
| `GET /api?mode=status&skip_dashboard=1` | Every minute | Each news server and its error, if any. |
| `GET /api?mode=get_config§ion=misc&keyword=bandwidth_max` | Every minute | Whether Maximum line speed is set, for the speed menu. |
| `POST /api?mode=pause`, `mode=resume` | When you press Pause or Resume | Pauses or resumes all downloading. |
| `POST /api?mode=config&name=set_pause` | When you pick a time from Pause for | Pauses, and resumes after that many minutes. |
| `POST /api?mode=config&name=speedlimit` | When you pick a limit | Sets the limit as a percent of Maximum line speed. |
| `POST /api?mode=queue&name=pause` (or `resume`, `delete`) | When you press a row’s button | Pauses, resumes or deletes that job; Delete also removes its files. |
| `POST /api?mode=retry` | When you press Retry | SABnzbd tries the failed job again. |
That’s 300 small requests an hour while your Mac is awake, about 12 KB a minute. They all belong to one source, so a press on any card refreshes the whole page. SABnzbd’s [API documentation](https://sabnzbd.org/wiki/configuration/5.1/api) covers each request.
The news server answer also carries your API key, as SABnzbd sends it. Legato holds answers in memory only and keeps no History for this page, but **Preview Source** shows it like any other answer.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Find your API key.** In SABnzbd, open **Config → General**. The key is under **Security**, as **API Key** (not the NZB Key).
2. **Save it in Legato.** In Settings → Secrets, save the key under `sabnzbd`, bound to your SABnzbd’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the page.** Paste the prompt into your agent, or download the page and run `/Applications/Legato.app/Contents/Helpers/legato set sabnzbd sabnzbd.json`.
4. **Point it at SABnzbd.** Change `http://sabnzbd.local:8080` to your SABnzbd’s address on the source. If you reach SABnzbd by a name, it must be one SABnzbd already accepts (Config → Special → `host_whitelist`); an IP address always works. If SABnzbd sits behind a reverse proxy at a path, or has a `url_base` set (Config → Special), such as `https://media.example.com/sabnzbd`, set the source’s `url` to `https://media.example.com` and add `"base": "/sabnzbd"`. SABnzbd’s own HTTPS uses a self-signed certificate, which Legato can trust at an IP address or a `.local` name.
The cards fill within a minute. A mistyped key is the usual reason they don’t: the page then notes that SABnzbd refused it.
### Prompt for your agent
```prompt
Add a Legato page for SABnzbd, starting from https://legatobar.com/examples/sabnzbd.json.
Add the page as it is and change http://sabnzbd.local:8080 on the source to my SABnzbd’s address. I’ll save my API key as sabnzbd in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the page
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "SABnzbd",
"icon": "arrow.down.circle",
"sources": {
"sab": {
"url": "http://sabnzbd.local:8080",
"secret": "sabnzbd",
"auth": {
"type": "query",
"name": "apikey"
},
"every": "1m",
"requests": {
"queue": "/api?mode=queue&limit=20&output=json",
"history": "/api?mode=history&limit=4&output=json",
"stats": "/api?mode=server_stats&output=json",
"status": "/api?mode=status&skip_dashboard=1&output=json",
"line": "/api?mode=get_config§ion=misc&keyword=bandwidth_max&output=json"
},
"fail": {
"when": {
"any": [
{
"path": "queue.status",
"equals": false
},
{
"path": "history.status",
"equals": false
},
{
"path": "stats.status",
"equals": false
},
{
"path": "status.status",
"equals": false
},
{
"path": "line.status",
"equals": false
}
]
},
"message": {
"if": {
"path": "queue.error",
"exists": true
},
"then": {
"template": "{queue.error}"
},
"else": {
"if": {
"path": "history.error",
"exists": true
},
"then": {
"template": "{history.error}"
},
"else": {
"if": {
"path": "stats.error",
"exists": true
},
"then": {
"template": "{stats.error}"
},
"else": {
"if": {
"path": "status.error",
"exists": true
},
"then": {
"template": "{status.error}"
},
"else": {
"template": "{line.error}"
}
}
}
}
}
},
"derive": [
{
"name": "queue_eta",
"value": {
"each": "queue.queue.slots",
"where": {
"path": "mb",
"gte": 0.01
},
"fields": {
"nzo_id": "nzo_id",
"seconds": {
"add": [
{
"path": "timeleft",
"match": "^([0-9]+):",
"scale": 3600
},
{
"path": "timeleft",
"match": "^[0-9]+:([0-9]+):",
"scale": 60
},
{
"path": "timeleft",
"match": ":([0-9]+)$"
}
],
"default": 0
},
"category": {
"path": "cat",
"values": {
"tv": "TV",
"movies": "Movies",
"music": "Music",
"audio": "Audio",
"software": "Software",
"*": "",
"None": ""
},
"default": {
"template": "{cat}"
}
}
}
}
},
{
"name": "queue_rows",
"value": {
"each": "queue.queue.slots",
"where": {
"path": "mb",
"gte": 0.01
},
"lookup": {
"from": "queue_eta",
"by": "nzo_id",
"on": "nzo_id",
"as": "eta"
},
"fields": {
"nzo_id": "nzo_id",
"status": "status",
"filename": "filename",
"title": {
"template": "{filename|clip:40}"
},
"unit": {
"if": {
"path": "mb",
"gte": 1024
},
"then": {
"template": "GB"
},
"else": {
"template": "MB"
}
},
"done": {
"if": {
"path": "mb",
"gte": 1024
},
"then": {
"subtract": [
{
"path": "mb",
"match": "^[0-9.]+"
},
{
"path": "mbleft",
"match": "^[0-9.]+"
}
],
"scale": 0.0009765625,
"round": 1
},
"else": {
"if": {
"path": "mb",
"gte": 10
},
"then": {
"subtract": [
{
"path": "mb",
"match": "^[0-9.]+"
},
{
"path": "mbleft",
"match": "^[0-9.]+"
}
],
"round": 0
},
"else": {
"subtract": [
{
"path": "mb",
"match": "^[0-9.]+"
},
{
"path": "mbleft",
"match": "^[0-9.]+"
}
],
"round": 2
}
}
},
"total": {
"if": {
"path": "mb",
"gte": 1024
},
"then": {
"path": "mb",
"match": "^[0-9.]+",
"scale": 0.0009765625,
"round": 1
},
"else": {
"if": {
"path": "mb",
"gte": 10
},
"then": {
"path": "mb",
"match": "^[0-9.]+",
"round": 0
},
"else": {
"path": "mb",
"match": "^[0-9.]+",
"round": 2
}
}
},
"state": {
"path": "status",
"values": {
"Paused": "Paused",
"Propagating": "Delayed",
"Checking": "Checking",
"Fetching": "Fetching repair blocks",
"Queued": "Queued"
},
"default": ""
},
"eta": {
"if": {
"path": "eta.seconds",
"gt": 0
},
"then": {
"if": {
"path": "eta.category",
"not": ""
},
"then": {
"template": "{eta.category} · in {eta.seconds|duration}"
},
"else": {
"template": "in {eta.seconds|duration}"
}
},
"else": {
"template": "{eta.category}"
}
},
"toggle": {
"if": {
"path": "status",
"equals": "Paused"
},
"then": {
"template": "resume"
},
"else": {
"template": "pause"
}
}
}
}
},
{
"name": "drawn",
"value": {
"count": "queue_rows",
"default": 0
}
},
{
"name": "others",
"value": {
"subtract": [
{
"path": "queue.queue.noofslots",
"default": 0
},
"drawn"
],
"default": 0
}
},
{
"name": "queue_empty",
"value": {
"if": {
"path": "others",
"gt": 0
},
"then": {
"if": {
"path": "others",
"equals": 1
},
"then": {
"template": "1 job waiting for its NZB"
},
"else": {
"template": "{others} jobs waiting for their NZBs"
}
},
"else": {
"template": "Nothing in the queue"
}
}
},
{
"name": "left_b",
"value": {
"path": "queue.queue.mbleft",
"match": "^[0-9.]+",
"scale": 1048576
}
},
{
"name": "left_s",
"value": {
"add": [
{
"path": "queue.queue.timeleft",
"match": "^([0-9]+):",
"scale": 3600
},
{
"path": "queue.queue.timeleft",
"match": "^[0-9]+:([0-9]+):",
"scale": 60
},
{
"path": "queue.queue.timeleft",
"match": ":([0-9]+)$"
}
],
"default": 0
}
},
{
"name": "free_b",
"value": {
"path": "queue.queue.diskspace2",
"match": "^[0-9.]+",
"scale": 1073741824
}
},
{
"name": "disk_b",
"value": {
"path": "queue.queue.diskspacetotal2",
"match": "^[0-9.]+",
"scale": 1073741824
}
},
{
"name": "temp_free_b",
"value": {
"path": "queue.queue.diskspace1",
"match": "^[0-9.]+",
"scale": 1073741824
}
},
{
"name": "temp_disk_b",
"value": {
"path": "queue.queue.diskspacetotal1",
"match": "^[0-9.]+",
"scale": 1073741824
}
},
{
"name": "temp_floor_b",
"value": {
"path": "queue.queue.diskspacetotal1",
"match": "^[0-9.]+",
"scale": 53687091.2
}
},
{
"name": "floor_b",
"value": {
"path": "queue.queue.diskspacetotal2",
"match": "^[0-9.]+",
"scale": 53687091.2
}
},
{
"name": "temp_low",
"value": {
"if": {
"all": [
{
"path": "temp_disk_b",
"gt": 0
},
{
"path": "temp_free_b",
"lt": {
"path": "temp_floor_b"
}
}
]
},
"then": {
"template": "yes"
},
"else": {
"template": "no"
}
}
},
{
"name": "newest_warning",
"value": {
"each": "status.status.warnings",
"last": 1,
"fields": {
"origin": "origin"
}
}
},
{
"name": "newest_origin",
"value": {
"first": "origin",
"of": "newest_warning"
}
},
{
"name": "disk_pause",
"value": {
"if": {
"all": [
{
"path": "queue.queue.paused",
"equals": true
},
{
"path": "newest_origin",
"contains": "assembler.py"
}
]
},
"then": {
"template": "yes"
},
"else": {
"template": "no"
}
}
},
{
"name": "done_low",
"value": {
"if": {
"all": [
{
"path": "disk_b",
"gt": 0
},
{
"path": "free_b",
"lt": {
"path": "floor_b"
}
}
]
},
"then": {
"template": "yes"
},
"else": {
"template": "no"
}
}
},
{
"name": "speed_mbs",
"value": {
"path": "queue.queue.kbpersec",
"match": "^[0-9.]+",
"scale": 0.0009765625,
"round": 2
}
},
{
"name": "server_errors",
"value": {
"count": "status.status.servers",
"default": 0,
"where": {
"all": [
{
"path": "servererror",
"exists": true
},
{
"path": "servererror",
"not": ""
}
]
}
}
},
{
"name": "server_error",
"value": {
"first": "servererror",
"of": "status.status.servers",
"where": {
"all": [
{
"path": "servererror",
"exists": true
},
{
"path": "servererror",
"not": ""
}
]
}
}
},
{
"name": "server_errors_more",
"value": {
"subtract": [
"server_errors",
1
]
}
},
{
"name": "pause_min",
"value": {
"path": "queue.queue.pause_int",
"match": "^([0-9]+):"
}
},
{
"name": "history_failed",
"value": {
"each": "history.history.slots",
"where": {
"path": "status",
"equals": "Failed"
},
"fields": {
"nzo_id": "nzo_id",
"name": "name",
"status": "status",
"retry": "retry",
"fail_message": "fail_message",
"bytes": "bytes",
"category": "category",
"completed": "completed",
"shown_category": {
"path": "category",
"values": {
"tv": "TV",
"movies": "Movies",
"music": "Music",
"audio": "Audio",
"software": "Software",
"*": "",
"None": ""
},
"default": {
"template": "{category}"
}
},
"reason": {
"path": "fail_message",
"match": "^(.*?)(?: - https?://\\S+)?$"
}
}
}
},
{
"name": "history_rest",
"value": {
"each": "history.history.slots",
"where": {
"path": "status",
"not": "Failed"
},
"fields": {
"nzo_id": "nzo_id",
"name": "name",
"status": "status",
"retry": "retry",
"fail_message": "fail_message",
"bytes": "bytes",
"category": "category",
"completed": "completed",
"shown_category": {
"path": "category",
"values": {
"tv": "TV",
"movies": "Movies",
"music": "Music",
"audio": "Audio",
"software": "Software",
"*": "",
"None": ""
},
"default": {
"template": "{category}"
}
},
"reason": {
"path": "fail_message",
"match": "^(.*?)(?: - https?://\\S+)?$"
}
}
}
},
{
"name": "history_rows",
"value": {
"each": [
"history_failed",
"history_rest"
],
"limit": 4,
"fields": {
"nzo_id": "nzo_id",
"status": "status",
"retry": "retry",
"text": {
"template": "{name|clip:60}"
},
"subtitle": {
"if": {
"path": "status",
"equals": "Failed"
},
"then": {
"template": "{reason|clip:80}"
},
"else": {
"if": {
"path": "bytes",
"gt": 0
},
"then": {
"if": {
"path": "category",
"in": [
"*",
"None",
""
]
},
"then": {
"template": "{bytes|bytes}"
},
"else": {
"template": "{shown_category} · {bytes|bytes}"
}
},
"else": {
"template": "{shown_category}"
}
}
},
"detail": {
"path": "status",
"values": {
"Completed": {
"template": "{completed|ago}"
},
"Failed": {
"template": "Failed · {completed|ago}"
}
},
"default": {
"template": "{status}"
}
}
}
}
}
]
}
},
"cards": [
{
"id": "health",
"type": "status",
"placement": "page_info",
"label": "SABnzbd",
"state": "unknown",
"width": "full",
"source": {
"ref": "sab",
"map": {
"state": {
"if": {
"any": [
{
"path": "server_errors",
"gt": 0
},
{
"path": "temp_low",
"equals": "yes"
},
{
"path": "done_low",
"equals": "yes"
},
{
"path": "disk_pause",
"equals": "yes"
}
]
},
"then": {
"template": "warning"
},
"else": {
"if": {
"path": "queue.queue.paused",
"equals": true
},
"then": {
"template": "off"
},
"else": {
"template": "ok"
}
}
},
"detail": {
"if": {
"path": "server_errors",
"gt": 0
},
"then": {
"if": {
"path": "server_errors",
"equals": 1
},
"then": {
"template": "{server_error|clip:110}"
},
"else": {
"template": "{server_error|clip:90} · and {server_errors_more} more"
}
},
"else": {
"if": {
"path": "disk_pause",
"equals": "yes"
},
"then": {
"template": "Paused: not enough free space · {temp_free_b|bytes} free for downloads"
},
"else": {
"if": {
"path": "temp_low",
"equals": "yes"
},
"then": {
"template": "Low on space for downloads: {temp_free_b|bytes} free of {temp_disk_b|bytes}"
},
"else": {
"if": {
"path": "done_low",
"equals": "yes"
},
"then": {
"template": "Low on space for finished downloads: {free_b|bytes} free of {disk_b|bytes}"
},
"else": {
"if": {
"path": "queue.queue.paused",
"equals": true
},
"then": {
"if": {
"path": "pause_min",
"gt": 0
},
"then": {
"template": "Paused · resumes in {pause_min} min"
},
"else": {
"if": {
"path": "queue.queue.pause_int",
"not": "0"
},
"then": {
"template": "Paused · resumes in under a minute"
},
"else": {
"template": "Paused"
}
}
},
"else": {
"template": "SABnzbd {queue.queue.version} · No problems"
}
}
}
}
}
}
},
"failed": {
"state": "critical",
"detail": "SABnzbd isn't answering",
"after": 3
}
}
},
{
"id": "controls",
"type": "text",
"label": "Controls",
"actions_placement": "corner",
"source": {
"ref": "sab"
},
"actions": [
{
"label": "Pause",
"icon": "pause.fill",
"method": "POST",
"path": "/api?mode=pause",
"body": {},
"success": {
"path": "status",
"equals": true
},
"error": "error",
"when": {
"path": "queue.queue.paused",
"equals": false
}
},
{
"label": "Pause for",
"icon": "timer",
"method": "POST",
"path": "/api?mode=config&name=set_pause&value={choice}",
"body": {},
"success": {
"path": "status",
"equals": true
},
"error": "error",
"when": {
"path": "queue.queue.paused",
"equals": false
},
"choices": [
{
"label": "30 minutes",
"value": 30
},
{
"label": "1 hour",
"value": 60
},
{
"label": "3 hours",
"value": 180
}
]
},
{
"label": "Resume",
"icon": "play.fill",
"method": "POST",
"path": "/api?mode=resume",
"body": {},
"success": {
"path": "status",
"equals": true
},
"error": "error",
"when": {
"path": "queue.queue.paused",
"equals": true
}
},
"|",
{
"label": "Speed limit",
"icon": "gauge.with.dots.needle.33percent",
"method": "POST",
"path": "/api?mode=config&name=speedlimit&value={choice}",
"body": {},
"success": {
"path": "status",
"equals": true
},
"error": "error",
"when": {
"all": [
{
"path": "line.config.misc.bandwidth_max",
"exists": true
},
{
"path": "line.config.misc.bandwidth_max",
"not": ""
}
]
},
"current": "queue.queue.speedlimit",
"choices": [
{
"label": "No limit",
"value": 100
},
{
"label": "75%",
"value": 75
},
{
"label": "50%",
"value": 50
},
{
"label": "25%",
"value": 25
}
]
}
]
},
{
"id": "facts",
"type": "facts",
"label": "Downloads",
"items": [
{
"key": "Left",
"value": "—"
},
{
"key": "Downloaded",
"value": "—"
},
{
"key": "Free space",
"value": "—"
},
{
"key": "Version",
"value": "—"
}
],
"source": {
"ref": "sab",
"map": {
"items[0].value": {
"if": {
"path": "left_b",
"gt": 0
},
"then": {
"if": {
"path": "queue.queue.paused",
"equals": true
},
"then": {
"template": "{left_b|bytes} · paused"
},
"else": {
"if": {
"path": "left_s",
"gt": 0
},
"then": {
"template": "{left_b|bytes} · {left_s|duration}"
},
"else": {
"template": "{left_b|bytes}"
}
}
},
"else": {
"template": "Nothing queued"
}
},
"items[1].value": {
"template": "{stats.day|bytes} today · {stats.month|bytes} this month"
},
"items[2].value": {
"template": "{free_b|bytes} of {disk_b|bytes}"
},
"items[3].value": {
"template": "{queue.queue.version}"
}
}
}
},
{
"id": "speed",
"type": "sparkline",
"label": "Speed",
"unit": "MB/s",
"change": false,
"points": [],
"source": {
"ref": "sab",
"map": {
"points": {
"history": "speed_mbs",
"every": "5m",
"keep": 60
}
}
}
},
{
"id": "queue",
"type": "pacing",
"label": "Queue",
"unit": "GB",
"items": [],
"source": {
"ref": "sab",
"empty": {
"text": "{queue_empty}",
"when": {
"path": "drawn",
"equals": 0
}
},
"map": {
"items": {
"each": "queue_rows",
"fields": {
"key": "nzo_id",
"label": "title",
"state": "state",
"detail": "eta",
"value": "done",
"target": "total",
"unit": "unit"
}
},
"detail": {
"if": {
"path": "others",
"gt": 0
},
"then": {
"template": "{others} more in SABnzbd"
}
}
}
},
"row_actions_shown": "always",
"row_actions": [
{
"label": "Pause or resume",
"icon": "playpause",
"method": "POST",
"path": "/api?mode=queue&name={toggle}&value={nzo_id}",
"body": {},
"success": {
"path": "status",
"equals": true
},
"error": "error"
},
{
"label": "Delete",
"icon": "trash",
"method": "POST",
"path": "/api?mode=queue&name=delete&value={nzo_id}&del_files=1",
"body": {},
"success": {
"path": "status",
"equals": true
},
"error": "error",
"confirm": {
"message": "Delete {filename|clip:80} and what it has downloaded so far?",
"button": "Delete"
}
}
]
},
{
"id": "history",
"type": "list",
"label": "History",
"max_items": 4,
"items": [],
"source": {
"ref": "sab",
"empty": {
"text": "Nothing finished yet",
"when": {
"path": "history.history.noofslots",
"equals": 0
}
},
"map": {
"items": {
"each": "history_rows",
"fields": {
"key": "nzo_id",
"text": "text",
"subtitle": "subtitle",
"detail": "detail"
}
}
}
},
"row_actions": [
{
"label": "Retry",
"icon": "arrow.uturn.forward",
"method": "POST",
"path": "/api?mode=retry&value={nzo_id}",
"body": {},
"success": {
"path": "status",
"equals": true
},
"error": "error",
"when": {
"all": [
{
"path": "status",
"equals": "Failed"
},
{
"path": "retry",
"equals": true
}
]
}
}
]
}
]
}
```
## Questions
### Why is there no speed menu?
The menu sets a percent of your **Maximum line speed**, and SABnzbd ignores a percent until you’ve told it how fast your connection is. Set it in Config → General, and the menu appears within a minute.
### Does the page tell me when SABnzbd paused itself?
When it paused for disk space, yes: the page turns orange and says "Paused: not enough free space". SABnzbd does that when a folder hasn’t room for the next file plus its minimum free space (Config → Folders). The page reads the reason from SABnzbd’s newest warning, so if you pause by hand right after a disk-space pause, it may still say so until SABnzbd logs something else. With **Auto resume** on in SABnzbd (Config → Folders), it carries on by itself once there’s room again.
### Why doesn’t a failed download count as a problem?
Downloads fail now and then, and Sonarr or Radarr usually find another copy. The failed job comes first in History with SABnzbd’s reason and Retry, so it’s there when you look. A news server SABnzbd can’t use affects every download, so that counts as a problem.
### What does Delete remove?
The job and whatever it has downloaded so far, as Delete in SABnzbd’s queue does when you also choose to remove the files. Finished downloads in your completed folder aren’t touched.
### Does it work with Sonarr and Radarr?
Yes: the [Sonarr](https://legatobar.com/services/sonarr) and [Radarr](https://legatobar.com/services/radarr) pages show the same downloads from their side, with the series and films they belong to.
Legato is independent and isn’t affiliated with or endorsed by SABnzbd.
## Verification
The page’s rules were checked against SABnzbd 5.1.3’s answers on 15 Nov 2026, from a test server downloading made-up jobs from a stand-in news server: a running queue, paused and timed-paused downloading, a failed job, Maximum line speed set and unset, and a news server made to turn SABnzbd away. Through Legato, a row’s Pause and Resume, Pause for 30 minutes, Resume, the 50% limit and No limit, Retry on the failed job and Delete on a queued one all went through, and a made-up API key was refused. SABnzbd 5.2.0, at its second release candidate then, sends the same fields. Illustrations use made-up jobs, servers and numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# qBittorrent in your Mac’s menu bar
See what qBittorrent is downloading without opening its Web UI: how far along each torrent is, which ones have stalled or lost their files, and how much room is left on the disk. Stop, start or remove a torrent from its row.
## What you’ll see
- **Health:** in Details, whether qBittorrent is connected and to how many DHT nodes. A torrent with an error or missing files turns the health card orange, with its name and how many others there are, and sends a notification. It turns red when qBittorrent reports no network connection, or once qBittorrent stops answering. Firewalled (no incoming connections) is shown but never counts as a problem, since many setups run that way on purpose.
- **qBittorrent:** free space in your download folder, the speed limits in force, what this session has downloaded and uploaded, how many torrents there are, and the version. The turtle in the corner switches qBittorrent’s alternative speed limits on and off, as the turtle in its status bar does. While they’re on, the limits row starts with Alternative.
- **Download and Upload:** the speed over the last few hours, a reading every 5 minutes, with the newest on top. qBittorrent keeps no history of its own, so Legato keeps these readings on your Mac, and the charts start empty.
- **Downloads:** torrents with an error or missing files first, then everything still downloading in qBittorrent’s queue order, each with how much of its size is done. A row says Stalled, Stopped, Queued or Checking when it’s one of those. Under its bar are its category, then its speed and time left while it’s moving. The card shows 8; any more, and torrents still getting their metadata (which have no size yet), are counted under it. Point at a row for its buttons:
- **Stop** or **Start**, whichever fits.
- **Remove** takes the torrent out of qBittorrent and leaves its files on disk.
- **Delete files** takes it out and deletes what it downloaded. Both ask first.
- **Finished:** a closed section at the end with the four torrents that finished most recently, each with its size and share ratio. Its heading says when the newest finished.
### Status
- Orange while a torrent has an error or its files are missing.
- Red when qBittorrent has no network connection.
- Red once qBittorrent stops answering.
- Firewalled never counts as a problem.
- Notifies you when it turns orange or red.
## How it connects
The page reads qBittorrent’s Web API with your API key, sent as `Authorization: Bearer`. It needs qBittorrent 5.3 (October 2026) or later: API keys came in 5.2, and the free space request in 5.3.
| Request | When | What it supplies |
| --- | --- | --- |
| `GET /api/v2/transfer/info` | Every minute | Speeds, this session’s totals, the speed limits in force, connection status and DHT nodes. |
| `GET /api/v2/transfer/speedLimitsMode` | Every minute | Whether the alternative speed limits are on. |
| `GET /api/v2/torrents/count` | Every minute | How many torrents there are. |
| `GET /api/v2/app/version` | Every minute | qBittorrent’s version. |
| `GET /api/v2/app/getFreeSpaceAtPath?path=/downloads` | Every minute | Free space where you download. |
| `GET /api/v2/app/defaultSavePath` | Every minute | Where qBittorrent saves, to check the folder you named. |
| `GET /api/v2/torrents/info?filter=errored&sort=added_on&limit=10` | Every minute | Torrents with an error or missing files. |
| `GET /api/v2/torrents/info?filter=downloading&sort=priority&limit=30` | Every minute | What’s downloading, stalled, stopped or queued, in queue order. |
| `GET /api/v2/torrents/info?filter=completed&sort=completion_on&reverse=true&limit=4` | Every 5 minutes | The four that finished most recently. |
| `POST /api/v2/transfer/setSpeedLimitsMode` | When you press the turtle | Turns the alternative speed limits on or off. |
| `POST /api/v2/torrents/stop`, `/start` | When you press Stop or Start | Stops or starts that torrent. |
| `POST /api/v2/torrents/delete` | When you press Remove or Delete files | Removes that torrent, with `deleteFiles` false or true. |
That’s about 490 requests an hour while your Mac is awake, mostly small. A torrent takes about 2 KB in a list, so the largest answer, 30 downloads, is about 60 KB. qBittorrent’s commands take their values as a form, so the buttons send them that way. qBittorrent’s [WebUI API documentation](https://github.com/qbittorrent/qBittorrent/wiki) covers each request.
An API key can do anything you can do in the Web UI, including changing qBittorrent’s settings: qBittorrent has no read-only keys. The page never reads qBittorrent’s preferences, which hold the key itself. qBittorrent also reports your public IP address. The page doesn’t show it, but **Preview Source** shows qBittorrent’s answers as they came, the address included.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make an API key.** In qBittorrent’s Web UI, open **Tools → Options → Web UI**. Under **API Key**, press **Generate API key** (the two curved arrows), then the copy button beside the key.
2. **Save it in Legato.** In Settings → Secrets, save the key under `qbittorrent`, bound to your qBittorrent’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the page.** Paste the prompt into your agent, or download the page and run `/Applications/Legato.app/Contents/Helpers/legato set qbittorrent qbittorrent.json`.
4. **Point it at qBittorrent.** Change `http://qbittorrent.local:8080` to your qBittorrent’s address on both sources. The Web UI’s port is 8080 unless you changed it.
5. **Name your download folder.** Free space is measured in `/downloads`, where most Docker setups save. If yours saves elsewhere, change `/downloads` to that folder everywhere it appears on the page. Use the path as qBittorrent sees it: inside its container, if it runs in Docker. Any folder on the same disk gives the same answer. If qBittorrent saves somewhere outside that folder, the Free space row says where, so you know to change it.
If qBittorrent sits behind a reverse proxy at a path, such as `https://media.example.com/qbittorrent`, set each source’s `url` to `https://media.example.com` and add `"base": "/qbittorrent"`. If you gave qBittorrent its own certificate, Legato can trust a self-signed one only at an IP address or a `.local` name.
The cards fill within a minute. A mistyped key is the usual reason they don’t: qBittorrent answers it with HTTP 403, and the cards say qBittorrent didn’t allow it with this secret.
### Prompt for your agent
```prompt
Add a Legato page for qBittorrent, starting from https://legatobar.com/examples/qbittorrent.json.
Add the page as it is and change http://qbittorrent.local:8080 on both sources to my qBittorrent's address. If qBittorrent saves somewhere other than /downloads, change /downloads to that folder everywhere it appears on the page. I’ll save my API key as qbittorrent in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the page
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "qBittorrent",
"icon": "arrow.down.circle",
"sources": {
"qbittorrent": {
"url": "http://qbittorrent.local:8080",
"secret": "qbittorrent",
"every": "1m",
"requests": {
"transfer": "/api/v2/transfer/info",
"mode": {
"path": "/api/v2/transfer/speedLimitsMode",
"format": "text"
},
"count": {
"path": "/api/v2/torrents/count",
"format": "text"
},
"version": {
"path": "/api/v2/app/version",
"format": "text"
},
"free": {
"path": "/api/v2/app/getFreeSpaceAtPath?path=/downloads",
"format": "text"
},
"save_path": {
"path": "/api/v2/app/defaultSavePath",
"format": "text"
},
"errored": "/api/v2/torrents/info?filter=errored&sort=added_on&limit=10",
"downloading": "/api/v2/torrents/info?filter=downloading&sort=priority&limit=30"
},
"derive": [
{
"name": "queue",
"value": {
"each": "downloading",
"sort": {
"by": [
"priority",
"added_on"
]
},
"fields": {
"hash": "hash",
"name": "name",
"state": "state",
"size": "size",
"amount_left": "amount_left",
"progress": "progress",
"category": "category",
"priority": "priority",
"added_on": "added_on",
"dlspeed": "dlspeed",
"eta": "eta",
"num_seeds": "num_seeds",
"save_path": "save_path"
}
}
},
{
"name": "rows",
"value": {
"each": [
"errored",
"queue"
],
"where": {
"path": "size",
"gt": 0
},
"limit": 8,
"fields": {
"hash": "hash",
"name": "name",
"detail": {
"if": {
"path": "category",
"not": ""
},
"then": {
"if": {
"path": "state",
"in": [
"downloading",
"forcedDL"
]
},
"then": {
"if": {
"path": "eta",
"lt": 8640000
},
"then": {
"template": "{category} · {dlspeed|bytes}/s · {eta|duration} left"
},
"else": {
"template": "{category} · {dlspeed|bytes}/s"
}
},
"else": {
"if": {
"path": "state",
"equals": "queuedDL"
},
"then": {
"template": "{category} · Queue position {priority|raw}"
},
"else": {
"if": {
"path": "state",
"equals": "stalledDL"
},
"then": {
"if": {
"path": "num_seeds",
"gt": 0
},
"then": {
"template": "{category} · {num_seeds} seeds connected · {progress|percent:0}"
},
"else": {
"template": "{category} · No seeds connected · {progress|percent:0}"
}
},
"else": {
"if": {
"path": "state",
"equals": "missingFiles"
},
"then": {
"template": "{category} · Not found in {save_path|clip:60}"
},
"else": {
"template": "{category} · {progress|percent:0}"
}
}
}
}
},
"else": {
"if": {
"path": "state",
"in": [
"downloading",
"forcedDL"
]
},
"then": {
"if": {
"path": "eta",
"lt": 8640000
},
"then": {
"template": "{dlspeed|bytes}/s · {eta|duration} left"
},
"else": {
"template": "{dlspeed|bytes}/s"
}
},
"else": {
"if": {
"path": "state",
"equals": "queuedDL"
},
"then": {
"template": "Queue position {priority|raw}"
},
"else": {
"if": {
"path": "state",
"equals": "stalledDL"
},
"then": {
"if": {
"path": "num_seeds",
"gt": 0
},
"then": {
"template": "{num_seeds} seeds connected · {progress|percent:0}"
},
"else": {
"template": "No seeds connected · {progress|percent:0}"
}
},
"else": {
"if": {
"path": "state",
"equals": "missingFiles"
},
"then": {
"template": "Not found in {save_path|clip:60}"
},
"else": {
"template": "{progress|percent:0}"
}
}
}
}
}
},
"state_word": {
"path": "state",
"values": {
"downloading": "",
"forcedDL": "Forced",
"metaDL": "Getting metadata",
"forcedMetaDL": "Getting metadata",
"stalledDL": "Stalled",
"stoppedDL": "Stopped",
"queuedDL": "Queued",
"checkingDL": "Checking",
"checkingResumeData": "Checking",
"moving": "Moving",
"missingFiles": "Files missing",
"error": "Error",
"uploading": "Seeding",
"stalledUP": "Seeding",
"stoppedUP": "Finished",
"queuedUP": "Queued",
"checkingUP": "Checking",
"forcedUP": "Seeding"
},
"default": ""
},
"state": "state",
"unit": {
"if": {
"path": "size",
"lt": 1048576
},
"then": {
"template": "KB"
},
"else": {
"if": {
"path": "size",
"lt": 1073741824
},
"then": {
"template": "MB"
},
"else": {
"template": "GB"
}
}
},
"done": {
"if": {
"path": "size",
"lt": 1048576
},
"then": {
"subtract": [
"size",
"amount_left"
],
"scale": 0.0009765625
},
"else": {
"if": {
"path": "size",
"lt": 1073741824
},
"then": {
"subtract": [
"size",
"amount_left"
],
"scale": 9.5367431640625e-07
},
"else": {
"subtract": [
"size",
"amount_left"
],
"scale": 9.313225746154785e-10
}
}
},
"total": {
"if": {
"path": "size",
"lt": 1048576
},
"then": {
"path": "size",
"scale": 0.0009765625
},
"else": {
"if": {
"path": "size",
"lt": 1073741824
},
"then": {
"path": "size",
"scale": 9.5367431640625e-07
},
"else": {
"path": "size",
"scale": 9.313225746154785e-10
}
}
}
}
}
},
{
"name": "drawn",
"value": {
"count": "rows",
"default": 0
}
},
{
"name": "errors",
"value": {
"count": "errored",
"default": 0
}
},
{
"name": "sized",
"value": {
"count": "downloading",
"where": {
"path": "size",
"gt": 0
},
"default": 0
}
},
{
"name": "sizeless",
"value": {
"count": "downloading",
"where": {
"path": "size",
"lte": 0
},
"default": 0
}
},
{
"name": "read",
"value": {
"count": "downloading",
"default": 0
}
},
{
"name": "undrawn",
"value": {
"subtract": [
{
"add": [
"errors",
"sized"
]
},
"drawn"
],
"default": 0
}
},
{
"name": "errors_more",
"value": {
"subtract": [
"errors",
1
],
"default": 0
}
},
{
"name": "first_error",
"value": {
"first": "name",
"of": "errored"
}
},
{
"name": "first_error_state",
"value": {
"first": "state",
"of": "errored"
}
},
{
"name": "version_number",
"value": {
"path": "version",
"match": "^v?(.+)$"
}
},
{
"name": "down_mb",
"value": {
"path": "transfer.dl_info_speed",
"scale": 9.5367431640625e-07,
"round": 1
}
},
{
"name": "up_kb",
"value": {
"path": "transfer.up_info_speed",
"scale": 0.0009765625,
"round": 0
}
},
{
"name": "first_error_word",
"value": {
"path": "first_error_state",
"values": {
"missingFiles": "Files missing",
"error": "Error"
},
"default": "Error"
}
},
{
"name": "errors_others",
"value": {
"if": {
"path": "errors",
"gte": 10
},
"then": {
"template": "and at least {errors_more} more"
},
"else": {
"template": "and {errors_more} more"
}
}
},
{
"name": "prefix",
"value": {
"if": {
"path": "mode",
"equals": "1"
},
"then": {
"template": "Alternative · "
},
"else": {
"template": ""
}
}
},
{
"name": "prefix_none",
"value": {
"if": {
"path": "mode",
"equals": "1"
},
"then": {
"template": "Alternative · none"
},
"else": {
"template": "None"
}
}
},
{
"name": "up_limit",
"value": {
"if": {
"path": "transfer.up_rate_limit",
"gt": 0
},
"then": {
"template": "{transfer.up_rate_limit|bytes}/s ↑"
},
"else": {
"template": "no limit ↑"
}
}
},
{
"name": "empty_text",
"value": {
"if": {
"path": "sizeless",
"gt": 0
},
"then": {
"template": "{sizeless} getting metadata"
},
"else": {
"template": "Nothing downloading"
}
}
},
{
"name": "card_detail",
"value": {
"if": {
"any": [
{
"path": "read",
"gte": 30
},
{
"path": "errors",
"gte": 10
}
]
},
"then": {
"template": "More in qBittorrent"
},
"else": {
"if": {
"path": "undrawn",
"gt": 0
},
"then": {
"if": {
"path": "sizeless",
"gt": 0
},
"then": {
"template": "{undrawn} more · {sizeless} getting metadata"
},
"else": {
"template": "{undrawn} more in qBittorrent"
}
},
"else": {
"if": {
"path": "sizeless",
"gt": 0
},
"then": {
"if": {
"path": "drawn",
"gt": 0
},
"then": {
"template": "{sizeless} getting metadata"
},
"else": {
"template": ""
}
},
"else": {
"template": ""
}
}
}
}
}
]
},
"finished": {
"url": "http://qbittorrent.local:8080",
"secret": "qbittorrent",
"every": "5m",
"requests": {
"recent": "/api/v2/torrents/info?filter=completed&sort=completion_on&reverse=true&limit=4"
},
"derive": [
{
"name": "newest",
"value": {
"first": "completion_on",
"of": "recent"
}
},
{
"name": "finished_count",
"value": {
"count": "recent",
"default": 0
}
}
]
}
},
"cards": [
{
"id": "health",
"type": "status",
"placement": "page_info",
"label": "qBittorrent",
"state": "unknown",
"width": "full",
"source": {
"ref": "qbittorrent",
"map": {
"state": {
"if": {
"path": "transfer.connection_status",
"equals": "disconnected"
},
"then": {
"template": "critical"
},
"else": {
"if": {
"path": "errors",
"gt": 0
},
"then": {
"template": "warning"
},
"else": {
"template": "ok"
}
}
},
"detail": {
"if": {
"path": "transfer.connection_status",
"equals": "disconnected"
},
"then": {
"template": "No network connection"
},
"else": {
"if": {
"path": "errors",
"gt": 1
},
"then": {
"template": "{first_error_word} · {first_error|clip:60} · {errors_others}"
},
"else": {
"if": {
"path": "errors",
"equals": 1
},
"then": {
"template": "{first_error_word} · {first_error|clip:90}"
},
"else": {
"if": {
"path": "transfer.connection_status",
"equals": "firewalled"
},
"then": {
"template": "Firewalled · {transfer.dht_nodes} DHT nodes"
},
"else": {
"template": "Connected · {transfer.dht_nodes} DHT nodes"
}
}
}
}
}
},
"failed": {
"state": "critical",
"detail": "qBittorrent isn't answering",
"after": 3
}
}
},
{
"id": "facts",
"type": "facts",
"items": [
{
"key": "Free space",
"value": "—"
},
{
"key": "Speed limits",
"value": "—"
},
{
"key": "This session",
"value": "—"
},
{
"key": "Torrents",
"value": "—"
},
{
"key": "Version",
"value": "—"
}
],
"actions_placement": "corner",
"actions": [
{
"label": "Use alternative speeds",
"icon": "tortoise",
"path": "/api/v2/transfer/setSpeedLimitsMode",
"form": {
"mode": "1"
},
"when": {
"path": "mode",
"equals": "0"
}
},
{
"label": "Use normal speeds",
"icon": "tortoise.fill",
"path": "/api/v2/transfer/setSpeedLimitsMode",
"form": {
"mode": "0"
},
"when": {
"path": "mode",
"equals": "1"
}
}
],
"source": {
"ref": "qbittorrent",
"map": {
"items[0].value": {
"if": {
"path": "save_path",
"contains": "/downloads"
},
"then": {
"template": "{free|bytes} in /downloads"
},
"else": {
"template": "{free|bytes} in /downloads · saves to {save_path|clip:40}"
}
},
"items[1].value": {
"if": {
"path": "transfer.dl_rate_limit",
"gt": 0
},
"then": {
"template": "{prefix}{transfer.dl_rate_limit|bytes}/s ↓ · {up_limit}"
},
"else": {
"if": {
"path": "transfer.up_rate_limit",
"gt": 0
},
"then": {
"template": "{prefix}{transfer.up_rate_limit|bytes}/s ↑"
},
"else": {
"template": "{prefix_none}"
}
}
},
"items[2].value": {
"template": "{transfer.dl_info_data|bytes} ↓ · {transfer.up_info_data|bytes} ↑"
},
"items[3].value": "count",
"items[4].value": {
"template": "{version_number}"
}
}
}
},
{
"id": "down",
"type": "sparkline",
"width": "half",
"label": "Download",
"unit": "MB/s",
"points": [],
"change": false,
"source": {
"ref": "qbittorrent",
"map": {
"points": {
"history": "down_mb",
"every": "5m",
"keep": 60
}
}
}
},
{
"id": "up",
"type": "sparkline",
"width": "half",
"label": "Upload",
"unit": "KB/s",
"points": [],
"change": false,
"source": {
"ref": "qbittorrent",
"map": {
"points": {
"history": "up_kb",
"every": "5m",
"keep": 60
}
}
}
},
{
"id": "downloads",
"type": "pacing",
"label": "Downloads",
"unit": "GB",
"items": [],
"source": {
"ref": "qbittorrent",
"empty": {
"text": "{empty_text}",
"when": {
"path": "drawn",
"equals": 0
}
},
"map": {
"items": {
"each": "rows",
"fields": {
"key": "hash",
"label": "name",
"state": "state_word",
"detail": "detail",
"value": "done",
"target": "total",
"unit": "unit"
}
},
"detail": {
"template": "{card_detail}"
}
}
},
"row_actions_shown": "always",
"row_actions": [
{
"label": "Stop",
"icon": "stop.fill",
"path": "/api/v2/torrents/stop",
"form": {
"hashes": "{hash}"
},
"when": {
"path": "state",
"not_in": [
"stoppedDL",
"stoppedUP",
"error",
"missingFiles"
]
}
},
{
"label": "Start",
"icon": "play.fill",
"path": "/api/v2/torrents/start",
"form": {
"hashes": "{hash}"
},
"when": {
"path": "state",
"in": [
"stoppedDL",
"stoppedUP",
"error",
"missingFiles"
]
},
"alternate": true
},
{
"label": "Remove",
"icon": "xmark",
"path": "/api/v2/torrents/delete",
"form": {
"hashes": "{hash}",
"deleteFiles": "false"
},
"confirm": {
"message": "Remove {name} from qBittorrent? Its files stay on disk.",
"button": "Remove"
}
},
{
"label": "Delete files",
"icon": "trash",
"path": "/api/v2/torrents/delete",
"form": {
"hashes": "{hash}",
"deleteFiles": "true"
},
"confirm": {
"message": "Delete {name} and its downloaded files? This can't be undone.",
"button": "Delete"
}
}
]
},
{
"id": "finished-section",
"type": "heading",
"text": "Finished",
"collapsed": true,
"cards": [
"finished"
],
"source": {
"ref": "finished",
"when": {
"path": "finished_count",
"gt": 0
},
"map": {
"detail": {
"template": "Last {newest|ago}"
}
}
}
},
{
"id": "finished",
"type": "list",
"label": "Recently finished",
"max_items": 4,
"items": [],
"source": {
"ref": "finished",
"empty": {
"text": "Nothing finished yet",
"when": {
"path": "finished_count",
"equals": 0
}
},
"map": {
"items": {
"each": "recent",
"fields": {
"key": "hash",
"text": "name",
"subtitle": {
"if": {
"path": "category",
"not": ""
},
"then": {
"template": "{category} · {size|bytes} · ratio {ratio|round:2}"
},
"else": {
"template": "{size|bytes} · ratio {ratio|round:2}"
}
},
"detail": {
"template": "{completion_on|ago}"
}
}
}
}
}
}
]
}
```
## Questions
### Why does it need qBittorrent 5.3?
Before 5.2, the only way into qBittorrent’s Web API was signing in with your username and password, which gives back a cookie, and Legato can’t sign in with a cookie. 5.2 added API keys, and 5.3 added the request that measures free space in a folder. Update qBittorrent to use the page.
### Why aren’t the seeding torrents listed?
Many people seed hundreds or thousands of torrents, and a list that long would be slow to read and hard to scan. The facts card counts every torrent, Finished lists the four newest, and qBittorrent’s Web UI has the rest.
### What does Stalled mean?
qBittorrent is ready to download the torrent but nobody is sending it anything right now, usually because there are no seeds. The row says how many seeds are connected and how much is done.
### What does Files missing mean?
qBittorrent knew the torrent as downloaded, but its files aren’t where it saved them: the drive wasn’t mounted, or the files were moved or deleted. Put them back and press Start, and qBittorrent checks them again.
### Does Delete files ask first?
Yes. Remove and Delete files both name the torrent and ask before anything is sent. Delete files can’t be undone.
### Does it work with Sonarr and Radarr?
Yes. The [Sonarr](https://legatobar.com/services/sonarr) and [Radarr](https://legatobar.com/services/radarr) pages show their own queues, including what they’ve sent to qBittorrent, and this page shows everything qBittorrent is downloading, whoever added it.
Legato is independent and isn’t affiliated with or endorsed by the qBittorrent project.
## Verification
The page’s rules were checked against qBittorrent 5.3.0’s answers on 15 Nov 2026, on a server with two Debian ISOs and three Blender open films downloading, made-up private torrents seeding, one with its files moved away, one stalled with no seeds, one stopped and one still getting metadata. Through Legato, the turtle was pressed both ways, Stop and Start were pressed on a download, Remove was pressed on one torrent (its files stayed) and Delete files on another (its files went). Illustrations use made-up torrents, folders and numbers, beside the names of the freely licensed downloads the server really had. See the [service index](https://legatobar.com/services/) for other examples.
---
# Healthchecks in your Mac’s menu bar
See which of your cron jobs and scheduled tasks need you, without opening Healthchecks: every check as a dot, what’s due next and what’s running, and a page for each check. It works with the hosted healthchecks.io and with a Healthchecks server you run yourself. Healthchecks keeps doing the watching; Legato reads its results once a minute while your Mac is awake.
## What you’ll see
- **Healthchecks:**
- **Checks:** every check in the project as a named dot, by name. Up to 40 show at once, what needs attention first, with **Show N more** past that, and 60 in all: in a bigger project the ones that are down or late stay in. Red when Healthchecks has it down, orange while it’s late (past its time, in its grace period), grey while it’s paused, or waiting for its first ping, or for its next one after you resume it. A dot that changes sends a notification. Pointing at a dot says when its last ping came, or what’s wrong. A click opens its check page.
- **Project:** the check due next and when, what’s running now (a job that sent a start ping and hasn’t finished), the newest ping, and what’s paused.
- **Check:** what a dot opens when the key is read-write.
- **Now:** its state, its last ping and when it’s due next. A click opens the check in Healthchecks when your server uses https. Its corner has **Pause monitoring**, or **Resume monitoring** while it’s paused.
- **Last 24 hours:** a strip of how the check stood every 5 minutes, and the share of that time it was up. Healthchecks doesn’t keep this history, so Legato records it from the day you add the pages.
- **Run time:** how long its recent runs took, from the pings Healthchecks keeps. It shows once two runs have a time, which needs the job to send a start ping before it runs as well as the finish ping after.
- **Details:** its schedule, how long the last run took, its grace time, its description, tags and how many pings it has had.
- **Recent pings:** the four newest pings: started, success, failed, logged or ignored, with each run’s time.
- **Status changes:** when it last went down and came back up, from the last 90 days.
- **Check, read-only key:** the same page for a read-only key, with Now, Last 24 hours, Details and Status changes. A read-only key can’t read pings or pause a check, so Run time, Recent pings and the buttons aren’t there.
### Status
- Watches every check in the project.
- Red when one is down, orange while one is late.
- Grey while one is paused or hasn’t had its first ping, which never needs attention.
- Red once Healthchecks stops answering.
- Notifies you when it turns orange or red.
## How it connects
The pages read Healthchecks’ Management API v3 with a project’s API key, sent in an `X-Api-Key` header. The hosted service and your own server answer the same way.
| Request | When | What it supplies |
| --- | --- | --- |
| `GET /api/v3/checks/` | Every minute, and again for a check’s page while it’s open | Every check in the project, for the overview and the top of each check’s page. |
| `GET /api/v3/checks/{id}/flips/?seconds=7776000` | Every minute, while a check’s page is open | Its status changes over the last 90 days. |
| `GET /api/v3/checks/{id}/pings/` | Every minute, while a check’s page is open, with a read-write key | Its recent pings, for Run time and Recent pings. |
| `POST /api/v3/checks/{id}/pause`, `…/resume` | When you press Pause or Resume | Pauses or resumes the check. |
Healthchecks asks for no more than 100 requests a minute. The overview makes one a minute, and an open check’s page three more (two with a read-only key). Each check is about 1 KB of the list’s answer with a read-write key and a little over half that with a read-only one. Legato reads an answer of up to 1 MB, so a project of more than about 900 checks needs a read-only key, and one of more than about 1,500 isn’t read at all. Healthchecks’ [API documentation](https://healthchecks.io/docs/api/) covers the keys and each request.
**Which key.** A project has a read-write key and a read-only key, and either works. The overview opens the full check page for a read-write key and a shorter one for a read-only key, which can’t read pings or pause a check. A read-write key can also change and delete checks through the API; the pages only read, pause and resume.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make a key.** In Healthchecks, open your project’s **Settings** and, under **API Access**, create an API key: read-only to watch your checks, or read-write for pings, run times and Pause. Healthchecks shows the key only once.
2. **Save it in Legato.** In Settings → Secrets, save the key under `healthchecks`, bound to `healthchecks.io` or your server’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download the three pages and run `/Applications/Legato.app/Contents/Helpers/legato set healthchecks healthchecks.json`, then the same for `healthchecks-check` and `healthchecks-check-ro`.
4. **Point them at your server,** if you run your own. Change `https://healthchecks.io` to its address, with its port (`http://192.0.2.30:8000` for the Docker image), on every source of all three pages. If you reach it over https with a self-signed certificate, use its IP address or a `.local` name, which Legato can trust. A server under a path, such as `https://example.com/healthchecks`, isn’t supported.
The dots fill within a minute. A mistyped key is the usual reason they don’t: the page then notes that Healthchecks refused it.
### Prompt for your agent
```prompt
Add 3 Legato pages for Healthchecks, starting from https://legatobar.com/examples/healthchecks.json, https://legatobar.com/examples/healthchecks-check.json, https://legatobar.com/examples/healthchecks-check-ro.json. Use the page IDs healthchecks, healthchecks-check, healthchecks-check-ro if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add all three pages as they are. For my own server, set the url of every source on all three pages to its address; for healthchecks.io, leave https://healthchecks.io. I’ll save the project’s API key as healthchecks in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Healthchecks (healthchecks.json)](https://legatobar.com/examples/healthchecks.json)
- [Download Check (healthchecks-check.json)](https://legatobar.com/examples/healthchecks-check.json)
- [Download Check (healthchecks-check-ro.json)](https://legatobar.com/examples/healthchecks-check-ro.json)
## Questions
### What does Pause do?
The same as Pause in Healthchecks: the check stops watching and sends no alerts until its next ping, or until you press Resume when the check is set to wait for a manual resume. Neither button asks first, since each undoes the other. They’re only on a check’s page, so Spotlight and Shortcuts don’t offer them.
### Why is a check down when its job just ran?
Healthchecks marks a check down when it misses its time and its grace time, and also when the job pings `/fail`. Both read Down on the dot. With a read-write key, the check’s Recent pings show which: a failed ping, or no ping at all. A job that sent a start ping and is still running past its grace time is down too, and says so.
### Can I watch more than one project?
Not yet. Healthchecks keys belong to one project, and the pages watch the project whose key you save.
### What if I switch keys?
A read-only key and a read-write key name each check by a different id, so after you switch, the Last 24 hours strips start again.
Legato is independent and isn’t affiliated with or endorsed by Healthchecks.
## Verification
The pages’ rules were checked against Healthchecks v5.0.3 on 16 Nov 2026, on a self-hosted server with a dozen made-up checks kept in every state: up, late, down, failing, running, paused, new and unnamed, with both a read-only and a read-write key. The hosted healthchecks.io uses the same API but wasn’t tested live. Illustrations use made-up checks, tags and numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# Mealie in your Mac’s menu bar
Check what’s for dinner, and tick things off the shopping list in the shop, without opening Mealie. The page shows the next seven days of your meal plan and the shopping list you name when you set it up, and a tick or a new item goes straight to Mealie.
## What you’ll see
- **Mealie:**
- **Meal plan:** today and the next six days, under Today, Tomorrow and each day’s date, in meal order: breakfast, lunch, dinner, side, dessert, snack, drink. Each recipe has its photo from Mealie (an icon when it has none), its total time, and a link to it in Mealie. A note in the plan ("Eating out") shows its own words. Something planned for a week but not a day, which Mealie 3.30 added, comes last under **Any day this week** (or **Any day next week**, once next week’s starts within the seven days). The card shows 7 rows, with **Show more** for the rest, and a note when more is planned than the page reads.
- **Your shopping list**, titled with its name: what’s left to buy, under the list’s labels in the order the list puts them (Produce, Dairy, Pantry), with unlabelled items under Other, then what’s already ticked under Ticked. The title counts how many are ticked. Tick a row and it’s ticked in Mealie too. The **+** in the corner adds an item: type it as you would in Mealie ("2 lemons"). The card shows 7 rows, with **Show more** for the rest.
- **Shopping lists:** when you have two or more, each with how many items are left on it. Click one for its own page. The page reads 200 shopping items at a time, unticked first; past that, a note says so and the counts read "At least".
- **Mealie:** how many recipes you have, and Mealie’s version.
- **Made recently:** the last four times someone pressed **I Made This** on a recipe, with the note they left and when.
- **A shopping list:** one page for any of your lists, titled with its name: the same checklist with 15 rows and its own **+**.
### Status
No health card. The meals and the list are the page, as on a to-do app.
## How it connects
The pages read Mealie’s REST API with your API token, sent as `Authorization: Bearer …`.
| Request | When | What it supplies |
| --- | --- | --- |
| `GET /api/households/mealplans?start_date=…&end_date=…&include_week_entries=true` | Every 5 minutes | The plan for today and the next six days, with each recipe’s name, time and photo. |
| `GET /api/households/shopping/items?orderBy=checked` | Every 5 minutes | Every list’s items, up to 200, the unticked ones first. |
| `GET /api/households/shopping/lists` | Every 5 minutes | Your lists, and the order each puts its labels in. |
| `GET /api/recipes/timeline/events?queryFilter=eventType="comment"` | Every 5 minutes | The four newest I Made This entries. |
| `GET /api/recipes/{id}` | For each of those four, at most every 6 hours | The recipe’s name and photo. |
| `GET /api/groups/self`, `/api/households/statistics`, `/api/app/about` | Every 5 minutes | The group in your recipe links, the recipe count and the version. |
| `GET /api/media/recipes/{id}/images/min-original.webp` | While the card shows | Each recipe’s photo, kept on your Mac for a week. |
| `PUT /api/households/shopping/items/{id}` | When you tick an item | The item as Mealie sent it, with checked set. |
| `POST /api/households/shopping/items` | When you add an item | The new item, on your list. |
That’s about 85 requests an hour while your Mac is awake, most of them a few kilobytes. A list’s own page reads the list and its items instead. Mealie’s API documentation is on your own server at `/docs`.
A tick sends the whole item back, because Mealie replaces an item with whatever it’s sent. The item is as Mealie answered within the last five minutes, so a change someone made to it in Mealie since then (its quantity, say) is undone by the tick.
Mealie’s tokens have no permissions of their own: a token can do anything its account can. Make it on the account whose meal plan and lists you want to see. Another household’s plan and lists aren’t visible to it.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make a token.** In Mealie, open your profile, then **API Tokens**, and generate one.
2. **Save it in Legato.** In Settings → Secrets, save the token under `mealie`, bound to your Mealie’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download both pages and run `/Applications/Legato.app/Contents/Helpers/legato set mealie mealie.json` and `/Applications/Legato.app/Contents/Helpers/legato set mealie-list mealie-list.json`.
4. **Point them at Mealie.** Change `http://mealie.local:9925` to your Mealie’s address everywhere it appears in both pages: the sources, the recipe links (`…/g/{grp.slug|raw}/r/…`) and the notes. Mealie can’t sit at a path behind a reverse proxy, so it’s always an address of its own.
5. **Name your list.** In the overview, change `Weekly shop` to your shopping list’s name, as Mealie shows it, everywhere it appears: the two `derive` rules, the shopping card’s title and two notes.
The cards fill within a minute. A mistyped token is the usual reason they don’t: the page then notes that Mealie refused it. If the list’s name doesn’t match, the page says so in place of the list.
### Prompt for your agent
```prompt
Add 2 Legato pages for Mealie, starting from https://legatobar.com/examples/mealie.json, https://legatobar.com/examples/mealie-list.json. Use the page IDs mealie, mealie-list if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add both pages as they are and change http://mealie.local:9925 to my Mealie address everywhere it appears in them: the two sources, the two recipe links and the notes. Change Weekly shop to the name of my shopping list everywhere it appears in the overview: its two derive rules, the shopping card's title and two notes. I’ll save my API token as mealie in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Mealie (mealie.json)](https://legatobar.com/examples/mealie.json)
- [Download Shopping list (mealie-list.json)](https://legatobar.com/examples/mealie-list.json)
## Questions
### Does it work with older Mealie versions?
With Mealie 2.0 and later. Version 2 moved meal plans and shopping lists under households, and the pages use those addresses, so Mealie 1.x answers with errors. The pages’ requests were read from Mealie 2.0.0, 3.28.0 and 3.31.0. Week entries ("any day this week") need Mealie 3.30 or later; before that there are none to show.
### Why does a ticked row stay on the list for a moment?
The tick reaches Mealie at once. The row spins until the page reads Mealie again, which it does within a minute of the tick, and then the item moves down under Ticked. Ticked items stay in Mealie until they’re deleted there.
### Can it untick an item?
No. Ticked items stay at the end of the list, struck through, until they’re deleted in Mealie. Untick one there.
### Why does Made recently miss a meal?
It lists the times someone pressed **I Made This** on a recipe. Mealie doesn’t count a meal plan entry as made.
### Why does a recipe have no photo?
It has none in Mealie, so the row shows a fork and knife. A note in the plan always shows a note icon.
Legato is independent and isn’t affiliated with or endorsed by Mealie.
## Verification
The pages were checked against Mealie v3.31.0’s answers on 16 Nov 2026, on a server filled with made-up recipes, photos (drawings of a plate), a meal plan with notes and a week entry, three shopping lists and I Made This notes. A tick and an Add were sent there through Legato’s own requests, and an item with a food and a unit kept both when ticked; a junk token was refused. The pages’ requests were also read from a Mealie 2.0.0 server with made-up data and a 3.28.0 server, after the last change to them. Illustrations use made-up recipes, lists and photos. See the [service index](https://legatobar.com/services/) for other examples.
---
# Audiobookshelf in your Mac’s menu bar
See who’s listening on your Audiobookshelf server without opening it: each book or episode with its cover, how far along it is and on which device, how many hours everyone listened each day this week, the newest books and episodes, and what each library holds. The page turns red only if the server stops answering or refuses the key.
## What you’ll see
- **Audiobookshelf:**
- **Health:** in Details. Once the server stops answering, or answers that the key isn’t allowed, the health card turns red, and Legato sends a notification. Nothing else counts as a problem.
- **Listening:** the last seven days in hours, for everyone on the server, with today in bold. A session counts on the day it started.
- **Server:** this week’s hours and how many people listened, when the last backup was made ("No backups" if there are none), how much space the libraries take, and the server’s version.
- **Now listening:** each book or episode someone is playing, with its cover (or a headphones or podcast icon when it has none), the author or the podcast, who’s listening on what, and a bar with "4.2 of 9.5 h" (episodes and anything under an hour in minutes). A player that hasn’t reported for two minutes says Paused. After 16 minutes of silence the row goes, even though Audiobookshelf keeps the session open for a day and a half.
- **Recently added:** a shelf of the four newest books and podcast episodes across your libraries, with their covers. Each opens in Audiobookshelf.
- **Libraries:** each library with what it holds ("412 books · 3,870 h", "9 podcasts · 1,204 episodes"). Each row opens that library’s page.
- **Recent listening:** the last four sessions that aren’t on Now listening, each with who, how long and when.
- **Library:** one page for every library, titled with its name. A book library shows how many books, hours and authors it has and its size, then the fifteen newest books. A podcast library shows its podcasts, episodes, hours and size, then the fifteen newest episodes. Each opens in Audiobookshelf.
### Status
- Watches whether the server answers and takes the key, not who’s listening.
- Red once the server stops answering or refuses the key.
- Someone listening, a pause or an old backup never counts as a problem.
- Notifies you when it turns orange or red.
## How it connects
The pages read your server’s own API with your API key, sent as `Authorization: Bearer`. Sessions, backups and the server’s totals answer only admin and root users, so the key has to be one of theirs.
| Request | Pages | When | What it supplies |
| --- | --- | --- | --- |
| `GET /api/sessions/open` | Audiobookshelf | Once a minute, and every 15 minutes | Who’s playing what, how far along, and when their player last reported. |
| `GET /status` | Audiobookshelf | Every 5 and 15 minutes | That the server answers, and its version. |
| `GET /api/backups` | Audiobookshelf | Every 5 and 15 minutes | The backups and when each was made. Checks the key too, since `/status` answers without one. |
| `GET /api/sessions?itemsPerPage=100&sort=updatedAt&desc=1` | Audiobookshelf | Every 15 minutes | The newest 100 listening sessions, for the week and Recent listening. |
| `GET /api/stats/server` | Audiobookshelf | Every 15 minutes | How much space the libraries take. |
| `GET /api/libraries` | Audiobookshelf, Library | Every 15 minutes | The libraries, their names and kinds. |
| `GET /api/libraries/{param.id}` | Library | Every 15 minutes | The library’s folders, so its episodes are asked for once. |
| `GET /api/libraries/{id}/stats` | Audiobookshelf, Library | Every 15 minutes, for each library | How many items, hours, episodes and authors each holds. |
| `GET /api/libraries/{id}/items?sort=addedAt&desc=1&limit=8&minified=1` | Audiobookshelf, Library | Every 15 minutes, for each library | The newest books in it (15 on the library’s page). |
| `GET /api/libraries/{id}/recent-episodes?limit=8` | Audiobookshelf, Library | Every 15 minutes, for each library | The newest episodes of a podcast library (15 on its page). A book library answers that it has none, and is left out. If a podcast library’s episodes don’t come, its page says so rather than showing it empty. |
| `GET /api/items/{id}/cover?width=144&format=jpeg` | Audiobookshelf, Library | While the panel shows the row | Covers, kept on this Mac. |
With the overview open and two libraries, that’s about 130 requests an hour, plus a cover the first time each one shows. Up to 10 libraries get their totals and newest items. Covers come only from your server, never from another site, and **Load icons from the web** in Settings doesn’t affect them. The pages have no buttons: Audiobookshelf can’t stop or message someone else’s player, and the pages never change your library.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make an API key.** Sign in to Audiobookshelf as an admin or root user, open **Settings → API Keys**, and add a key for that user. Audiobookshelf 2.26 added API keys. Leave the expiry off, or note when it runs out. [Audiobookshelf’s docs](https://www.audiobookshelf.org/docs) cover the rest of the server.
2. **Save it in Legato.** In Settings → Secrets, save the key under `audiobookshelf`, bound to your server’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download the two pages and run `/Applications/Legato.app/Contents/Helpers/legato set audiobookshelf-library audiobookshelf-library.json`, then `legato set audiobookshelf audiobookshelf.json`. Keep the ID `audiobookshelf-library`: every library row opens it with that library’s id.
4. **Point them at your server.** Change `http://audiobookshelf.local:13378` to your server’s address on every source and link of both pages. Docker’s usual port is 13378. A server behind a reverse proxy works at its own address (`https://books.example.com`). The installer doesn’t take an address with a path, such as `/audiobookshelf`; edit the downloaded pages for one, putting the path in each source’s [`base`](https://legatobar.com/docs/source-reference.md).
The cards fill within a minute. A key of a user who isn’t an admin is the usual reason they don’t: the server answers that it isn’t allowed, and Details turns red.
### Prompt for your agent
```prompt
Add 2 Legato pages for Audiobookshelf, starting from https://legatobar.com/examples/audiobookshelf.json, https://legatobar.com/examples/audiobookshelf-library.json. Use the page IDs audiobookshelf, audiobookshelf-library if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add the pages as they are, keeping their page IDs, and change http://audiobookshelf.local:13378 on every source and link of both pages to my server’s address. I’ll save my Audiobookshelf API key as audiobookshelf in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Audiobookshelf (audiobookshelf.json)](https://legatobar.com/examples/audiobookshelf.json)
- [Download Library (audiobookshelf-library.json)](https://legatobar.com/examples/audiobookshelf-library.json)
## Questions
### When does a row say Paused, and when does it go?
Audiobookshelf keeps a session open until the app closes it, or for 36 hours. The page goes by when the player last reported instead: Paused after two minutes of silence, and gone after 16.
### Why does the week say "newest 100 sessions"?
The page reads the newest 100 sessions. On a busy server, a week can have more than that, so its first days would look short. When that happens the chart says so, and This week says "At least". Audiobookshelf’s own stats have the whole history.
### Why doesn’t an old backup count as a problem?
Automatic backups are off unless you turn them on, and the API doesn’t say whether they are. A month-old backup might be a problem or might be how you run it, so the page only says when the last one was made.
### What happens to the covers?
Legato fetches each cover from your server, only while it’s on screen, and keeps up to 50 MB of them on this Mac, the oldest going first. They never go anywhere else.
Legato is independent and isn’t affiliated with or endorsed by Audiobookshelf.
## Verification
The pages were filled from an Audiobookshelf 2.37.2 server on 16 Nov 2026 with made-up listeners playing on a phone, a browser and an Android app, 30 days of their listening, two libraries of invented books and podcasts with silent audio, and one backup. Illustrations use made-up titles, people and numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# Tautulli in your Mac’s menu bar
Tautulli records every play on your Plex server, which Plex itself doesn’t keep. This page shows what’s playing now, how much was watched over the last 30, 7 or 90 days, the shows, movies and artists played most, who watches the most, and what each person watched last. It counts as a problem only when Tautulli loses Plex or stops answering.
## What you’ll see
- **Tautulli:**
- **Health:** in Details, your Plex server’s name and "Connected to Plex". When Tautulli can’t reach Plex, it says "Not connected to Plex", and the health card turns orange, and Legato sends a notification. It turns red once Tautulli itself stops answering. Someone watching, a transcode or an update waiting never counts as a problem.
- **Period:** 30 days, 7 days or 90 days, under the title. Plays per day, the facts’ Plays and Most at once, the Top tabs and Top viewers follow it. Tautulli counts rolling days, today and the days before it, as its own home page does.
- **Now playing:** each stream with its poster, title and episode, a bar with "31 of 47 min", who’s watching on which player, and whether it plays directly, as a direct stream or transcoding. A paused stream says Paused. While Tautulli can’t reach Plex, the card says so instead of "Nothing playing". On a server with Plex Pass, point at a row for **Stop**, which asks first.
- **Plays per day:** one point a day across the period.
- **Facts:** plays and watch time in the period ("287 · 134h watched"), the most streams at once and the day it happened, Tautulli’s version with "Update ready" when there’s one, and the Plex version.
- **Most watched:** Top shows, Top movies and Top artists tabs, five each with their posters, plays and watch time in the period. Each row opens the title in Tautulli.
- **Top viewers:** the five people who played the most in the period, with their plays, watch time and when they last played. Each opens their own page.
- **Recently watched:** the four newest plays, each with its poster, who watched and when. A film stopped before the end says how far it got ("stopped at 42%").
- **Viewer:** one page for each person, titled with their name, following the same period: their plays per day, what they watched in the period and all time, when they last played, the players they use most, and their last seven plays.
### Status
- Watches whether Tautulli can reach Plex.
- Orange while Tautulli isn’t connected to Plex.
- Red once Tautulli stops answering.
- Someone watching, a transcode or an update waiting never counts as a problem.
- Notifies you when it turns orange or red.
## How it connects
The pages read Tautulli’s API with your API key, sent as the `X-Api-Key` header, so it never sits in an address.
| Request | Pages | When | What it supplies |
| --- | --- | --- | --- |
| `GET /api/v2?cmd=get_activity` | Tautulli | Once a minute | What’s playing, where it’s up to, and how it plays. |
| `GET /api/v2?cmd=server_status` | Tautulli | Once a minute | Whether Tautulli can reach Plex. |
| `GET /api/v2?cmd=get_server_info` | Tautulli | Once a minute, and every 15 minutes | The Plex server’s name and version, and whether it has Plex Pass, which Stop needs. |
| `GET /api/v2?cmd=get_history&length=4&include_activity=0` | Tautulli | Once a minute | The four newest plays. |
| `GET /api/v2?cmd=get_plays_by_date&time_range={period.id}` | Tautulli | Every 15 minutes | Plays per day across the period. |
| `GET /api/v2?cmd=get_plays_by_date&time_range={period.id}&y_axis=duration` | Tautulli | Every 15 minutes | Time watched per day, for the watch time. |
| `GET /api/v2?cmd=get_home_stats&stat_id=most_concurrent&time_range={period.id}` | Tautulli | Every 15 minutes | The most streams at once. |
| `GET /api/v2?cmd=get_tautulli_info` | Tautulli | Every 15 minutes | Tautulli’s version. |
| `GET /api/v2?cmd=update_check` | Tautulli | Every 15 minutes | Whether an update is ready. Tautulli asks GitHub itself, at most every few hours. |
| `GET /api/v2?cmd=get_home_stats&stat_id=top_tv&stats_type=plays&stats_count=5&time_range={period.id}` | Tautulli | Every 15 minutes | The most watched shows (and `top_movies`, `top_music` and `top_users` for films, artists and viewers). |
| `GET /api/v2?cmd=get_user&user_id={param.user}` | Viewer | Every 15 minutes | The viewer’s name. |
| `GET /api/v2?cmd=get_plays_by_date&time_range={period.id}&user_id={param.user}` | Viewer | Every 15 minutes | Their plays per day (and `y_axis=duration` for their watch time). |
| `GET /api/v2?cmd=get_user_watch_time_stats&user_id={param.user}&query_days=0` | Viewer | Every 15 minutes | What they’ve watched all time. |
| `GET /api/v2?cmd=get_user_player_stats&user_id={param.user}` | Viewer | Every 15 minutes | The players they use most. |
| `GET /api/v2?cmd=get_history&user_id={param.user}&length=7&include_activity=0` | Viewer | Every 15 minutes | Their last seven plays. |
| `GET /api/v2?cmd=pms_image_proxy&img={thumb}&width=300&height=450` | Tautulli, Viewer | While the panel shows the row | Posters, through Tautulli from your Plex server, kept on this Mac. |
| `POST /api/v2?cmd=terminate_session&session_key={id}&message=…` | Tautulli | When you press Stop and confirm | Stops that stream; the viewer sees "The server owner has ended the stream." |
That’s about 280 requests an hour with the overview open, plus a poster the first time each one shows. Tautulli’s API key can do anything Tautulli’s web page can, including deleting history; these pages only read, apart from Stop. [Tautulli’s API reference](https://github.com/Tautulli/Tautulli/wiki/Tautulli-API-Reference) lists every command.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Turn on the API.** In Tautulli, open Settings → Web Interface, tick **Enable API** under API, save, and copy the **API key** shown there.
2. **Save it in Legato.** In Settings → Secrets, save the key under `tautulli`, bound to your Tautulli’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download the two pages and run `/Applications/Legato.app/Contents/Helpers/legato set tautulli-user tautulli-user.json`, then `legato set tautulli tautulli.json`. Keep the ID `tautulli-user`: every viewer row opens it with that person’s Tautulli user id.
4. **Point them at Tautulli.** Change `http://tautulli.local:8181` to your Tautulli’s address on every source and link of both pages. Tautulli answers on port 8181 by default. If you reach it through a reverse proxy at a path (Tautulli’s **HTTP Root**, such as `/tautulli`), keep the bare address in `url` and add `"base": "/tautulli"` to each source; Legato adds it to requests, Stop and posters. The links that open titles in Tautulli are full addresses, so add the path to them too (`http://media.example.com/tautulli/info?…`). If you’ve turned on Tautulli’s own HTTPS with its self-signed certificate, Legato can trust it only at an IP address or a `.local` name.
The cards fill within a minute. A mistyped key is the usual reason they don’t: the page then notes that Tautulli refused it.
### Prompt for your agent
```prompt
Add 2 Legato pages for Tautulli, starting from https://legatobar.com/examples/tautulli.json, https://legatobar.com/examples/tautulli-user.json. Use the page IDs tautulli, tautulli-user if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add the pages as they are, keeping their page IDs, and change http://tautulli.local:8181 on every source and link of both pages to my Tautulli’s address. I’ll save my API key as tautulli in Settings → Secrets myself. Don’t press Stop to test it.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Tautulli (tautulli.json)](https://legatobar.com/examples/tautulli.json)
- [Download Viewer (tautulli-user.json)](https://legatobar.com/examples/tautulli-user.json)
## Questions
### Do I need Legato’s Plex page too?
No. This page has its own Now playing, so it works alone. The Plex page adds what was just added and your libraries’ counts, which Tautulli doesn’t keep.
### Why don’t I see Stop on a row?
Tautulli stops a stream only for a Plex account with Plex Pass, so Stop shows only then. The viewer sees "The server owner has ended the stream."
### Why can’t I delete history from here?
Deleting a play can’t be undone, and the history is what Tautulli is for. Do it in Tautulli’s History page if you need to.
### Why does Top artists list artists, not albums?
Tautulli ranks music by artist, so that’s what the tab shows. The poster is the artist’s picture, or a note icon when Plex has none.
### What happens to the posters?
Legato fetches each poster through Tautulli with your API key, only while it’s on screen, and keeps up to 50 MB of them on this Mac, the oldest going first. They never go anywhere else.
Legato is independent and isn’t affiliated with or endorsed by Tautulli or Plex.
## Verification
The pages were filled from Tautulli 2.19.1 on 16 Nov 2026, watching a Plex Media Server 1.43.5 with made-up players and 45 days of made-up plays by five invented viewers. That Plex server wasn’t signed in to Plex, so Stop is checked by tests with made-up answers rather than live. Losing Plex was checked live by stopping the server. Illustrations use made-up titles, people and numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# Your RSS feeds in your Mac’s menu bar
Blogs, news sites, podcasts and release pages publish what’s new as a feed. These pages read the feeds you list and show the newest posts from all of them in one place, each with the feed it came from. Below that, each feed gets a dot, and a click on a dot opens that feed’s own page. Legato reads RSS, Atom and JSON Feed. Feeds are public, so there’s no account or key.
## What you’ll see
- **RSS Feeds:** every feed on your list on one page:
- **Latest:** the newest posts from every feed, newest first. Each row shows the post’s title, which feed it came from and how long ago it was posted, and a click opens the post in your browser. Seven show at first, and Show more brings up the rest, up to 30. A post with no date goes after the dated ones. A post dated in the future is placed as if it were posted now, so a feed with a wrong clock can’t stay on top.
- **Feeds:** one dot for each address on your list, in the list’s order, named by the feed’s own title. Hover over a dot to see when its newest post went up. A feed that misses a read keeps its posts on the page and stays green. After three missed reads in a row its dot turns orange, and the hover says why, such as the site answering with an error. An address Legato can’t read turns orange straight away and says what’s wrong with it. A click opens the feed’s own page.
- **Feed:** one page for each feed, opened from its dot and named after the feed. It lists the feed’s posts with the start of each summary, then the feed’s newest post, its site and how many posts the feed holds.
### Status
- Watches each feed on your list, a dot each.
- Orange once a feed has missed three reads in a row, or when an address on the list can’t be read.
- A missed read or two isn’t a problem.
- New posts aren’t a problem.
- Notifies you when it turns orange or red.
## How it connects
The pages ask for no key. Legato reads each address on your list once every 30 minutes, with no sign-in:
| Request | When | What it supplies |
| --- | --- | --- |
| `GET` each feed’s address | Every 30 minutes | The feed’s title and site, and its posts with their titles, links, dates, authors and summaries. |
Feeds are read four at a time, and each is read on its own, so a feed that doesn’t answer affects only its own dot. When a site says its feed hasn’t changed, Legato uses what it already has. [Several feeds from a list](https://legatobar.com/docs/source-requests.md#several-feeds-from-a-list) explains how a page reads a list of feeds.
## Set it up
1. **Find each feed’s address.** Most sites link to their feed as RSS, or keep it at `/feed`, `/rss` or `/atom.xml`. Open the address in a browser and you should see the feed’s text, starting with `
# Beszel in your Mac’s menu bar
See how your machines are doing without opening Beszel: every system as a dot, the five busiest, the alerts firing, and a page for each system. Beszel’s hub keeps watching and keeps the history; Legato reads it once a minute while your Mac is awake.
## What you’ll see
- **Beszel:**
- **Systems:** every system as a named dot, by name, up to 40 at once with **Show N more** past that, and 60 in all: on a bigger hub the ones down or alerting stay in, and a note says how many there are. Red when Beszel has it down, orange while one of your alerts is firing on it, grey while it waits for its agent to connect, and off while it’s paused. A dot that changes sends a notification. Pointing at a dot shows its CPU, memory and disk, or what’s wrong. A click opens the system’s page.
- **Busiest:** the five systems using the most CPU, with their memory and disk.
- **Hub:** how many systems there are and how many aren’t up, the fullest disk, and Beszel’s version.
- **Alerts firing:** shown only while an alert is firing, newest first, each opening its system.
- **Alert history:** closed at the bottom. How many alerts fired in the last 7 days, and the four newest, firing or cleared.
- **System:** what a dot opens.
- **Details:** whether it’s up and for how long, down and since when, paused, or which alert is firing.
- **CPU** and **Memory:** the last 12 hours, from the readings Beszel keeps every 10 minutes.
- **Disks:** how full the root disk is, then any others the agent watches, by name.
- **Temperatures:** the sensors the agent reports, hottest first. Not every machine has any, and the card shows only when they do.
- **System:** load, CPU model and cores, operating system, network traffic, uptime and the agent’s version.
- **Containers:** its Docker or Podman containers by CPU, unhealthy ones first. Shown only on a system that has containers.
- **Alerts:** the alert rules you set on it, the firing ones marked.
### Status
- Watches every system the user can see.
- Red when one is down, orange while one of the user’s alerts is firing on it.
- Grey while one is waiting for its agent, and paused systems never count as a problem.
- Red once Beszel stops answering.
- Notifies you when it turns orange or red.
## How it connects
Beszel’s hub runs on PocketBase and has no API keys. Legato signs in as a Beszel user with an email and password, keeps the token it gets back, and signs in again when Beszel turns that token down.
| Request | When | What it supplies |
| --- | --- | --- |
| `POST /api/collections/users/auth-with-password` | When Legato starts, and again when the token has run out | The sign-in token. |
| `GET /api/collections/systems/records` | Every minute, and for a system’s page while it’s open | Each system’s state and its CPU, memory and disk. |
| `GET /api/collections/alerts_history/records` | Every minute (three requests) | The alerts firing, the four newest, and how many fired in the last 7 days. |
| `GET /api/beszel/info` | Every minute | Beszel’s version. |
| `GET /api/collections/system_details/records`, `…/containers/records`, `…/alerts/records` | Every minute, while a system’s page is open | Its CPU model and operating system, its containers and its alert rules. |
| `GET /api/collections/system_stats/records` | Every 5 minutes, while a system’s page is open | Its last 12 hours of 10-minute readings. |
The overview makes five requests a minute, and an open system’s page four more, plus its history every 5 minutes. All are small: a system is a few hundred bytes of an answer. The overview reads up to 1,000 systems and 1,000 firing alerts, down systems first. Beszel’s [REST API documentation](https://beszel.dev/guide/rest-api) covers the collections.
**Which user.** Make a user with the read-only role for Legato. It sees the systems shared with it, or every system when the hub runs with `SHARE_ALL_SYSTEMS=true`. Alerts belong to the user who made them, so the pages show the alerts of the user Legato signs in as. A read-only user can make its own alerts in Beszel’s settings. A user that signs in only with OAuth, or with a one-time code (`MFA_OTP`), can’t be used.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make a user.** As an admin, open **Users** from Beszel’s account menu. It opens PocketBase’s dashboard, where you add a user with the `readonly` role. Add that user to each system you want to see (a system’s `users`, in the same dashboard), or run the hub with `SHARE_ALL_SYSTEMS=true`. Then sign in to Beszel as that user once and set up its alerts.
2. **Save its password in Legato.** In Settings → Secrets, save the password under `beszel`, bound to your hub’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download both pages and run `/Applications/Legato.app/Contents/Helpers/legato set beszel beszel.json`, then the same for `beszel-system`.
4. **Point them at your hub and user.** Change `http://beszel.local:8090` to your hub’s address, with its port, and `legato-reader@example.net` to the user’s email, on every source of both pages. If you reach the hub over https with a self-signed certificate, use its IP address or a `.local` name, which Legato can trust. A hub under a path, such as `https://example.com/beszel`, isn’t supported.
The dots fill within a minute. A wrong email or password is the usual reason they don’t: the page then notes that Beszel refused the sign-in.
### Prompt for your agent
```prompt
Add 2 Legato pages for Beszel, starting from https://legatobar.com/examples/beszel.json, https://legatobar.com/examples/beszel-system.json. Use the page IDs beszel, beszel-system if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add both pages as they are. Set the url of every source on both pages to my Beszel hub’s address, and the identity in every source’s sign-in request to my Beszel user’s email. I’ll save the user’s password as beszel in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Beszel (beszel.json)](https://legatobar.com/examples/beszel.json)
- [Download System (beszel-system.json)](https://legatobar.com/examples/beszel-system.json)
## Questions
### Why don’t I see my alerts?
Beszel keeps alerts for each user. The pages show the alerts of the user Legato signs in as, so set them up on that user, or sign in as the user whose alerts you want.
### Can I pause a system from Legato?
No. The pages only read, and a read-only user can’t pause anything. Pause it in Beszel.
### Can I watch more than one hub?
Not yet. One hub already watches every machine you add to it, so most people need only one.
Legato is independent and isn’t affiliated with or endorsed by Beszel.
## Verification
The pages’ rules were checked against Beszel 0.21.2 on 16 Nov 2026, on a hub with four agents and a fifth system with none, signed in both as an admin and as a read-only user: systems up, down, paused and pending, alerts firing and cleared, and a machine with 47 containers. Temperatures, GPUs, extra disks and Podman weren’t on the test machines, so those cards were checked only against made-up answers. Illustrations use made-up systems, containers and numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# Notion in your Mac’s menu bar
Legato shows your Notion databases in the Mac’s menu bar: the ones you share with it and the pages edited last, a page for any database with its rows edited last, and three pages for databases you keep yourself. Tick off tasks, move a book from Up next to Reading, and see which posts go out in the next two weeks, without opening Notion.
## What you’ll see
- **Notion:**
- **Databases:** the databases your token can read, the one edited last first, seven at a time with **Show N more**. Each opens its own page.
- **Recently edited:** the four pages edited last, with their database and when.
- **A database:** what a row on the overview opens.
- **Recently edited:** its 15 rows edited last, each opening in Notion.
- **Database:** when it was last edited and its properties.
- **Data source ID:** with a Copy button, for the pages below.
- **Tasks:** for a tasks database:
- **Due, Upcoming and No date**, one tab each, every row a task you tick to mark it done. Due is today’s tasks, then the overdue ones. Upcoming is the next 7 days, under each day. Each row says its day, its time when it has one, and its status.
- **Completed**, closed at the bottom: the four tasks marked done that were edited last.
- **Reading list:**
- **Reading:** what you’re reading now and when each was last edited, each with a **Finished** button.
- **Up next:** what you haven’t started, the oldest added first, each with **Start reading**.
- **Finished**, closed at the bottom: the four edited last.
- **Content calendar:**
- **Past its date:** posts whose publish date has gone by and aren’t published, with their status. It shows only while there are some.
- **Next 14 days:** an agenda of what goes out, each with its status.
- **Recently published**, closed at the bottom: the last four out.
### Status
Nothing counts as a problem: tasks and posts are their own status, so an overdue task doesn’t turn the page orange.
## How it connects
The pages read Notion’s API, version 2026-03-11, with your token sent as a bearer token. Each page reads its source every 5 minutes while your Mac is awake.
| Request | Page | What it supplies |
| --- | --- | --- |
| `POST /v1/search` | Notion | The databases your token can read, and the four pages edited last. |
| `GET /v1/data_sources/{id}` | A database | Its name, properties and when it was last edited. |
| `POST /v1/data_sources/{id}/query` | A database, Tasks, Reading list, Content calendar | Rows, filtered by status and date and sorted the way each card reads them. Tasks makes five of these, the others three or one. |
| `PATCH /v1/pages/{id}` | Tasks, Reading list | When you tick a task or press Finished or Start reading: sets its status. |
Notion keeps each integration to a few requests a second, which these pages stay well under. Notion’s [API reference](https://developers.notion.com/reference/intro) covers the requests and its [authorization guide](https://developers.notion.com/docs/authorization) covers tokens.
**Which token.** An internal connection’s token sees only the pages and databases you share with it, and its [capabilities](https://developers.notion.com/reference/capabilities) say whether it can change them. A personal access token acts as you, with your permissions. Ticking a task and the reading buttons change a page; when the token can’t, they say Notion refused.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make a token.** Make an internal connection or a personal access token, as [Notion’s authorization guide](https://developers.notion.com/docs/authorization) describes. For an internal connection, let it update content if you want to tick tasks, and then share each database you want in Legato with it: in Notion, open the database and choose **•••** → **Add connections**.
2. **Save it in Legato.** In Settings → Secrets, save the token under `notion`, bound to `api.notion.com`. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Install the pages.** **Install in Legato** above adds the Notion page and the database page. Each database appears within 5 minutes.
4. **Add a page for a database you keep,** if you want one: Tasks, Reading list or Content calendar, from the links under Install in Legato. Each asks for:
- **Its data source ID.** Open the database from Legato’s Notion page and press Copy beside Data source ID.
- **The names of its properties,** as Notion shows them: the Status property, and the date a task is due or a post goes out. Status has to be a Status property, not a Select.
- **Its status values:** the one a finished task has (Done), and on a reading list the ones for reading now, not started and finished.
A page that can’t read its database says that Notion answered HTTP 400 or 404. HTTP 404 means the token can’t see the database: share it with your connection in Notion. HTTP 400 usually means a property or status name doesn’t match the database: check its spelling and capitals.
### Prompt for your agent
```prompt
Add 5 Legato pages for Notion, starting from https://legatobar.com/examples/notion.json, https://legatobar.com/examples/notion-database.json, https://legatobar.com/examples/notion-tasks.json, https://legatobar.com/examples/notion-reading.json, https://legatobar.com/examples/notion-calendar.json. Use the page IDs notion, notion-database, notion-tasks, notion-reading, notion-calendar if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add the notion and notion-database pages as they are. Add notion-tasks, notion-reading or notion-calendar only for a database I have of that kind, and ask me for its data source ID, the names of its Status and date properties, and the status values the page names; put them where the page has Status, Due date, Publish date, Done, In progress, Not started and Published, including the property name used as a key in each button’s body. I’ll save the token as notion in Settings → Secrets myself. Don’t tick a task or press a button to test it.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Notion (notion.json)](https://legatobar.com/examples/notion.json)
- [Download Database (notion-database.json)](https://legatobar.com/examples/notion-database.json)
- [Download Tasks (notion-tasks.json)](https://legatobar.com/examples/notion-tasks.json)
- [Download Reading list (notion-reading.json)](https://legatobar.com/examples/notion-reading.json)
- [Download Content calendar (notion-calendar.json)](https://legatobar.com/examples/notion-calendar.json)
## Questions
### Why is Due today’s tasks, then overdue?
So what’s due today stays on top however many old tasks have gone by. Each half is in the order of its due date.
### What does ticking a task do?
It sets the task’s Status to the Done status you named, as choosing it in Notion would. Legato reads the database again straight after, and the task leaves the list. Ticking doesn’t ask first, and you can set the status back in Notion. Spotlight and Shortcuts don’t offer row buttons.
### Why doesn’t Completed say how many I finished this week?
Notion doesn’t keep when a task was marked done, only when the page was last edited. So Completed shows the tasks marked done that were edited last, and says when each was edited.
### What if a list has more than the page shows?
Due reads 30 tasks due today and 30 overdue, and Upcoming and No date read 60 each. When Notion has more, the page says some aren’t shown. Reading, Up next and Next 14 days say so on their titles, and the database page says it shows the 15 edited last.
### Does a task due at a time count by my Mac’s day?
A task due on a day counts on that day. For a task due at a time, Notion’s [filter reference](https://developers.notion.com/reference/filter-data-source-entries) reads a day in a filter as a day in UTC, so a task due late in the evening west of UTC, or early in the morning east of it, can show on the day before or after.
### Can I use a Select for status?
Not yet. The pages filter and set a Status property, which is what Notion’s own task and content templates use.
Legato is independent and isn’t affiliated with or endorsed by Notion.
## Verification
The overview and the database page were checked live on 16 Nov 2026 against Notion’s API with an internal connection. Notion accepted every request of the other three pages against a database with a Status property and dates, and a row dated a day fell in exactly one of today, before and after. Ticking, the reading buttons and tasks due at a time near midnight were checked against made-up answers, not live. Illustrations use made-up databases, pages and titles. See the [service index](https://legatobar.com/services/) for other examples.
---
# Vercel in your Mac’s menu bar
See how your Vercel projects are doing without opening the dashboard: what’s building, how the last day went, every project’s production build as a dot, and the newest deployments. Each project opens a page of its own with its production deployment, build times, domains and deployments, and the buttons to redeploy, roll back, promote or cancel.
## What you’ll see
- **Vercel:**
- **Details:** domains bought through Vercel and your access token. The health card turns orange when a domain has 30 days left with auto-renew off, or the token has 14 days left (with its date saved), and red when a domain has a week or less left or the token has run out. Otherwise it names the next renewal. The page reads your first 100 domains, and says so when you have more.
- **Team:** what’s building or queued now, the last 24 hours’ deployments and how many failed (“At least” when there were more than the 100 the page reads), and the newest production deployment.
- **Deployments:** a column for each of the last 7 days. A busy team that makes more than 100 deployments in a week sees the newest 100, and the card says from which day.
- **Projects:** every project as a dot, by name. Orange when its newest production build failed or was blocked and an older one still serves the site, red when a failed build left nothing serving, grey while it’s paused or before its first production deployment. A failed preview stays green, with a note when you point at it. A dot that changes sends a notification. 24 show at once, what needs attention first, with **Show N more**. The page reads 40 projects, and the card says so when you have more. Each dot opens its project’s page.
- **Recent deployments:** the four newest, with their commit message, project, Production or Preview, and state. A click opens the deployment in Vercel. A build that’s running or queued has **Cancel build** at its right, which asks first.
- **Project:** one page for every project, opened from its dot and titled with its name:
- **Production:** when the live build was deployed. If the newest production build failed, it says so and when the build still serving went live; after a rollback, it says newer builds are waiting for Promote. A click opens the site. **Redeploy** in its corner builds the deployment serving production again, from the same commit, after asking.
- **Build time:** how long each of the newest builds took.
- **Project:** the last 24 hours’ deployments (“At least” past the 20 the page reads), the production branch, and the framework and Node version.
- **Domains:** the project’s domains, with a note on one that redirects, follows a branch or isn’t verified yet (in orange). Past 20, the card’s title says it shows the first 20.
- **Deployments:** the seven newest, with **Show N more** up to 20. The one serving production says so. Each can have one button, and each asks first:
- **Promote to production** on a newer production build that isn’t live: one made without taking traffic, or one a rollback passed over.
- **Roll back to this** on an earlier production build Vercel can return to. On the Hobby plan only the build just before works, and Vercel says so if you press an older one.
- **Cancel build** on a build that’s running or queued.
### Status
- Watches each project’s production builds.
- Orange when the newest production build failed or was blocked and an older one still serves, red when a failed build left nothing serving.
- A failed preview doesn’t count as a problem.
- Grey for a paused project or one never deployed, which never needs attention.
- Details turns orange when a domain bought through Vercel has 30 days left without auto-renew, or when the token has 14 days left.
- Notifies you when it turns orange or red.
## How it connects
The pages read Vercel’s REST API at `api.vercel.com` with an access token as a bearer token.
| Request | Pages | When | What it supplies |
| --- | --- | --- | --- |
| `GET /v7/deployments?limit=100&since=…` | Vercel | Once a minute | The week’s deployments, newest first. |
| `GET /v10/projects?limit=40` | Vercel | Every 2 minutes | Each project with its newest production build and newest deployments. |
| `GET /v4/aliases?limit=100` | Vercel | Every 2 minutes | Which deployment each production address points at, so a failed build can be told from a site that’s down. |
| `GET /v5/domains?limit=100` | Vercel | Once an hour | Domains, with the renewal date of those bought through Vercel. |
| `GET /v9/projects/{param.id}` | Project | Once a minute | The project and what serves production. |
| `GET /v7/deployments?projectId={param.id}&limit=20` | Project | Once a minute | The project’s newest deployments. |
| `GET /v4/aliases?projectId={param.id}&limit=100` | Project | Once a minute | Which deployment the project’s addresses point at. |
| `GET /v9/projects/{param.id}/domains?production=true&redirects=false&limit=20` | Project | Once a minute | The project’s production addresses. |
| `GET /v7/deployments?projectId={param.id}&rollbackCandidate=true&limit=20` | Project | Once a minute | The builds Vercel can roll back to. |
| `GET /v7/deployments?projectId={param.id}&target=production&limit=1` | Project | Once a minute | The newest production deployment, however many previews came after it. |
| `GET /v9/projects/{param.id}/domains?limit=20` | Project | Once a minute | The project’s domains. |
| `PATCH /v12/deployments/{uid}/cancel` | Both | When you press Cancel build | Stops a build. |
| `POST /v13/deployments` | Project | When you press Redeploy | Builds the deployment serving production again. |
| `POST /v1/projects/{projectId}/rollback/{uid}` | Project | When you press Roll back to this | Serves an earlier production build. |
| `POST /v10/projects/{projectId}/promote/{uid}` | Project | When you press Promote to production | Serves a production build that hasn’t taken traffic yet. |
Vercel’s [REST API docs](https://vercel.com/docs/rest-api) and its [limits](https://vercel.com/docs/limits) have the rest. [Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make a token.** At [vercel.com/account/tokens](https://vercel.com/account/tokens), create a token, set its Scope to the team you want to watch, and choose when it expires. A token scoped to one project can’t read the team’s domains. Full Account works too and watches your default team.
2. **Save it in Legato.** In Settings → Secrets, save it under `vercel`, bound to `api.vercel.com`, with the date it expires. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download the two pages and run `/Applications/Legato.app/Contents/Helpers/legato set vercel-project vercel-project.json`, then `legato set vercel vercel.json`. Keep the ID `vercel-project`: every dot opens it with its project’s ID.
The cards fill within a minute. A missing, expired or mistyped token is the usual reason they don’t: Vercel answers 403, and the page notes that api.vercel.com turned it down.
### Prompt for your agent
```prompt
Add 2 Legato pages for Vercel, starting from https://legatobar.com/examples/vercel.json, https://legatobar.com/examples/vercel-project.json. Use the page IDs vercel, vercel-project if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add both pages as they are, keeping their page IDs. I’ll save my Vercel access token as vercel in Settings → Secrets myself. Don’t press Redeploy, Roll back, Promote or Cancel to test them.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Vercel (vercel.json)](https://legatobar.com/examples/vercel.json)
- [Download Project (vercel-project.json)](https://legatobar.com/examples/vercel-project.json)
## Questions
### Why is a project orange when the site is up?
Vercel keeps serving the last good production build when a new one fails. Orange means the newest production build failed while an older one is still live: the site is up, and your latest change isn’t on it. Red means a production build failed and nothing serves production.
### Does Redeploy use my latest commit?
No. It builds the deployment that serves production now again, with the same commit and the project’s current settings and environment variables. Push a commit to ship a newer one.
### What happens after Roll back to this?
Vercel serves that earlier build and stops sending new production builds to your domains until you promote one. After a rollback, **Promote to production** shows on the newer builds; pressing it, or Promote in Vercel, puts things back. Vercel’s [Instant Rollback](https://vercel.com/docs/instant-rollback) page has the details.
### Why don’t I see usage or costs?
Vercel sends usage and charges as JSON Lines, one record a line, which Legato doesn’t read yet.
### Can it watch more than one team?
One team at a time: the team the token is scoped to.
Legato is independent and isn’t affiliated with or endorsed by Vercel.
## Verification
The pages were checked against a real Vercel Hobby team on 17 Nov 2026, signed in with a Full Account token and no team named: projects with a failed production build, one with nothing serving, a failed preview, a build running and one cancelled. Redeploy, Roll back to this, Promote to production and Cancel build were each pressed once against it. Domain renewals weren’t, since the team had no domain bought through Vercel, and neither were projects linked to a Git repository: the commit messages and branches came from the deployments themselves. The example pages have tests with made-up answers for a busy day. Illustrations use made-up teams, projects, domains and commits. See the [service index](https://legatobar.com/services/) for other examples.
---
# Cloudflare in your Mac’s menu bar
See whether your Cloudflare Tunnels are connected and how your sites did over the last day without opening the dashboard. Each tunnel and each zone opens a page of its own.
## What you’ll see
- **Cloudflare:**
- **Details:** your zones, your API token and any domains registered through Cloudflare. The health card turns orange when a zone is still waiting for Cloudflare’s nameservers or its nameservers have moved away, or the token has 14 days left (with its date saved), and red once the token has run out. Domains turn it orange 30 days before one without auto-renew expires and red in its last week; with auto-renew on, it names the next renewal.
- **Last 24 hours:** requests, data served, the share served from Cloudflare’s cache, and the share that were server errors (5xx), added up across every zone in the account. Cloudflare counts these from a sample of visitors’ requests.
- **Requests an hour:** each whole hour of the last day across the same zones, so a spike stands out.
- **Tunnels:** every Cloudflare Tunnel as a dot, by name. Orange while it’s degraded, red while it’s down with no connections, grey for one that has never run. A dot that changes sends a notification. Each dot opens its tunnel’s page. An account with no tunnels doesn’t show the card.
- **Zones:** your zones, a zone waiting for its nameservers first, then the busiest, with their requests and data served over the last day. A paused zone says so. Each opens its zone’s page.
- **Billing:** your plans with their prices, the next renewal of a plan with a fixed price, and the last charge with its date and status. A click on the last charge opens its invoice. Products billed by use, such as R2 and Workers, show what they cost once Cloudflare charges for them, not as the month goes.
- **Free allowance:** R2 storage and Class A and B operations this month against R2’s free 10 GB, 1 million and 10 million, and Workers requests in the last 24 hours against the Free plan’s 100,000 a day. Only what you use gets a row. On a paid Workers plan there’s no daily limit, so read the Workers row as a count. Storage is each bucket’s largest size this month, so it can read above what Cloudflare averages for the bill.
- **Zone:** one page for every zone, opened from its row and titled with its name:
- **Details:** the zone’s edge certificates. The health card turns orange when one couldn’t be validated, issued or deployed, or has a week left without renewing, and red when one has expired. Cloudflare renews them about a month ahead.
- **Controls:** a Security level menu, from Essentially off to I’m Under Attack; Development mode on or off, which skips the cache for three hours; and Purge cache, which asks first and removes every cached file.
- **Requests a day** for the last 30 days.
- **Last 30 days:** requests, the share cached, data served, its status and its plan.
- **Responses** over the last day by status: 2xx, 3xx, 4xx and 5xx.
- **Top countries** over the last day.
- **Tunnel:** one page for every tunnel, opened from its dot and titled with its name:
- **Tunnel:** healthy, degraded, down or never run, since when, its connections and the Cloudflare data centres they reach.
- **Last 24 hours:** a strip of how it stood every 15 minutes, from what the overview noted every 5 minutes while your Mac was awake.
- **Connectors:** each `cloudflared` running it, with its version, platform, address and when it started. A connector on an older version than the latest `cloudflared` release on GitHub turns orange and says an update is available, and the card’s title names the latest release.
### Status
- Watches each Cloudflare Tunnel.
- Orange while a tunnel is degraded, red while it’s down with no connections.
- Grey for a tunnel that has never run.
- Details turns orange when a zone is waiting for its nameservers or they’ve moved away, the token has 14 days left, or a domain without auto-renew has 30 days left.
- A zone’s Details turns orange when a certificate stalls or has a week left.
- Notifies you when it turns orange or red.
## How it connects
The pages read Cloudflare’s API at `api.cloudflare.com` with an API token as a bearer token. Traffic comes from Cloudflare’s GraphQL Analytics API.
| Request | Pages | When | What it supplies |
| --- | --- | --- | --- |
| `GET /client/v4/accounts?per_page=5` | All | With each request that needs it | Your account, so the pages don’t ask for its ID. |
| `GET /client/v4/accounts/{account}/cfd_tunnel?is_deleted=false&per_page=100` | Cloudflare | Once a minute | Each tunnel and its state. |
| `GET /client/v4/zones?per_page=50&account.id={account}` | Cloudflare | Every 5 minutes | Your zones and their status. |
| `POST /client/v4/graphql` | Cloudflare | Every 5 minutes | The account’s last 24 hours: requests an hour, each zone’s requests, data served, server errors and cache. |
| `GET /client/v4/accounts/{account}/subscriptions` | Cloudflare | Once an hour | Your plans, their prices and when each renews. |
| `GET /client/v4/accounts/{account}/billing/history?per_page=20` | Cloudflare | Once an hour | Your charges, newest first. |
| `GET /client/v4/accounts/{account}/registrar/registrations` | Cloudflare | Every 6 hours | Domains registered through Cloudflare and when each expires. |
| `POST /client/v4/graphql` | Cloudflare | Once an hour | R2 storage and operations this month, and Workers requests in the last day. |
| `GET /client/v4/zones/{param.zone}` | Zone | Every 5 minutes | The zone, its status and plan. |
| `POST /client/v4/graphql` | Zone | Every 5 minutes | 30 days of requests a day, and the last day’s responses and countries. |
| `GET /client/v4/zones/{param.zone}/ssl/certificate_packs` | Zone | Every 6 hours | The zone’s edge certificates and when each expires. |
| `GET /client/v4/zones/{param.zone}/settings/security_level` and `…/development_mode` | Zone | Once a minute | The settings the Controls card shows. |
| `PATCH /client/v4/zones/{param.zone}/settings/…` | Zone | When you pick a security level or press Development mode | Changes that setting. |
| `POST /client/v4/zones/{param.zone}/purge_cache` | Zone | When you press Purge cache | Removes every cached file. |
| `GET /client/v4/accounts/{account}/cfd_tunnel/{param.id}` | Tunnel | Once a minute | The tunnel and its state. |
| `GET /client/v4/accounts/{account}/cfd_tunnel/{param.id}/connections` | Tunnel | Once a minute | Its connectors and their connections. |
| `GET https://api.github.com/repos/cloudflare/cloudflared/releases/latest` | Tunnel | Every 6 hours | The latest `cloudflared` release. Sent without your token. |
The token reads everything the pages show. Only the zone buttons change anything, and only with Edit on Zone Settings and Purge on Cache Purge. Cloudflare’s [API token docs](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) and [GraphQL Analytics API docs](https://developers.cloudflare.com/analytics/graphql-api/) have the rest. [Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make a token.** At [dash.cloudflare.com/profile/api-tokens](https://dash.cloudflare.com/profile/api-tokens), create a custom user token. Give it Read on Account › Cloudflare Tunnel, Account Analytics, Billing and Registrar, and on Zone › Zone, Analytics, Zone Settings and SSL and Certificates. For the zone buttons, add Edit on Zone › Zone Settings and Purge on Zone › Cache Purge; leave those out for a token that only reads. Under Account Resources choose one account (the pages watch the first account the token can read), and under Zone Resources all zones from that account. You can give it an expiry date there. An account token works too, without the Domains card, since Cloudflare’s Registrar answers only user tokens.
2. **Save the token in Legato.** In Settings → Secrets, save it under `cloudflare`, bound to `api.cloudflare.com`, with the date it expires if you gave it one. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download the three pages and run `/Applications/Legato.app/Contents/Helpers/legato set cloudflare-zone cloudflare-zone.json`, then the same for `cloudflare-tunnel` and `cloudflare`. Keep the IDs `cloudflare-zone` and `cloudflare-tunnel`: every row and dot opens them.
The cards fill within a few minutes. A token without one of the permissions is the usual reason one doesn’t. Without a Read permission, the card that needs it notes that api.cloudflare.com turned it down; without Read on analytics, the page says so where the traffic would be.
### Prompt for your agent
```prompt
Add 3 Legato pages for Cloudflare, starting from https://legatobar.com/examples/cloudflare.json, https://legatobar.com/examples/cloudflare-zone.json, https://legatobar.com/examples/cloudflare-tunnel.json. Use the page IDs cloudflare, cloudflare-zone, cloudflare-tunnel if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add all three pages as they are, keeping their page IDs. I’ll save my Cloudflare API token as cloudflare in Settings → Secrets myself. Don’t press Purge cache, Development mode or the security level menu to test them.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Cloudflare (cloudflare.json)](https://legatobar.com/examples/cloudflare.json)
- [Download Zone (cloudflare-zone.json)](https://legatobar.com/examples/cloudflare-zone.json)
- [Download Tunnel (cloudflare-tunnel.json)](https://legatobar.com/examples/cloudflare-tunnel.json)
## Questions
**Why don’t the totals match a zone list I can see?** Cloudflare counts traffic for zones its zone list leaves out, such as a workers.dev subdomain, so those requests are in the totals without a row of their own.
**Why are the numbers a little different from the dashboard?** The hour-by-hour figures come from Cloudflare’s sampled analytics, and the overview counts requests from visitors, leaving out ones your Workers make. The 30-day figures on a zone page are Cloudflare’s daily totals.
**Does it show security events?** No. The pages show traffic and tunnels only.
**Can it purge the cache or turn on Under Attack mode?** Yes, from a zone’s page, with a token that has Edit on Zone Settings and Purge on Cache Purge. Purge cache asks first. A token without them shows the buttons, and Cloudflare turns the press down.
## Verification
On 17 Nov 2026 all three pages were fetched through Legato from a live Free-plan account with one zone and one tunnel, and every card filled. The answers to a wrong token and to a token without Read on analytics were checked live too. A degraded or down tunnel, a zone waiting for its nameservers and an account with many zones were checked only against made-up answers.
---
# Sentry in your Mac’s menu bar
See what Sentry has caught without opening it: whether an issue is escalating or has come back, how many errors arrived in the last day and when, and every unresolved issue seen in that time, with the ones that need you first. Each issue and each project opens a page of its own. It works with sentry.io, in the US or the EU, and with a Sentry server you run yourself.
## What you’ll see
- **Sentry:**
- **Details:** the health card turns orange while an unresolved issue seen in the last 24 hours is escalating (Sentry saw it spike) or regressed (it came back after you resolved it), and names the busiest one. Otherwise it says how many unresolved issues Sentry saw that day. It also turns orange when Sentry hasn’t answered three times in a row.
- **Last 24 hours:** the unresolved issues seen, with how many are new, and the errors Sentry accepted. “At least” when there were more than the page reads.
- **Errors:** the errors Sentry accepted each hour for the last 24 hours, for the whole organization. A regression shows here as a spike. On a day with no errors at all there’s no chart.
- **Issues:** every unresolved issue seen in the last 24 hours: escalating ones first, then regressed and new ones, each saying so, then the rest with when they were last seen. Each part runs busiest first. A row shows its project, its events that day and where in the code it happens; a fatal one is red. Seven show at once, with **Show N more** up to 60. A click opens the issue’s page. **Resolve** and **Archive** sit at the end of each row, and each asks first. Archive keeps the issue out of the way until Sentry sees it escalate.
- **Projects:** every project, busiest first, with its errors in the last 24 hours and an escalating or regressed issue if it has one. Four show at once. A click opens the project’s page.
- **Project:** one page for every project, titled with its name: its unresolved issues and errors for the day, its latest release, its errors an hour, and its issues with the same buttons. It reads that project on its own, so it shows issues a busy organization’s overview leaves out.
- **Issue:** one page for every issue, titled with its short ID:
- **Issue:** escalating, regressed, new, ongoing, resolved or archived, and its title. Escalating and regressed turn it orange, and an archived issue is grey. A click opens it in Sentry. Its corner has **Resolve** and **Archive**, or **Unresolve** once it’s resolved or archived.
- **Events:** its events each hour for the last 24 hours.
- **Details:** its events in the last 24 hours, when it was last and first seen, its events and users of all time, the first and latest release it was seen in, where in the code, and its level and priority.
### Status
- Watches the unresolved issues seen in the last 24 hours.
- Orange while one is escalating or regressed, and after three reads in a row that Sentry doesn’t answer.
- Never red, and new or ongoing issues don’t count as a problem.
- Shows in Details and notifies you when it turns orange or red.
## How it connects
The pages read Sentry’s API at `/api/0/` with a token as a bearer token. sentry.io and a Sentry server answer the same way.
| Request | Pages | When | What it supplies |
| --- | --- | --- | --- |
| `GET /organizations/{org}/issues/?query=is:unresolved+is:escalating&statsPeriod=24h&sort=freq…` | Sentry, Project | Once a minute | Escalating issues seen in the last 24 hours, busiest first. Three more requests ask for regressed, new and ongoing ones. |
| `GET /organizations/{org}/stats_v2/?category=error&outcome=accepted&groupBy=outcome&statsPeriod=24h&interval=1h…` | Sentry, Project | Once a minute | Errors accepted each hour. |
| `GET /organizations/{org}/stats_v2/?…&groupBy=project…` | Sentry | Once a minute | Each project’s errors in the last 24 hours. |
| `GET /organizations/{org}/projects/?per_page=100` | Sentry | Once a minute | The projects. |
| `GET /projects/{org}/{param.id}/` | Project | Once a minute | The project’s name and latest release. |
| `GET /organizations/{org}/issues/{param.id}/` | Issue | Once a minute | The issue, with its events each hour. |
| `PUT /organizations/{org}/issues/{id}/` | All three | When you press Resolve, Archive or Unresolve | Changes the issue’s status. |
Sentry’s [API docs](https://docs.sentry.io/api/) have the rest. [Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make a token.** In Sentry’s settings for your own account, create a personal token (Sentry also calls it a user auth token) with Read access to Organization, Project, and Issue & Event. Choose Read & Write for Issue & Event if you want Resolve and Archive to work. An organization token (one that starts `sntrys_`) can’t read issues.
2. **Find your organization’s slug.** It’s the part after `/organizations/` in Sentry’s addresses, or the first part of your `.sentry.io` address.
3. **Save the token in Legato.** In Settings → Secrets, save it under `sentry`, bound to `sentry.io`, `de.sentry.io` or your server’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
4. **Add the pages.** Paste the prompt into your agent, or download the three pages. In each one, replace `tidewater-apps` with your organization’s slug. For an organization in the EU, change the address on every source to `https://de.sentry.io`; for your own server, to the address you open it at, such as `https://sentry.example.com` or `http://192.0.2.20:9000`. Then run `/Applications/Legato.app/Contents/Helpers/legato set sentry-issue sentry-issue.json`, `legato set sentry-project sentry-project.json` and `legato set sentry sentry.json`. Keep the IDs `sentry-project` and `sentry-issue`: every row opens them with its project’s or issue’s ID.
The cards fill within a minute. A mistyped token or slug is the usual reason they don’t, and so is a token missing one of the Read scopes; the page notes the error Sentry sent. A Sentry server with a self-signed certificate works at an IP address or a `.local` name.
### Prompt for your agent
```prompt
Add 3 Legato pages for Sentry, starting from https://legatobar.com/examples/sentry.json, https://legatobar.com/examples/sentry-project.json, https://legatobar.com/examples/sentry-issue.json. Use the page IDs sentry, sentry-project, sentry-issue if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add all three pages as they are, keeping their page IDs. For my own server or an EU organization, set the url of every source on all three pages to its address; for sentry.io in the US, leave https://sentry.io. Replace tidewater-apps in every path, and in the buttons’ paths, with my organization’s slug. I’ll save my Sentry token as sentry in Settings → Secrets myself. Don’t press Resolve, Archive or Unresolve to test them.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Sentry (sentry.json)](https://legatobar.com/examples/sentry.json)
- [Download Project (sentry-project.json)](https://legatobar.com/examples/sentry-project.json)
- [Download Issue (sentry-issue.json)](https://legatobar.com/examples/sentry-issue.json)
## Questions
### What’s the difference between escalating and regressed?
Sentry calls an issue escalating when it’s getting many more events than it usually does, and regressed when it happens again after you resolved it. Both turn Details orange. New means Sentry first saw it in the last week; ongoing is everything else that’s unresolved.
### Why don’t the numbers match Sentry’s Issues page?
The pages count what Sentry saw in the last 24 hours, and Sentry’s Issues page usually covers a longer period. The errors are every error Sentry accepted for the organization, including those in issues that are resolved or archived and in projects your token can’t open.
### Why does it say “At least”?
The page reads up to 25 escalating, 25 regressed, 25 new and 60 ongoing issues each minute. When one of those comes back full there are more, so the count says “At least”. A project’s page reads that project on its own.
### What happens when I press Resolve?
Sentry marks the issue resolved and it leaves the list. If it happens again, Sentry marks it regressed and it comes back, in orange. Unresolve on the issue’s page puts it back by hand.
### Why can’t it connect to sentry.io?
Some ad and tracker blocklists block sentry.io, on a router, a Pi-hole or the Mac itself. If the pages can’t reach it, allow `sentry.io` (or `de.sentry.io`) there.
Legato is independent and isn’t affiliated with or endorsed by Sentry.
## Verification
These pages haven’t been checked against a live Sentry yet. They were built on 17 Nov 2026 from Sentry’s published API description and its source code, and tested with made-up answers for a busy day, a quiet day and answers cut short at what the page reads. Illustrations use made-up organizations, projects, issues and releases. See the [service index](https://legatobar.com/services/) for other examples.
---
# Your Unraid server in your Mac’s menu bar
See how your Unraid server is doing without opening its web interface: whether the array is healthy, how full and how warm each disk is, how far a parity check has got, which containers stopped when they shouldn’t have, and what Unraid wants to tell you. The pages read the API that comes with Unraid 7.2 and later.
## What you’ll see
- **Unraid:**
- **Details** holds the server’s health. Its button turns red when the array can’t start, a disk is disabled, missing or past its critical use, or Unraid has an unread alert. It turns orange for a disk past its warning use, read or write errors on a disk, a parity check that found errors or didn’t finish, or an unread warning. Use thresholds are the ones in Unraid’s Display Settings, or a disk’s own. Unraid judges heat itself, with its own limits for each disk, NVMe drive and SSD, and sends a warning or alert when a disk runs hot. That counts as a problem, in Unraid’s words. It’s grey while the array is stopped. A click on its row opens Unraid’s web interface.
- **Parity check:** while a check, a parity sync, a disk rebuild or a disk clear runs, how far it has got and its speed. A parity check or read check has **Pause** or **Resume** in its corner; a rebuild or a sync has no buttons.
- **Server:** the array’s state and how much of it is used, the last parity check and its errors, how many containers are running and how many have an update, how many VMs are running, and the Unraid version and uptime.
- **CPU** and **Memory** over the last 6 hours.
- **Disks:** how full each data disk and pool is, with its temperature while it’s spinning. With more than 12, the fullest 12.
- **Containers:** every Docker container as a dot, under Needs attention, Running and Stopped. A container set to autostart that isn’t running is orange, and counts as a problem too. One you stopped yourself is grey and never counts as a problem. Each dot opens that container’s page.
- **Virtual machines:** each VM and its state, with **Start**, **Resume** or **Shut down** on its row.
- **Notifications:** the four newest unread, with **Mark all read** in the corner.
- **Container:** one page for every container, titled with its name:
- how it stands now, with Start, Stop and **Update** (when Unraid has found one) in the card’s corner;
- its state over the last day;
- its image, whether it starts with the array, whether an update is ready, and when it was made;
- **Logs:** its last 10 log lines.
### Status
- Watches the array, every disk, the last parity check, Unraid’s unread alerts and warnings, and every container.
- Red for an array that won’t start, a disk that’s disabled, missing or past its critical use, or an unread alert.
- Orange for a disk past its warning use or with read or write errors, a parity check that found errors or didn’t finish, an unread warning, or a container set to autostart that isn’t running.
- Grey while the array is stopped.
- Red once Unraid stops answering.
- Shows in Details and notifies you when it turns orange or red.
## How it connects
The pages send GraphQL queries to your server with your API key in the `x-api-key` header. Every request is a `POST /graphql`.
| Query | Pages | When | What it supplies |
| --- | --- | --- | --- |
| `array`, `vars`, `info`, `metrics`, `docker.containers`, `vms.domains`, `notifications` | Unraid | Once a minute | The array, its disks and pools, the parity check, Display Settings’ thresholds, CPU and memory, every container, every VM and the newest unread notifications, in one request of a few KB. |
| `docker.containers` | Container | Once a minute while open | The container’s state, image and whether an update is ready. |
| `docker.logs` | Container | Once a minute while open | Its last 10 log lines. |
| `parityCheck.pause`, `parityCheck.resume` | Unraid | When you press Pause or Resume | Pauses or resumes a parity check or read check. |
| `vm.start`, `vm.resume`, `vm.stop` | Unraid | When you press Start, Resume, or Shut down and confirm | Starts a stopped VM, resumes a paused one, or shuts one down. Shut down asks the VM to shut itself down, and Unraid turns it off if it’s still running after about 10 seconds. |
| `archiveAll` | Unraid | When you press Mark all read | Moves every unread notification to the archive, where Unraid keeps it. |
| `docker.start`, `docker.unpause`, `docker.stop`, `docker.updateContainer` | Container | When you press Start, Resume, Stop or Update (Stop and Update ask first) | Starts, resumes or stops the container, or runs Unraid’s own update: it pulls the new image and recreates the container from its template. The press waits until Unraid has finished, up to 15 minutes. |
That’s 60 requests an hour with the Unraid page open, plus 120 an hour while a container’s page is open. Legato also keeps each container’s state every 5 minutes in [History](https://legatobar.com/docs/history.md), for its page’s day, and the CPU and memory readings for the charts. Unraid’s API reference is in [its documentation](https://docs.unraid.net/API/how-to-use-the-api/).
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make an API key.** In Unraid, open **Settings → Management Access → API Keys** and create a key. The **Viewer** role reads everything the pages show. For the buttons, also give it update permission on **Docker**, **VMs**, **Array** and **Notifications**; without it, the pages work and a press says Unraid refused it.
2. **Save it in Legato.** In Settings → Secrets, save the key under `unraid`, bound to your server’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download the two pages and run `/Applications/Legato.app/Contents/Helpers/legato set unraid-container unraid-container.json`, then `legato set unraid unraid.json`. Keep the ID `unraid-container`: every dot opens it.
4. **Point them at your server.** Change `http://tower.local` to the address you open Unraid at. It’s on each source, and it’s the Server card’s `url`, the link to Unraid’s web interface. Use the address without a path: `http://192.168.1.20`, `http://tower.local`, or your `https://…myunraid.net` address. With SSL set to **Yes**, Unraid uses a certificate it made itself: Legato asks you to trust it once, in Settings → Certificates, for an IP address or a `.local` name.
The cards fill within a minute. A mistyped key is the usual reason they don’t: the page then notes that Unraid refused it.
### Prompt for your agent
```prompt
Add 2 Legato pages for Unraid, starting from https://legatobar.com/examples/unraid.json, https://legatobar.com/examples/unraid-container.json. Use the page IDs unraid, unraid-container if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add the pages as they are, keeping their page IDs. Change http://tower.local everywhere it appears in both pages (each source, and the Server card’s link) to my Unraid server’s address. I’ll save my API key as unraid in Settings → Secrets myself. Don’t press Pause, Resume, Start, Shut down, Stop, Update or Mark all read to test them.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Unraid (unraid.json)](https://legatobar.com/examples/unraid.json)
- [Download Container (unraid-container.json)](https://legatobar.com/examples/unraid-container.json)
## Questions
### Why is a stopped container sometimes orange and sometimes grey?
Unraid knows which containers you set to start with the array. One of those that isn’t running needs a look, so it’s orange. One you don’t autostart, such as a tool you run now and then, is grey.
### Why are there no buttons on a disk rebuild?
Unraid’s API pauses a parity check with the same command it would send for a rebuild, so the pages offer Pause only while a parity check or read check runs. Cancelling or starting a check, and starting or stopping the array, stay in Unraid. A cancelled check starts again from the beginning next time, and Spotlight presses a page’s buttons without asking.
### Why does the container page show an error under Logs?
Logs, Update and Resume need Unraid 7.2.4 or later. On 7.2.0 to 7.2.3 the Logs card shows Unraid’s error and the buttons fail when pressed. The rest of the page works.
### Where are SMART reports?
The API reports SMART health only as OK or unknown, so the pages don’t show it. When Unraid finds a SMART problem it sends a notification, which shows under Notifications. An unread alert turns Details red, and a warning orange, until you mark them read.
### Does Spotlight ask before it acts?
Spotlight presses a button you choose by name without asking, as it does for every button. Here that’s **Pause**, **Resume** and **Mark all read**: a paused check carries on where it stopped, and Unraid keeps archived notifications. The VM and container buttons aren’t in Spotlight, since it couldn’t say which VM or container they’d act on.
### Does it work with several servers?
The Unraid page shows one server. For another, add a copy of the page with its own ID, that server’s address in its source and its link, and no `collect`: only one page can keep the containers’ History. Each dot still opens the one container page, which then reads the first server.
Legato is independent and isn’t affiliated with or endorsed by Lime Technology or Unraid.
## Verification
Unraid is a licensed operating system, so these pages couldn’t be filled from a live server. Every query and button was checked against Unraid’s published GraphQL schema as it shipped with Unraid 7.2.0, with 7.2.4 and as it stands in November 2026: all of them exist from 7.2.4, and all but the container page’s logs, Update and Resume from 7.2.0. Tests with made-up answers cover a busy day, a quiet day, a stopped array, Docker and the VM manager turned off, disks that are disabled, missing, full or showing errors, Unraid’s unread warnings and alerts, a rebuild, a server with no parity disk, and the buttons. Illustrations use a made-up server. See the [service index](https://legatobar.com/services/) for other examples.
---
# UniFi in your Mac’s menu bar
See how your UniFi network is doing without opening the UniFi app: whether each site’s internet is connected, how its latency looked over the day, and every gateway, switch, access point, camera and drive as a dot. Each site opens a page of its own with its latency and each WAN over a day, a week or a month. The pages read Ubiquiti’s cloud Site Manager, so one key covers every console your account owns.
## What you’ll see
- **UniFi:**
- **Details:** your sites and your consoles, as two lists. A site is red when none of its WANs is connected or its gateway is offline, and its line names the ISP and which WAN is up. A second WAN that isn’t connected is said in words and isn’t a problem for the page, so a spare left unplugged stays quiet. A console is red when it stops reporting to UniFi, which is what a console that has lost its internet looks like from the cloud, and grey when UniFi has no report from it yet. A site whose console has no report is grey too. Each site opens its page, and an account without a Network site has no Sites list. When two in one list share a name, each gets the end of its ID added. Past 60 in a list, the ones that need a look come first and the title says how many there are.
- **Network** (when you have a Network site): the internet (the ISP and which WAN is up, or how many sites are connected when you have several), clients on Wi-Fi and wired, every device with how many are offline and how many have a firmware update waiting, and Wi-Fi retries.
- **Latency:** the last 24 hours from UniFi’s own 5-minute ISP measurements, when your account has one site. With several, each site’s page has its own. It’s read on its own, so the rest of the page still loads if it can’t.
- **Devices:** every device across your consoles as a dot, under Network, Protect and Other. Red when it’s offline, grey in any other state UniFi reports. A device waiting for firmware stays green, and says so when you point at it. When two devices share a name, each gets the end of its MAC address added. A dot that changes sends a notification. 24 show at once, offline ones first, with **Show N more**. Past 60, the card keeps the offline ones and says how many there are. The pages read up to 2,000 sites, 200 consoles and 2,000 groups of devices; past that, a note says the counts cover part of them.
- **Site:** one page for each site, opened from Details or the Internet line, and titled with the site’s name (for a site still called Default, its console’s name):
- **Details:** the site’s WANs now, as on the overview.
- **Today, 7 days, 30 days:** a row for the span the page shows.
- **Latency:** every 5 minutes for Today, hourly for 7 and 30 days. With two WANs up in the span, a line for each, and a longer stretch when one was down is a gap in its line. With one, the line is the highest average among the WANs that were up.
- **Internet:** each WAN over the span: its ISP, how much of the time it was up, and how much of the time it lost packets. A WAN with no link in the whole span reads Not connected.
- **Site:** clients, devices, Wi-Fi retries and the gateway’s model.
### Status
- Watches every site, console and device the key can see.
- Red when a device is offline, when a site has no WAN connected or its gateway is offline, or when a console stops reporting to UniFi.
- Grey while UniFi has no report from a console, or a device or console is in a state other than online or offline.
- A spare WAN that isn’t connected and a firmware update waiting don’t count as a problem.
- Red once Site Manager stops answering.
- Notifies you when it turns orange or red.
## How it connects
The pages read Ubiquiti’s Site Manager API at `api.ui.com`, with an API key in an `X-API-Key` header.
| Request | Pages | When | What it supplies |
| --- | --- | --- | --- |
| `GET /v1/sites?pageSize=500`, more pages with `nextToken` | Both | Every 2 minutes on UniFi, every 5 on a site | Each site’s WANs, ISP, client and device counts. |
| `GET /v1/hosts?pageSize=50`, more pages with `nextToken` | Both | The same | Each console and whether it’s reporting. |
| `GET /v1/devices?pageSize=500`, more pages with `nextToken` | Both | The same | Every device on every console; on a site’s page, only to see whether its console is still reporting. |
| `GET /v1/isp-metrics/5m?duration=24h` | UniFi | Every 5 minutes | The last day of 5-minute latency. |
| `POST /v1/isp-metrics/5m/query` (Today) or `/1h/query` (7 and 30 days) | Site | Every 5 minutes | This site’s latency, uptime and packet loss from the start of the span chosen, read on its own so the site’s state still shows if it can’t load. It only reads, though it’s a POST. |
Ubiquiti’s [Site Manager API docs](https://developer.ui.com/site-manager/v1.0.0/gettingstarted) have the rest. [Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make a key.** Sign in at [unifi.ui.com](https://unifi.ui.com/settings/api-keys) with the account that owns your consoles, open Settings → API Keys and create one. UniFi shows it only once, so copy it then.
2. **Save it in Legato.** In Settings → Secrets, save it under `unifi`, bound to `api.ui.com`. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download the two pages and run `/Applications/Legato.app/Contents/Helpers/legato set unifi-site unifi-site.json`, then `legato set unifi unifi.json`. Keep the ID `unifi-site`: every site opens it with its own ID.
The cards fill within two minutes. A wrong or deleted key is the usual reason they don’t: Site Manager answers 401, and the page notes that api.ui.com turned it down. A key made in the Network app on the console itself is a different kind of key, and Site Manager refuses it the same way.
### Prompt for your agent
```prompt
Add 2 Legato pages for UniFi, starting from https://legatobar.com/examples/unifi.json, https://legatobar.com/examples/unifi-site.json. Use the page IDs unifi, unifi-site if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add both pages as they are, keeping their page IDs. I’ll save my Site Manager API key as unifi in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download UniFi (unifi.json)](https://legatobar.com/examples/unifi.json)
- [Download Site (unifi-site.json)](https://legatobar.com/examples/unifi-site.json)
## Questions
### Why is a console red when my internet is fine?
Site Manager hears from each console over the internet. A console that stops reporting, because it lost its connection, restarted or was unplugged, is red until it reports again. Until then, its devices show what it last reported.
### Why does it say a WAN isn’t connected?
UniFi reports each WAN port, including a second one kept for failover. When one has no link, the site’s line and its page say so, and the page counts it as a problem only when no WAN at all is connected.
### Why don’t I see the latency chart?
The overview draws it when your account has one site. With several, open a site from Details. A site with no ISP measurements from UniFi yet shows no chart.
### Can I restart a device or see my clients by name?
Not from these pages. They only read, and Site Manager doesn’t list clients one by one. The UniFi app does both.
Legato is independent and isn’t affiliated with or endorsed by Ubiquiti.
## Verification
The pages were checked on 17 Nov 2026 against a live UniFi account with two WANs and several consoles, using a Site Manager key. Every request above was read live, and both pages were drawn from live answers, the site page for Today, 7 days and 30 days. Following `nextToken` was checked with one item a page, including the empty pages Site Manager sends before the list ends. Not checked live: several Network sites, a console that has stopped reporting, and an offline gateway; the example pages have tests with made-up answers for those. Illustrations use made-up sites, consoles, devices and ISPs. See the [service index](https://legatobar.com/services/) for other examples.
---
# Grafana alerts in your Mac’s menu bar
See what your Grafana alerts are saying without opening Grafana: what’s firing, with the critical ones first, what’s about to fire, and what you’ve silenced. Each alert opens a page for its rule, where you can silence it for an hour, a day or a week. Grafana keeps evaluating the rules and sending its notifications. Legato reads the results once a minute while your Mac is awake.
## What you’ll see
- **Grafana alerts:**
- **Health,** in Details: how many alerts are firing, pending and silenced. It turns red while a firing alert’s `severity` label is `critical`, `crit`, `high`, `page`, `error`, `emergency`, `alert`, `fatal`, `p1` or `sev1`, in any case. It turns orange while any other alert is firing or a rule can’t be evaluated. Grafana has no severity of its own, so an alert with no `severity` label counts as orange. The health card takes its colour, and a change sends a notification.
- **Firing:** each firing alert, critical first and then newest first. A row names the rule, where it’s firing (its `instance`, `service`, `job`, `host` or `pod` label) with its summary, and how long it has been firing. A rule that can’t be evaluated shows here too, with Grafana’s error. Seven show at once, with **Show N more**.
- **Pending:** alerts whose condition is true but haven’t waited out their pending period yet.
- **Silenced:** firing alerts that a silence in Grafana is holding back.
- **Grafana:** how many rules there are and how many can’t be evaluated, how many silences are active and when the next one ends, and Grafana’s version.
- **Recent changes:** the last four times an alert started firing or resolved, from Grafana’s state history.
- **Alert rule:** what a row opens.
- **Now:** whether the rule is firing, and on how many of its instances, pending, silenced, paused or failing to evaluate. With an Editor token, its corner has **Silence**, a menu of 1 hour, 4 hours, 1 day and 1 week, or **End silence** while a silence made that way holds it. With https, a click opens the rule in Grafana.
- **Instances:** each series the rule watches, firing first, with its state and since when.
- **Rule:** its summary, folder and group, how often it’s evaluated and its pending period, its `severity` label, and when Grafana last evaluated it.
- **State changes:** its last four changes.
### Status
- Watches every alert rule the token can see.
- Red while an alert labelled critical (or a word like it, such as high, page or p1) is firing, orange while any other alert is firing or a rule can’t be evaluated.
- Pending and silenced alerts never count as a problem.
- Red once Grafana stops answering.
- Shows in Details and notifies you when it turns orange or red.
## How it connects
The pages read Grafana’s alerting API with a service account token, sent as `Authorization: Bearer`. A self-hosted Grafana and Grafana Cloud answer the same way.
| Request | When | What it supplies |
| --- | --- | --- |
| `GET /api/prometheus/grafana/api/v1/rules?state=firing&state=pending&state=recovering` | Every minute | The rules that are firing, pending or recovering, with their alerts, and how many rules there are. |
| `GET /api/prometheus/grafana/api/v1/rules?health=error&health=nodata` | Every minute | Rules that can’t be evaluated. |
| `GET /api/alertmanager/grafana/api/v2/alerts` | Every minute | Every firing alert in Grafana’s own Alertmanager, and whether a silence holds it. |
| `GET /api/alertmanager/grafana/api/v2/silences` | Every minute | Active silences and when they end. |
| `GET /api/annotations?type=alert` | Every minute | Recent state changes. |
| `GET /api/health` | Every minute | Grafana’s version. |
| `GET /api/prometheus/grafana/api/v1/rules?rule_uid=…` and the requests above for one rule | Every minute, while a rule’s page is open | The rule, its instances, silences and changes. |
| `GET /api/access-control/user/permissions` | Every minute, while a rule’s page is open | Whether the token may silence, so Silence shows only when it can. |
| `POST /api/alertmanager/grafana/api/v2/silences` | When you pick a length from Silence | A silence on the rule, from now until then. |
| `DELETE /api/alertmanager/grafana/api/v2/silence/{id}` | When you press End silence | Ends that silence. |
The overview makes six small requests a minute, and a rule’s page five more while it’s open. Grafana’s [alerting API documentation](https://grafana.com/docs/grafana/latest/alerting/) describes the rules, silences and roles.
**Which token.** A service account with the **Viewer** role can read every rule in the folders it can view, and that’s all the pages need. An **Editor** service account can also make and end silences, so Silence appears on a rule’s page. An Editor token can change rules and dashboards through the API too; the pages only read, silence and end silences.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make a token.** In Grafana, open **Administration → Users and access → Service accounts**, add a service account with the Viewer role (or Editor, to silence from Legato), and add a token to it. Grafana shows the token only once.
2. **Save it in Legato.** In Settings → Secrets, save the token under `grafana`, bound to your Grafana’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download both pages and run `/Applications/Legato.app/Contents/Helpers/legato set grafana grafana.json`, then the same for `grafana-rule`.
4. **Point them at your Grafana.** Change `http://grafana.local:3000` to its address, with its port, on every source of both pages and in each page’s `site` value: `https://example.grafana.net` for Grafana Cloud. If you reach it over https with a self-signed certificate, use its IP address or a `.local` name, which Legato can trust. A Grafana served under a path, such as `https://example.com/grafana`, needs that path as each source’s `base`.
The rows fill within a minute. A mistyped token is the usual reason they don’t: the page then notes that Grafana refused it.
### Prompt for your agent
```prompt
Add 2 Legato pages for Grafana alerts, starting from https://legatobar.com/examples/grafana.json, https://legatobar.com/examples/grafana-rule.json. Use the page IDs grafana, grafana-rule if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add both pages as they are. Set the url of every source on both pages to my Grafana’s address, and the same address in each page’s site value. I’ll save a service account token as grafana in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Grafana alerts (grafana.json)](https://legatobar.com/examples/grafana.json)
- [Download Alert rule (grafana-rule.json)](https://legatobar.com/examples/grafana-rule.json)
## Questions
### What does Silence do?
The same as a silence you make in Grafana: it holds back the rule’s notifications, for every one of its instances, until the time you picked. It goes in Grafana’s own Alertmanager, made by “Legato”. While it holds, the rule’s page offers End silence. A silence you made in Grafana some other way, such as on a label, shows as Silenced but can only be ended in Grafana. Silence is only on a rule’s page, so Spotlight and Shortcuts don’t offer it.
### Why does a firing alert show when Grafana sends alerts elsewhere?
While Grafana’s own Alertmanager holds alerts, the pages read what’s firing and what’s silenced from it. When it holds none, because Grafana sends its alerts only to another Alertmanager, they read what’s firing from the rules instead, which fire whichever way the alerts are sent. Silences made in that other Alertmanager don’t show, and the alerts they hold read as firing. Pending alerts always come from the rules. One gap: when a rule that already has an alert in Grafana’s Alertmanager starts firing on another instance, that instance can be missing for up to one evaluation, until Grafana passes it on.
### Which rules does it show?
The rules Grafana manages, in the folders the token’s service account can view. Rules kept in a Prometheus, Mimir or Loki ruler (data-source-managed rules, common on Grafana Cloud) aren’t included yet.
### What about older Grafana?
The pages need Grafana 12.0 or later: Grafana 11 refuses the request for recovering alerts, so the overview can’t load. Two filters arrived later and are ignored before then. Before 12.2 the check for rules that can’t be evaluated reads every rule, and before 12.4 a rule’s page reads every rule and keeps the one it’s about. Both still work, but a big server sends more each minute, and past about 700 rules that answer is more than the 1 MB Legato reads, so those cards can’t load.
Legato is independent and isn’t affiliated with or endorsed by Grafana Labs.
## Verification
The pages’ rules were checked against Grafana OSS 13.3.1 on 17 Nov 2026, on a self-hosted server with a small Prometheus and a dozen made-up rules: firing with and without a severity label, pending, silenced, paused, and one that can’t be evaluated. Silence and End silence were pressed against it with an Editor token, and a Viewer token was checked to hide them. Both pages were also run against Grafana OSS 12.0.10, the oldest version they support. Grafana Cloud uses the same API but wasn’t tested live. Illustrations use made-up rules, hosts and numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# UniFi Network in your Mac’s menu bar, from the console
See how your UniFi network is doing without opening the UniFi app, read straight from your console: whether the internet is connected and on which WAN, the last speed test, a day of latency, and every gateway, switch and access point as a dot. Each device opens a page of its own with its uptime, CPU and memory over the day, its ports or radios, and a Restart button. It works while your internet is down, and nothing goes through Ubiquiti’s cloud. For every console your account owns from one key, the [UniFi](https://legatobar.com/services/unifi) pages read the cloud instead.
## What you’ll see
- **UniFi Network:**
- **Details:** each site’s internet. A site is red when none of its WANs is connected or its gateway is offline, and its line names the ISP, which WAN is up and the latency now. A second WAN that isn’t connected is said in words and isn’t a problem for the page, so a spare left unplugged stays quiet. A site still called Default takes its gateway’s name.
- **Internet:** the ISP and which WAN is up, the last speed test (download, upload, ping and how long ago), and the gateway’s firmware, CPU and memory. With several sites, it says how many are connected.
- **Network:** clients (and how many are on Wi-Fi), devices (and how many are offline or have a firmware update waiting), and the Network version.
- **Latency:** the last 24 hours. The console keeps no history, so Legato keeps a reading every 5 minutes while it runs, and the chart starts the day you add the page. It shows for a console with one site.
- **Devices:** every device as a dot, under Gateway, Switches and Access points. Red when it’s offline, orange when its connection is interrupted, grey while it’s updating or being adopted. A device waiting for firmware stays green, and says so when you point at it. When two devices share a name, each gets the end of its MAC address added. Each dot opens the device’s page. 24 show at once, offline ones first, with **Show N more**. Past 60, the card keeps the ones that need a look and says how many there are. The page reads up to 4 sites and 200 devices a site, and uptime, CPU and memory for the first 40 devices; past that, a note says the counts cover part of them.
- **Device:** one page for each device, titled with its name:
- **Details:** whether it’s online, and for how long.
- **Facts:** uptime, firmware (and whether an update is waiting), its uplink’s speed now, model and address. **Restart** is in the corner while it’s online, and asks first. The device shows offline for a minute or two while it restarts. On the gateway, the question says the internet drops until it’s back.
- **Last 24 hours:** whether it was online through the day, from the readings Legato keeps.
- **CPU** and **Memory:** the last 24 hours, side by side.
- **Ports** (a switch or gateway): each port, up or down, its speed and whether it’s powering a device. Or **Radios** (an access point): each band, its channel, width and retries.
### Status
- Watches each site’s internet and every device on the console.
- Red when a device is offline, when a site has no WAN connected or its gateway is offline, or when the console stops answering.
- Orange when a device’s connection is interrupted.
- Grey while a device is updating or adopting, or when the console’s health answer stops coming.
- A spare WAN that isn’t connected and a firmware update waiting don’t count as a problem.
- Notifies you when it turns orange or red.
## How it connects
The pages read the console at `https://`, with an API key in an `X-API-KEY` header. Everything under `/proxy/network/integration/v1` is Ubiquiti’s documented Network API.
| Request | Pages | When | What it supplies |
| --- | --- | --- | --- |
| `GET …/integration/v1/info` and `…/sites` | UniFi Network | Every 2 minutes | The Network version and the console’s sites. |
| `GET …/sites/{site}/devices?limit=200`, once a site | UniFi Network | The same | Every device and its state. |
| `GET …/sites/{site}/clients?limit=1`, once a site, and again for Wi-Fi only | UniFi Network | The same | How many clients, and how many on Wi-Fi. |
| `GET …/sites/{site}/devices/{device}/statistics/latest`, once a device | UniFi Network | The same | Each device’s uptime, CPU and memory, kept for its page. |
| `GET /proxy/network/api/stat/sites` | UniFi Network | Every 2 minutes, on its own | Each site’s internet: ISP, WANs, latency, the last speed test and the gateway. |
| `GET …/sites/{site}/devices/{device}` and `…/statistics/latest` | Device | Every minute | The device’s ports or radios, firmware, uplink and uptime. |
| `POST …/sites/{site}/devices/{device}/actions` | Device | When you press Restart | Restarts it. |
The internet rows come from a route Ubiquiti doesn’t document. Other dashboards use it too, but a Network update could change it. It’s read on its own, so if it stops answering, only the Internet cards go grey and the devices keep working.
Ubiquiti’s [Network API docs](https://developer.ui.com/network/v11.0.97/gettingstarted) have the rest. [Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make a key.** On your console, open UniFi Network and go to Settings → Control Plane → Integrations (the menu moves a little between versions), then create an API key. UniFi shows it only once, so copy it then. It’s an admin key: there’s no read-only kind, and it can change your network as well as read it. Keep it in Legato’s Secrets or 1Password, and nowhere else.
2. **Use the console’s IP address.** The console answers on port 443 with a certificate it made for itself. Legato can trust one at an IP address or a `.local` name, so use `https://192.0.2.1` with your console’s own address, not a name from your router.
3. **Save it in Legato.** In Settings → Secrets, save the key under `unifi-network`, bound to that address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
4. **Add the pages.** Paste the prompt into your agent, or download the two pages, put your console’s address in place of `https://192.0.2.1`, and run `/Applications/Legato.app/Contents/Helpers/legato set unifi-network-device unifi-network-device.json`, then `legato set unifi-network unifi-network.json`. Keep the ID `unifi-network-device`: every device opens it with its own ID.
5. **Trust the certificate.** The first time the page reads the console, Legato asks you to check its certificate. Trust it in Settings → Certificates.
The cards fill within two minutes. A wrong or deleted key is the usual reason they don’t: the console answers 401, and the page notes that it turned the key down. A key made at unifi.ui.com is a different kind, for the cloud, and the console refuses it the same way.
### Prompt for your agent
```prompt
Add 2 Legato pages for UniFi Network (local), starting from https://legatobar.com/examples/unifi-network.json, https://legatobar.com/examples/unifi-network-device.json. Use the page IDs unifi-network, unifi-network-device if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add both pages as they are, keeping their page IDs, with my console's address in place of https://192.0.2.1 on every source. I’ll save my console's API key as unifi-network in Settings → Secrets and trust its certificate myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download UniFi Network (unifi-network.json)](https://legatobar.com/examples/unifi-network.json)
- [Download Device (unifi-network-device.json)](https://legatobar.com/examples/unifi-network-device.json)
## Questions
### Why does it say a WAN isn’t connected?
UniFi reports each WAN port, including a second one kept for failover. When one has no link, the site’s line says so, and the page counts it as a problem only when no WAN at all is connected.
### Why is the latency chart empty?
The console doesn’t keep latency over time, so Legato records it every 5 minutes while it runs, and the chart fills over the first day. With more than one site on the console, the chart isn’t drawn; each site’s line in Details has its latency now.
### Can I restart the gateway?
Yes, from its page. Your internet, and this console’s pages, drop while it restarts, usually a few minutes, and the question says so before anything is sent.
### Why do CPU and memory stop after 40 devices?
Each device’s statistics are a request of their own, and a page sends at most 64 requests each time it reads. The first 40 devices have them; the rest still show as dots with their state.
Legato is independent and isn’t affiliated with or endorsed by Ubiquiti.
## Verification
The pages were checked on 17 Nov 2026 against a live console on UniFi Network 10.6 with two WANs, one site, switches and access points. Every read above was sent live, and both pages were drawn from live answers. The Restart request was sent once, to an access point, which went offline and came back in about a minute and a half; Legato's own button was tested against that answer, not pressed live. Not checked live: several sites on one console, an offline device or gateway, and a release that changes the health route; the example pages have tests with made-up answers for those. Illustrations use made-up devices, ISPs and addresses. See the [service index](https://legatobar.com/services/) for other examples.
---
# Your Mac’s calendars in the menu bar
This page shows what Calendar on your Mac knows: iCloud, Google, Exchange, or any other account you’ve added there. It reads them through macOS itself, so there’s no key to save and no account to sign in to.
## What you’ll see
- **Next up:** the meeting you’re in, counting down to its end, or else the next one, counting down to its start. Under the count is how long it lasts and where it is. A **Join** button opens the call when the event has a Zoom, Google Meet, Microsoft Teams, Webex, FaceTime or similar link in its URL, location or notes. All-day events don’t count here, so a holiday never pushes your next meeting off the card.
- **The month,** with today filled in and a dot in each calendar’s colour on the days that have events. The arrows beside the month’s name page up to a year either way.
- **The week ahead,** under the grid: today and the six days after it, leaving out days with nothing on. Seven events show, with **Show more** for the rest, which also brings back today’s finished ones. A line marks now, and each row has its calendar’s colour and a Join button when it has a call link. Click another day in the grid to list the week from there.
- **New Event,** in the month’s corner, opens a form in the panel. It starts at the current time, or on the day you’ve clicked. **Add** saves the event to Calendar.
Events you’ve declined, and cancelled events, are left out. Times show in your Mac’s time zone, so on a trip they move with you.
### Status
Nothing counts as a problem: a busy day isn’t a problem, so meetings never turn anything orange.
## How it connects
There are no requests over the internet. Legato reads the calendars through macOS’s EventKit, on your Mac.
| What | When | What it supplies |
| --- | --- | --- |
| A [calendar source](https://legatobar.com/docs/source-calendar.md#calendar-sources) with `"window": "month"` | Within seconds of any change in Calendar, when an event starts or ends, at midnight, and at least every 5 minutes | The next meeting, and every event in the six weeks the grid shows and the 30 days after them. The source reads more when you page to another month. |
The first time the page opens, the Next up card asks for Calendar access, with **Allow Calendar Access**. If you’ve turned access off, it offers **Open Privacy Settings** instead. Legato never asks at launch.
## Set it up
1. **Add the page.** Use Install in Legato, paste the prompt into your agent, or download the page and run `/Applications/Legato.app/Contents/Helpers/legato set calendar calendar.json`.
2. **Allow Calendar access** from the Next up card.
If you already have a page with the ID `calendar`, Install in Legato adds this one beside it as a copy and leaves yours alone.
### Only some calendars
The page reads every calendar on your Mac, including subscribed ones like holidays or sports. To show only some, add `calendars` to the source with their names as Calendar shows them:
```json
"calendar": { "kind": "calendar", "window": "month", "every": "5m", "calendars": ["Work", "Family"] }
```
Two calendars with the same name are both read.
### Prompt for your agent
```prompt
Add a Legato page for Calendar, starting from https://legatobar.com/examples/calendar.json.
Add the page as it is, keeping its page ID. Don’t add, change or delete any events to test it. I’ll allow Calendar access from the page myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the page
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "Calendar",
"icon": "calendar",
"sources": {
"calendar": {
"kind": "calendar",
"window": "month",
"every": "5m"
}
},
"cards": [
{
"id": "up",
"type": "countdown",
"label": "Next up",
"at": "2026-01-01T00:00:00Z",
"source": {
"ref": "calendar",
"map": {
"label": "up.title",
"at": "up.at",
"detail": "up.detail"
},
"empty": {
"when": {
"path": "has_up",
"equals": false
},
"text": "No timed events coming up"
}
},
"actions": [
{
"kind": "open",
"label": "Join",
"icon": "video.fill",
"url": "{up.join}",
"prominent": true,
"when": {
"path": "up.has_join",
"equals": true
}
}
]
},
{
"id": "month",
"type": "month",
"days": 7,
"hide_empty_days": true,
"max_events": 7,
"items": [],
"source": {
"ref": "calendar",
"map": {
"items": {
"each": "agenda",
"limit": 300,
"fields": {
"title": "title",
"start": {
"if": {
"path": "all_day",
"equals": true
},
"then": "start_date",
"else": "start"
},
"end": {
"if": {
"path": "all_day",
"equals": true
},
"then": "end_date",
"else": "end"
},
"detail": "location",
"url": "join",
"color": "color"
}
}
}
},
"actions": [
{
"kind": "add-event",
"label": "New Event",
"icon": "calendar.badge.plus"
}
],
"actions_placement": "corner"
}
]
}
```
## Questions
### Can the page change my calendars?
Only when you press **Add** in the New Event form. Nothing else on the page writes to Calendar. Join opens the meeting’s link in your browser or its app.
### Does it follow the calendars I’ve turned off in Calendar?
No. The checkboxes in Calendar’s sidebar only change what Calendar draws. Legato reads every calendar unless the source lists the ones you want, as above.
### Why isn’t an invite I said Maybe to marked?
The page doesn’t say how you answered an invite. Every event you haven’t declined shows the same way.
### Can I see more days under the grid?
Change the month card’s `days` to any number up to 30, and `max_events` to how many events to show before **Show more**. The source already reads 30 days past the grid.
Legato is independent and isn’t affiliated with or endorsed by Apple.
## Verification
The page’s tests fill it with made-up events (overlapping meetings, a declined invite, all-day events and a travel day), as of 17 Nov 2026. The illustration uses made-up events and calendars. See the [service index](https://legatobar.com/services/) for other examples.
---
# Apple Reminders in your Mac’s menu bar
Legato shows the reminders on your Mac in the menu bar: what’s due, what’s coming up and what has no date, to tick off without opening Reminders, your lists with how many reminders each has open, and what you’ve completed this week. Each list opens a page of its own.
## What you’ll see
- **Reminders:**
- **Due, Upcoming and No date**, one tab each. Every row is a reminder you can tick. Due is today’s reminders, then the overdue ones. Upcoming is the next 7 days after today, under each day. No date is every reminder without a due date, from all your lists. Seven show at a time, with **Show N more** for the rest.
- Each row gives its day, its time when it has one, and its list. A repeating reminder has a small repeat mark after its name, and a priority shows as Reminders shows it, with `!`, `!!` or `!!!` before the name.
- **Lists:** your lists, the most open reminders first, each with its count and how many are overdue. Each one opens its own page.
- **Completed**, a closed section: what you’ve completed today and in the last 7 days, each day’s count, and the latest four.
- **List:** one page for every list, named after it. It shows the list’s open reminders under Overdue, Today, Upcoming and No date, fifteen at a time, to tick off as on Due.
### Status
Nothing counts as a problem: a to-do list is its own status, so overdue reminders don’t turn the page orange.
## How it connects
Legato reads Reminders through macOS (EventKit), the same store Reminders uses, so the pages show what Reminders shows, including lists synced from iCloud. Nothing leaves your Mac.
| Read | Page | When | What it does |
| --- | --- | --- | --- |
| Every open reminder | Both | When Reminders changes, at midnight, when a timed reminder falls due, and every 5 minutes | Due, Upcoming, No date, the counts and a list’s page. |
| Reminders completed in the last 7 days | Reminders | The same | Completed. |
| Mark a reminder completed | Both | When you tick a row | Completes it, as ticking it in Reminders does: a repeating reminder moves to its next date. |
[Calendar and Reminders sources](https://legatobar.com/docs/source-calendar.md) explains the source behind them.
## Set it up
1. **Add the pages.** Paste the prompt into your agent, or download both pages and run `/Applications/Legato.app/Contents/Helpers/legato set reminders-list reminders-list.json`, then the same for `reminders`. Keep those page IDs: each list opens its page by `reminders-list`.
2. **Allow Reminders access.** The first time, the page shows **Allow Reminders Access**. Click it and choose Allow in the box macOS shows. If you turned access off before, the button is **Open Privacy Settings** instead: turn Legato on under Privacy & Security → Reminders.
The cards fill as soon as access is on.
### Prompt for your agent
```prompt
Add 2 Legato pages for Reminders, starting from https://legatobar.com/examples/reminders.json, https://legatobar.com/examples/reminders-list.json. Use the page IDs reminders, reminders-list if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add both pages as they are, keeping their IDs. They read this Mac’s Reminders, so there’s no key to save. I’ll allow Reminders access from the page myself. Don’t tick any reminder to test it.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Reminders (reminders.json)](https://legatobar.com/examples/reminders.json)
- [Download Reminders list (reminders-list.json)](https://legatobar.com/examples/reminders-list.json)
## Questions
### Why is there no Flagged tab?
macOS doesn’t let other apps see flags. It also keeps subtasks, sections, tags and a list’s own order from them. So a subtask shows as an ordinary reminder in its list, and a list’s page sorts by due date, then by when each undated reminder was made.
### Why is Due today’s reminders, then overdue?
Today’s reminders stay at the top however many are overdue, each group under its own heading. A reminder due at a time earlier today stays under Today.
### What does ticking a repeating reminder do?
The same as ticking it in Reminders: Reminders keeps the one you completed and moves the reminder to its next date, so the row leaves Due and turns up in Upcoming or on its new day.
### What if a list is renamed or deleted?
Its page opens the list by its id, so it keeps working after a rename. If the list is deleted, the page says the list isn’t in Reminders any more.
### What if I have a lot of reminders?
Each tab, and a list’s page, shows up to 100. When one has more, a note says so. The counts on Lists and Completed include every reminder.
*Checked on November 18, 2026, with a made-up test list in macOS Reminders. The pages showed its due, upcoming, undated, repeating and completed reminders. When reminders were completed, the pages caught up within seconds: a daily one moved to tomorrow and a weekly one to next week. A list’s page kept its list through a rename and said so when the list was deleted. Illustrations use made-up reminders. Reminders is a trademark of Apple Inc. Legato isn’t affiliated with or endorsed by Apple.*
---
# What’s new in Legato, in your Mac’s menu bar
Every version of Legato gets notes on the [changelog](https://legatobar.com/changelog/). This page reads the changelog’s feed and lists the versions, newest first, with a line about each.
## What you’ll see
- **Releases:** a row for each version, newest first, with the start of its notes and the month and year it came out. A click opens that version’s notes on legatobar.com. Four show at first, and Show more brings up the rest.
Nothing on the page counts as a problem. Legato itself looks for a new version once a day and asks before installing it.
## How it connects
The page asks for no key. Legato reads one public address every 6 hours, with no sign-in:
| Request | When | What it supplies |
| --- | --- | --- |
| `GET https://legatobar.com/changelog/feed.xml` | Every 6 hours | Each version’s number, its day, a line about it and its address on the changelog. |
The feed is Atom, so a feed reader can follow it too. If a read fails, the page keeps the versions it last showed and tries again at the next read.
## Set it up
In Legato, open the collection chevron and choose **New from Template…**, then Legato Updates. You can also paste the prompt into your agent, or download the page and run `/Applications/Legato.app/Contents/Helpers/legato set legato-updates legato-updates.json`. If you already use the [RSS Feeds](https://legatobar.com/services/rss-feeds) page, you can add `https://legatobar.com/changelog/feed.xml` to its list instead.
### Prompt for your agent
```prompt
Add a Legato page for Legato Updates, starting from https://legatobar.com/examples/legato-updates.json.
Add the page as it is, keeping its page ID.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the page
```json
{
"$schema": "./.schemas/page.schema.json",
"title": "Legato Updates",
"icon": "sparkles",
"sources": {
"changelog": {
"url": "https://legatobar.com/changelog/feed.xml",
"auth": {
"type": "none"
},
"format": "feed",
"every": "6h"
}
},
"cards": [
{
"id": "releases",
"type": "list",
"label": "Releases",
"max_items": 4,
"items": [],
"source": {
"ref": "changelog",
"map": {
"items": {
"each": "items",
"limit": 24,
"fields": {
"text": {
"template": "{title|clip:60}"
},
"subtitle": {
"if": {
"path": "summary",
"exists": true
},
"then": {
"template": "{summary|clip:90}"
}
},
"detail": {
"if": {
"path": "published",
"exists": true
},
"then": {
"template": "{published|month_year}"
}
},
"url": "url"
}
}
}
}
}
]
}
```
## Questions
### Does it say which version I have?
Not yet. Settings → Updates shows the version on this Mac.
## Verification
On 18 Nov 2026 the changelog’s feed was built and read by Legato’s own feed reader in its tests, which found the three versions with their days, lines and links. The page passed Legato’s page check. It hasn’t yet been seen in Legato’s panel. See the [service index](https://legatobar.com/services/) for other pages.
---
# Gitea in your Mac’s menu bar
Keep up with your Gitea without opening it: the pull requests waiting for your review, your own with how their reviews and CI stand, the issues assigned to you and your notifications. Every repository you work in is a dot for CI on its default branch, and each opens a page of its own with its latest runs and a button to re-run the failed jobs. Legato reads your Gitea once a minute while your Mac is awake.
## What you’ll see
- **Gitea:**
- **Health,** in Details: Gitea’s own check of its database and cache. It turns orange for a warning, and red when a check fails or Gitea stops answering.
- **Reviews:** open pull requests that ask for your review, newest first, with their repository and how long ago they changed.
- **My PRs:** your open pull requests, each with where it stands: CI failing, Changes requested, Draft, Approved, or its repository when none of those applies.
- **Issues:** open issues assigned to you.
- **Notifications:** your unread notifications, with whether each is an issue or a pull request, and **Mark all read** under the list.
- **Repositories:** up to 24 repositories you own or belong to, most recently updated first, under their owner’s name. Each dot is CI on the default branch: green passing, red failing, orange pending, grey with no CI or nothing pushed yet. A dot opens that repository’s page.
- **Contributions:** a year of your activity, a square per day, with the year’s total.
- **Gitea:** the server’s version.
- **Repository:** what a dot opens.
- **CI,** in Details: the checks on the default branch.
- **Repository:** open pull requests and issues, the latest release, stars, forks and when it last changed.
- **Workflow runs:** the latest four Actions runs, each named by its commit, with how it ended and on which branch. While the newest run on the default branch failed, the corner has **Re-run failed jobs**, which asks first.
- **Open pull requests:** seven at once, most recently updated first.
- **Gitea server:** for the site admin, from its own template.
- **Health,** in Details: the server and every Actions runner as a dot (up to 50), red while a runner is offline, grey for one you’ve disabled. With https, a runner’s dot opens it in Gitea’s admin pages.
- **Actions:** jobs waiting for a runner and how long the oldest has waited, runners online, jobs running, and the version.
- **Waiting for a runner:** the jobs waiting, oldest first.
### Status
- Gitea’s own check of its database and cache, in Details.
- Red once Gitea reports a failed check or stops answering, orange for a warning.
- The repository fleet’s dots show CI on each default branch, red while it fails.
- Review requests and notifications never count as a problem.
- Shows in Details and notifies you when it turns orange or red.
## How it connects
The pages read Gitea’s REST API at `/api/v1` with an access token, sent as `Authorization: Bearer`.
| Request | When | What it supplies |
| --- | --- | --- |
| `GET /api/healthz` | Every minute, with no sign-in | Gitea’s check of its database and cache. |
| `GET /api/v1/version` | Every hour | Gitea’s version. |
| `GET /api/v1/settings/api` | With the lists | Gitea’s page size, so a list cut short says so. |
| `GET /api/v1/repos/issues/search?type=pulls&review_requested=true` | Every minute | Pull requests waiting for your review. |
| `GET /api/v1/repos/issues/search?type=issues&assigned=true` | Every minute | Issues assigned to you. |
| `GET /api/v1/notifications` | Every minute | Your unread notifications. |
| `GET /api/v1/repos/issues/search?type=pulls&created=true`, then for each: `GET …/pulls/{n}/reviews`, `GET …/pulls/{n}` and `GET …/commits/{head}/status` | Every two minutes | Your pull requests, their reviews and the checks on their latest commit (up to 10). |
| `GET /api/v1/user`, `GET /api/v1/repos/search?uid=…`, then `GET …/commits/{branch}/status` for each | Every two minutes | Your repositories and CI on each default branch (up to 24). |
| `GET /api/v1/users/{you}/heatmap` | Every hour | Your contributions. |
| `PUT /api/v1/notifications` | When you press Mark all read | Marks your notifications read. |
| `GET /api/v1/repos/{owner}/{repo}`, `…/releases`, `…/pulls`, `…/commits/{branch}/status`, `…/actions/runs` | Every two minutes, while a repository’s page is open | Its facts, latest release, pull requests, CI and runs. |
| `POST …/actions/runs/{run}/rerun-failed-jobs` | When you press Re-run failed jobs | Runs that run’s failed jobs again. |
| `GET /api/v1/admin/actions/runners`, `GET /api/v1/admin/actions/jobs` | Every minute, on the server page | Runners and their state, jobs waiting and running. |
Gitea has no single query for all of this the way GitHub does, so each of your pull requests and repositories takes its own requests: up to 59 every two minutes for both, plus five a minute for the lists, Gitea’s page size and the health check, and the version once an hour. Gitea’s [API documentation](https://docs.gitea.com/api/) is also at `/api/swagger` on your own server.
**Which token.** In Gitea, a token’s permissions are read or write for each area. The pages need read for **repository**, **issue** and **user**, and **notification** with write so Mark all read works. Add write for **repository** if you want Re-run failed jobs. A read-only token works too: Mark all read and Re-run then show Gitea’s refusal. The server page needs a site admin’s token with read for **admin**.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Make a token.** In Gitea, open **Settings → Applications**, give the token a name, choose the permissions above, and press Generate Token. Gitea shows it only once.
2. **Save it in Legato.** In Settings → Secrets, save it under `gitea`, bound to your Gitea’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download the pages and run `/Applications/Legato.app/Contents/Helpers/legato set gitea gitea.json`, then the same for `gitea-repo`.
4. **Point them at your Gitea.** Change `http://gitea.local:3000` to its address everywhere it appears on both pages: every source, the health card’s link and the notes’ links. If you reach it over https with a self-signed certificate, use its IP address or a `.local` name, which Legato can trust. A Gitea served under a path, such as `https://example.com/git`, needs that path as each source’s `base`, and in the links too.
5. **If you run the server,** add `gitea-server` the same way, with a site admin’s token saved as `gitea-admin`.
The lists fill within a minute. A mistyped token is the usual reason they don’t: the page then notes that Gitea refused it.
### Prompt for your agent
```prompt
Add 3 Legato pages for Gitea, starting from https://legatobar.com/examples/gitea.json, https://legatobar.com/examples/gitea-repo.json, https://legatobar.com/examples/gitea-server.json. Use the page IDs gitea, gitea-repo, gitea-server if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add the gitea and gitea-repo pages as they are. Replace http://gitea.local:3000 with my Gitea’s address everywhere it appears on both pages: every source’s url, the health card’s link and the notes’ links. I’ll save an access token as gitea in Settings → Secrets myself. Only if I say I’m the site admin, also add gitea-server with the same address; I’ll save a site admin’s token as gitea-admin myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download Gitea (gitea.json)](https://legatobar.com/examples/gitea.json)
- [Download Repository (gitea-repo.json)](https://legatobar.com/examples/gitea-repo.json)
- [Download Gitea server (gitea-server.json)](https://legatobar.com/examples/gitea-server.json)
## Questions
### Which repositories are in the fleet?
The ones you own or belong to, through an organisation or as a collaborator, leaving out archived ones. The 24 most recently updated show, and the card’s title says so when there are more.
### What does a grey dot mean?
That the default branch has no checks at all (no Actions workflow and nothing else reporting a status), or that nothing has been pushed yet. A dot that says CI not read is one Legato couldn’t ask about, usually because the default branch’s name has a slash in it, such as `release/2026`. On that repository’s page, CI says the same and Re-run failed jobs isn’t offered; the runs and everything else still show.
### Why don’t notifications say why I got them?
Gitea’s API doesn’t send a reason. It says only whether a notification is about an issue or a pull request, and whether that’s closed or merged.
### How is “Approved” worked out?
From each reviewer’s latest review, whether or not they’re an official reviewer. Changes requested by anyone comes first; otherwise one approval of the latest commit is enough to say Approved (an approval of an older commit doesn’t count). It doesn’t say whether branch protection’s required approvals are met. A pull request with 50 or more reviews shows its repository instead, since Legato reads one page of them.
### What about older Gitea, or Forgejo?
The pages need Gitea 1.26 or later, for workflow runs and Re-run failed jobs. Forgejo started from Gitea but its API has moved on since; these pages haven’t been checked against it.
Legato is independent and isn’t affiliated with or endorsed by Gitea.
## Verification
The pages were checked against Gitea 28.4.0 on 18 Nov 2026, on a self-hosted server with made-up users, an organisation, seven repositories, Actions runs passing, failing and running, reviews in each state, issues and notifications. Re-run failed jobs and Mark all read were pressed against it, and the server page was checked with a runner offline and a job waiting. Gitea 1.26 and 1.27 weren’t run: the pages follow those versions’ published API descriptions. Illustrations use made-up repositories, users and numbers. See the [service index](https://legatobar.com/services/) for other examples.
---
# changedetection.io in your Mac’s menu bar
See what changed on the pages you watch without opening changedetection.io. Every watch is in one list, the ones that need you first, with the first changed line under each, and each watch has its own page. changedetection.io does the checking, and Legato reads its results every 10 minutes while your Mac is awake.
## What you’ll see
- **changedetection.io:**
- **Watches:** every watch, in this order. First the watches changedetection.io can’t check, in orange, with the reason. Then changes you haven’t seen, with a blue dot, newest first. Then the rest, by when they last changed, and paused watches last. The grey line under each is the first line that changed in the last 7 days. For a change that only took lines away, it’s the first line removed. With no change in the last 7 days, the line shows the watch’s group. Seven watches show, with **Show N more** past that, up to 60. A click opens the watch’s page.
- **Server:** how many changes there were in the last 7 days and on how many pages, whether checks are on time (how many are running now and how many are overdue), how many watches there are and how many are paused, and the version.
- **Details** (⌘I) says how many watches there are, or that they’re all paused. It turns red only when changedetection.io stops answering. A watch that can’t be checked is an orange row and isn’t a problem.
- **Watch:** what a row opens.
- **Can’t check this page:** a note with changedetection.io’s reason, shown only while the watch’s last check failed.
- **Latest change:** the lines that changed in the newest change, as changedetection.io marks them: `(changed)` and `(into)` for a line that changed, `(added)` and `(removed)` for one that came or went. Its corner has **Mark as seen** while the change is new. Before a watch’s first change, the card says so. If changedetection.io no longer keeps the snapshot before the newest, the card says there’s nothing to compare it with.
- **Snapshots, 7 days:** how many snapshots changedetection.io kept each day, and how many it has kept since the first. It keeps one for each change, plus the first check.
- **Watch:** when it was last checked and how often, its address, its group, and whether its alerts are muted, for it or for every watch. Its corner has **Check now**, **Pause** or **Resume**, and **Mute alerts** or **Unmute alerts**.
### Status
- Watches the server, not the pages it checks.
- Red once changedetection.io stops answering.
- A watch that can’t be checked shows orange in its row and isn’t a problem for the page.
- Notifies you when it turns orange or red.
## How it connects
The pages read changedetection.io’s REST API with its API key, sent in an `x-api-key` header.
| Request | When | What it supplies |
| --- | --- | --- |
| `GET /api/v1/watch` | Every 10 minutes | Every watch: its title, address, group, when it was checked and last changed, its error, and whether you’ve seen its change. |
| `GET /api/v1/tags` | Every 10 minutes, and every 5 for an open watch’s page | Group names. |
| `GET /api/v1/systeminfo` | Every 10 minutes, twice: once on its own for Details, and once with the list. Every 5 minutes for an open watch’s page, to see whether every watch is paused or muted | The version, the number of watches, and the checks running now and overdue. |
| `GET /api/v1/changes?from=…&format=json&context=0` | Every 10 minutes | The changes of the last 7 days, for each watch’s grey line and the Server card. If it fails, for example on a server too old to have it, or a big install that takes too long, the list still updates, with groups in place of change lines. |
| `GET /api/v1/watch/{uuid}`, `…/history` | Every 5 minutes, while a watch’s page is open | The watch (read twice: for its facts, and beside its latest change), and when each of its snapshots was kept. Each card reads its own requests, so a history too big to read leaves the facts and buttons working. |
| `GET /api/v1/watch/{uuid}/difference/previous/{last changed}?format=text&changesOnly=true` | Every 5 minutes, while a watch’s page is open | Its latest change, up to the snapshot the watch’s own answer names, so Mark as seen clears that change and not a newer one. Before a watch has changed, changedetection.io answers 404, which the page reads as no change yet. |
| `GET /api/v1/watch/{uuid}?recheck=1` | When you press Check now | Puts the watch at the front of the queue. |
| `PUT /api/v1/watch/{uuid}` | When you press Mark as seen, Pause, Resume, Mute alerts or Unmute alerts | Sets `last_viewed`, `paused` or `notification_muted`. |
Each watch adds about 450 bytes to the list. Legato reads an answer of up to 1 MB, so the overview works up to about 2,000 watches. The Changes request reads the snapshots of every page that changed, so on a busy install it costs more than the list. On the test server it took a few hundredths of a second. If it fails, only the grey lines and the 7-day count go. changedetection.io’s [API documentation](https://changedetection.io/docs/api_v1/index.html) covers each request.
**About the key.** changedetection.io has one API key, and it can do everything the API can, including deleting watches. The pages only read, check, pause, mute and mark as seen. If you turned off **API access token security check enabled** in its API settings, the API answers without a key. Legato still sends the one you save.
[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.
## Set it up
1. **Copy the key.** In changedetection.io, open **Settings** and the **API** tab, and click the key to copy it.
2. **Save it in Legato.** In Settings → Secrets, save the key under `changedetection`, bound to your server’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download both pages and run `/Applications/Legato.app/Contents/Helpers/legato set changedetection changedetection.json`, then the same for `changedetection-watch`.
4. **Point them at your server.** Change `http://192.0.2.30:5000` to the address you open changedetection.io at, with its port (5000 for the Docker image), on the source of both pages. If you reach it over https with a self-signed certificate, use its IP address or a `.local` name, which Legato can trust. A server under a path, such as `https://example.com/changedetection`, isn’t supported.
The list fills within a minute. A mistyped key is the usual reason it doesn’t: the page then notes that changedetection.io didn’t allow it (HTTP 403).
### Prompt for your agent
```prompt
Add 2 Legato pages for changedetection.io, starting from https://legatobar.com/examples/changedetection.json, https://legatobar.com/examples/changedetection-watch.json. Use the page IDs changedetection, changedetection-watch if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add both pages as they are, and set the url of the source on each page to my changedetection.io address with its port. I’ll save the API key as changedetection in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```
### Download the pages
- [Download changedetection.io (changedetection.json)](https://legatobar.com/examples/changedetection.json)
- [Download Watch (changedetection-watch.json)](https://legatobar.com/examples/changedetection-watch.json)
## Questions
### What does Mark as seen do?
The same as opening the change in changedetection.io: the blue dot goes, on the Mac and in changedetection.io’s own list. It marks the change the page shows, so a newer one that came in since stays new. Your install keeps one seen-or-not for everyone who uses it.
### Why does a row say 12m beside an older line?
The time is when the watch last changed. The grey line is the first line of what changed over the last 7 days, which can include older changes. The watch’s page shows the newest change on its own.
### What do Pause and Mute alerts do?
The same as in changedetection.io. Pause stops checking the page until you resume it. Mute alerts keeps checking but sends none of the watch’s notifications. Neither asks first, since each has a button that undoes it. They’re only on a watch’s page, so Spotlight and Shortcuts don’t offer them.
### Does it work with the hosted changedetection.io?
It wasn’t tested. The hosted service serves the same API at your own login address, but only a self-hosted server was checked, and an address with a path isn’t supported.
Legato is independent and isn’t affiliated with or endorsed by changedetection.io.
## Verification
The pages were checked against changedetection.io 0.70.3 on 18 Nov 2026, on a self-hosted server watching made-up pages that change on a schedule: pages that change, one that answers 404, one that answers 500, one that times out, a host that doesn’t exist, a paused watch, a muted one and one nobody named. Each button’s request (Check now, Pause, Resume, Mute alerts, Unmute alerts and Mark as seen) was sent to the same server and did what it says. Illustrations use made-up pages, groups and numbers. See the [service index](https://legatobar.com/services/) for other examples.