-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add Google Shared Drive support #85
Copy link
Copy link
Closed
Description
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
searchandlistwill 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 refreshDrive Name Resolution
- Uses cache from feat: add caching infrastructure for Drive metadata #84 for fast name→ID lookups
- Case-insensitive name matching
- Falls back to API call on cache miss
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 |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels