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
| Command | Description |
|---|
gws auth status | Check authentication status |
gws auth login | Authenticate (requires browser/RDP) |
gws auth logout | Clear credentials |
export GOOGLE_WORKSPACE_CLI_KEYRING_BACKEND=file | Enable headless/WSL mode |
Calendar
| Command | Description |
|---|
gws calendar +agenda --today --tz America/Denver | Today’s agenda |
gws calendar +agenda --week --format table --tz America/Denver | Week view (table) |
gws calendar +agenda --days 3 --tz America/Denver | Next 3 days |
gws calendar events quickAdd --params '{"calendarId":"primary","text":"..."}' | Natural language event |
gws calendar freebusy query --json '{...}' | Check availability |
Gmail
| Command | Description |
|---|
gws gmail +triage | Inbox overview with AI summary |
gws gmail +send --to X --subject Y --body Z | Send 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.pdf | Send with attachment |
gws gmail +read --message-id ID | Read a specific message |
gws gmail +reply --message-id ID --body "..." | Reply to a message |
gws gmail +forward --message-id ID --to X | Forward a message |
gws gmail messages list --params '{"q":"from:X after:2026/04/01"}' | Search messages |
Drive
| Command | Description |
|---|
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.pdf | Export to PDF |
gws drive files list --params '{"q":"name contains '\''report'\''"}' | Search files |
Sheets
| Command | Description |
|---|
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
| Command | Description |
|---|
gws docs +write --document-id ID --text "Content..." | Append to a doc |
gws docs documents batchUpdate --params '{"documentId":"ID"}' --json '{"requests":[...]}' | Batch update |
Slides
| Command | Description |
|---|
gws slides presentations batchUpdate --params '{"presentationId":"ID"}' --json '{"requests":[...]}' | Batch update |
Document Generation Workflow
| Step | Command |
|---|
| 1. Copy template | gws drive files copy --params '{"fileId":"TEMPLATE_ID"}' --json '{"name":"New Doc"}' |
| 2. Replace text | gws slides presentations batchUpdate ... replaceAllText ... |
| 3. Replace images | gws slides presentations batchUpdate ... replaceAllShapesWithImage ... |
| 4. Export PDF | gws drive files export --params '{"fileId":"ID","mimeType":"application/pdf"}' > out.pdf |
| 5. Email PDF | gws 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
| Command | Description |
|---|
gws schema calendar.events.list | Show API schema for any method |
gws schema drive.files.copy | Drive copy parameters |
gws schema slides.presentations.batchUpdate | Slides batchUpdate schema |
gws --help | Full CLI help |
Last updated: 2026-04-11