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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- Docs: add `docs insert-image --url` for inserting public HTTPS images directly without Drive upload or temporary public sharing. (#675) — thanks @sebsnyk.
- Docs: expose paragraph emptiness and text-run ranges, styles, and links in `docs paragraphs list --json`. (#734) — thanks @sebsnyk.
- Docs: add opt-in `--check-orphans` to Markdown replacement writes so open comments whose quoted text would disappear block the mutation with orphaned exit code 11. (#691) — thanks @sebsnyk.
- Drive: add `drive revisions list|get` for paged revision metadata and provider export links. (#672) — thanks @aaroneden.

### Fixed

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ gog calendar appointments
Docs: [Drive audits](docs/drive-audits.md), [raw API dumps](docs/raw-api.md),
[`gog drive`](docs/commands/gog-drive.md),
[`drive changes`](docs/commands/gog-drive-changes.md),
[`drive revisions`](docs/commands/gog-drive-revisions.md),
[`drive activity`](docs/commands/gog-drive-activity.md).

```bash
Expand All @@ -203,8 +204,13 @@ gog drive get <fileId> --fields 'id,name,mimeType,size,owners,emailAddress' --js
# Track changes and audit activity.
gog drive changes start-token
gog drive changes list --token <token> --json
gog drive revisions list <fileId> --all --json
gog drive revisions get <fileId> <revisionId> --json
gog drive activity query --file <fileId> --actions edit,share --from 2026-01-01T00:00:00Z --json

# The Drive API exposes revision metadata and provider export links. For native
# Docs Editors files, it does not expose complete editor history or historical bodies.

# Lossless raw API JSON.
gog drive raw <fileId> --pretty
```
Expand Down
3 changes: 3 additions & 0 deletions docs/commands.generated.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ Generated from `gog schema --json`.
- [`gog drive (drv) permissions <fileId> [flags]`](commands/gog-drive-permissions.md) - List permissions on a file
- [`gog drive (drv) raw <fileId> [flags]`](commands/gog-drive-raw.md) - Dump raw Google Drive API response as JSON (Files.Get; lossless; for scripting and LLM consumption)
- [`gog drive (drv) rename <fileId> <newName>`](commands/gog-drive-rename.md) - Rename a file or folder
- [`gog drive (drv) revisions (revision) <command>`](commands/gog-drive-revisions.md) - List and inspect file revisions
- [`gog drive (drv) revisions (revision) get <fileId> <revisionId>`](commands/gog-drive-revisions-get.md) - Get revision metadata
- [`gog drive (drv) revisions (revision) list (ls) <fileId> [flags]`](commands/gog-drive-revisions-list.md) - List revisions for a file
- [`gog drive (drv) search <query> ... [flags]`](commands/gog-drive-search.md) - Full-text search across Drive
- [`gog drive (drv) share <fileId> [flags]`](commands/gog-drive-share.md) - Share a file or folder
- [`gog drive (drv) tree [flags]`](commands/gog-drive-tree.md) - Print a read-only folder tree
Expand Down
5 changes: 4 additions & 1 deletion docs/commands/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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.

Generated pages: 615.
Generated pages: 618.

## Top-level Commands

Expand Down Expand Up @@ -380,6 +380,9 @@ Generated pages: 615.
- [gog drive permissions](gog-drive-permissions.md) - List permissions on a file
- [gog drive raw](gog-drive-raw.md) - Dump raw Google Drive API response as JSON (Files.Get; lossless; for scripting and LLM consumption)
- [gog drive rename](gog-drive-rename.md) - Rename a file or folder
- [gog drive revisions](gog-drive-revisions.md) - List and inspect file revisions
- [gog drive revisions get](gog-drive-revisions-get.md) - Get revision metadata
- [gog drive revisions list](gog-drive-revisions-list.md) - List revisions for a file
- [gog drive search](gog-drive-search.md) - Full-text search across Drive
- [gog drive share](gog-drive-share.md) - Share a file or folder
- [gog drive tree](gog-drive-tree.md) - Print a read-only folder tree
Expand Down
45 changes: 45 additions & 0 deletions docs/commands/gog-drive-revisions-get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# `gog drive revisions get`

> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.

Get revision metadata

## Usage

```bash
gog drive (drv) revisions (revision) get <fileId> <revisionId>
```

## Parent

- [gog drive revisions](gog-drive-revisions.md)

## Flags

| Flag | Type | Default | Help |
| --- | --- | --- | --- |
| `--access-token` | `string` | | Use provided access token directly (bypasses stored refresh tokens; token expires in ~1h) |
| `-a`<br>`--account`<br>`--acct` | `string` | | Account email for API commands (gmail/calendar/chat/classroom/drive/drivelabels/docs/slides/contacts/tasks/people/sheets/forms/sites/appscript/analytics/searchconsole/youtube/photos) |
| `--client` | `string` | | OAuth client name (selects stored credentials + token bucket) |
| `--color` | `string` | auto | Color output: auto\|always\|never |
| `--disable-commands` | `string` | | Comma-separated list of disabled commands; dot paths allowed |
| `-n`<br>`--dry-run`<br>`--dryrun`<br>`--noop`<br>`--preview` | `bool` | | Do not make changes; print intended actions and exit successfully |
| `--enable-commands` | `string` | | Comma-separated list of enabled command prefixes; dot paths allowed (restricts CLI) |
| `--enable-commands-exact` | `string` | | Comma-separated list of exact enabled commands; dot paths allowed and parent commands do not enable children |
| `-y`<br>`--force`<br>`--assume-yes`<br>`--yes` | `bool` | | Skip confirmations for destructive commands |
| `--gmail-no-send` | `bool` | false | Block Gmail send operations (agent safety) |
| `-h`<br>`--help` | `kong.helpFlag` | | Show context-sensitive help. |
| `--home` | `string` | | Override gogcli config/data/state/cache root (equivalent to GOG_HOME) |
| `-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) |
| `--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 |
| `--version` | `kong.VersionFlag` | | Print version and exit |
| `--wrap-untrusted` | `bool` | false | In JSON/raw output, wrap fetched text fields in external untrusted-content markers |

## See Also

- [gog drive revisions](gog-drive-revisions.md)
- [Command index](README.md)
49 changes: 49 additions & 0 deletions docs/commands/gog-drive-revisions-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# `gog drive revisions list`

> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.

List revisions for a file

## Usage

```bash
gog drive (drv) revisions (revision) list (ls) <fileId> [flags]
```

## Parent

- [gog drive revisions](gog-drive-revisions.md)

## Flags

| Flag | Type | Default | Help |
| --- | --- | --- | --- |
| `--access-token` | `string` | | Use provided access token directly (bypasses stored refresh tokens; token expires in ~1h) |
| `-a`<br>`--account`<br>`--acct` | `string` | | Account email for API commands (gmail/calendar/chat/classroom/drive/drivelabels/docs/slides/contacts/tasks/people/sheets/forms/sites/appscript/analytics/searchconsole/youtube/photos) |
| `--all`<br>`--all-pages`<br>`--allpages` | `bool` | | Fetch all pages |
| `--client` | `string` | | OAuth client name (selects stored credentials + token bucket) |
| `--color` | `string` | auto | Color output: auto\|always\|never |
| `--disable-commands` | `string` | | Comma-separated list of disabled commands; dot paths allowed |
| `-n`<br>`--dry-run`<br>`--dryrun`<br>`--noop`<br>`--preview` | `bool` | | Do not make changes; print intended actions and exit successfully |
| `--enable-commands` | `string` | | Comma-separated list of enabled command prefixes; dot paths allowed (restricts CLI) |
| `--enable-commands-exact` | `string` | | Comma-separated list of exact enabled commands; dot paths allowed and parent commands do not enable children |
| `--fail-empty`<br>`--non-empty`<br>`--require-results` | `bool` | | Exit with code 3 if no revisions |
| `-y`<br>`--force`<br>`--assume-yes`<br>`--yes` | `bool` | | Skip confirmations for destructive commands |
| `--gmail-no-send` | `bool` | false | Block Gmail send operations (agent safety) |
| `-h`<br>`--help` | `kong.helpFlag` | | Show context-sensitive help. |
| `--home` | `string` | | Override gogcli config/data/state/cache root (equivalent to GOG_HOME) |
| `-j`<br>`--json`<br>`--machine` | `bool` | false | Output JSON to stdout (best for scripting) |
| `--max`<br>`--limit` | `int64` | 200 | Max results |
| `--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) |
| `--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 |
| `--version` | `kong.VersionFlag` | | Print version and exit |
| `--wrap-untrusted` | `bool` | false | In JSON/raw output, wrap fetched text fields in external untrusted-content markers |

## See Also

- [gog drive revisions](gog-drive-revisions.md)
- [Command index](README.md)
50 changes: 50 additions & 0 deletions docs/commands/gog-drive-revisions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# `gog drive revisions`

> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.

List and inspect file revisions

## Usage

```bash
gog drive (drv) revisions (revision) <command>
```

## Parent

- [gog drive](gog-drive.md)

## Subcommands

- [gog drive revisions get](gog-drive-revisions-get.md) - Get revision metadata
- [gog drive revisions list](gog-drive-revisions-list.md) - List revisions for a file

## Flags

| Flag | Type | Default | Help |
| --- | --- | --- | --- |
| `--access-token` | `string` | | Use provided access token directly (bypasses stored refresh tokens; token expires in ~1h) |
| `-a`<br>`--account`<br>`--acct` | `string` | | Account email for API commands (gmail/calendar/chat/classroom/drive/drivelabels/docs/slides/contacts/tasks/people/sheets/forms/sites/appscript/analytics/searchconsole/youtube/photos) |
| `--client` | `string` | | OAuth client name (selects stored credentials + token bucket) |
| `--color` | `string` | auto | Color output: auto\|always\|never |
| `--disable-commands` | `string` | | Comma-separated list of disabled commands; dot paths allowed |
| `-n`<br>`--dry-run`<br>`--dryrun`<br>`--noop`<br>`--preview` | `bool` | | Do not make changes; print intended actions and exit successfully |
| `--enable-commands` | `string` | | Comma-separated list of enabled command prefixes; dot paths allowed (restricts CLI) |
| `--enable-commands-exact` | `string` | | Comma-separated list of exact enabled commands; dot paths allowed and parent commands do not enable children |
| `-y`<br>`--force`<br>`--assume-yes`<br>`--yes` | `bool` | | Skip confirmations for destructive commands |
| `--gmail-no-send` | `bool` | false | Block Gmail send operations (agent safety) |
| `-h`<br>`--help` | `kong.helpFlag` | | Show context-sensitive help. |
| `--home` | `string` | | Override gogcli config/data/state/cache root (equivalent to GOG_HOME) |
| `-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) |
| `--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 |
| `--version` | `kong.VersionFlag` | | Print version and exit |
| `--wrap-untrusted` | `bool` | false | In JSON/raw output, wrap fetched text fields in external untrusted-content markers |

## See Also

- [gog drive](gog-drive.md)
- [Command index](README.md)
1 change: 1 addition & 0 deletions docs/commands/gog-drive.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ gog drive (drv) <command> [flags]
- [gog drive permissions](gog-drive-permissions.md) - List permissions on a file
- [gog drive raw](gog-drive-raw.md) - Dump raw Google Drive API response as JSON (Files.Get; lossless; for scripting and LLM consumption)
- [gog drive rename](gog-drive-rename.md) - Rename a file or folder
- [gog drive revisions](gog-drive-revisions.md) - List and inspect file revisions
- [gog drive search](gog-drive-search.md) - Full-text search across Drive
- [gog drive share](gog-drive-share.md) - Share a file or folder
- [gog drive tree](gog-drive-tree.md) - Print a read-only folder tree
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/backup_drive_collaboration.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func fetchBackupDriveRevisions(ctx context.Context, svc *drive.Service, fileID s
for {
call := svc.Revisions.List(fileID).
PageSize(200).
Fields(gapi.Field("nextPageToken, revisions(id,mimeType,modifiedTime,keepForever,published,publishAuto,publishedOutsideDomain,publishedLink,lastModifyingUser,md5Checksum,size,originalFilename,exportLinks)")).
Fields(gapi.Field(driveRevisionListFields)).
Context(ctx)
if pageToken != "" {
call = call.PageToken(pageToken)
Expand Down
1 change: 1 addition & 0 deletions internal/cmd/drive.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ type DriveCmd struct {
URL DriveURLCmd `cmd:"" name:"url" help:"Print web URLs for files"`
Comments DriveCommentsCmd `cmd:"" name:"comments" help:"Manage comments on files"`
Drives DriveDrivesCmd `cmd:"" name:"drives" help:"List shared drives (Team Drives)"`
Revisions DriveRevisionsCmd `cmd:"" name:"revisions" aliases:"revision" help:"List and inspect file revisions"`
Changes DriveChangesCmd `cmd:"" name:"changes" help:"Track Drive changes for sync and automation"`
Activity DriveActivityCmd `cmd:"" name:"activity" help:"Query Drive Activity audit events"`
Raw DriveRawCmd `cmd:"" name:"raw" help:"Dump raw Google Drive API response as JSON (Files.Get; lossless; for scripting and LLM consumption)"`
Expand Down
Loading
Loading