bygoogleworkspace· 58 skills
Google Sheets: Read and write spreadsheets.
$npx -y skills add googleworkspace/cli --skill gws-sheetsInstalls into the current project.
Run `npx skills use "https://github.com/googleworkspace/cli" --skill "googleworkspace/cli/gws-sheets"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.
Use the skills in "https://github.com/googleworkspace/cli" that are relevant to the current task. Run `npx skills add "https://github.com/googleworkspace/cli"` and select the relevant skills, then follow their instructions.
| 1 | # sheets (v4) |
| 2 | |
| 3 | > **PREREQUISITE:** Read `../gws-shared/SKILL.md` for auth, global flags, and security rules. If missing, run `gws generate-skills` to create it. |
| 4 | |
| 5 | ```bash |
| 6 | gws sheets <resource> <method> [flags] |
| 7 | ``` |
| 8 | |
| 9 | ## Helper Commands |
| 10 | |
| 11 | | Command | Description | |
| 12 | |---------|-------------| |
| 13 | | [`+append`](../gws-sheets-append/SKILL.md) | Append a row to a spreadsheet | |
| 14 | | [`+read`](../gws-sheets-read/SKILL.md) | Read values from a spreadsheet | |
| 15 | |
| 16 | ## API Resources |
| 17 | |
| 18 | ### spreadsheets |
| 19 | |
| 20 | - `batchUpdate` — Applies one or more updates to the spreadsheet. Each request is validated before being applied. If any request is not valid then the entire request will fail and nothing will be applied. Some requests have replies to give you some information about how they are applied. The replies will mirror the requests. For example, if you applied 4 updates and the 3rd one had a reply, then the response will have 2 empty replies, the actual reply, and another empty reply, in that order. |
| 21 | - `create` — Creates a spreadsheet, returning the newly created spreadsheet. |
| 22 | - `get` — Returns the spreadsheet at the given ID. The caller must specify the spreadsheet ID. By default, data within grids is not returned. You can include grid data in one of 2 ways: * Specify a [field mask](https://developers.google.com/workspace/sheets/api/guides/field-masks) listing your desired fields using the `fields` URL parameter in HTTP * Set the includeGridData URL parameter to true. |
| 23 | - `getByDataFilter` — Returns the spreadsheet at the given ID. The caller must specify the spreadsheet ID. For more information, see [Read, write, and search metadata](https://developers.google.com/workspace/sheets/api/guides/metadata). This method differs from GetSpreadsheet in that it allows selecting which subsets of spreadsheet data to return by specifying a dataFilters parameter. Multiple DataFilters can be specified. |
| 24 | - `developerMetadata` — Operations on the 'developerMetadata' resource |
| 25 | - `sheets` — Operations on the 'sheets' resource |
| 26 | - `values` — Operations on the 'values' resource |
| 27 | |
| 28 | ## Discovering Commands |
| 29 | |
| 30 | Before calling any API method, inspect it: |
| 31 | |
| 32 | ```bash |
| 33 | # Browse resources and methods |
| 34 | gws sheets --help |
| 35 | |
| 36 | # Inspect a method's required params, types, and defaults |
| 37 | gws schema sheets.<resource>.<method> |
| 38 | ``` |
| 39 | |
| 40 | Use `gws schema` output to build your `--params` and `--json` flags. |