Personal Project Python CLI

Google Workspace,
from the terminal.

A Python command-line tool that reads Gmail, Calendar, Drive, Tasks and Contacts without opening a browser. It is read-only today. The CLI core works. The scheduled-automation layer around it never did, and is paused.

python gmail-api calendar-api read-only cli
Documentation
GitHub →
CLI COMMAND FLOW, GWS CLI cli.py <cmd> User runs CLI Arg Parser Click OAuth2 Token refresh token.json cached · refresh if expired API Call 5 read-only APIs Gmail API search, read, digest Calendar API today, upcoming Also: Drive, Tasks and People (Contacts) APIs, read-only
SYSTEM ARCHITECTURE, GWS CLI CLI LAYER COMMAND MODULES AUTH GOOGLE APIS CLI Entrypoint Click gws/*.py 5 API modules google-auth OAuth2 client Gmail REST API search · read · digest Calendar REST API today · upcoming + Drive, Tasks, People all read-only scopes token.json Cached token credentials.json OAuth2 config OAuth2 token cached locally; currently expired, needs a manual re-auth run

This page is the build record for GWS CLI, a Python command-line tool that reads five Google Workspace APIs (Gmail, Calendar, Drive, Tasks and Contacts), so common lookups never require opening a browser tab.

Save as PDF →

Google Workspace,
from the terminal.

What It Is

GWS CLI (Google Workspace CLI) is a Python tool that puts five Google Workspace APIs behind one command-line interface. The goal: handle the most common lookups without switching to a browser, without navigating a UI, and without leaving the terminal.

$ python cli.py gmail search "invoice from:accounts@vendor.com"

The interface is intentionally thin: small wrappers over the Google APIs with clean output. No heavy abstraction. No config files beyond OAuth credentials.

Five APIs,
all read-only today.

Capabilities

Every scope the tool asks for is read-only. It reads and reports. It does not write to any Google account.

M

Gmail

Search messages and read one in full. A digest command scans newsletters and uses the Claude API to keep only what is relevant.

$ python cli.py gmail digest --days 2

C

Google Calendar

List today's events, look a few days ahead, and list calendars.

$ python cli.py cal upcoming --days 7

D

Drive, Tasks, Contacts

Search Drive by file name or list recent files. List open tasks. Look up a contact by email through the People API.

$ python cli.py drive recent

Built versus planned

APIIn the code todayPlanned, not built
Gmailsearch, read, newsletter scan, digestdrafts, sending, labels
Calendartoday, upcoming, list calendarscreating or updating events
Drivesearch by name, recent filesnone
Taskslist tasksnone
People (Contacts)look up by emailnone

Core built.
Automation layer paused.

Status & Roadmap
Built Read-only CLI over 5 Google APIs, manual use
Paused Scheduled automation layer
Not started Write actions: drafts, sending, events

Why the automation layer is paused

The CLI commands work when run by hand. The scheduled-automation layer built around them (unattended newsletter digests, idea mining into Obsidian) never completed a single successful run and was dismantled. Reviving it means fixing the scheduling setup and re-authenticating before any of it runs unattended again.

Possible next steps

Nothing is scheduled. If the tool comes back, the first step is write scopes for drafts and calendar events, behind a confirm step. rclone for Google Drive sync is a possible extension of the CLI itself, apart from the automation question.

No async needed.
Just clean wrappers.

Tech Stack

Language

Python · synchronous (no async required for Google API calls)

APIs in use

Gmail · Calendar · Drive · Tasks · People, all read-only · OAuth 2.0 · Claude API for the digest

Planned, not built

Write scopes for Gmail drafts and Calendar events · rclone (Google Drive sync)