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-sharegit clone https://github.com/VivekKarmarkar/claude-code-os.gitcp claude-code-os/SKILL.MD ~/.claude/skills/vivekkarmarkar-claude-code-os-skills-share/SKILL.md---
name: share
description: Share a file from Google Drive with a specific email address using the GWS CLI. Use when the user says "share this with", "give access to", "share the file with", "let X see this", "send X access", or any variation of sharing a Drive file with someone. Also triggers on "/share". Takes an email address as argument — e.g. "/share adi@example.com".
---
# Share — Google Drive File Sharing (GWS CLI)
You share files on Google Drive with specific people by email. The user provides an email address (and optionally a file reference) and you make it happen.
## Philosophy
Sharing should be instant. The user says "share with X" and the file gets shared. Infer which file from context — recently uploaded, recently discussed, recently created. Only ask if there's genuine ambiguity about WHICH file.
## Arguments
The skill takes an email address as the primary argument:
- `/share adi@example.com` — share the contextually obvious file
- `/share adi@example.com the report PDF` — share a specific file
- `/share adi@example.com writer` — share with edit access
## Workflow
### Step 1: Identify the file
Determine which file to share from context:
**Clear from conversation** — a file was just uploaded, just discussed, or the user named it:
- Use the file ID if you have it from a recent upload
- Otherwise search for it on Drive (Step 2)
**Ambiguous** — multiple files could match:
- Ask: "Which file? I see [list recent candidates]"
**User specified a filename**:
- Search Drive for it (Step 2)
### Step 2: Find the file on Drive (if needed)
```bash
gws drive files list --params '{"q": "name contains '\''filename'\'' and trashed = false", "fields": "files(id, name, mimeType, modifiedTime)", "spaces": "drive", "orderBy": "modifiedTime desc", "pageSize": 5}'
```
If multiple results, show them and ask which one. If one result, proceed.
### Step 3: Determine access level
Default to **reader** (view only) unless:
- The user said "edit access", "writer", "let them edit", "full access" → use **writer**
- The user said "commenter" → use **commenter**
- Context suggests collaboration (e.g., "share the doc so we can work on it together") → use **writer**
### Step 4: Share the file
```bash
gws drive permissions create --params '{"fileId": "<file-id>"}' --json '{"role": "<role>", "type": "user", "emailAddress": "<email>"}'
```
Where `<role>` is one of: `reader`, `writer`, `commenter`.
**Do NOT ask for confirmation. Just share it.**
### Step 5: Get the shareable link
```bash
gws drive files get --params '{"fileId": "<file-id>", "fields": "webViewLink, name"}'
```
### Step 6: Report
Brief confirmation:
```
Shared "filename.pdf" with adi@example.com (view access).
Link: https://drive.google.com/file/d/...
```
## Sharing with multiple people
If the user provides multiple emails:
- `/share adi@example.com, bob@example.com`
- Share with each in sequence, report all at the end
## Making a file public (link sharing)
If the user says "make it public", "anyone with the link", "shareable link":
```bash
gws drive permissions create --params '{"fileId": "<file-id>"}' --json '{"role": "reader", "type": "anyone"}'
```
Then get and return the webViewLink.
## Sharing a folder
Works the same way — folders have file IDs too. Search with:
```bash
gws drive files list --params '{"q": "name = '\''FolderName'\'' and mimeType = '\''application/vnd.google-apps.folder'\'' and trashed = false", "fields": "files(id, name)", "spaces": "drive"}'
```
Then share with the same permissions create command.
## If GWS auth fails
Tell the user: "Google Drive auth is expired. Run `! gws auth login` to re-authenticate."