Gws Sheets Streamlined
Comprehensive command designed for google, sheets, read, write. Includes structured workflows, validation checks, and reusable patterns for google workspace.
GWS Sheets Streamlined
Streamlined command for Google Sheets operations including reading, writing, appending rows, creating spreadsheets, and executing batch updates through the GWS CLI.
When to Use This Command
Run this command when you need to interact with Google Sheets programmatically -- reading data, appending rows, or performing batch operations.
- You need to read cell ranges from a Google Spreadsheet using the
+readhelper - You want to append new rows of data to an existing sheet using the
+appendhelper - You are creating new spreadsheets or performing batch updates on existing ones
- You need to extract data from spreadsheets for reporting or pipeline processing
Use it also when:
- You want to use developer metadata to tag and filter spreadsheet data
- You need to paginate through large spreadsheet datasets
Quick Start
# .claude/commands/gws-sheets-streamlined.md name: gws-sheets-streamlined description: Streamlined Google Sheets read, write, and batch operations arguments: operation: The Sheets operation to execute
# Read values from a spreadsheet range claude gws-sheets-streamlined "+read --spreadsheet-id 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms --range 'Sheet1!A1:D10'"
Expected output:
{
"range": "Sheet1!A1:D10",
"values": [
["Name", "Email", "Role", "Status"],
["Alice", "[email protected]", "Engineer", "Active"],
["Bob", "[email protected]", "Designer", "Active"]
]
}
Core Concepts
| Concept | Description |
|---|---|
| Spreadsheet ID | The unique identifier from the spreadsheet URL |
| Range | Cell reference like Sheet1!A1:D10 or named range |
| Batch Update | Multiple operations applied atomically to a spreadsheet |
| Append | Add rows after the last row of data in a sheet |
| Values Resource | The API resource for reading and writing cell values |
Sheets Data Flow:
āāāāāāāāāāā āāāāāāāāāāāāāāāā āāāāāāāāāāāāā
ā +read āāāāā>ā Sheets API ā<āāāāā +append ā
āāāāāāāāāāā ā (v4) ā āāāāāāāāāāāāā
ā ā
āāāāāāāāāāāāāāā ā ā āāāāāāāāāāāāāāāāāāāā
ā batchUpdate ā>ā ā<ā create ā
āāāāāāāāāāāāāāā āāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāā
Configuration
| Parameter | Default | Description |
|---|---|---|
spreadsheet-id | required | The target spreadsheet identifier |
range | required | Cell range in A1 notation or named range |
format | json | Output format: json, table, yaml, csv |
page-all | false | Auto-paginate through large result sets |
dry-run | false | Validate the operation without executing |
Best Practices
-
Use the +read and +append helpers for common operations -- These shortcuts handle parameter construction automatically, reducing the chance of errors compared to raw API calls.
-
Specify precise ranges to minimize data transfer -- Instead of reading entire sheets, target specific ranges like
A1:D100to reduce response size and latency. -
Use batchUpdate for multiple changes -- When you need to make several modifications (formatting, cell values, sheet properties), bundle them in a single
batchUpdatecall. -
Include the sheet name in ranges -- Always prefix ranges with the sheet name (
Sheet1!A1:B5) to avoid ambiguity, especially in spreadsheets with multiple tabs. -
Handle empty cells gracefully -- The Sheets API omits trailing empty cells in rows. Pad your data processing logic to account for variable-length row arrays.
Common Issues
-
Spreadsheet not found (404) -- Verify the spreadsheet ID is correct and that the authenticated user has at least viewer access to the spreadsheet.
-
Range does not exist -- Sheet names are case-sensitive and must match exactly. Use
gws sheets spreadsheets getto list available sheets before specifying ranges. -
Quota exceeded on bulk operations -- The Sheets API has per-minute read and write quotas. Add delays between batch operations or request a quota increase in the GCP console. The default quota is 60 read requests and 60 write requests per minute per user.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Git Commit Message Generator
Generates well-structured conventional commit messages by analyzing staged changes. Follows Conventional Commits spec with scope detection.
React Component Scaffolder
Scaffolds a complete React component with TypeScript types, Tailwind styles, Storybook stories, and unit tests. Follows project conventions automatically.
CI/CD Pipeline Generator
Generates GitHub Actions workflows for CI/CD including linting, testing, building, and deploying. Detects project stack automatically.