Skip to content
Edith

Docs

Command reference

ed running-apps quit

Plans or applies a request to quit one running app, or every unprotected app. Finder and Edith are always protected.

Output
ed running-apps quit <app> [--force] [--yes] [--json]ed running-apps quit --all [--force] [--yes] [--json]

Without --yes, both forms are previews. They resolve the exact targets, print the plan, change nothing, and do not require Edith to be running.

Arguments

Name Type / values Default What it does
<app> running app name or bundle id none Select an exact name, exact bundle id, or unambiguous name prefix. Required unless --all is used. Running names and bundle ids complete dynamically.

Options

Name Type / values Default What it does
--all flag off Select every app except Finder and both Edith processes. Cannot be combined with an app name.
--force flag off Plan or request forceTerminate instead of a normal quit. This can prevent an app from saving.
--yes flag off Apply the exact plan. Required for named targets and --all.
--json flag off Emit one JSON document on stdout.
--help, -h flag off Print help and exit 0.
--version flag off Print the CLI version and exit 0.

Naming neither a target nor --all exits 1. Combining both also exits 1:

Output
$ ed running-apps quiterror: say which app to quithint: pass a name, or --all$ ed running-apps quit --all Safarierror: --all quits everything, so it takes no app name

Resolution tries a case-insensitive exact name, a case-insensitive exact bundle id, then an unambiguous name prefix. Missing and ambiguous targets exit 3. Protected named targets exit 1 before any request is sent.

Preview and apply

A named preview is one line on stdout:

Output
$ ed running-apps quit Spotifywould quit Spotify; pass --yes to apply

An all-app preview includes the exact names captured by the plan:

Output
$ ed running-apps quit --allwould quit 3 apps: Music, Safari, Spotify; pass --yes to apply

Pass --yes to quit them:

Output
$ ed running-apps quit Spotify --yesEdith accepted quit for 1 of 1 apps

--json shape

Preview and apply use the same stable object. applied says whether execution was requested. acknowledged says whether Edith answered. requested is the exact target count and changed is how many termination requests macOS accepted. Neither count proves that every app has already closed.

JSON
{  "acknowledged": false,  "applied": false,  "changed": 0,  "force": false,  "operation": "runningApps.quit",  "requested": 1,  "targets": [    {      "active": false,      "bundleID": "com.spotify.client",      "name": "Spotify",      "pid": 18719    }  ]}

With --yes, the same plan becomes:

JSON
{  "acknowledged": true,  "applied": true,  "changed": 1,  "force": false,  "operation": "runningApps.quit",  "requested": 1,  "targets": [    {      "active": false,      "bundleID": "com.spotify.client",      "name": "Spotify",      "pid": 18719    }  ]}

Behaviour notes

The CLI and Running Apps page share the same plan and protections. The Running Apps page's confirmation dialogs supply the confirmation that --yes supplies on the command line.

--yes quits exactly the apps the preview listed. Edith checks protected apps again before quitting, and a missing confirmation from Edith exits 4 instead of claiming success.

An app with unsaved changes may show a save dialog and remain open after macOS accepts the termination request. Check the list again when a script needs to know whether the target closed:

Output
ed running-apps quit Spotify --yessleep 2ed running-apps ls --json | jq -r '.[].name'

--force skips normal termination and can lose unsaved work. It still requires --yes.

Examples

Output
ed running-apps quit Spotifyed running-apps quit Spotify --yesed running-apps quit com.spotify.client --force --yesed running-apps quit --all --jsoned running-apps quit --all --yes --json

Where to go next