This software stopped working after 30 July 2016 when Habitica's deprecated API v2 was removed.

Information about the API change can be found at Application Programming Interface.

Calendar events.png


Imports your Google Calendar events for tomorrow into your Habitica To Do's.


Install and configure Google Calendar Command Line Interface and Habitica Command Line Tool (direct link). Copy the script to an executable file on your Linux computer.


Run the script each time you want to import events (e.g., every evening). Each event for tomorrow will be added as a To Do with the name ":calendar: %H:%M Event name", with easy difficulty. For example, you create Google Calendar event "Learn more about Inferno and Plan9" for 15:00. After running this script, you will have a new To Do in Habitica titled ":calendar: 15:00 Learn more about Interno and Plan9." Events which had been imported on a previous run will not be imported again.

Below is the version of the script as of February 21, 2016, however it is recommended that you obtain the latest version of the script from the maintainer's website.



calendar_get_events() {
    local day="${1:-tomorrow}" # see man date(1) DATE STRING

    # validate day syntax
    for i in $day "$day + 1 day"; do
        date -d"${i}" "+%Y-%m-%d" >/dev/null 2>&1 || {
            echo "calendar_get_events invalid argument, see man date(1) DATE STRING" > /dev/stderr
    gcalcli --military --nocolor agenda `date -d"$day" +%Y-%m-%d` `date -d"$day + 1 day" +%Y-%m-%d`

parse_events() {
     sed -E 's/^..\. [^\.]+\. [0-9]+? //' | awk -vPREFIX="${TODO_PREFIX}" -r '/^ +[0-9]+?:[0-9]+? / {printf PREFIX" "$1;$1=""; print $0}' | sort -r


habatica_update_todo() {
    xargs -tI% sh -c "habitica todos | fgrep '%' || habitica todos add --difficulty=easy '%'"

calendar_get_events "tomorrow" | parse_events | habatica_update_todo
Community content is available under CC-BY-SA unless otherwise noted.