google-drive
Interact with Google Drive API using PyDrive2 for uploading, downloading, searching, and managing files. Use when working with Google Drive operations including file transfers, metadata queries, search operations, folder management, batch operations, and sharing. Authentication is pre-configured at ~/.gdrivelm/. Includes helper scripts for common operations and comprehensive API references. Helper script automatically detects markdown formatting and sets appropriate MIME types.
What this skill does
## Prerequisites
**Required Python package:** `pydrive2` must be installed.
```bash
# Install with pip
pip install pydrive2
# OR with uv
uv pip install pydrive2
```
**Authentication:** Credentials must be configured at `~/.gdrivelm/`. See `references/auth_setup.md` for initial setup.
## Configuration
**Helper script path:**
```
/Users/wz/.claude/plugins/marketplaces/warren-claude-code-plugin-marketplace/claude-context-orchestrator/snippets/local/productivity/google-drive/scripts/gdrive_helper.py
```
**Authentication files** (use `~/.gdrivelm/` - expands to home directory):
- Credentials: `~/.gdrivelm/credentials.json`
- Settings: `~/.gdrivelm/settings.yaml`
- Token: `~/.gdrivelm/token.json` (auto-generated)
Load `references/auth_setup.md` for detailed authentication configuration.
## Helper Script Usage
Use `scripts/gdrive_helper.py` for common operations to avoid rewriting authentication and upload/download code.
### Import and Use Functions
```python
import sys
sys.path.insert(0, '/Users/wz/.claude/plugins/marketplaces/warren-claude-code-plugin-marketplace/claude-context-orchestrator/snippets/local/productivity/google-drive/scripts')
from gdrive_helper import authenticate, upload_file, download_file, search_files, get_metadata
# Authenticate once
drive = authenticate()
# Upload file
result = upload_file(drive, '/path/to/file.txt', title='My File')
print(f"Uploaded: {result['id']}")
# Search files
results = search_files(drive, "title contains 'report'")
for file in results:
print(f"{file['title']} - {file['id']}")
# Download file
download_file(drive, 'FILE_ID', '/path/to/save.txt')
# Get metadata
metadata = get_metadata(drive, 'FILE_ID')
print(f"Size: {metadata['size']} bytes")
```
### Available Helper Functions
- `authenticate()` - Authenticate and return Drive instance
- `upload_file(drive, local_path, title=None, folder_id=None)` - Upload local file
- `upload_string(drive, content, title, folder_id=None, use_markdown=None)` - Upload string content with auto-markdown detection
- `download_file(drive, file_id, local_path)` - Download file
- `get_file_content(drive, file_id)` - Get file content as string
- `get_metadata(drive, file_id)` - Get file metadata
- `search_files(drive, query, max_results=None)` - Search for files
- `delete_file(drive, file_id, permanent=False)` - Delete or trash file
- `create_folder(drive, folder_name, parent_id=None)` - Create folder
- `list_files_in_folder(drive, folder_id)` - List files in folder
### CLI Usage
The helper script can be used from command line. First ensure `pydrive2` is installed:
```bash
# Install pydrive2 if needed (one-time setup)
pip install pydrive2
# OR with uv:
uv pip install pydrive2
# Run commands directly (no cd or venv activation needed)
python /Users/wz/.claude/plugins/marketplaces/warren-claude-code-plugin-marketplace/claude-context-orchestrator/snippets/local/productivity/google-drive/scripts/gdrive_helper.py upload /path/to/file.txt
python /Users/wz/.claude/plugins/marketplaces/warren-claude-code-plugin-marketplace/claude-context-orchestrator/snippets/local/productivity/google-drive/scripts/gdrive_helper.py search "title contains 'report'"
python /Users/wz/.claude/plugins/marketplaces/warren-claude-code-plugin-marketplace/claude-context-orchestrator/snippets/local/productivity/google-drive/scripts/gdrive_helper.py download FILE_ID /path/to/save.txt
```
## File Type Handling
Google Drive files require different retrieval methods depending on their type:
### Google Docs/Sheets/Slides (Native Google Formats)
Native Google formats require **export** with a specific MIME type, not direct download:
```python
import sys
sys.path.insert(0, '/Users/wz/.claude/plugins/marketplaces/warren-claude-code-plugin-marketplace/claude-context-orchestrator/snippets/local/productivity/google-drive/scripts')
from gdrive_helper import authenticate
drive = authenticate()
# Extract file ID from URL
file_id = '1rX7KHFnHyoAu3KrIvQgv0gJdTvMztWJT-Pkx5x954vc'
# Create file object and fetch metadata
file = drive.CreateFile({'id': file_id})
file.FetchMetadata()
# Export with appropriate MIME type
content = file.GetContentString(mimetype='text/plain') # For Google Docs
# content = file.GetContentString(mimetype='text/csv') # For Google Sheets
# content = file.GetContentString(mimetype='text/plain') # For Google Slides
print(content)
```
### Regular Files (PDF, Images, Text, etc.)
Regular uploaded files can use direct download:
```python
from gdrive_helper import authenticate, get_file_content
drive = authenticate()
content = get_file_content(drive, 'FILE_ID')
```
### Usage Pattern: No Project Directory Required
**Important:** The helper scripts are globally available. You don't need to `cd` into a project directory:
```python
# ✅ CORRECT: Import from global skill path directly
import sys
sys.path.insert(0, '/Users/wz/.claude/plugins/marketplaces/warren-claude-code-plugin-marketplace/claude-context-orchestrator/snippets/local/productivity/google-drive/scripts')
from gdrive_helper import authenticate
drive = authenticate()
# Continue with operations...
# ❌ INCORRECT: Don't try to cd into project directory
# cd ~/Desktop/zPersonalProjects/gdrivelm # This may not exist
```
## Common Operations
### Upload File from Local Path
```python
from gdrive_helper import authenticate, upload_file
drive = authenticate()
result = upload_file(drive, '/path/to/document.pdf', title='Important Document')
print(f"File ID: {result['id']}")
print(f"Link: {result['link']}")
```
### Upload String Content
The `upload_string` function automatically detects markdown formatting and sets the appropriate MIME type:
```python
from gdrive_helper import authenticate, upload_string
drive = authenticate()
# Auto-detects markdown based on content
markdown_content = """# My Document
This is a **markdown** formatted document with:
- Lists
- **Bold** text
- [Links](https://example.com)
"""
result = upload_string(drive, markdown_content, 'My Document')
print(f"Created: {result['title']}") # Will be 'My Document.md'
print(f"MIME Type: {result['mimeType']}") # Will be 'text/markdown'
# Force plain text (disable auto-detection)
plain_content = "This is plain text content"
result = upload_string(drive, plain_content, 'note.txt', use_markdown=False)
# Force markdown
result = upload_string(drive, "Simple text", 'doc', use_markdown=True) # Will be 'doc.md'
```
### Search Files
```python
from gdrive_helper import authenticate, search_files
drive = authenticate()
# Search by title
results = search_files(drive, "title contains 'invoice'")
# Search by type
results = search_files(drive, "mimeType = 'application/pdf'")
# Complex search
query = "title contains 'report' and mimeType = 'application/pdf' and trashed = false"
results = search_files(drive, query)
for file in results:
print(f"{file['title']} ({file['id']})")
```
For comprehensive search query syntax and examples, load `references/search_queries.md`.
### Download File
```python
from gdrive_helper import authenticate, download_file
drive = authenticate()
result = download_file(drive, 'FILE_ID_HERE', '/path/to/save/file.txt')
print(f"Downloaded {result['title']} to {result['local_path']}")
```
### Get File Metadata
```python
from gdrive_helper import authenticate, get_metadata
drive = authenticate()
metadata = get_metadata(drive, 'FILE_ID_HERE')
print(f"Title: {metadata['title']}")
print(f"Size: {metadata['size']} bytes")
print(f"Modified: {metadata['modified']}")
print(f"Link: {metadata['link']}")
```
### Create Folder and Upload to It
```python
from gdrive_helper import authenticate, create_folder, upload_file
drive = authenticate()
# Create folder
folder = create_folder(drive, 'My Documents')
print(f"Folder ID: {folder['id']}")
# Upload file to folder
result = upload_file(drive, '/path/to/file.txt', folder_id=folder['id'])
print(f"Uploaded to folder: {result['title']}")
```
## Advanced Usage
For direct PyDrive2 API usage anRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.