Quickstart
This guide will walk you through installing the Google Workspace CLI, setting up authentication, and running your first commands.Install the CLI
Install Verify the installation:
gws via npm:Terminal
Terminal
Expected output
Expected output
Alternatively, you can build from source using Cargo if you prefer.
Set up authentication
Run the interactive setup command to create a Google Cloud project and configure OAuth:This command will:
Terminal
- Create a new Google Cloud project (or use an existing one)
- Enable required Google Workspace APIs
- Create OAuth 2.0 credentials
- Walk you through the OAuth consent flow
- Store encrypted credentials in your OS keyring
What if gws auth setup doesn't work?
What if gws auth setup doesn't work?
If automated setup fails, you can configure OAuth manually through the Google Cloud Console:
- Create an OAuth 2.0 Desktop client
- Download the client secret JSON
- Save it to
~/.config/gws/client_secret.json - Run
gws auth login
Try More Commands
Now that you’re set up, try these common operations:Create a Spreadsheet
Terminal
Expected output
Expected output
Search Gmail Messages
Terminal
Expected output
Expected output
Create a Calendar Event
Terminal
Expected output
Expected output
Useful Flags
gws includes powerful flags that work across all commands:
| Flag | Description | Example |
|---|---|---|
--params <JSON> | URL/query parameters as JSON | --params '{"pageSize": 10}' |
--json <JSON> | Request body for POST/PATCH/PUT | --json '{"title": "New Doc"}' |
--format <FMT> | Output format: json, table, yaml, csv | --format table |
--dry-run | Preview the request without sending | --dry-run |
--page-all | Auto-paginate all results as NDJSON | --page-all |
--upload <PATH> | Upload a local file (multipart) | --upload ./file.pdf |
--output <PATH> | Save response to file | --output response.json |
Dry Run Example
Preview a request before sending it:Terminal
Dry run output
Dry run output
Pagination Example
Fetch all pages and stream results as NDJSON:Terminal
Sample output
Sample output
jq to extract specific fields.Schema Introspection
Usegws schema to inspect API method schemas without leaving your terminal:
Terminal
Schema output
Schema output
--resolve-refs:
Terminal
Next Steps
Authentication Options
Learn about headless auth, service accounts, and CI workflows
Command Reference
Browse all available services and commands
Advanced Features
Master pagination, uploads, and schema introspection
AI Integration
Use gws with AI agents via MCP or OpenCode skills