Installation:
sudo apt update -y
sudo apt install gcalcli -y
- Create a New Project within the Google developer console
- Activate the “Create” button.
- Enable the Google Calendar API
- Activate the “Enable” button.
- Create OAuth2 consent screen for an “UI /Desktop Application”.
- Fill out required App information section
- Specify App name. Example: “gcalcli”
- Specify User support email. Example: your@gmail.com
- Fill out required Developer contact information
- Specify Email addresses. Example: your@gmail.com
- Activate the “Save and continue” button.
- Scopes: activate the “Save and continue” button.
- Test users
- Add your@gmail.com
- Activate the “Save and continue” button.
- Fill out required App information section
- Create OAuth Client ID
- Specify Application type: Desktop app.
- Activate the “Create” button.
- Grab your newly created Client ID (in the form “xxxxxxxxxxxxxxx.apps.googleusercontent.com”) and Client Secret from the Credentials page.
- Call
gcalcliwith your Client ID and Client Secret to login via the OAuth2 Authorization Screen.gcalcli --client-id=xxxxxxxxxxxxxxx.apps.googleusercontent.com --client-secret=xxxxxxxxxxxxxxxxx list. In most shells, putting a space before the command will keep it, and therefore your secrets, out of history. Check withhistory | tail. - This should automatically open the OAuth2 authorization screen in your default browser.
Viewing Events:
gcalcli agenda --details all --tsv
Get the agenda for a specific date range:
gcalcli agenda 'YYYY-MM-DD' 'YYYY-MM-DD'
Add a new event:
gcalcli add --title "test" --where "Office" --when "2024-06-09 11am" --duration 1
Delete an event by ID:
gcalcli delete "test" 2024-06-01 2024-06-10
Edit an event by ID:
gcalcli edit "test" 2024-06-01 2024-06-30 --details all
List all calendars:
gcalcli list
View calendar in a weekly format:
gcalcli calw
View calendar in a monthly format:
gcalcli calm