google-drive

Search, list, and manage Google Drive files using the gws CLI.

Updated Mar 29, 2024
One-click install
npx skills add https://github.com/petobens/ai-harness --skill google-drive-petobens
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: google-drive
Source: https://github.com/petobens/ai-harness/tree/main/skills/google-drive
Command: npx skills add https://github.com/petobens/ai-harness --skill google-drive-petobens

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Locating and managing files across Google Drive requires repetitive manual clicks in the web UI. This Skill lets you search Drive, list folder contents, and perform file lifecycle operations (create, copy, rename, trash) directly through the gws command-line tool, covering Docs, Sheets, Slides, PDFs, and any other Drive file type. ## Core Features & Use Cases - Drive Search and Listing: Query files by name and MIME type, list a folder's direct children, and page through large folders or recurse into folder trees. - File Lifecycle Management: Create new Docs, Sheets, or Slides, and copy, rename, or trash any Drive file with confirmation safeguards for destructive actions. - Metadata Inspection and Download: Fetch a file's mimeType before mutating it, and download blob files like PDFs for further processing. - Use Case: Ask the assistant to find every spreadsheet named 'quarterly model' modified recently, copy the latest one into a project folder, and rename it for the new quarter. ## Quick Start Ask the assistant to search Google Drive for a file by name and list the contents of a specific folder using gws.

Frequently Asked Questions about google-drive

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search Google Drive files from the command line?

Use gws drive files list with a query parameter such as name contains 'keyword', optionally filtered by mimeType. Results return file IDs, names, types, and web links, with support for shared drives via includeItemsFromAllDrives.

How to list all files in a Google Drive folder?

Run gws drive files list with the query 'FOLDER_ID' in parents and trashed = false, ordering by folder and name. For folders with over 1,000 children, follow the nextPageToken to page through results.

Can I create Google Docs or Sheets from the command line?

Yes, gws drive files create accepts a name and mimeType such as application/vnd.google-apps.spreadsheet to create a new file. Set the parents field to place it in a specific folder, and confirm with the user before creating.

Does gws work with shared drives and Drive URLs?

Yes, pass supportsAllDrives and includeItemsFromAllDrives in params for shared drive content. Drive URLs are accepted, but only the bare ID after /d/ or /folders/ should be passed to gws commands.

Why do gws Drive commands fail in sandboxed environments?

Google Drive operations require network access, so DNS or discovery errors in restricted sandboxes indicate blocked connectivity. Rerun the same command with escalated tool permissions rather than treating it as an API or query failure.