Free SKILL.md scraped from GitHub. Clone the repo or copy the file directly into your Claude Code skills directory.
npx versuz@latest install vivekkarmarkar-claude-code-os-skills-uploadgit clone https://github.com/VivekKarmarkar/claude-code-os.gitcp claude-code-os/SKILL.MD ~/.claude/skills/vivekkarmarkar-claude-code-os-skills-upload/SKILL.md---
name: upload
description: Upload files to Google Drive using the GWS CLI. Use this skill whenever the user wants to upload a file to Google Drive, says "upload this", "put this on Drive", "save to Drive", "upload to Google Drive", "push this to Drive", "back this up to Drive", or references uploading, storing, or sharing files via Google Drive. Also triggers on "/upload". Handles folder targeting, folder creation, and multiple file uploads. Asks clarifying questions when the destination matters.
---
# Upload — Google Drive (GWS CLI)
You upload files from the local filesystem to the user's Google Drive. This involves figuring out WHAT to upload and WHERE to put it.
## Philosophy
Uploads have more ambiguity than email — "upload this" could mean root Drive, a specific folder, or a folder that needs to be created first. Use context clues aggressively, but when the destination genuinely matters (work files, shared folders), ask rather than guess wrong. A file in the wrong folder is worse than a quick question.
## Workflow
### Step 1: Figure out what to upload
Determine from context:
- **Which file(s)?** Look for file paths mentioned in conversation, recently created files, or ask. Verify the file exists on disk before proceeding.
- **File name on Drive** — default to the local filename unless the user specified something else.
### Step 2: Figure out where to put it
This is where judgment matters. Check context for clues:
**Clear destination** — user said "upload to the Reports folder" or "put it in Shared/Projects":
- Search for the folder (Step 3a)
- If not found, ask: "I can't find a folder called 'Reports'. Want me to create it, or upload to a different location?"
**No destination specified** — user just said "upload this to Drive":
- If the file type or context suggests a logical home (e.g., a presentation probably goes somewhere specific), ask: "Where on Drive should this go? A specific folder, or just the root?"
- If it's clearly a quick one-off (e.g., sharing a screenshot), upload to root Drive without asking.
**Folder needs to be created** — user said "create a folder called X and upload there":
- Create the folder first (Step 3b), then upload into it.
### Step 3a: Find a folder
Search for an existing folder by name:
```bash
gws drive files list --params '{"q": "name = '\''FolderName'\'' and mimeType = '\''application/vnd.google-apps.folder'\'' and trashed = false", "fields": "files(id, name, parents)", "spaces": "drive"}'
```
If multiple folders match, show the user the options with their paths and ask which one.
If looking for a nested path like "Projects/2026/Reports":
1. Find "Projects" first
2. Then search within it: `"name = '2026' and mimeType = 'application/vnd.google-apps.folder' and '<projects-id>' in parents and trashed = false"`
3. Then find "Reports" within that
### Step 3b: Create a folder
```bash
gws drive files create --json '{"name": "FolderName", "mimeType": "application/vnd.google-apps.folder", "parents": ["<parent-folder-id>"]}'
```
Omit `parents` to create at root. For nested folder creation ("Projects/2026/Reports"), create each level in sequence, using the previous folder's ID as the parent.
### Step 4: Upload the file
```bash
gws drive files create --json '{"name": "filename.pdf", "parents": ["<folder-id>"]}' --upload "/absolute/path/to/local/file.pdf"
```
- Omit `parents` to upload to root Drive
- The `--upload` flag takes the absolute local file path
- MIME type is auto-detected from extension
### Step 5: Confirm
After upload, report:
- File name
- Location on Drive (folder name or "root")
- File ID (useful for sharing links)
- Shareable link if the user might want to share it
Example: "Uploaded `report.pdf` to Drive > Reports. File ID: `1abc...xyz`"
## Multiple files
If the user wants to upload several files:
1. List what you'll upload and where
2. Upload each file, reporting progress
3. Summarize at the end
## Sharing after upload
If the user says "upload and share with X" or "upload and get a link":
To make a file shareable by link:
```bash
gws drive permissions create --params '{"fileId": "<file-id>"}' --json '{"role": "reader", "type": "anyone"}'
```
Then get the web view link:
```bash
gws drive files get --params '{"fileId": "<file-id>", "fields": "webViewLink"}'
```
To share with a specific person:
```bash
gws drive permissions create --params '{"fileId": "<file-id>"}' --json '{"role": "writer", "type": "user", "emailAddress": "person@example.com"}'
```
## Common patterns
- **"Upload the PDF I just made"** → look for recently created/discussed PDF in conversation context
- **"Upload this to the shared folder"** → search for folders with "shared" in the name, or ask which one
- **"Back up my presentation"** → look for .pptx files discussed in session, upload to root or ask
- **"Upload and send the link to Adi"** → upload, create sharing permission, compose email with link (chains with /email skill)
## If GWS auth fails
Tell the user: "Google Drive auth is expired. Run `! gws auth login` to re-authenticate."