Use the Apple Mail CLI skill
mainThe apple-mail skill allows you to interact with Mail.app on macOS using AppleScript and SQLite. It supports reading, searching, sending, replying to, and managing emails.
Prerequisites:
- macOS operating system.
Mail.appmust be running.sqlite3must be installed on the system.
Core Workflow:
- Refresh: Always call
mail-refreshbefore listing or searching if you need the most recent messages, as the scripts read cached data and do not auto-refresh. - List/Search: Use
mail-listormail-searchto find message IDs. - Act: Use the retrieved IDs to read, delete, or mark messages.
Output Format for Lists/Searches:
ID | ReadStatus | Date | Sender | Subject
●indicates an unread message.- A blank space indicates a read message.
# Example workflow
mail-refresh Google
mail-list Inbox Google 10
mail-read 12345