# google-drive > List, search, download, upload, and manage Google Drive files - Author: KIrill Enkogu - Repository: enkogu/pipeline-fullstack-app - Version: 20260125155958 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/enkogu/pipeline-fullstack-app - Web: https://mule.run/skillshub/@@enkogu/pipeline-fullstack-app~google-drive:20260125155958 --- --- name: google-drive description: List, search, download, upload, and manage Google Drive files python_requires: - google-api-python-client - google-auth - google-auth-oauthlib requires_oauth: - drive --- # Google Drive Skill ## ⚠️ SCRIPT NAMES - These Do NOT Exist Do NOT guess script names. These common mistakes will fail: | ❌ WRONG (doesn't exist) | ✅ CORRECT (use this) | |--------------------------|----------------------| | find-files.py | search-files.py | | get-files.py | list-files.py | | fetch-file.py | download-file.py | | get-file.py | download-file.py | | create-file.py | upload-file.py | | new-folder.py | create-folder.py | | make-folder.py | create-folder.py | | list-folder.py | list-files.py | | get-folder.py | list-files.py | | search-folders.py | search-files.py (use type "folder") | ## File Storage Location All downloaded files are saved to: `~/.standi/downloads/drive/` The script returns the absolute `file_path` in the response - use that path for subsequent operations (upload, read, process). ## Script Comparison - Choose the Right Script ### List vs Search | Script | Purpose | Input | When to Use | |--------|---------|-------|-------------| | `list-files.py` | List N most recent files | INTEGER (count) | "Show me my recent files" | | `search-files.py` | Find files by name | STRING (query) | "Find a folder named X" | **Common mistake**: Passing a folder name to `list-files.py`: - ❌ `list-files.py "All invoices"` → ValueError (expects integer) - ✅ `search-files.py "All invoices" folder` → Finds folder by name ## Common Mistakes 1. **Confusing list-files vs search-files**: - `list-files.py` → Takes INTEGER count, returns recent files by date - `search-files.py` → Takes STRING query, finds files by name 2. **upload-file argument order** - param names: `path`, `folder_id`, `custom_name`: - ✅ Positional: `["/file.pdf", "folder_id"]` → Upload with original filename - ✅ Positional: `["/file.pdf", "folder_id", "custom.pdf"]` → Upload with custom name - ✅ JSON object: `{"path": "/file.pdf", "folder_id": "abc123", "custom_name": "Invoice.pdf"}` ## Commands ### List Files (Recent Files by Count) ``` run_skill("google-drive/list-files.py", "") # Default: 20 recent files run_skill("google-drive/list-files.py", "50") # 50 recent files ``` **Note**: This lists files sorted by modification time, NOT by name. Use search-files.py to find by name. ### Search Files (Find by Name) Param names: `query`, `type` ⚠️ **IMPORTANT**: Query should be a **SIMPLE SEARCH TERM**, not Google Drive API syntax! The script automatically wraps your query with `name contains '...'`. - ✅ **CORRECT**: `"Founding Engineer"` → Script builds: `name contains 'Founding Engineer'` - ❌ **WRONG**: `"name contains 'Founding Engineer'"` → Double-wrapped, causes API error ``` # Positional format: run_skill("google-drive/search-files.py", "") run_skill("google-drive/search-files.py", '["", ""]') # JSON object format (RECOMMENDED): run_skill("google-drive/search-files.py", '{"query": "search term", "type": "folder"}') ``` File types: document, spreadsheet, presentation, pdf, folder **Examples:** ``` # Find any file containing "invoice" (single arg) run_skill("google-drive/search-files.py", "invoice") # Find a folder named "All invoices" - JSON object (recommended) run_skill("google-drive/search-files.py", '{"query": "All invoices", "type": "folder"}') # Find a spreadsheet containing "2025" run_skill("google-drive/search-files.py", '{"query": "2025", "type": "spreadsheet"}') # Multi-word search without file type filter run_skill("google-drive/search-files.py", "Project Report 2025") run_skill("google-drive/search-files.py", '{"query": "Project Report 2025"}') ``` ### Download File Param names: `file_id`, `path` ``` # Positional format: run_skill("google-drive/download-file.py", "") run_skill("google-drive/download-file.py", '["", ""]') # JSON object format: run_skill("google-drive/download-file.py", '{"file_id": "abc123", "path": "/local/output.pdf"}') ``` - Google Docs → PDF - Google Sheets → CSV - Google Slides → PDF - Other files → original format ### Upload File Param names: `path`, `folder_id`, `custom_name` ``` # Positional format: run_skill("google-drive/upload-file.py", "") run_skill("google-drive/upload-file.py", '["", ""]') run_skill("google-drive/upload-file.py", '["", "", ""]') # JSON object format (RECOMMENDED): run_skill("google-drive/upload-file.py", '{"path": "/file.pdf", "folder_id": "abc123"}') run_skill("google-drive/upload-file.py", '{"path": "/file.pdf", "folder_id": "abc123", "custom_name": "Invoice.pdf"}') ``` **Examples:** ``` # Upload to root with original filename run_skill("google-drive/upload-file.py", "/path/to/file.pdf") # Upload to specific folder (positional) run_skill("google-drive/upload-file.py", '["/path/to/file.pdf", "1abc123_folder_id"]') # Upload with custom filename (JSON object - recommended) run_skill("google-drive/upload-file.py", '{"path": "/path/to/temp_file.pdf", "folder_id": "1abc123_folder_id", "custom_name": "Invoice_2025-12-18.pdf"}') ``` ### Create Folder Param names: `name`, `parent_id` ``` # Positional format: run_skill("google-drive/create-folder.py", "") run_skill("google-drive/create-folder.py", '["", ""]') # JSON object format: run_skill("google-drive/create-folder.py", '{"name": "Folder Name", "parent_id": "abc123"}') ``` **Examples:** ``` run_skill("google-drive/create-folder.py", "Invoices") # Single word name run_skill("google-drive/create-folder.py", '["All Invoices 2025"]') # Multi-word name run_skill("google-drive/create-folder.py", '{"name": "My Folder", "parent_id": "10656zbixdlonwZ0-wcXj38JIjVDG0__B"}') # With parent (JSON object) ``` ### Share File ``` run_skill("google-drive/share-file.py", '["", "", ""]') ``` Role: reader, writer, or commenter ### Delete File ``` run_skill("google-drive/delete-file.py", "") run_skill("google-drive/delete-file.py", '["", "permanent:true"]') ``` Default: move to trash. Use `permanent:true` to permanently delete. ### Move File ``` run_skill("google-drive/move-file.py", '["", ""]') ``` ### Rename File ``` run_skill("google-drive/rename-file.py", '["", ""]') ``` Example: `run_skill("google-drive/rename-file.py", '["abc123", "My New Document.pdf"]')` ### Get File Info ``` run_skill("google-drive/get-file-info.py", "") ``` ### Get Storage Info ``` run_skill("google-drive/get-storage-info.py", "") ``` Returns storage quota, usage, and user information. ### Empty Trash ``` run_skill("google-drive/empty-trash.py", "confirm") ``` Permanently deletes all files in trash. Must pass 'confirm' to execute. ## Notes - All scripts output JSON to stdout