Sentinel

CLI

A standalone sentinel binary for the terminal. Under the hood every subcommand runs an AppleScript command via osascript, launching Sentinel first if it isn’t already running — so unlike the fire-and-forget URL scheme, the CLI’s exit code and output reflect what actually happened: sentinel start Typo for a script that doesn’t exist exits non-zero with a real error rather than silently succeeding.

Installation

An option to install the CLI to your Mac is available on the General tab in Settings. When you click to install, you will likely be prompted for permission to copy the app to /usr/local/bin/. You must install the CLI before you can use it.

If you do not wish to install the CLI, you can access the same functionality via AppleScript automation.

Commands

Command Description Format
list List scripts sentinel list [--format names\ | namesAndFolders\ | json\ | alfred]
start Start a script that is not running sentinel start IDENTIFIER
stop Stop a script that is running sentinel stop IDENTIFIER
restart Stop then restart a script that is running sentinel restart IDENTIFIER
status Exit 0 if the script is running, non-zero otherwise sentinel status IDENTIFIER
output Print a script’s captured output sentinel output IDENTIFIER
open-log Open the log window for a script sentinel open-log IDENTIFIER
quit Quit the Sentinel app sentinel quit

IDENTIFIER is a script’s Folder/Name — quote it if the folder or name has a space, e.g. "Work/DB Proxy".

list formats

Format Output
names One script name per line, no folder
namesAndFolders One Folder/Name per line
json Full array of script objects — name, folder, running, uptime
alfred Alfred Script Filter JSON — items titled by script, arg an open-log sentinel:// URL

Pick names/namesAndFolders for piping into shell loops, json for scripting against fields other than the name, alfred for wiring straight into an Alfred workflow.

Walkthrough: start your stack from one shell alias

Add to .zshrc:

alias devup='sentinel start "Work/API" && sentinel start "Work/Web" && sentinel start "Work/DB Proxy"'

Run devup once and every piece of your stack is running in Sentinel, logged and supervised — no more three terminal tabs to keep open.

Walkthrough: gate a script on another tool’s exit code

if ! sentinel status "Work/DB Proxy" > /dev/null; then
  echo "DB proxy isn't running — starting it."
  sentinel start "Work/DB Proxy"
fi

npm run build

Drop this at the top of a build or test script so a missing dependency starts itself instead of the build failing with a cryptic connection error.

Walkthrough: a tmux session that boots your scripts

tmux new-session -d -s work
tmux send-keys -t work 'sentinel start "Work/API"' C-m
tmux send-keys -t work 'sentinel start "Work/Web"' C-m

Useful if you already script your tmux layout on login — Sentinel takes over supervision (crash recovery, logs) the moment each script starts, so tmux only has to fire the command once.

More surfaces: URL scheme · AppleScript · Shortcuts