icalBuddy is a command-line utility that can be used to get lists of events and tasks/to-do's from the OS X calendar database (the same one iCal uses).
hasseg.org, in "icalBuddy"
Works well with Outlook too, if you share your Outlook calendar to the mac calendar app. For searching I created a small alias alias calgrep="icalBuddy 'eventsToday+21'|grep -i -A2" to search events in the next 3 weeks by name.