gws-sheets

Read and write Google Sheets spreadsheets via the gws CLI and Sheets API v4.

Updated Nov 9, 2023
One-click install
npx skills add https://github.com/oresttokovenko/dot-files --skill gws-sheets-oresttokovenko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gws-sheets
Source: https://github.com/oresttokovenko/dot-files/tree/main/chezmoi/dot_agents/skills/gws-sheets
Command: npx skills add https://github.com/oresttokovenko/dot-files --skill gws-sheets-oresttokovenko

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gws.

What problem does it solve? Working with Google Sheets programmatically normally requires writing API client code, handling OAuth, and learning the Sheets API surface. This Skill exposes the full Sheets API v4 through the gws CLI so you can create, read, and update spreadsheets with single commands. ## Core Features & Use Cases - Spreadsheet Management: Create spreadsheets, fetch metadata, and apply batched updates via the spreadsheets resource (create, get, batchUpdate, getByDataFilter). - Values and Sheets Operations: Access the values, sheets, and developerMetadata sub-resources for reading ranges and manipulating sheet structure. - Helper Commands: Use the companion +append and +read helpers to append rows or read cell values without constructing raw API calls. - Use Case: Append a new row of daily metrics to a tracking spreadsheet, then read back a range to verify the update, all from the command line. ## Quick Start Ask the AI to read the values from a specific range of a Google Sheet by its spreadsheet ID using the gws sheets command.

Frequently Asked Questions about gws-sheets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I read values from a Google Sheet using the command line?

Use the gws sheets CLI with the values resource, or the companion gws-sheets-read helper skill. Run gws sheets --help to browse methods and gws schema sheets.values.get to inspect required parameters like the spreadsheet ID and range.

How do I append a row to a Google Sheet programmatically?

Use the gws-sheets-append helper skill, which wraps the Sheets API values append method. Provide the spreadsheet ID, target range, and row values; the CLI handles the API request after authentication is configured.

What authentication is required for the Google Sheets API with gws?

Authentication and global flags are defined in the gws-shared skill, which must be read first. If it is missing, run gws generate-skills to create it before calling any sheets methods.

Does gws sheets support batch updates to spreadsheets?

Yes, the spreadsheets.batchUpdate method applies multiple updates atomically. If any request in the batch is invalid, the entire request fails and nothing is applied, ensuring spreadsheet consistency.

Why does gws sheets get return no cell data?

By default, the get method does not return grid data. Include a fields parameter with a field mask, or set the includeGridData URL parameter to true to retrieve cell contents.