Use the Terminal Widget command-line tool to update widgets from scripts, shell commands, and automation.
Usage
terminal-widget [--target NAME] [--text "STRING"] [--icon "SF_SYMBOL"] [--font "FONT NAME"] [--fg COLOR] [--bg COLOR] [--alpha A] [--progress N] [--chart "N N ..." --chart-format MODE] [--caption] [--image PATH_OR_URL] [--padding N|fill|--fullsize] [--command "CMD"] [--theme|--mode system|light|dark]
Options
--target NAMEWidget to update (matches Edit Widget “Target name”). If omitted, uses the last target written (.lastTarget), else the first registered widget name (widget1,widget2, …), elsewidget1.--text STRINGText line (shown above the progress bar when both are set)--icon SF_SYMBOLSF Symbol name; shown before text, or before the progress bar, or alone centered if nothing else is set--font "FONT NAME"Installed system font name used for text rendering (omitting--fontresets to default)--foreground COLORText/icon color (alias:--fg). AcceptsRRGGBB,#RRGGBB,rgb(r,g,b), orrgba(r,g,b,a).--background COLORWidget background color (alias:--bg). AcceptsRRGGBB,#RRGGBB,rgb(r,g,b), orrgba(r,g,b,a).--alpha AOverride alpha channel for--foreground/--backgroundthis update (0.0...1.0).--progress NInteger0-100for a progress bar; omit to hide the bar on this update--chart VALUESChart series values separated by spaces or commas. Omit to clear. Max 128 points.--chart-format MODEChart style (default:sparkline):sparkline(aliases:spark,bar): bar sparkline scaled min..maxgraph(alias:line): connected line with point markerswaveform(alias:wave): centered mirrored bars interpolated between valuesarea: line graph with area fill under the curvelollipop: stems from baseline with dots at valuesstrip(alias:dot): dot/strip plot with no connecting lineradial: circular/radial connected plotdelta: positive/negative bars showing change between adjacent pointsthreshold: line graph with threshold guide linesmooth: smoothed curve interpolationsine: half-sine interpolation between pointspeak: line graph with peak point emphasizedmatrix: heatmap matrix values mapped to foreground alpha
--captionShow centered[min/max]caption below the active chart--image IMAGE_PATHAbsolute/relative image path or anhttp(s)image URL--full-widthAlias for--padding fill(kept for compatibility)--padding N|fillWidget content padding in points (0-64), orfillfor orientation-aware image fill/crop mode--fullsizeShortcut for--padding 0(edge-to-edge content)--command COMMANDRun command and use its stdout as text--theme MODEsystem,light, ordark--mode MODEAlias for--theme(system,light, ordark)--verbosePrint debug/status output and manual test URL--helpShow this help
Notes
- If both
--textand--commandare supplied,--commandoutput wins. --text -reads text from stdin.--chart -reads chart values from stdin.- Legacy stdin modes are still accepted:
--sparkline -,--graph -,--waveform -, and--matrix -. - If neither
--text -nor--chart -is used, piped stdin defaults to text when--textis omitted. - Omitting both
--textand--commandclears the widget text line (for example:terminal-widget --progress 50only updates the bar). --commandruns withzsh -lc(login env + Homebrew paths). Fish functions are not visible; use a script on PATH or--text.- Icon-only: pass
--iconwith no--text,--command,--image,--progress, or chart flags to show a centered symbol. - Omit
--foreground/--backgroundon a later update to reset those colors to theme defaults. --padding fillenables image fill mode: portrait images fill width/crop height, landscape images fill height/crop width.--paddingand--fullsizepersist in payload until changed again for that target.- Updates the App Group JSON + prefs, then notifies the app via
SIGUSR1andterminalwidget:///update?sync=1&target=....
Command Examples
terminal-widget --target widget1 --text "Deploy complete" --icon "checkmark.circle.fill" --fg "#22c55e"
terminal-widget --target widget2 --command "pmset -g batt | head -1"
terminal-widget --target widget3 --image "https://picsum.photos/800/400" --fullsize
terminal-widget --target widget1 --progress 67 --text "Rendering"
terminal-widget --target widget1 --chart "5 12 8 21 34 55 89" --chart-format sparkline
terminal-widget --target widget1 --chart "5 12 8 21 34 55 89" --chart-format sine --caption
terminal-widget --target widget1 --chart "0 2 8 3 5 1 0 9" --chart-format matrix
echo "Build complete" | terminal-widget --target widget1
---|---|
cat values.txt | terminal-widget --target widget1 --chart - --chart-format radial
Chart Gallery
Use the same data with different --chart-format values to compare styles quickly:
# Base sample data
DATA="1 4 9 3 8 2 7 5 10 6"
terminal-widget --target widget1 --chart "$DATA" --chart-format sparkline
terminal-widget --target widget1 --chart "$DATA" --chart-format graph
terminal-widget --target widget1 --chart "$DATA" --chart-format waveform
terminal-widget --target widget1 --chart "$DATA" --chart-format area
terminal-widget --target widget1 --chart "$DATA" --chart-format lollipop
terminal-widget --target widget1 --chart "$DATA" --chart-format strip
terminal-widget --target widget1 --chart "$DATA" --chart-format radial
terminal-widget --target widget1 --chart "$DATA" --chart-format delta
terminal-widget --target widget1 --chart "$DATA" --chart-format threshold
terminal-widget --target widget1 --chart "$DATA" --chart-format smooth
terminal-widget --target widget1 --chart "$DATA" --chart-format sine
terminal-widget --target widget1 --chart "$DATA" --chart-format peak
terminal-widget --target widget1 --chart "$DATA" --chart-format matrix
Add --caption to any chart command to show [min/max] below the chart.
URL Scheme Examples
terminalwidget://update?target=widget1&text=Backup%20Complete&icon=externaldrive.fill
terminalwidget://update?target=widget2&progress=42&text=Syncing
terminalwidget://update?target=widget3&image=https%3A%2F%2Fpicsum.photos%2F640%2F360&padding=0
terminalwidget://update?target=widget1&chart=4,8,15,16,23,42&chartFormat=peak&caption=1
terminalwidget://update?target=widget2&theme=dark&fg=%23ffffff&bg=%23111417