# google-drive > Manage Google Drive files and folders. Load when user mentions 'google drive', 'drive', 'upload file', 'download file', 'share file', 'create folder', or references cloud file storage operations. - Author: dorianschlede - Repository: DorianSchlede/nexus-template - Version: 20260202173543 - Stars: 6 - Forks: 1 - Last Updated: 2026-02-06 - Source: https://github.com/DorianSchlede/nexus-template - Web: https://mule.run/skillshub/@@DorianSchlede/nexus-template~google-drive:20260202173543 --- --- name: google-drive version: 1.0 description: "Manage Google Drive files and folders. Load when user mentions 'google drive', 'drive', 'upload file', 'download file', 'share file', 'create folder', or references cloud file storage operations." --- # Google Drive Upload, download, and manage files and folders in Google Drive via OAuth authentication. --- ## Pre-Flight Check (ALWAYS RUN FIRST) ```bash uv run python 00-system/skills/google/google-master/scripts/google_auth.py --check --service drive ``` **Exit codes:** - **0**: Ready to use - proceed with user request - **1**: Need to login - run `python3 00-system/skills/google/google-master/scripts/google_auth.py --login` - **2**: Missing credentials or dependencies - see [../google-master/references/setup-guide.md](../google-master/references/setup-guide.md) --- ## Quick Reference ### List Files (Root) ```bash uv run python 00-system/skills/google/google-drive/scripts/drive_operations.py list ``` ### List Files in Folder ```bash uv run python 00-system/skills/google/google-drive/scripts/drive_operations.py list --folder ``` ### Search Files ```bash uv run python 00-system/skills/google/google-drive/scripts/drive_operations.py search "report" ``` ### Get File Info ```bash uv run python 00-system/skills/google/google-drive/scripts/drive_operations.py info ``` ### Download File ```bash uv run python 00-system/skills/google/google-drive/scripts/drive_operations.py download --output ./local_file.pdf ``` ### Download Google Doc as PDF ```bash uv run python 00-system/skills/google/google-drive/scripts/drive_operations.py download --format pdf ``` ### Upload File ```bash uv run python 00-system/skills/google/google-drive/scripts/drive_operations.py upload ./local_file.pdf --folder ``` ### Create Folder ```bash uv run python 00-system/skills/google/google-drive/scripts/drive_operations.py create-folder "New Folder" --parent ``` ### Move File ```bash uv run python 00-system/skills/google/google-drive/scripts/drive_operations.py move ``` ### Copy File ```bash uv run python 00-system/skills/google/google-drive/scripts/drive_operations.py copy --name "Copy of File" ``` ### Rename File ```bash uv run python 00-system/skills/google/google-drive/scripts/drive_operations.py rename "New Name" ``` ### Delete File (Trash) ```bash uv run python 00-system/skills/google/google-drive/scripts/drive_operations.py delete ``` ### Share File ```bash uv run python 00-system/skills/google/google-drive/scripts/drive_operations.py share user@example.com --role writer ``` ### Get Sharing Info ```bash uv run python 00-system/skills/google/google-drive/scripts/drive_operations.py sharing ``` --- ## File/Folder ID The ID is in the URL: ``` https://drive.google.com/file/d/[FILE_ID]/view https://drive.google.com/drive/folders/[FOLDER_ID] ``` --- ## Export Formats For Google Docs files, use `--format` when downloading: | File Type | Available Formats | |-----------|-------------------| | Google Docs | pdf, docx, txt, html | | Google Sheets | pdf, xlsx, csv | | Google Slides | pdf, pptx | --- ## Available Operations | Operation | Function | Description | |-----------|----------|-------------| | **List** | `list_files()` | List files in a folder | | **Search** | `search_files()` | Search by name | | **Info** | `get_file_info()` | Get file metadata | | **Download** | `download_file()` | Download to local | | **Upload** | `upload_file()` | Upload from local | | **Create Folder** | `create_folder()` | Create new folder | | **Move** | `move_file()` | Move to different folder | | **Copy** | `copy_file()` | Duplicate a file | | **Rename** | `rename_file()` | Change name | | **Delete** | `delete_file()` | Move to trash | | **Share** | `share_file()` | Share with user | | **Sharing** | `get_sharing_info()` | Get permissions | --- ## Sharing Roles | Role | Permissions | |------|-------------| | `reader` | View only | | `commenter` | View and comment | | `writer` | View, comment, and edit | --- ## Error Handling See [../google-master/references/error-handling.md](../google-master/references/error-handling.md) for common errors and solutions. --- ## Setup First-time setup: [../google-master/references/setup-guide.md](../google-master/references/setup-guide.md) **Quick start:** 1. `pip install google-auth google-auth-oauthlib google-api-python-client` 2. Create OAuth credentials in Google Cloud Console (enable Google Drive API, choose "Desktop app") 3. Add to `.env` file at Nexus root: ``` GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com GOOGLE_CLIENT_SECRET=your-client-secret GOOGLE_PROJECT_ID=your-project-id ``` 4. Run `python3 00-system/skills/google/google-master/scripts/google_auth.py --login`