Usage
Description
Closes an application by sending a quit command. By default, this allows the application to perform cleanup (save files, prompt user, etc.). Use--force to immediately terminate the process.
Parameters
Application name to close (e.g., “Safari”, “TextEdit”)
Force-kill the process (SIGKILL) instead of quitting gracefully. Use this if the app is unresponsive.
Response
Examples
Close application gracefully
Force-kill unresponsive application
Close and verify
Error Codes
APP_NOT_FOUND— Application is not currently runningINVALID_ARGS— Attempted to close a protected system processACTION_FAILED— Failed to terminate the application
Protected Processes
The following system processes cannot be closed for safety:loginwindowwindowserverdocklaunchdfinder
INVALID_ARGS error.
Notes
- Without
--force, the app may display save dialogs or confirmation prompts - Use
--forceonly when necessary — it prevents cleanup and may cause data loss - On macOS, requires Accessibility permission