Skip to content

feat: Add --include-shared flag to drive list command#9

Merged
shahariaazam merged 2 commits intomainfrom
feat/drive-include-shared-files
Dec 5, 2025
Merged

feat: Add --include-shared flag to drive list command#9
shahariaazam merged 2 commits intomainfrom
feat/drive-include-shared-files

Conversation

@shahariaazam
Copy link
Copy Markdown
Member

Summary

  • Added --include-shared flag to the drive list command to allow listing files shared with the authenticated user
  • This enhancement enables users to access collaborative documents that are shared with them but not in their Drive folders
  • Particularly useful for AI agents and automation tools that need access to shared documents

Changes Made

  • Added --include-shared option to drive list command with descriptive help text
  • Updated listFiles function in src/lib/drive.ts to support shared files using Google Drive API's corpora: 'allDrives' parameter
  • Updated README.md with usage examples showing the new flag in both the main commands section and AI use cases section

Usage Example

# List files including those shared with you
gscli drive list --include-shared --limit 20

# List only files in your Drive folders (default behavior)
gscli drive list --limit 10

Test Plan

  • Built the project successfully
  • Tested --include-shared flag and verified it returns shared files
  • Tested default behavior (without flag) to ensure backward compatibility
  • Verified help text displays correctly
  • Updated documentation in README.md

## Summary
- Added support for embedding Google OAuth2 credentials during build-time
- Updated credential loading priority to include build-time injected environment variables
- Added custom build scripts for different platforms

## Changes
- Auth priority updated to:
  1. Saved `credentials.json`
  2. Build-time injected env variables (`GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET`)
  3. Path specified in `GOOGLE_CLIENT_CREDENTIAL_FILE`
  4. `./client.json` in the current directory
- `package.json`: Added custom build scripts for embedding credentials
- `README.md`: Documented custom build options and security considerations

## Benefits
- Simplifies
This enhancement allows users to list files that are shared with them in addition to files in their Drive folders.

Changes:
- Added --include-shared option to drive list command with clear help text
- Updated listFiles function to support shared files using corpora: 'allDrives'
- Updated README.md with usage examples for the new flag

The flag is particularly useful for AI agents and automation tools that need access to collaborative documents shared with the authenticated user.
@shahariaazam shahariaazam merged commit 2cabd6a into main Dec 5, 2025
1 check passed
@shahariaazam shahariaazam deleted the feat/drive-include-shared-files branch December 5, 2025 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant