Displaying calendar events as text, in the terminal

Using Yosemite, is there a way to display events from my calendar in the command line?

I'm aware of the stock calendars apple supplies for things like holidays and such, /usr/share/calendar/ and the command 'calendar' to display events listed in these. Is there a way to do the same thing but list events from my own calendars?

I've found that personal calendars are stored in ~/Library/Calendars but everything I've found within that folder does not work with the 'calendar' command. There are several folders with ambiguous names similar to "D4385-GS57-D352-GA248592.calendar". And some folders contain a lot of *.ics files, which I think are calendar events.


How about something like that:

$ find ~/Library/Calendars -name "*.ics" |
      xargs grep -h -e "SUMMARY" -e "DTSTAMP" |
      sed -E 's/^[A-Z].*:(.*$)/\1/g' |
      sed -E 's/^([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2}).*$/\1-\2-\3 \4:\5:\6/g'
Fist’s Birthday
2014-05-16 05:44:20
Secon’s Birthday
2014-07-26 09:58:49
Third’s Birthday
2014-05-16 05:44:20
...

This command will output all events in all your calendars (included subscribed ones).


I like to use Homebrew to install a version of icalbuddy that works fine with OS X 10.11

brew install ical-buddy 

You should look into icalbuddy http://hasseg.org/icalBuddy/ . This lets you configure what days you want to output, by date/calendar and all fields. It actually interacts great with calendars of all kinds (synced and not) and can be used in terminal, geektool, etc.