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

Add a widget first. URL updates only appear on widgets you place yourself (Desktop or Home Screen) after you set Edit Widget → Target name to match target=. See Integrations → Getting Started.

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

Widget body text may include CommonMark-style [label](url) links. The widget renders them as tappable buttons; non-link taps still use actionKind / actionValue.

Launcher button grids (buttons, borders, button-columns) are not available as URL query parameters. Set them with CLI --json (or another structured JSON update). See Widgets.

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
terminalwidget://update?target=widget1&chart=1%204%209%203/2%205%208%204/6%207%205%202&chartFormat=series&chartSeriesLabels=CPU,Memory,Disk&fg=%23f87171,%234ade80,%2360a5fa&bg=%230f172a
terminalwidget://update?target=widget1&chart=CPU:45%20Memory:30%20Disk:25&chartFormat=pie&fg=%23f87171,%234ade80,%2360a5fa&bg=%230f172a
terminalwidget://update?target=cpu&chart=CPU:45%20Memory:30%20Disk:25&chartFormat=pie&chartKey=external&keyTarget=cpu-key&bg=%230f172a&fg=%23e2e8f0
terminalwidget://update?target=widget3&chart=1,4,9,3,8,2,7,5&chartFormat=sparkline&limit=20
terminalwidget://update?target=widget3&append=10,12&limit=20

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
terminalwidget://update?target=widget1&backgroundImage=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1506905925346-21bda4d32df4%3Fauto%3Dformat%26fit%3Dcrop%26w%3D1600%26q%3D80&filter=alpha%3A40&text=Austin%2084

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.csv&grid=zebra&tableLayout=fill
terminalwidget://update?target=widget1&tablePayload=...&tableAlign=left,right,center
terminalwidget://update?target=widget1&tablePayload=...&tableLayout=auto&tableCenter=1
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.