Google Workspace CLI
Drive · Gmail · Calendar · Sheets · Docs · Chat — six APIs, one install, structured JSON for AI Agents.
$ pip install cli-anything-gworkspace
$ pip install "cli-anything-gworkspace[full]" # includes google-api-python-client
gworkspace-cli drive list --limit 20
gworkspace-cli drive upload report.pdf --folder ID
gworkspace-cli drive download FILE_ID -o local.pdf
gworkspace-cli drive share FILE_ID --email user@co
gworkspace-cli drive mkdir "Q1 Reports"
List, upload, download, share, delete files and create folders via Drive API v3. Multipart upload support.
gworkspace-cli gmail send --to [email protected] -s "Hi" -b "Body"
gworkspace-cli gmail list --label INBOX --limit 10
gworkspace-cli gmail search "from:boss has:attachment"
gworkspace-cli gmail reply MESSAGE_ID -b "Thanks!"
gworkspace-cli gmail labels
Send, list, get, search, reply to and trash emails. Manage labels. Follows the +send +reply +triage pattern from gws reference.
gworkspace-cli calendar events --days 7
gworkspace-cli calendar create -t "Sprint Review" \
--start 2026-03-20T10:00:00 --end ...T11:00:00
gworkspace-cli calendar calendars
gworkspace-cli calendar delete EVENT_ID --yes
Agenda view, event CRUD, multi-calendar support, attendee management via Calendar API v3. Timezone aware.
gworkspace-cli sheets read SHEET_ID "Sheet1!A1:D10"
gworkspace-cli sheets write SHEET_ID "A1" -v '[["x","y"]]'
gworkspace-cli sheets append SHEET_ID "A1" -v '["Alice",95]'
gworkspace-cli sheets create -t "Q1 Budget"
gworkspace-cli sheets info SHEET_ID
Read/write/append cell ranges, create spreadsheets — Sheets API v4. Ideal for data pipeline automation and reporting.
gworkspace-cli docs create -t "Report" -c "Content..."
gworkspace-cli docs get DOC_ID --text-only
gworkspace-cli docs append DOC_ID "New paragraph"
gworkspace-cli docs info DOC_ID
Create docs, extract plain text, append content, get metadata — Docs API v1. Great for automated report generation.
gworkspace-cli chat spaces
gworkspace-cli chat send spaces/XYZ "Deploy done ✓"
gworkspace-cli chat messages spaces/XYZ --limit 20
List spaces, send and read messages — Chat API v1. Build internal notification bots for CI/CD, alerts and reports.
export GOOGLE_WORKSPACE_TOKEN=$(gcloud auth print-access-token)or:
gworkspace-cli --token TOKEN drive list
export GOOGLE_APPLICATION_CREDENTIALS=/path/sa.jsonRequires
pip install google-auth
export GWS_OAUTH_FILE=~/.config/gws/credentials.jsonSee: googleworkspace/cli auth guide
| Command | Arguments | Description |
|---|---|---|
| ── DRIVE ── | ||
drive list | --limit N --query Q --folder ID | List files |
drive info | FILE_ID | Get file metadata |
drive upload | FILEPATH --name N --folder ID | Upload file (multipart) |
drive download | FILE_ID -o PATH | Download file |
drive share | FILE_ID --email E --role reader|writer | Share file or make public |
drive delete | FILE_ID --yes | Move to trash |
drive mkdir | NAME --parent ID | Create folder |
| ── GMAIL ── | ||
gmail send | --to E --subject S --body B | Send email |
gmail list | --limit N --label L --query Q | List emails |
gmail get | MESSAGE_ID --format full|metadata | Get email details |
gmail search | QUERY --limit N | Search (Gmail syntax) |
gmail reply | MESSAGE_ID --body B | Reply to email |
gmail trash | MESSAGE_ID | Move to trash |
gmail labels | List labels | |
| ── CALENDAR ── | ||
calendar events | --days N --limit N --calendar-id ID | Upcoming events (agenda) |
calendar create | -t TITLE --start DT --end DT --attendees E,E | Create event |
calendar get | EVENT_ID | Get event details |
calendar delete | EVENT_ID --yes | Delete event |
calendar calendars | List calendars | |
| ── SHEETS ── | ||
sheets read | SPREADSHEET_ID "Sheet1!A1:D10" | Read cell range |
sheets write | SHEET_ID RANGE -v '[["a","b"]]' | Write values (overwrite) |
sheets append | SHEET_ID RANGE -v '["val1","val2"]' | Append row(s) |
sheets create | -t TITLE --sheets "Sheet1,Sheet2" | Create spreadsheet |
sheets info | SPREADSHEET_ID | Get metadata |
| ── DOCS ── | ||
docs create | -t TITLE -c "Initial content" | Create document |
docs get | DOC_ID --text-only | Get doc / extract text |
docs append | DOC_ID "New paragraph text" | Append to end |
docs info | DOC_ID | Get metadata |
| ── CHAT ── | ||
chat spaces | --limit N | List spaces |
chat send | SPACE_NAME "Message text" | Send message |
chat messages | SPACE_NAME --limit N | List space messages |
# Install
pip install cli-anything-gworkspace
# Discover capabilities (no credentials needed)
gworkspace-cli schema
# Set credentials (choose one)
export GOOGLE_WORKSPACE_TOKEN=$(gcloud auth print-access-token)
# or
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/sa.json
# Health check
gworkspace-cli --json detect
# → {"status":"ok","email":"[email protected]","services":["drive","gmail","calendar","sheets","docs","chat"]}
# Drive: list recent files
gworkspace-cli --json drive list --limit 5
# Gmail: send a notification
gworkspace-cli --json gmail send --to [email protected] -s "Deploy complete" -b "v2.0.1 is live"
# Calendar: today's agenda
gworkspace-cli --json calendar events --days 1
# Sheets: append a row
gworkspace-cli --json sheets append SHEET_ID "A1" -v '["2026-03-15","passed","42ms"]'
# Docs: create report
gworkspace-cli --json docs create -t "Weekly Report" -c "Summary: all tests passing"
# Chat: notify team
gworkspace-cli --json chat send spaces/AAAA "Pipeline finished. 42 tests passed."