Skip to main content
Glama
README.md
<p align="center">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="assets/tiller-lockup-dark.svg" />
    <source media="(prefers-color-scheme: light)" srcset="assets/tiller-lockup-light.svg" />
    <img alt="Tiller" src="assets/tiller-lockup-dark.svg" width="420" />
  </picture>
</p>

<p align="center">
  An agent-operated Chromium browser daemon, CLI, and MCP server.<br />
  Stays hidden in the background until needed, with compact semantic outlines, tiny post-action diffs, single-round-trip batch actions, and on-demand window visibility.
</p>

## Why Tiller

Traditional browser automation tools were built for human-authored test suites, not LLM tool loops. Every extra round trip and every full-page accessibility dump costs wall-clock time and context tokens.

Tiller keeps one Chromium daemon running on demand over a Unix socket and talks to Chrome DevTools Protocol directly over `--remote-debugging-pipe`:

- **Hidden until needed, visible on demand:** Launches a real Chromium window silently in Hyprland's `special:tiller` workspace so background agent work never interrupts your screen or steals focus. Bring it onto the built-in laptop display anytime via `tiller show [TAB]`, `tiller toggle`, the MCP `show` tool, or the "Tiller" desktop app launcher, and send it back with `tiller hide`. Set `TILLER_HEADLESS=1` for pure headless operation.
- **Ask the user on screen:** Pass `--message "..." [--wait 120]` to `tiller show TAB` (or `message` and `wait_seconds` to MCP `show`) to display an isolated, navigation-persistent banner with "Done", "I can't do this", and an optional note field, send a desktop notification (`notify-send`), and wait for the user to finish sign-in, 2FA, CAPTCHA, or approval flows. The banner is rendered inside a closed shadow root, communicates over an isolated CDP binding, and stays hidden from Tiller's outlines and diffs.
- **Persistent signed-in profile:** Sign into websites once in Tiller's profile (`~/.local/share/tiller/profile`) and agents reuse those sessions automatically across tasks.
- **Single-round-trip `batch` actions:** Chain up to 32 `fill`, `click`, `select`, `press`, `scroll`, `goto`, and `wait` steps in one call, settling and diffing once at the end.
- **Compact semantic outlines and tiny diffs:** Numbered element references (`e1`, `e2`, ...) strip layout noise. After an action, Tiller returns only what changed instead of resending the entire page tree.
- **Shared multi-agent daemon:** Multiple agents run independent tabs concurrently inside one browser process while same-tab commands stay serialized. If the window is closed manually, the daemon stays up and relaunches Chromium cleanly on the next command.
- **Built-in consequence guardrails:** Heuristic checks hold clicks or Enter submissions that appear to `pay`, `send`, or `delete` for human review.
- **Native MCP server (`tiller mcp`):** Exposes 20 browser and connected-app tools over stdio, including `show`/`hide`, inline PNG screenshots, and a warm app client.

## Benchmark Snapshot (v0.3.0)

Measured locally on Linux (Node v26.13.1, Chromium 155, Playwright 1.64.1) against deterministic local HTTP fixtures:

| Benchmark | Tiller MCP | Playwright baseline | Comparison |
| :--- | ---: | ---: | :--- |
| **4-step interactive form** (`batch` vs cold script) | **93.6 ms** | 1,039.4 ms | **11.1x faster** |
| **4-step interactive form** (`batch` vs warm in-process) | **93.6 ms** | 221.9 ms | **2.4x faster** |
| **40-row dashboard click update** (payload size) | **49 B diff** (216 B JSON) | 17,763 B full ARIA | **362.5x smaller diff** |
| **Heavy page (120 cards) initial read** (payload size) | **6,919 B** (~1.7k tok) | 25,326 B ARIA / 81,234 B HTML | **3.7x vs ARIA / 11.7x vs HTML** |
| **Viewport PNG screenshot** (`/heavy`) | **46.9 ms** (inline base64) | 53.5 ms (buffer) | **1.14x faster** |
| **Dashboard `goto`** (existing tab) | **183.7 ms** | 230.7 ms | **1.26x faster** |
| **Warm `apps` discovery** (MCP vs CLI) | **0.7 ms** | 768.5 ms (Tiller CLI) | **1,098x faster** |

**Where Playwright still wins:** raw heavy-DOM `goto` (`202.7 ms` ARIA vs `344.5 ms`), one-time cold start (`182.8 ms` headless shell vs `1,436.3 ms` daemon startup, paid once per session), and in-process 4-tab bursts sharing one browser (`278.9 ms` vs `482.3 ms`).

## Requirements

- **Node.js 24+** (uses native TypeScript execution)
- **Chromium** (or Chrome) installed locally, or point `TILLER_CHROMIUM` to a binary
- **Hyprland 0.56+** (optional) for `special:tiller` silent background placement and `show`/`hide`/`toggle`

## Install

