Skip to content

feat: add Google Shared Drive support #85

@rianjs

Description

@rianjs

Summary

Add support for Google Shared Drives (formerly Team Drives) with ergonomic defaults. This is Phase 2 of shared drive support (depends on #84).

Motivation

Currently gro drive only searches/lists files in "My Drive". Many users have access to shared drives that contain important files. The CLI should search everywhere by default, with options to narrow scope.

Design

Default Behavior Change

  • search and list will search all drives by default (My Drive + shared drives)
  • This is a breaking change from current My Drive-only behavior

New Flags

--my-drive         Limit to My Drive only
--drive <name-id>  Search in specific shared drive (name or ID)

These flags are mutually exclusive.

New Command

gro drive drives              # List available shared drives
gro drive drives --json       # JSON output
gro drive drives --refresh    # Force cache refresh

Drive Name Resolution

API Requirements

Parameter Purpose
supportsAllDrives=true Must be in ALL requests
includeItemsFromAllDrives=true Include shared drive results
corpora "user", "drive", or "allDrives"
driveId Required when corpora="drive"

No additional OAuth scopes needed - drive.readonly covers shared drives.

Files to Create/Modify

File Changes
internal/drive/files.go Add SharedDrive, DriveScope types
internal/drive/interfaces.go Add new interface methods
internal/drive/client.go Implement shared drive methods
internal/cmd/drive/drives.go NEW - list shared drives
internal/cmd/drive/list.go Add --my-drive, --drive flags
internal/cmd/drive/search.go Add --my-drive, --drive flags
internal/cmd/drive/tree.go Add --my-drive, --drive flags
internal/cmd/drive/get.go Add SupportsAllDrives(true)
internal/cmd/drive/download.go Add SupportsAllDrives(true)
internal/cmd/drive/output.go Add resolveDriveScope() helper
README.md Document shared drive commands

Example Usage

# List available shared drives
gro drive drives

# Search everywhere (new default)
gro drive search "quarterly report"

# Search only My Drive
gro drive search "quarterly report" --my-drive

# Search specific shared drive by name
gro drive search "budget" --drive "Finance Team"

# List files in shared drive
gro drive list --drive "Engineering"

Behavior Summary

Command Current New Default --my-drive --drive "X"
list My Drive All drives My Drive Shared drive X
search My Drive All drives My Drive Shared drive X
tree My Drive All drives My Drive Shared drive X
get My Drive All drives N/A N/A
download My Drive All drives N/A N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions