Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- CLI: add `GOG_HELP=agent` compact root help with common read-only recipes and targeted schema guidance so agents can execute Gmail, Calendar, and Drive tasks without traversing multiple help levels.
- Auth: add `auth setup` for guided Google Cloud project/API preparation, OAuth client installation, and optional browser authorization.
- API: add Discovery-backed `api list`, `api describe`, and scoped `api call` access for Google methods outside the first-class command surface, with dry-run plans and explicit write opt-in.
- Safety: add global `--readonly` / `GOG_READONLY=1` runtime enforcement that blocks mutating Google and Zoom API requests before dispatch while preserving read-only query POSTs and least-privilege OAuth setup.

## 0.30.0 - 2026-06-21

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ Useful global flags:
- `--wrap-untrusted`: in JSON/raw output, wrap fetched free-text fields with
external untrusted-content markers for LLM/agent consumption
- `--dry-run`: print intended actions where a command supports planning
- `--readonly`: block mutating API requests before network dispatch; still allow known POST-based query APIs
- `--no-input`: fail instead of prompting
- `--force`: confirm destructive operations
- `--enable-commands <csv>`: allow selected command prefixes. Parent paths allow children, so `gmail` allows the Gmail command family.
Expand All @@ -569,6 +570,7 @@ For coding agents or CI, prefer:
gog --account you@gmail.com \
--enable-commands-exact gmail.search,gmail.get,drive.ls,docs.cat \
--gmail-no-send \
--readonly \
--wrap-untrusted \
--json \
gmail search 'newer_than:7d'
Expand Down
15 changes: 15 additions & 0 deletions docs/automation.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ Use `--no-input` in CI and unattended processes. Use `--wrap-untrusted` when
Google-hosted free text will be consumed by an LLM or another instruction-aware
system.

Use `--readonly` (or `GOG_READONLY=1`) as a runtime backstop. It permits GET,
HEAD, OPTIONS, and the small allowlist of Google APIs whose query operations use
POST, while rejecting mutating API requests before network dispatch. This guard
is independent of OAuth scopes and command names, propagates into MCP child
processes, and also blocks Zoom meeting mutations. `gog auth add --readonly`
continues to request read-only OAuth scopes where Google provides them.

```bash
gog --readonly --account you@example.com gmail search 'newer_than:7d'
gog --readonly --account you@example.com calendar freebusy you@example.com
```

Interactive browser commands fail fast under `--no-input`. Preview
`gog auth manage` with `--dry-run`; use `gog auth import` for unattended token
installation.
Expand All @@ -73,6 +85,7 @@ Example:
gog \
--enable-commands-exact schema,gmail.search \
--gmail-no-send \
--readonly \
--no-input \
--wrap-untrusted \
schema --json |
Expand All @@ -87,6 +100,7 @@ common_flags=(
--account you@example.com
--enable-commands-exact schema,gmail.search
--gmail-no-send
--readonly
--no-input
--wrap-untrusted
)
Expand All @@ -97,6 +111,7 @@ gog "${common_flags[@]}" schema --json |
.automation.safety.no_input and
.automation.safety.wrap_untrusted and
.automation.safety.gmail_no_send and
.automation.safety.readonly and
(.automation.safety.command_rules.enabled_exact | index("gmail.search"))
'

Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin-groups-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ gog admin groups list (ls) [flags]
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `--page`<br>`--cursor` | `string` | | Page token |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin-groups-members-add.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ gog admin groups members add (invite) <groupEmail> <memberEmail> [flags]
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--role` | `string` | MEMBER | Member role (MEMBER, MANAGER, OWNER) |
| `--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. |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin-groups-members-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ gog admin groups members list (ls) <groupEmail> [flags]
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `--page`<br>`--cursor` | `string` | | Page token |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin-groups-members-remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ gog admin groups members remove (rm,del,delete) <groupEmail> <memberEmail>
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin-groups-members.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ gog admin groups members <command>
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin-groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ gog admin groups <command>
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin-orgunits-create.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ gog admin orgunits (org-units,ou) create (add,new) <name> [flags]
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `--parent` | `string` | / | Parent org unit path |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin-orgunits-delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ gog admin orgunits (org-units,ou) delete (rm,del,remove) <path>
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin-orgunits-get.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ gog admin orgunits (org-units,ou) get (info,show) <path>
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin-orgunits-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ gog admin orgunits (org-units,ou) list (ls) [flags]
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `--parent` | `string` | / | Parent org unit path or ID |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `--type` | `string` | children | Return all descendants, children, or all including parent |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin-orgunits-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ gog admin orgunits (org-units,ou) update (edit,set) <path> [flags]
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `--parent` | `*string` | | New parent org unit path |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin-orgunits.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ gog admin orgunits (org-units,ou) <command>
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin-users-create.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ gog admin users create (add,new) <email> [flags]
| `--org-unit`<br>`--ou` | `string` | | Organization unit path |
| `--password`<br>`--pass` | `string` | | Initial password (generated if omitted) |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--recovery-email` | `string` | | Recovery email address |
| `--recovery-phone` | `string` | | Recovery phone number in E.164 format |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin-users-delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ gog admin users delete (rm,del,remove) <userEmail>
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin-users-get.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ gog admin users get (info,show) <userEmail>
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin-users-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ gog admin users list (ls) [flags]
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `--page`<br>`--cursor` | `string` | | Page token |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin-users-suspend.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ gog admin users suspend <userEmail>
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin-users.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ gog admin users <command>
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
Expand Down
1 change: 1 addition & 0 deletions docs/commands/gog-admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ gog admin <command> [flags]
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
| `--no-input`<br>`--non-interactive`<br>`--noninteractive` | `bool` | | Never prompt; fail instead (useful for CI) |
| `-p`<br>`--plain`<br>`--tsv` | `bool` | false | Output stable, parseable text to stdout (TSV; no colors) |
| `--readonly` | `bool` | false | Block mutating API requests at runtime; auth add also requests read-only OAuth scopes |
| `--results-only` | `bool` | | In JSON mode, emit only the primary result (drops envelope fields like nextPageToken) |
| `--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. |
| `-v`<br>`--verbose` | `bool` | | Enable verbose logging |
Expand Down
Loading
Loading