GWS CLI Cheat Sheet

Quick reference for Google Workspace CLI commands. For full documentation, see GWS CLI Playbook.

Version: v0.22.3+ | Account: mr.sunshine@solanasis.com | Auth: OAuth2


Auth

CommandDescription
gws auth statusCheck authentication status
gws auth loginAuthenticate (requires browser/RDP)
gws auth logoutClear credentials
export GOOGLE_WORKSPACE_CLI_KEYRING_BACKEND=fileEnable headless/WSL mode

Calendar

CommandDescription
gws calendar +agenda --today --tz America/DenverToday’s agenda
gws calendar +agenda --week --format table --tz America/DenverWeek view (table)
gws calendar +agenda --days 3 --tz America/DenverNext 3 days
gws calendar events quickAdd --params '{"calendarId":"primary","text":"..."}' Natural language event
gws calendar freebusy query --json '{...}'Check availability

Gmail

CommandDescription
gws gmail +triageInbox overview with AI summary
gws gmail +send --to X --subject Y --body ZSend plain text email
gws gmail +send --to X --subject Y --html "<p>...</p>"Send HTML email
gws gmail +send --to X --subject Y --body Z -a file.pdfSend with attachment
gws gmail +read --message-id IDRead a specific message
gws gmail +reply --message-id ID --body "..."Reply to a message
gws gmail +forward --message-id ID --to XForward a message
gws gmail messages list --params '{"q":"from:X after:2026/04/01"}'Search messages

Drive

CommandDescription
gws drive files list --params '{"orderBy":"modifiedTime desc","pageSize":10}'Recent files
gws drive files create --upload file.pdf --params '{"name":"Report.pdf"}'Upload a file
gws drive files copy --params '{"fileId":"ID"}' --json '{"name":"Copy"}'Copy a file
gws drive files export --params '{"fileId":"ID","mimeType":"application/pdf"}' > out.pdfExport to PDF
gws drive files list --params '{"q":"name contains '\''report'\''"}'Search files

Sheets

CommandDescription
gws sheets +read --spreadsheet-id ID --range "Sheet1!A1:D10"Read a range
gws sheets +append --spreadsheet-id ID --range "Sheet1" --values '[["A","B"]]'Append rows

Docs

CommandDescription
gws docs +write --document-id ID --text "Content..."Append to a doc
gws docs documents batchUpdate --params '{"documentId":"ID"}' --json '{"requests":[...]}'Batch update

Slides

CommandDescription
gws slides presentations batchUpdate --params '{"presentationId":"ID"}' --json '{"requests":[...]}'Batch update

Document Generation Workflow

StepCommand
1. Copy templategws drive files copy --params '{"fileId":"TEMPLATE_ID"}' --json '{"name":"New Doc"}'
2. Replace textgws slides presentations batchUpdate ... replaceAllText ...
3. Replace imagesgws slides presentations batchUpdate ... replaceAllShapesWithImage ...
4. Export PDFgws drive files export --params '{"fileId":"ID","mimeType":"application/pdf"}' > out.pdf
5. Email PDFgws gmail +send --to X --subject Y --body Z -a out.pdf

Automated: secret run solanasis-scripts -- python generate-doc.py proposal --client "Acme Corp"

API Discovery

CommandDescription
gws schema calendar.events.listShow API schema for any method
gws schema drive.files.copyDrive copy parameters
gws schema slides.presentations.batchUpdateSlides batchUpdate schema
gws --helpFull CLI help

Last updated: 2026-04-11