Files
openclaw/docs/platforms/macos.md

98 lines
2.9 KiB
Markdown
Raw Normal View History

---
2026-01-08 23:06:56 +01:00
summary: "Clawdbot macOS companion app (menu bar + gateway broker)"
read_when:
- Implementing macOS app features
- Changing gateway lifecycle or node bridging on macOS
---
2026-01-04 14:32:47 +00:00
# Clawdbot macOS Companion (menu bar + gateway broker)
2025-12-05 23:13:53 +01:00
2026-01-08 23:06:56 +01:00
The macOS app is the **menubar companion** for Clawdbot. It owns permissions,
manages the Gateway locally, and exposes macOS capabilities to the agent as a
node.
2025-12-05 23:13:53 +01:00
2026-01-08 23:06:56 +01:00
## What it does
2026-01-07 21:37:05 +01:00
2026-01-08 23:06:56 +01:00
- Shows native notifications and status in the menu bar.
- Owns TCC prompts (Notifications, Accessibility, Screen Recording, Microphone,
Speech Recognition, Automation/AppleScript).
- Runs or connects to the Gateway (local or remote).
- Exposes macOSonly tools (Canvas, Camera, Screen Recording, `system.run`).
- Optionally hosts **PeekabooBridge** for UI automation.
- Installs a helper CLI (`clawdbot`) into `/usr/local/bin` and
`/opt/homebrew/bin` on request.
## Local vs remote mode
- **Local** (default): the app ensures a local Gateway is running via launchd.
- **Remote**: the app connects to a Gateway over SSH/Tailscale and never starts
a local process.
- **Attachonly** (debug): the app connects to an alreadyrunning local Gateway
and never spawns its own.
## Launchd control
The app manages a peruser LaunchAgent labeled `com.clawdbot.gateway`.
2026-01-07 21:37:05 +01:00
```bash
launchctl kickstart -k gui/$UID/com.clawdbot.gateway
launchctl bootout gui/$UID/com.clawdbot.gateway
```
2026-01-08 23:06:56 +01:00
If the LaunchAgent isnt installed, enable it from the app or run
`clawdbot daemon install`.
2026-01-08 23:06:56 +01:00
## Node capabilities (mac)
2026-01-08 23:06:56 +01:00
The macOS app presents itself as a node. Common commands:
2026-01-08 23:06:56 +01:00
- Canvas: `canvas.present`, `canvas.navigate`, `canvas.eval`, `canvas.snapshot`, `canvas.a2ui.*`
- Camera: `camera.snap`, `camera.clip`
- Screen: `screen.record`
- System: `system.run`, `system.notify`
2025-12-05 23:13:53 +01:00
2026-01-08 23:06:56 +01:00
The node reports a `permissions` map so agents can decide whats allowed.
2026-01-08 23:06:56 +01:00
## Deep links
2026-01-08 23:06:56 +01:00
The app registers the `clawdbot://` URL scheme for local actions.
2026-01-04 14:32:47 +00:00
### `clawdbot://agent`
2026-01-08 23:06:56 +01:00
Triggers a Gateway `agent` request.
```bash
2026-01-04 14:32:47 +00:00
open 'clawdbot://agent?message=Hello%20from%20deep%20link'
```
Query parameters:
2026-01-08 23:06:56 +01:00
- `message` (required)
- `sessionKey` (optional)
- `thinking` (optional)
- `deliver` / `to` / `provider` (optional)
- `timeoutSeconds` (optional)
- `key` (optional unattended mode key)
Safety:
- Without `key`, the app prompts for confirmation.
- With a valid `key`, the run is unattended (intended for personal automations).
## Onboarding flow (typical)
1) Install and launch **Clawdbot.app**.
2) Complete the permissions checklist (TCC prompts).
3) Ensure **Local** mode is active and the Gateway is running.
4) Install the CLI helper if you want terminal access.
2025-12-05 23:13:53 +01:00
## Build & dev workflow (native)
2026-01-08 23:06:56 +01:00
- `cd apps/macos && swift build`
- `swift run Clawdbot` (or Xcode)
- Package app + CLI: `scripts/package-mac-app.sh`
## Related docs
- [Gateway runbook](/gateway)
- [Bundled bun Gateway](/platforms/mac/bun)
- [macOS permissions](/platforms/mac/permissions)
- [Canvas](/platforms/mac/canvas)