Skip to main content
Dismiss all notifications currently in the Notification Center, with an optional filter to target notifications from a specific app.

Usage

agent-desktop dismiss-all-notifications [OPTIONS]

Parameters

--app
string
Only dismiss notifications from this application. If omitted, all notifications are dismissed.
agent-desktop dismiss-all-notifications --app Slack

Response

dismissed_count
number
required
Number of notifications successfully dismissed
failures
array
Array of error messages for notifications that failed to dismiss. Omitted if all dismissals succeeded.
failed_count
number
Number of notifications that failed to dismiss. Only present if failures occurred.

Examples

Dismiss All Notifications

agent-desktop dismiss-all-notifications
{
  "version": "1.0",
  "ok": true,
  "command": "dismiss-all-notifications",
  "data": {
    "dismissed_count": 5
  }
}

Dismiss All from Specific App

agent-desktop dismiss-all-notifications --app Slack
{
  "version": "1.0",
  "ok": true,
  "command": "dismiss-all-notifications",
  "data": {
    "dismissed_count": 3
  }
}

With Partial Failures

If some notifications fail to dismiss, the response includes failure details:
{
  "version": "1.0",
  "ok": true,
  "command": "dismiss-all-notifications",
  "data": {
    "dismissed_count": 4,
    "failures": [
      {
        "index": 2,
        "error": "Notification already dismissed"
      }
    ],
    "failed_count": 1
  }
}

Use Cases

Clean up all notifications at once:
agent-desktop dismiss-all-notifications
Useful for maintaining a clean notification center or before screenshots/demos.
Dismiss all notifications from a specific app while keeping others:
agent-desktop dismiss-all-notifications --app Slack
agent-desktop dismiss-all-notifications --app Messages
Run periodically to prevent notification buildup:
# In a cron job or automation script
agent-desktop dismiss-all-notifications
Clear distractions before starting focused work:
# Clear notifications and mute communication apps
agent-desktop dismiss-all-notifications
agent-desktop close-app Slack
agent-desktop close-app Messages

Behavior

  • Dismissals are attempted in order from first to last notification
  • If some notifications fail to dismiss, the command continues with remaining notifications
  • The command returns success ("ok": true) even if some dismissals fail; check the failures field for details
  • Notifications dismissed successfully are removed immediately and won’t appear in subsequent list-notifications calls

Error Handling

Common error codes:
  • PERM_DENIED: macOS accessibility permission not granted
  • APP_NOT_FOUND: Specified app has no notifications
Partial failures are reported in the response data, not as top-level errors:
{
  "version": "1.0",
  "ok": true,
  "command": "dismiss-all-notifications",
  "data": {
    "dismissed_count": 2,
    "failures": [
      {
        "index": 0,
        "error": "Element no longer exists"
      }
    ],
    "failed_count": 1
  }
}

Notes

  • This is a bulk operation; use dismiss-notification for selective dismissal
  • The --app filter is case-sensitive and must match the app name exactly as shown in list-notifications
  • Notifications are dismissed sequentially, not in parallel
  • The command does not require list-notifications to be called first

Build docs developers (and LLMs) love