gws-drive-upload
googleworkspace/cli
Upload files to Google Drive with automatic MIME type detection and optional metadata.
What is gws-drive-upload?
Uploads a file to Google Drive with automatic MIME type detection. Use this when you need to programmatically transfer files to Drive, optionally specifying a parent folder or custom filename.
- Uploads a file to Google Drive from a local path
- Automatically detects MIME type based on file extension
- Allows specifying a parent folder ID for organization
- Supports custom target filename via --name flag
- Infers filename from local path if --name is not provided
How to install gws-drive-upload
npx skills add null --skill gws-drive-upload- gws CLI installed and configured
- Google Workspace authentication set up (see gws-shared/SKILL.md)
- Read access to gws-shared/SKILL.md for auth and global flags
How to use gws-drive-upload
- 1.Ensure the file path is correct and accessible locally
- 2.Run `gws drive +upload <file>` with the path to your file
- 3.Optionally add `--parent FOLDER_ID` to specify the destination folder
- 4.Optionally add `--name 'Custom Name'` to rename the file on upload
- 5.Confirm the upload when prompted (write operation)
Use cases
- Upload a report PDF to a specific Drive folder
- Batch upload CSV data files with custom names
- Transfer local documents to Drive as part of an automated workflow
- Upload files to a shared drive folder by parent ID
- Archive local files to Drive with renamed filenames
- Automation engineers building Drive workflows
- Teams managing document uploads programmatically
- Users integrating local file systems with Google Drive
- Developers building productivity tools
gws-drive-upload FAQ
MIME type is detected automatically based on the file extension.
The filename is inferred from the local file path, preserving the original name.
Yes, use the --parent flag with a folder ID to specify the destination.
This is a write command, so you will be prompted to confirm before execution.
See gws-drive/SKILL.md for all file, folder, and shared drive management commands.
Full instructions (SKILL.md)
Source of truth, from googleworkspace/cli.
name: gws-drive-upload description: "Google Drive: Upload a file with automatic metadata." metadata: version: 0.22.5 openclaw: category: "productivity" requires: bins: - gws cliHelp: "gws drive +upload --help"
drive +upload
PREREQUISITE: Read
../gws-shared/SKILL.mdfor auth, global flags, and security rules. If missing, rungws generate-skillsto create it.
Upload a file with automatic metadata
Usage
gws drive +upload <file>
Flags
| Flag | Required | Default | Description |
|---|---|---|---|
<file> | ✓ | — | Path to file to upload |
--parent | — | — | Parent folder ID |
--name | — | — | Target filename (defaults to source filename) |
Examples
gws drive +upload ./report.pdf
gws drive +upload ./report.pdf --parent FOLDER_ID
gws drive +upload ./data.csv --name 'Sales Data.csv'
Tips
- MIME type is detected automatically.
- Filename is inferred from the local path unless --name is given.
[!CAUTION] This is a write command — confirm with the user before executing.
See Also
- gws-shared — Global flags and auth
- gws-drive — All manage files, folders, and shared drives commands
Related skills
More from googleworkspace/cli and the wider catalog.
gws-gmail
Send, read, and manage Gmail emails via Google Workspace CLI.
gws-drive
Manage Google Drive files, folders, and shared drives via CLI.
gws-docs
Read and write Google Docs via command line.
gws-calendar
Manage Google Calendar events, calendars, and access control via CLI.
gws-sheets
Read and write Google Sheets spreadsheets via CLI.
gws-gmail-send
Send emails via Gmail with attachments, CC/BCC, HTML support, and draft options.