gws-drive

Manage Google Drive files, folders, and shared drives via the gws CLI.

Updated Nov 9, 2023
One-click install
npx skills add https://github.com/oresttokovenko/dot-files --skill gws-drive-oresttokovenko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gws-drive
Source: https://github.com/oresttokovenko/dot-files/tree/main/chezmoi/dot_agents/skills/gws-drive
Command: npx skills add https://github.com/oresttokovenko/dot-files --skill gws-drive-oresttokovenko

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gws.

What problem does it solve? Working with Google Drive programmatically requires learning the Drive API v3 surface, authentication flows, and parameter schemas. This Skill exposes the full Drive API through the gws CLI so an AI agent can list, upload, download, share, and organize files and shared drives without writing custom API client code. ## Core Features & Use Cases - File Operations: Create, copy, download, export, update, and search files with query filters, including trashed-file exclusion and label management. - Shared Drive Management: Create, list, hide, unhide, and update shared drives, plus manage permissions for files and drives. - Collaboration & Auditing: Work with comments, replies, revisions, approvals, access proposals, and change notifications via watch channels. - Use Case: Ask the agent to find all untrashed spreadsheets in a shared drive, download one as CSV, and grant a colleague read access, all through gws drive commands. ## Quick Start Use the gws-drive skill to list all non-trashed files in my Google Drive and show their names and IDs.

Frequently Asked Questions about gws-drive

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

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

Run gws drive files list with an optional q query parameter to filter results. By default all files including trashed ones are returned, so add trashed=false to the query to exclude them.

How do I upload a file to Google Drive with gws?

Use the gws-drive-upload helper skill, which wraps file upload with automatic metadata handling. Alternatively call gws drive files create, which supports upload URIs up to 5,120 GB with any valid MIME type.

Can I export Google Docs to PDF or CSV using the Drive API?

Yes, gws drive files export converts Google Workspace documents to a requested MIME type and returns the byte content. Exported content is limited to 10 MB per request.

How do I share a Google Drive file with specific users?

Use gws drive permissions create to add a permission for a file or shared drive. Concurrent permission operations on the same file are not supported, and only the last update is applied.

Why does gws drive require the gws-shared skill?

Authentication, global flags, and security rules are defined in the gws-shared skill, which this skill depends on as a prerequisite. If it is missing, run gws generate-skills to create it before using drive commands.

What are the limitations of listing file revisions in Google Drive?

Revision lists may be incomplete for files with large histories, such as frequently edited Docs or Sheets, and older revisions can be omitted. Revisions can only be deleted for binary files like images or videos, not Google Docs formats.