Gws Drive Action
Production-ready command that handles google, drive, manage, files. Includes structured workflows, validation checks, and reusable patterns for google workspace.
GWS Drive Action
Advanced Google Drive operations for file management, bulk operations, and Drive administration.
When to Use This Command
Run this command when you need to:
- Perform bulk file operations like moving, copying, or deleting multiple files matching a pattern
- Manage Shared Drive creation, settings, and membership for team collaboration
- Execute advanced Drive operations like file versioning, trash management, or quota analysis
Consider alternatives when:
- You need to do a single quick file search or download where the instant command is faster
- You are managing Drive Labels and classification which requires the Drive Labels API specifically
Quick Start
Configuration
name: gws-drive-action type: command category: google-workspace
Example Invocation
claude command:run gws-drive-action --action bulk-move --source "old-project/" --dest "archive/2025/"
Example Output
Executing bulk file operation...
Action: move files
Source: old-project/ (folder ID: 0B1a2b3c)
Destination: archive/2025/ (folder ID: 0D4e5f6g)
Scanning source folder...
Files found: 34
Total size: 2.8 GB
Types: 12 docs, 8 sheets, 6 slides, 5 PDFs, 3 images
Moving files...
[========================================] 34/34 complete
Move summary:
Moved: 34 files
Failed: 0
Total transferred: 2.8 GB
Source folder: now empty (delete with --cleanup)
Core Concepts
Advanced Drive Operations Overview
| Aspect | Details |
|---|---|
| Bulk Operations | Move, copy, delete, or share multiple files in a single command |
| Shared Drives | Create, configure, manage membership and permissions for team drives |
| Versioning | List, restore, or purge file version history to manage storage |
| Trash | Manage trashed files: list, restore, permanently delete, or empty trash |
| Quota | Analyze storage usage by user, folder, or file type across the domain |
Bulk Operation Workflow
Define Operation
|
v
Scan Target Files
(apply filters)
|
v
Preview Changes
(dry-run mode)
|
v
Confirm Execution
|
v
Process Files
[progress bar]
|
v
Generate Report
(success/failure counts)
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
| action | string | (required) | Operation: bulk-move, bulk-copy, bulk-delete, shared-drive, quota |
| source | string | (none) | Source folder path or ID for bulk operations |
| dest | string | (none) | Destination folder path or ID for move and copy |
| filter | string | * | File filter pattern: *.pdf, type:document, older:90days |
| cleanup | boolean | false | Delete empty source folders after moving all contents |
Best Practices
-
Always preview with dry-run - Bulk operations on hundreds of files are difficult to undo. Run with
--dry-runfirst to see exactly which files will be affected before executing. -
Filter precisely for bulk deletes - Combine multiple filters like type and date to target exactly the files you want. A broad delete pattern can remove files you did not intend to lose.
-
Monitor storage quotas proactively - Use the quota action monthly to identify storage hogs. Large video files and abandoned shared drives often consume significant quota unnoticed.
-
Back up before bulk operations - For irreversible operations like permanent deletion, ensure you have backups or at minimum export the file list for reference.
Common Issues
-
Bulk move times out on large folders - Folders with thousands of files may exceed API rate limits. Use the batch-size parameter to process files in smaller groups with delays between batches.
-
Shared Drive creation requires admin - Only Google Workspace admins can create new Shared Drives. Regular users receive a permission error even if their license supports Shared Drives.
-
Files in trash still count toward quota - Trashed files continue consuming storage until permanently deleted. Use the trash action to empty trash and reclaim storage space. Schedule periodic trash cleanups as part of your domain storage management routine to prevent quota from filling up unexpectedly.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Git Commit Message Generator
Generates well-structured conventional commit messages by analyzing staged changes. Follows Conventional Commits spec with scope detection.
React Component Scaffolder
Scaffolds a complete React component with TypeScript types, Tailwind styles, Storybook stories, and unit tests. Follows project conventions automatically.
CI/CD Pipeline Generator
Generates GitHub Actions workflows for CI/CD including linting, testing, building, and deploying. Detects project stack automatically.