Skip to content

Latest commit

 

History

History
85 lines (56 loc) · 2.16 KB

README.md

File metadata and controls

85 lines (56 loc) · 2.16 KB

clcal (command line calendar)

Show your Google Calendar events in the command line (including Zoom links from the event description)

Showing upcoming events

Optional arguments
-d: maximum number of days ahead to check (0 checks until end of today, 1 until end of tomorrow, etc.)
-e: maximum events to show (default 10)

sample

On Mac: (Cmd + DoubleClick) to open Zoom link from terminal

Creating events

Arguments:
--create, -c: create event
--summary, -s: summary of event (aka name of event)
--description, -d: description of event
--startdate, sd: start date for created event. format as "today", "tomorrow", yyyy-mm-dd, or mm-dd (defaults to current year).
--enddate, ed (optional): same format as --startdate
--starttime, st: start time for event, format as hh:mm:ss or hh:mm
--endtime (optional): end time for event, defaults to 1 hour after start if empty

example:

gcal -c -s "test event" -sd tomorrow -st 13:00

Installation

git clone https://github.com/maxwellreynolds/clcal/
pip install -r requirements.txt

Follow oauth client id credentials steps 1-3 for "Web App" here. https://developers.google.com/workspace/guides/create-credentials?authuser=3#web-application.

In the Google Cloud Platform "Create OAuth Client ID" step, select Desktop App

Create name for project (any name should work)

Select "Download JSON", and download credentials as "credentials.json" in the same directory as this repository.

python clcal.py

(will be an authorization step the first time running) Note: if you only want to give the app read priveleges (i.e. cannot create events, just shows them; change the line in clcal.py from

SCOPES = ['https://www.googleapis.com/auth/calendar']

to

SCOPES = ['https://www.googleapis.com/auth/calendar.readonly']

for easy access make an alias

On Mac:

  • nano ~/.bash_profile (or vi ~/.bash_profile)
  • In the bash profile add the line:

alias gcal = python <path/to/clcal.py>
(restart terminal for alias to take effect)

Now simply type "gcal" into terminal to list your next events or "gcal -c ..." to create an event