Use the terminalwidget:// URL scheme to trigger widget updates from Shortcuts, LaunchBar, Alfred, Raycast, browser bookmarks, and any app that can open URLs.

Base Format

terminalwidget://update?target=widget1&text=Hello%20World

Values should be URL-encoded ( => %20, # => %23, & => %26).

Widget taps use a separate dispatch endpoint:

terminalwidget://action?target=widget1

You usually do not need to open that URL yourself. Set actionKind and actionValue on the update endpoint, and the widget extension will use the action endpoint when the saved action is supported on the current platform.

How It Works

  1. macOS receives the URL and launches (or wakes) TerminalWidget.
  2. The URL is parsed into the same payload used by the CLI and AppleScript layers.
  3. The target widget state is written to shared preferences/App Group storage.
  4. Widget refresh notifications are posted.

If a parameter is invalid, that field is ignored while valid fields still apply.

Common Parameters

Action support is platform-specific. macOS supports all four action kinds. iOS supports URL and Shortcut actions; synced macOS-only app and shell actions fall back to the normal widget open/update behavior.

Example URLs

Text + Icon

terminalwidget://update?target=widget1&text=Build%20Complete&icon=checkmark.circle.fill
terminalwidget://update?target=widget2&text=Deploy%20%F0%9F%9A%80&icon=%3Arocket%3A

Progress

terminalwidget://update?target=widget1&text=Syncing&progress=42
terminalwidget://update?target=widget1&text=Transfer%20Queue&progress=63&progressFormat=gradient-vertical&gradientFrom=%234fd1ff&gradientWidth=32&caption=1

Charts

terminalwidget://update?target=widget3&chart=4,8,15,16,23,42&chartFormat=peak
terminalwidget://update?target=widget3&chart=5,12,8,21,13,34&chartFormat=graph&annotate=1&caption=true
terminalwidget://update?target=widget3&chart=1,4,9,3&chartFormat=sparkline&labelY=1&timestamp=1
terminalwidget://update?target=widget1&progress=50&caption=1&timestamp=1
terminalwidget://update?target=widget1&text=Build%20queue&title=%F0%9F%93%88%20Throughput&captionText=Updated%20%E2%8F%B0&timestamp=1
terminalwidget://update?target=widget3&chart=1,4,9,3,8,2,7,5&chartFormat=matrix&padding=0
terminalwidget://update?target=widget3&chart=1-3,2-3,1-4&chartFormat=rangebar

Images + Filters

terminalwidget://update?target=widget2&image=https%3A%2F%2Fpicsum.photos%2F640%2F360&padding=fill
terminalwidget://update?target=widget2&image=https%3A%2F%2Fpicsum.photos%2F640%2F640&filter=sepia%3A25%2Cblur%3A8
terminalwidget://update?target=widget2&image=%2FUsers%2Fyou%2FPictures%2Fstatus.png&padding=12

Tables

terminalwidget://update?target=widget1&table=%2FUsers%2Fyou%2Fstatus.csv&grid=zebra&tableLayout=auto&zebraOpacity=60
terminalwidget://update?target=widget1&table=%2FUsers%2Fyou%2Fstatus.tsv&grid=both&tableLayout=equal
terminalwidget://update?target=widget1&table=%2FUsers%2Fyou%2Fstatus.json&grid=none

Colors + Theme

terminalwidget://update?target=widget2&theme=dark&fg=%23ffffff&bg=%23111417
terminalwidget://update?target=widget2&text=Light%20Mode%20Test&icon=sun.horizon&theme=light
terminalwidget://update?target=widget2&text=Alpha%20Override&fg=%23ffcc00&bg=%230f172a&alpha=0.85

Combined Payloads

terminalwidget://update?target=widget1&text=CPU%2062%25&icon=cpu.fill&chart=58,61,66,62,64,62&chartFormat=strip
terminalwidget://update?target=widget1&text=Night%20Audit&icon=moon.stars.fill&progress=91&theme=dark&fg=%23dbeafe&bg=%230b1220

Notify on change

terminalwidget://update?target=widget1&text=Service%20OK&notify=1
terminalwidget://update?target=widget1&text=Deploy%20done&notifyOnce=1

Widget tap actions

terminalwidget://update?target=widget1&text=Open%20dashboard&icon=arrow.up.right.square&actionKind=open-url&actionValue=https%3A%2F%2Fexample.com%2Fdashboard
terminalwidget://update?target=widget1&text=Run%20Backup&icon=externaldrive.fill&actionKind=run-shortcut&actionValue=Start%20Backup
terminalwidget://update?target=widget1&text=Open%20Transmission&icon=arrow.up.right.square&actionKind=open-app&actionValue=org.m0k.transmission
terminalwidget://update?target=widget1&text=Run%20script&icon=terminal&actionKind=run-command&actionValue=say%20Done
terminalwidget://update?target=widget1&clearAction=1

Opening the dispatch endpoint runs the action currently saved for the target:

terminalwidget://action?target=widget1

Building URLs in Scripts

When generating URLs from scripts, always URL-encode dynamic values:

TARGET="widget1"
TEXT="$(python3 -c 'import urllib.parse; print(urllib.parse.quote("Build complete #42"))')"
open "terminalwidget://update?target=${TARGET}&text=${TEXT}&icon=checkmark.circle.fill"

Shortcuts Tip

In Shortcuts, use URL Encode on text values before building the URL string, then call Open URLs.

For native Shortcuts actions (which avoid manual URL encoding), see Shortcuts Documentation.