SYSTEM: A CloudâHosted NaturalâLanguage Mac Remote Automation Platform
SYSTEM is a lightweight framework that lets you control any macOS device remotely via conversation, powered by Cloudflare Workers, Claude, and a local bridge. By separating the intelligence from the execution layer it offers robust security, low latency, and deep integration with tools such as Raycast and Shortcuts. The platform ships with an endâtoâend quick start that walks developers through authentication, Raycast extension discovery, and bridge provisioning.
SYSTEM is a lightweight framework that lets you control any macOS device remotely through conversation, powered by Cloudflare Workers, Claude, and a lightweight local bridge. By separating the intelligence layer from the execution layer it delivers strong security guarantees, low latency, and rich integration with existing tools such as Raycast, Shortcuts, and native Apple scripting. The platform ships with a zeroâconfiguration âquick startâ that walks developers through setting up authentication, installing Raycast extensions, and provisioning the bridge.
Quick Start
- Clone the repository and install dependencies:
```
git clone https://github.com/ygwyg/system
cd system && npm install
```
- Run the interactive wizard:
```
npm run setup
```
During the wizard you will be prompted for an Anthropic API key, the location of any Raycast extensions, and whether the agent should expose a public tunnel.
- Start the system:
```
npm start
```
This launches the Cloudflare tunnel, spins up the express bridge on port 3456, and opens the web UI at https://your-agent.workers.dev.
Architecture
```
+---------------------------------------------------+
| User (phone/browser) |
+---------------------+---------------------------+
| HTTPS
v
+---------------------------------------------------+
| AGENT (Brain) |
| Cloudflare Workers + D.O. |
| +--------+ +--------+ +--------+ |
| |Claude | |State | |Schedules| |
| +--------+ +--------+ +--------+ |
+---------------------+---------------------------+
| Tunnel
v
+---------------------------------------------------+
| BRIDGE (Body) |
| macOS local server |
| +---------+ +---------+ +---------+ |
| |AppleScript| |Shell | |Raycast | |
| +---------+ +---------+ +---------+ |
+---------------------------------------------------+
```
The agent (brain) resides entirely in the Cloudflare Workers runtime, storing state and scheduling logic in Durable Objects. All communication with the bridge (body) occurs over a secure WebSocket tunnel that is established once a user authenticates with a bearer token.
Authentication
Every request to the agent API must present an API secret either as a ` Authorization: Bearer ` header or a `?token=` query parameter. Tokens are generated during the ` npm run setup` step and written to ` bridge.config.json`.
Chat & Scheduling
Send a naturalâlanguage message to the agent via the UI or an HTTP POST:
```http
POST https://your-agent.workers.dev/chat
Bearer
{
\"message\": \"Play some jazz music\"
}
```
The agent replies with an intentâdriven JSON that lists both a humanâreadable confirmation message and the lowâlevel tool actions it will perform, for example:
```json
{
\"message\": \"Playing jazz on Apple Music\",
\"actions\": [{
\"tool\": \"music_play\",
\"args\": { \"query\": \"jazz\" },
\"success\": true,
\"result\": \"Now playing: Jazz Vibes\"
}]
}
```
You can also cancel or list scheduled tasks, clear history, or retrieve the current agent state using the corresponding endpoints.
Core Toolset
SYSTEM ships with a rich set of preâdefined tools that can be invoked autonomously or via Raycast extensions. Some of the most frequently used include:
* `open_app` â Launch any native application.
* `open_url` â Open a URL in the default browser.
* `shell` â Execute a whitelistâprotected shell command.
* `applescript` â Run arbitrary AppleScript.
* `notify` â Show a macOS notification.
* `say` â Textâtoâspeech via `say(1)`.
* `clipboard_get/set` â Read or write the clipboard.
* `screenshot` â Capture a screenshot and store it locally.
Music, Messaging, and System Utilities
The platform also contains specialized tool families for Apple Music control (`music_play`, `music_pause`, etc.), iMessage sending (`send_imessage`), calendar and reminders manipulation, display settings, battery status, notes, and file operations via Finder.
Raycast Integration
During setup, SYSTEM scans `~/.config/raycast/extensions/` and exposes every compatible command as a distinct tool. The generic name follows the pattern `extension_command`, e.g. `spotify_player_play` or `linear_create_issue_for_myself`. Users can then issue naturalâlanguage requests such as âCreate a Linear issue for fixing the login bugâ or âSend a Slack message to #general saying helloâ.
Bridge API
For advanced integration, the bridge exposes a local REST API that lists all available tools, executes a chosen tool with arguments, or reports bridge status. Sample GET to list tools:
```http
GET http://localhost:3456/api/tools
Bearer
```
WebSocket Events
Clients can subscribe to live notifications (e.g. task results, scheduled runs) via the WebSocket endpoint:
```javascript
const ws = new WebSocket('wss://your-agent.workers.dev/ws?token=...');
ws.onmessage = e => {
const payload = JSON.parse(e.data);
console.log(payload.type, payload.payload);
};
```
Security Model
* **Bearer tokens** â The only credential for API access, stored securely on the local bridge and never transmitted unencrypted.
* **Shell safety** â The bridge accepts only a curated whitelist of shell commands; anything resembling `rm -rf` or `sudo` is blocked.
* **Ephemeral tunnels** â Cloudflare Tunnel creates a new shortâlived URL for each session, and the local bridge listens only when a tunnel is active.
* **Humanâinâtheâloop** â Sensitive operations like sending messages prompt the user for confirmation before execution.
Zero Trust Deployment
For production deployments, we recommend enabling Cloudflare Access to add an extra authentication layer at the edge. The Access application can be deployed via the Cloudflare dashboard or Terraform. An example Terraform snippet:
```hcl
resource \"cloudflare_access_application\" \"system\" {
zone_id = var.zone_id
name = \"SYSTEM\"
domain = \"yourâagent.workers.dev\"
session_duration = \"24h\"
}
resource \"cloudflare_access_policy\" \"allow_me\" {
application_id = cloudflare_access_application.system.id
zone_id = var.zone_id
name = \"Allow specific emails\"
precedence = 1
decision = \"allow\"
include {
email = [\"you@example.com\"]
}
}
```
Conclusion
SYSTEM blends the scalability of Cloudflare Workers with the immediateness of local macOS controls, all through a conversational interface. Its design prioritises security, extensibility, and developer ergonomics, making it an ideal foundation for building advanced, multiâdevice automation workflows.