Overview
Thegws drive +upload helper command simplifies uploading files to Google Drive by automatically detecting MIME types and handling metadata. It wraps the Drive API’s files.create method with intelligent defaults.
Command Syntax
Parameters
Path to the local file to upload
Parent folder ID where the file should be uploaded. If not specified, the file is uploaded to the root of “My Drive”
Target filename in Drive. If not specified, uses the source filename from the local path
Examples
Basic upload
Upload a file to the root of My Drive:Upload to specific folder
Upload a file to a specific parent folder:Upload with custom name
Upload a file with a different name than the source:Combined options
Output Format
Returns a JSON object containing the uploaded file’s metadata:How It Works
- MIME Type Detection: Automatically detects the file’s MIME type based on its extension
- Filename Handling: Uses the source filename unless
--nameis provided - Metadata Building: Constructs the required metadata JSON with
nameand optionalparentsfields - Upload: Executes the Drive API
files.createmethod with multipart upload
Related
- gws-drive-upload skill — AI agent integration
- For more advanced upload options (custom properties, permissions), use the raw API: