list-notifications.
Usage
Parameters
1-based notification index from list-notifications. Must be >= 1.Note: While
list-notifications returns 0-based indices, this command accepts 1-based indices for user convenience.Filter notifications by app before selecting the index. This scopes the index to notifications from the specified app only.
Response
Information about the dismissed notification
Examples
Dismiss by Index
Dismiss with App Filter
Workflow
Note the index
Identify the notification you want to dismiss. The JSON response shows 0-based indices.
Use Cases
Clear Specific Notifications
Clear Specific Notifications
Dismiss notifications selectively while keeping others:
Dismiss Notifications from One App
Dismiss Notifications from One App
Clear all Slack notifications one by one:
Automated Notification Cleanup
Automated Notification Cleanup
Dismiss old notifications in a script:
Error Handling
Common error codes:ELEMENT_NOT_FOUND: Index out of range or notification already dismissedINVALID_ARGS: Index is 0 or negativePERM_DENIED: macOS accessibility permission not granted
Notes
- The command uses 1-based indexing for user convenience, but the JSON response shows the original 0-based index
- After dismissing a notification, all subsequent indices shift down by 1
- If you dismiss multiple notifications, work from highest to lowest index to avoid shifting issues
- The
--appfilter is applied before indexing, so index 1 refers to the first notification from that app
Related Commands
- list-notifications - List all notifications to get indices
- dismiss-all-notifications - Dismiss all notifications at once
- notification-action - Click an action button instead of dismissing