```bash
git clone https://github.com/campeterson41/tiller.git
cd tiller
npm install
ln -sf "$(pwd)/bin/tiller" ~/.local/bin/tiller
```

Optional: install the desktop entry so you can search for "Tiller" in your application launcher (Walker/Omarchy):

```bash
tiller install-desktop
```

This writes `~/.local/share/applications/tiller.desktop` pointing to the CLI with `tiller toggle`. Launching "Tiller" starts the daemon if needed and shows the window on the built-in laptop display; launching it again hides the window back to `special:tiller` without closing agents' tabs.

Verify the installation:

```bash
npm run typecheck
npm test
```

## MCP Setup

Register `tiller mcp` with any MCP-compatible client (Claude Code, Codex, Antigravity, etc.):

```json
{
  "mcpServers": {
    "tiller": {
      "command": "/path/to/tiller/bin/tiller",
      "args": ["mcp"]
    }
  }
}
```

### Exposed MCP tools

`open`, `goto`, `read`, `click`, `fill`, `select`, `press`, `scroll`, `batch`, `dialog`, `console`, `net`, `eval`, `screenshot`, `show`, `hide`, `close`, `tabs`, `apps`, `app_flow`.

## CLI Quickstart

```bash
# Open a page (hidden in special:tiller by default) and get a compact outline
tiller open https://example.com

# Bring Tiller onto the built-in laptop display for login, CAPTCHA, or review
tiller show <TAB_ID>

# Show the window with an on-screen prompt banner, notify the user, and wait up to 120s
tiller show <TAB_ID> --message "Please sign in and complete 2FA." --wait 120

# Check or keep waiting on an active prompt without re-notifying
tiller ask-status <TAB_ID> --wait 120

# Send the window back to special:tiller when done (or toggle visibility)
tiller hide
tiller toggle

# Chain multiple form actions in one round trip
tiller batch <TAB_ID> <<'EOF'
[
  {"action": "fill", "ref": "e3", "value": "42"},
  {"action": "select", "ref": "e5", "value": "Pro Plan"},
  {"action": "click", "ref": "e6"}
]
EOF

# Capture a viewport or full-page screenshot
tiller screenshot <TAB_ID> --full

# Inspect console errors, failed network requests, or run JS
tiller console <TAB_ID> --errors
tiller net <TAB_ID> --failed
tiller eval <TAB_ID> "document.title"

# Close your tab (or stop the shared daemon when all tasks are done)
tiller close <TAB_ID>
tiller stop
```

An operator skill is included at [skill/tiller/SKILL.md](skill/tiller/SKILL.md) for agent harnesses that load skills.

## Configuration

- `TILLER_HEADLESS`: Set to `1` to force pure headless mode (`--headless=new`). Without a graphical display (`WAYLAND_DISPLAY`/`DISPLAY`), Tiller falls back to headless automatically.
- `TILLER_CHROMIUM`: Path to the Chromium binary (defaults to `~/.local/bin/chromium` if present, then searches `PATH`).
- `TILLER_HOME`: Override all state/data/socket paths under a single root (useful for isolated runs and tests).
- `TILLER_WINDOW_CLASS`: Override the Chromium Wayland app ID / X11 class (defaults to `tiller`, or a per-`TILLER_HOME` class during isolated runs).
- `TILLER_EXTENSIONS`: Optional comma-separated list of unpacked extension directories to keep loaded (extensions are disabled by default).
- `TILLER_TMPDIR`: Temporary directory for Chromium sockets (defaults to `/tmp`).

## Architecture

- `bin/tiller`: Node 24+ native TypeScript CLI entry point.
- `src/daemon.ts`, `src/client.ts`, `src/command-queue.ts`: On-demand `flock`-guarded Unix-socket daemon with per-tab concurrency, browser-level barriers, and automatic Chromium recovery if the window is closed.
- `src/launch.ts`, `src/cdp.ts`, `src/browser.ts`, `src/tab.ts`: Direct CDP over `--remote-debugging-pipe` with network, console, dialog, and mutation-observer settle tracking.
- `src/window.ts`, `src/desktop.ts`, `src/ask.ts`: Hyprland special-workspace placement (`show`, `hide`, `toggle`), desktop launcher installation (`install-desktop`), and on-page user prompt banner with `notify-send` alerts and wait handling.
- `src/snapshot.ts`, `src/diff.ts`, `src/guard.ts`, `src/commands.ts`: Semantic accessibility outline (excluding Tiller's prompt banner), incremental snapshot diffs, consequence guard, and tab/window actions.
- `src/mcp.ts`, `src/mcp-client.ts`, `src/apps.ts`, `src/app-client.ts`: Stdio MCP server/client and warm connected-app workflow runner.
- `src/terminal.ts`, `src/profile-marker.ts`, `src/profile-tab.mjs`: Local CLI/SSH/HTTP helpers and fallback regular-Chromium task-window marker with 2-minute unclaimed auto-close.

## License

[MIT](LICENSE)