home / skills / kjgarza / marketplace-claude / searching-documents-with-google-drive

searching-documents-with-google-drive skill

/plugins/kjgarza-product/skills/searching-documents-with-google-drive

This skill lets you locate and download Google Drive documents via rclone, exporting Google Docs as Markdown for easy reading.

npx playbooks add skill kjgarza/marketplace-claude --skill searching-documents-with-google-drive

Review the files below or copy the command above to add this skill to your agents.

Files (6)
SKILL.md
3.7 KB
---
name: searching-documents-with-google-drive
description: Search and download documents from Google Drive using rclone. Exports Google Docs as Markdown by default. Use when users ask to find files in Google Drive, download documents from Drive, export Google Docs, or sync Drive content locally. Triggers on requests mentioning Google Drive, gdrive, or document downloads from cloud storage.
---

# Google Drive Document Access

## Overview

Search for and download documents from Google Drive using rclone. Google Docs are automatically exported as Markdown for easy reading and processing.

Scripts are located at `.claude/searching-documents-with-google-drive/gdrive/scripts/`.

**Reference Documentation:**
- [scripts/](scripts/) — Shell scripts for search, download, and sync operations
- [digital-science-reference.md](digital-science-reference.md) — Digital Science documentation links

**Authentication:** See the Authentication section in [digital-science-reference.md](digital-science-reference.md) for rclone setup. The remote must be named `gdrive`.

## Quick Start

```bash
# Check rclone is configured
./scripts/check_rclone.sh

# Search for files
./scripts/search_gdrive.sh "meeting notes"

# Search shared files
./scripts/search_gdrive.sh "standup" --shared

# Download a file (exports Google Docs as Markdown)
./scripts/download_gdrive.sh "Documents/Report" ./output

# Download by file ID
./scripts/download_gdrive.sh --id "FILE_ID" ./output

# Download matching shared files
./scripts/download_gdrive.sh --shared --include "pattern*" ./output
```

## Common Tasks

| Task | Command |
|------|---------|
| Check setup | `./scripts/check_rclone.sh` |
| Search files | `./scripts/search_gdrive.sh "pattern"` |
| Search shared files | `./scripts/search_gdrive.sh "pattern" --shared` |
| Download file | `./scripts/download_gdrive.sh "path/to/file" ./output` |
| Download by ID | `./scripts/download_gdrive.sh --id "FILE_ID" ./output` |
| Download folder | `./scripts/download_gdrive.sh "Folder" ./output --bulk` |
| Download shared files | `./scripts/download_gdrive.sh --shared --include "pattern*" ./output` |
| Limit downloads | `./scripts/download_gdrive.sh --shared --include "pattern*" ./output --limit 20` |

## Export Formats

Google Docs can be exported in different formats:

| Format | Flag | Use Case |
|--------|------|----------|
| Markdown | `--format md` (default) | Easy reading and processing |
| Word | `--format docx` | Office compatibility |
| PDF | `--format pdf` | Final documents |
| Plain text | `--format txt` | Minimal formatting |
| HTML | `--format html` | Web content |

Example: `./scripts/download_gdrive.sh "Report" ./output --format docx`

## File ID Extraction

Extract file IDs from Google Drive URLs:
- `https://docs.google.com/document/d/FILE_ID/edit` → use FILE_ID
- `https://drive.google.com/file/d/FILE_ID/view` → use FILE_ID

## Preview Before Download

Use dry-run to see what would be downloaded:
```bash
./scripts/download_gdrive.sh "Large Folder" ./output --bulk --dry-run
```

## Direct rclone Commands

For advanced use cases:
```bash
rclone ls gdrive:"Documents"           # List files
rclone lsjson gdrive:"path" --no-traverse  # Get file info as JSON
rclone sync gdrive:"Source" ./local --drive-export-formats md  # Sync folder
```

## Troubleshooting

| Issue | Solution |
|-------|----------|
| "remote not configured" | Run `rclone config` to set up gdrive remote |
| "Cannot connect" | Run `rclone config reconnect gdrive:` |
| Empty search results | Check path spelling; try searching from root |
| File not downloading | Verify file permissions; check if file is in Trash |
| Shared files not found | Use `--shared` flag |
| Too many files | Use `--limit N` to download only N most recent |

Overview

This skill searches, previews, and downloads documents from Google Drive using rclone. Google Docs are exported as Markdown by default for easy reading and downstream processing. Use the provided scripts to search by name or ID, handle shared files, and sync Drive content locally.

How this skill works

The skill wraps rclone commands in small shell scripts that perform search, download, and bulk sync operations against a remote named gdrive. It can search by query or path, download by path or file ID, export Google Docs to selectable formats (default: md), and perform dry-run previews before downloading. Advanced users can call rclone directly for JSON listing or sync with export format flags.

When to use it

  • Find files or folders in a Google Drive remote from the command line
  • Export Google Docs to Markdown for processing or publishing
  • Download or sync Drive content to a local directory
  • Download shared files that aren’t in your root drive (use --shared)
  • Preview large downloads with a dry-run before executing

Best practices

  • Ensure rclone is configured and the remote is named gdrive (run ./scripts/check_rclone.sh)
  • Use dry-run (--dry-run) for large folders to avoid accidental massive downloads
  • Prefer downloads by file ID when file names are ambiguous or duplicated
  • Limit bulk downloads with --limit to control bandwidth and storage
  • Choose export format explicitly for downstream use (md, docx, pdf, txt, html)

Example use cases

  • Search for meeting notes: ./scripts/search_gdrive.sh "meeting notes"
  • Export a Google Doc as Markdown: ./scripts/download_gdrive.sh "Documents/Report" ./output
  • Download a shared folder with a filename pattern: ./scripts/download_gdrive.sh --shared --include "project*" ./output
  • Sync a remote folder to local with Markdown exports: rclone sync gdrive:"Source" ./local --drive-export-formats md
  • Preview what would be downloaded from a large folder: ./scripts/download_gdrive.sh "Large Folder" ./output --bulk --dry-run

FAQ

What does the skill require to run?

Install and configure rclone with a remote named gdrive; authentication steps are handled via rclone config.

How do I export Google Docs to Word or PDF instead of Markdown?

Pass --format docx or --format pdf to the download script to change the export format.