Skip to content

Commit 322695f

Browse files
authored
feat(sheets): add table basics
Adds Google Sheets table list/get/create/delete commands, local table column type validation, generated command docs, and a dedicated Sheets tables docs page.\n\nCo-authored-by: Pedro Henrique Gomes Venturott <27008096+Pedrohgv@users.noreply.github.com>
1 parent b4d6f55 commit 322695f

17 files changed

Lines changed: 1112 additions & 3 deletions

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Raw API dumps: add `docs raw`, `sheets raw`, `slides raw`, `drive raw`, `gmail raw`, `calendar raw`, `people raw`, `contacts raw`, `tasks raw`, and `forms raw` subcommands for lossless Google API JSON output, with `--pretty`, Drive raw redaction defaults, Sheets grid-data warnings, and a raw-output security audit. (#495, #496) — thanks @karbassi.
99
- Docs: add `docs format` and plain-text `docs write` formatting flags for fonts, colors, bold/italic/underline/strikethrough, alignment, and line spacing. (#479) — thanks @mmaghsoodnia.
1010
- Drive: add `--fields` to `drive ls` and `drive get` so callers can pass Drive API field masks for fields beyond the default JSON set. (#495) — thanks @karbassi.
11+
- Sheets: add `sheets table` list/get/create/delete commands for Google Sheets structured tables. (#470) — thanks @Pedrohgv.
1112
- Agent safety: add baked safety-profile builds for fail-closed agent binaries, with `agent-safe`, `readonly`, and `full` profiles, filtered help/schema output, docs, and build tooling. (#366, #239) — thanks @drewburchfield.
1213
- Calendar: add `--with-meet` to `calendar update` for adding Google Meet conferencing to existing events. (#538) — thanks @alexisperumal.
1314
- Calendar: add `calendar move` / `calendar transfer` to move an event to another calendar and change its organizer. (#448) — thanks @markusbkoch.

‎README.md‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Fast, script-friendly CLI for Gmail, Calendar, Chat, Classroom, Drive, Docs, Sli
1616
- **Drive** - list/search/upload/download files, scope search to folders or shared drives, replace uploads in-place, convert uploads (including Markdown to Google Doc), manage permissions/comments, organize folders, and list shared drives
1717
- **Contacts** - search/create/update contacts, including addresses, relations, org/title metadata, custom fields, Workspace directory, and other contacts
1818
- **Tasks** - manage tasklists and tasks: get/create/add/update/done/undo/delete/clear, plus repeat schedule materialization with RRULE aliases
19-
- **Sheets** - read/write/update spreadsheets, insert rows/cols, manage tabs and named ranges, format/merge/freeze/resize cells, read/write notes, inspect formats, find/replace text, list links, and create/export sheets
19+
- **Sheets** - read/write/update spreadsheets, insert rows/cols, manage tabs, named ranges, and Sheets tables, format/merge/freeze/resize cells, read/write notes, inspect formats, find/replace text, list links, and create/export sheets
2020
- **Forms** - create/update forms, manage questions, inspect responses, and manage watches
2121
- **Apps Script** - create/get/bind projects, inspect content, and run functions
2222
- **Docs/Slides** - create/copy/export docs/slides, edit Docs by tab title or ID, import Markdown, do richer find-replace, export whole Docs or a single Docs tab, and generate Slides from Markdown or templates
@@ -1388,6 +1388,13 @@ gog sheets named-ranges add <spreadsheetId> MyCols 'Sheet1!A:C'
13881388
gog sheets named-ranges update <spreadsheetId> MyNamedRange --name MyNamedRange2
13891389
gog sheets named-ranges delete <spreadsheetId> MyNamedRange2
13901390

1391+
# Tables
1392+
gog sheets table list <spreadsheetId>
1393+
gog sheets table create <spreadsheetId> 'Sheet1!A1:C4' --name Tasks --columns-json '[{"columnName":"Task","columnType":"TEXT"},{"columnName":"Amount","columnType":"DOUBLE"},{"columnName":"Done","columnType":"BOOLEAN"}]'
1394+
gog sheets table get <spreadsheetId> <tableId>
1395+
gog sheets table delete <spreadsheetId> <tableId> --force
1396+
# See docs/sheets-tables.md for valid column types and current command scope.
1397+
13911398
# Charts
13921399
gog sheets chart list <spreadsheetId>
13931400
gog sheets chart get <spreadsheetId> <chartId> --json > chart.json

‎docs/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Keep, and related agent workflows.
1212
accounts, or Workspace domain-wide delegation.
1313
- Read [Command Guards and Baked Safety Profiles](safety-profiles.md) when
1414
running `gog` from agents or automation.
15+
- Read [Sheets Tables](sheets-tables.md) when creating or inspecting Google
16+
Sheets structured tables.
1517
- Open the [Command Index](commands/README.md) for generated docs for every CLI
1618
command.
1719

‎docs/commands.generated.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,11 @@ Generated from `gog schema --json`.
414414
- [`gog sheets (sheet) rename-tab (rename-sheet) <spreadsheetId> <oldName> <newName>`](commands/gog-sheets-rename-tab.md) - Rename a tab/sheet in a spreadsheet
415415
- [`gog sheets (sheet) resize-columns <spreadsheetId> <columns> [flags]`](commands/gog-sheets-resize-columns.md) - Resize sheet columns
416416
- [`gog sheets (sheet) resize-rows <spreadsheetId> <rows> [flags]`](commands/gog-sheets-resize-rows.md) - Resize sheet rows
417+
- [`gog sheets (sheet) table (tables) <command>`](commands/gog-sheets-table.md) - Manage Google Sheets tables
418+
- [`gog sheets (sheet) table (tables) create (add,new) --name=STRING --columns-json=STRING <spreadsheetId> <range>`](commands/gog-sheets-table-create.md) - Create a table
419+
- [`gog sheets (sheet) table (tables) delete (rm,remove,del) <spreadsheetId> <tableId>`](commands/gog-sheets-table-delete.md) - Delete a table
420+
- [`gog sheets (sheet) table (tables) get (show,info) <spreadsheetId> <tableId>`](commands/gog-sheets-table-get.md) - Get a table
421+
- [`gog sheets (sheet) table (tables) list <spreadsheetId>`](commands/gog-sheets-table-list.md) - List tables in a spreadsheet
417422
- [`gog sheets (sheet) unmerge <spreadsheetId> <range>`](commands/gog-sheets-unmerge.md) - Unmerge cells in a range
418423
- [`gog sheets (sheet) update (edit,set) <spreadsheetId> <range> [<values> ...] [flags]`](commands/gog-sheets-update.md) - Update values in a range
419424
- [`gog sheets (sheet) update-note (set-note) <spreadsheetId> <range> [flags]`](commands/gog-sheets-update-note.md) - Set or clear a cell note

‎docs/commands/README.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Every `gog` command has a generated docs page. The source of truth is the live CLI schema; run `make docs-commands` after changing command names, flags, help text, aliases, or arguments.
44

5-
Generated pages: 451.
5+
Generated pages: 456.
66

77
## Top-level Commands
88

@@ -457,6 +457,11 @@ Generated pages: 451.
457457
- [gog sheets rename-tab](gog-sheets-rename-tab.md) - Rename a tab/sheet in a spreadsheet
458458
- [gog sheets resize-columns](gog-sheets-resize-columns.md) - Resize sheet columns
459459
- [gog sheets resize-rows](gog-sheets-resize-rows.md) - Resize sheet rows
460+
- [gog sheets table](gog-sheets-table.md) - Manage Google Sheets tables
461+
- [gog sheets table create](gog-sheets-table-create.md) - Create a table
462+
- [gog sheets table delete](gog-sheets-table-delete.md) - Delete a table
463+
- [gog sheets table get](gog-sheets-table-get.md) - Get a table
464+
- [gog sheets table list](gog-sheets-table-list.md) - List tables in a spreadsheet
460465
- [gog sheets unmerge](gog-sheets-unmerge.md) - Unmerge cells in a range
461466
- [gog sheets update](gog-sheets-update.md) - Update values in a range
462467
- [gog sheets update-note](gog-sheets-update-note.md) - Set or clear a cell note
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# `gog sheets table create`
2+
3+
> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.
4+
5+
Create a table
6+
7+
## Usage
8+
9+
```bash
10+
gog sheets (sheet) table (tables) create (add,new) --name=STRING --columns-json=STRING <spreadsheetId> <range>
11+
```
12+
13+
## Parent
14+
15+
- [gog sheets table](gog-sheets-table.md)
16+
17+
## Flags
18+
19+
| Flag | Type | Default | Help |
20+
| --- | --- | --- | --- |
21+
| `--access-token` | `string` | | Use provided access token directly (bypasses stored refresh tokens; token expires in ~1h) |
22+
| `-a`<br>`--account`<br>`--acct` | `string` | | Account email for API commands (gmail/calendar/chat/classroom/drive/docs/slides/contacts/tasks/people/sheets/forms/appscript/ads) |
23+
| `--client` | `string` | | OAuth client name (selects stored credentials + token bucket) |
24+
| `--color` | `string` | auto | Color output: auto\|always\|never |
25+
| `--columns-json` | `string` | | Column definitions as JSON array or @file (columnName + optional columnType; valid types include TEXT, DOUBLE, BOOLEAN, DATE, DROPDOWN) |
26+
| `--disable-commands` | `string` | | Comma-separated list of disabled commands; dot paths allowed |
27+
| `-n`<br>`--dry-run`<br>`--dryrun`<br>`--noop`<br>`--preview` | `bool` | | Do not make changes; print intended actions and exit successfully |
28+
| `--enable-commands` | `string` | | Comma-separated list of enabled commands; dot paths allowed (restricts CLI) |
29+
| `-y`<br>`--force`<br>`--assume-yes`<br>`--yes` | `bool` | | Skip confirmations for destructive commands |
30+
| `--gmail-no-send` | `bool` | false | Block Gmail send operations (agent safety) |
31+
| `-h`<br>`--help` | `kong.helpFlag` | | Show context-sensitive help. |
32+
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
33+
| `--name` | `string` | | Table name |
34+
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
35+
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
36+
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
37+
| `--select`<br>`--pick`<br>`--project` | `string` | | In JSON mode, select comma-separated fields (best-effort; supports dot paths). Desire path: use --fields for most commands. |
38+
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
39+
| `--version` | `kong.VersionFlag` | | Print version and exit |
40+
41+
## See Also
42+
43+
- [gog sheets table](gog-sheets-table.md)
44+
- [Command index](README.md)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# `gog sheets table delete`
2+
3+
> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.
4+
5+
Delete a table
6+
7+
## Usage
8+
9+
```bash
10+
gog sheets (sheet) table (tables) delete (rm,remove,del) <spreadsheetId> <tableId>
11+
```
12+
13+
## Parent
14+
15+
- [gog sheets table](gog-sheets-table.md)
16+
17+
## Flags
18+
19+
| Flag | Type | Default | Help |
20+
| --- | --- | --- | --- |
21+
| `--access-token` | `string` | | Use provided access token directly (bypasses stored refresh tokens; token expires in ~1h) |
22+
| `-a`<br>`--account`<br>`--acct` | `string` | | Account email for API commands (gmail/calendar/chat/classroom/drive/docs/slides/contacts/tasks/people/sheets/forms/appscript/ads) |
23+
| `--client` | `string` | | OAuth client name (selects stored credentials + token bucket) |
24+
| `--color` | `string` | auto | Color output: auto\|always\|never |
25+
| `--disable-commands` | `string` | | Comma-separated list of disabled commands; dot paths allowed |
26+
| `-n`<br>`--dry-run`<br>`--dryrun`<br>`--noop`<br>`--preview` | `bool` | | Do not make changes; print intended actions and exit successfully |
27+
| `--enable-commands` | `string` | | Comma-separated list of enabled commands; dot paths allowed (restricts CLI) |
28+
| `-y`<br>`--force`<br>`--assume-yes`<br>`--yes` | `bool` | | Skip confirmations for destructive commands |
29+
| `--gmail-no-send` | `bool` | false | Block Gmail send operations (agent safety) |
30+
| `-h`<br>`--help` | `kong.helpFlag` | | Show context-sensitive help. |
31+
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
32+
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
33+
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
34+
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
35+
| `--select`<br>`--pick`<br>`--project` | `string` | | In JSON mode, select comma-separated fields (best-effort; supports dot paths). Desire path: use --fields for most commands. |
36+
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
37+
| `--version` | `kong.VersionFlag` | | Print version and exit |
38+
39+
## See Also
40+
41+
- [gog sheets table](gog-sheets-table.md)
42+
- [Command index](README.md)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# `gog sheets table get`
2+
3+
> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.
4+
5+
Get a table
6+
7+
## Usage
8+
9+
```bash
10+
gog sheets (sheet) table (tables) get (show,info) <spreadsheetId> <tableId>
11+
```
12+
13+
## Parent
14+
15+
- [gog sheets table](gog-sheets-table.md)
16+
17+
## Flags
18+
19+
| Flag | Type | Default | Help |
20+
| --- | --- | --- | --- |
21+
| `--access-token` | `string` | | Use provided access token directly (bypasses stored refresh tokens; token expires in ~1h) |
22+
| `-a`<br>`--account`<br>`--acct` | `string` | | Account email for API commands (gmail/calendar/chat/classroom/drive/docs/slides/contacts/tasks/people/sheets/forms/appscript/ads) |
23+
| `--client` | `string` | | OAuth client name (selects stored credentials + token bucket) |
24+
| `--color` | `string` | auto | Color output: auto\|always\|never |
25+
| `--disable-commands` | `string` | | Comma-separated list of disabled commands; dot paths allowed |
26+
| `-n`<br>`--dry-run`<br>`--dryrun`<br>`--noop`<br>`--preview` | `bool` | | Do not make changes; print intended actions and exit successfully |
27+
| `--enable-commands` | `string` | | Comma-separated list of enabled commands; dot paths allowed (restricts CLI) |
28+
| `-y`<br>`--force`<br>`--assume-yes`<br>`--yes` | `bool` | | Skip confirmations for destructive commands |
29+
| `--gmail-no-send` | `bool` | false | Block Gmail send operations (agent safety) |
30+
| `-h`<br>`--help` | `kong.helpFlag` | | Show context-sensitive help. |
31+
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
32+
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
33+
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
34+
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
35+
| `--select`<br>`--pick`<br>`--project` | `string` | | In JSON mode, select comma-separated fields (best-effort; supports dot paths). Desire path: use --fields for most commands. |
36+
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
37+
| `--version` | `kong.VersionFlag` | | Print version and exit |
38+
39+
## See Also
40+
41+
- [gog sheets table](gog-sheets-table.md)
42+
- [Command index](README.md)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# `gog sheets table list`
2+
3+
> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.
4+
5+
List tables in a spreadsheet
6+
7+
## Usage
8+
9+
```bash
10+
gog sheets (sheet) table (tables) list <spreadsheetId>
11+
```
12+
13+
## Parent
14+
15+
- [gog sheets table](gog-sheets-table.md)
16+
17+
## Flags
18+
19+
| Flag | Type | Default | Help |
20+
| --- | --- | --- | --- |
21+
| `--access-token` | `string` | | Use provided access token directly (bypasses stored refresh tokens; token expires in ~1h) |
22+
| `-a`<br>`--account`<br>`--acct` | `string` | | Account email for API commands (gmail/calendar/chat/classroom/drive/docs/slides/contacts/tasks/people/sheets/forms/appscript/ads) |
23+
| `--client` | `string` | | OAuth client name (selects stored credentials + token bucket) |
24+
| `--color` | `string` | auto | Color output: auto\|always\|never |
25+
| `--disable-commands` | `string` | | Comma-separated list of disabled commands; dot paths allowed |
26+
| `-n`<br>`--dry-run`<br>`--dryrun`<br>`--noop`<br>`--preview` | `bool` | | Do not make changes; print intended actions and exit successfully |
27+
| `--enable-commands` | `string` | | Comma-separated list of enabled commands; dot paths allowed (restricts CLI) |
28+
| `-y`<br>`--force`<br>`--assume-yes`<br>`--yes` | `bool` | | Skip confirmations for destructive commands |
29+
| `--gmail-no-send` | `bool` | false | Block Gmail send operations (agent safety) |
30+
| `-h`<br>`--help` | `kong.helpFlag` | | Show context-sensitive help. |
31+
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
32+
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
33+
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
34+
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
35+
| `--select`<br>`--pick`<br>`--project` | `string` | | In JSON mode, select comma-separated fields (best-effort; supports dot paths). Desire path: use --fields for most commands. |
36+
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
37+
| `--version` | `kong.VersionFlag` | | Print version and exit |
38+
39+
## See Also
40+
41+
- [gog sheets table](gog-sheets-table.md)
42+
- [Command index](README.md)

‎docs/commands/gog-sheets-table.md‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# `gog sheets table`
2+
3+
> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.
4+
5+
Manage Google Sheets tables
6+
7+
## Usage
8+
9+
```bash
10+
gog sheets (sheet) table (tables) <command>
11+
```
12+
13+
## Parent
14+
15+
- [gog sheets](gog-sheets.md)
16+
17+
## Subcommands
18+
19+
- [gog sheets table create](gog-sheets-table-create.md) - Create a table
20+
- [gog sheets table delete](gog-sheets-table-delete.md) - Delete a table
21+
- [gog sheets table get](gog-sheets-table-get.md) - Get a table
22+
- [gog sheets table list](gog-sheets-table-list.md) - List tables in a spreadsheet
23+
24+
## Flags
25+
26+
| Flag | Type | Default | Help |
27+
| --- | --- | --- | --- |
28+
| `--access-token` | `string` | | Use provided access token directly (bypasses stored refresh tokens; token expires in ~1h) |
29+
| `-a`<br>`--account`<br>`--acct` | `string` | | Account email for API commands (gmail/calendar/chat/classroom/drive/docs/slides/contacts/tasks/people/sheets/forms/appscript/ads) |
30+
| `--client` | `string` | | OAuth client name (selects stored credentials + token bucket) |
31+
| `--color` | `string` | auto | Color output: auto\|always\|never |
32+
| `--disable-commands` | `string` | | Comma-separated list of disabled commands; dot paths allowed |
33+
| `-n`<br>`--dry-run`<br>`--dryrun`<br>`--noop`<br>`--preview` | `bool` | | Do not make changes; print intended actions and exit successfully |
34+
| `--enable-commands` | `string` | | Comma-separated list of enabled commands; dot paths allowed (restricts CLI) |
35+
| `-y`<br>`--force`<br>`--assume-yes`<br>`--yes` | `bool` | | Skip confirmations for destructive commands |
36+
| `--gmail-no-send` | `bool` | false | Block Gmail send operations (agent safety) |
37+
| `-h`<br>`--help` | `kong.helpFlag` | | Show context-sensitive help. |
38+
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
39+
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
40+
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
41+
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
42+
| `--select`<br>`--pick`<br>`--project` | `string` | | In JSON mode, select comma-separated fields (best-effort; supports dot paths). Desire path: use --fields for most commands. |
43+
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
44+
| `--version` | `kong.VersionFlag` | | Print version and exit |
45+
46+
## See Also
47+
48+
- [gog sheets](gog-sheets.md)
49+
- [Command index](README.md)

0 commit comments

Comments
 (0)