{"document":{"id":"agent-alerts-doc-swift-cli","kind":"doc","slug":"swift-cli","title":"Swift CLI","description":"Install the Swift CLI with Homebrew and send updates from macOS terminal workflows.","keywords":["Agent Alerts","CLI","Homebrew","macOS","terminal","hooks","install"],"updatedAt":"2026-11-10","content":"# Swift CLI\n\nInstall the Swift CLI with Homebrew and send updates from macOS terminal workflows.\n\nUse the Swift CLI to send Agent Alerts from terminal workflows and scripts on macOS 13 or later.\n\n## Install with Homebrew\n\n```bash\nbrew tap andreasink/agent-alerts-cli https://github.com/AndreasInk/agent-alerts-cli.git\nbrew install andreasink/agent-alerts-cli/agentalerts\nagentalerts setup\n```\n\nSetup opens the website pairing flow. Review the requested access, scan its QR code with Agent Alerts on iPhone, compare the code on both devices, and approve the connection.\n\nPaste the one-time token into the CLI's hidden prompt. Store tokens only in the secret storage for the runtime that sends your updates. Do not put tokens in commands, source code, logs, or conversations. Token plaintext is shown once; if it is lost, revoke that connection and create a replacement.\n\n## Send the first example\n\nDownload [funnel.json](/agent-alerts/examples/funnel.json) into your terminal's current folder, then run:\n\n```bash\nagentalerts send --file funnel.json --activity-id funnel\n```\n\nThis uses the gallery's activation funnel sample, with illustrative values of 100%, 72%, 58%, and 41%. The example sends a Live Activity and notification. Check the command result and confirm what appeared on your iPhone.\n\n## Update the same activity\n\nUse the same `--activity-id` for the same subject. Replace the file's content with the next observed result, then send again. Keep different workflows on different stable IDs.\n\nBuilder content files use `builderSpec` and `data`. Gallery downloads already use the Swift CLI's supported content format. The remote MCP example request beside an image may use a different request shape; do not treat it as a CLI content file.\n\n## Hooks and automation\n\nThe CLI repository includes hooks and integration instructions. Choose an event that matches the claim you want to report: an agent turn ending does not establish that a task finished or tests passed.\n\nKeep recurring scheduling in your AI client, CI system, or scheduler. Agree on refresh cadence, escalation, and notification behavior before enabling a workflow.\n\nFor exact options and current hook setup, use the [Swift CLI README](https://github.com/AndreasInk/agent-alerts-cli). For a service running outside macOS, use the [webhook API](/agent-alerts/docs/webhook-api).\n","path":"docs/swift-cli","url":"https://www.andreas.ink/agent-alerts/docs/swift-cli","markdownUrl":"https://www.andreas.ink/api/agent-alerts/content?path=docs%2Fswift-cli&format=markdown"}}