recipe-organize-drive-folder

Creates Google Drive folder structures and moves files into target folders via gws CLI.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Organizing scattered files in Google Drive into a structured folder hierarchy normally requires many manual clicks in the web UI. This recipe automates folder creation and file relocation using the gws command-line tool. ## Core Features & Use Cases - Folder Structure Creation: Create a parent project folder and nested sub-folders with the Google Drive API via gws. - File Relocation: Move existing files into the right folders by adding and removing parent folder references. - Structure Verification: List folder contents to confirm files landed in the correct locations. - Use Case: When starting a new quarterly project, create a "Q2 Project" folder with a "Documents" sub-folder, then move all related existing files into it and verify the final structure. ## Quick Start Ask the assistant to create a Q2 Project folder in Google Drive with a Documents sub-folder and move your selected files into it.

Frequently Asked Questions about recipe-organize-drive-folder

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

FAQPage Schema
How do I create a folder in Google Drive from the command line?

Use the gws CLI with the drive files create command, passing a JSON body with the folder name and the mimeType application/vnd.google-apps.folder. To nest it, include a parents array with the parent folder ID.

How to move a file to another folder in Google Drive via API?

Call gws drive files update with the fileId, the addParents parameter set to the destination folder ID, and removeParents set to the old parent ID. This relocates the file without copying it.

What do I need installed to organize Google Drive folders with gws?

You need the gws binary installed and the gws-drive skill loaded, since this recipe depends on it for all Drive operations. Without these prerequisites the folder creation and file move commands cannot run.

How can I verify files were moved to the right Google Drive folder?

Run gws drive files list with a query parameter like FOLDER_ID in parents and the table output format. This lists all files currently inside the target folder so you can confirm the structure.

Can I create nested sub-folders in Google Drive with gws?

Yes, create the parent folder first, then create each sub-folder with the parents array containing the parent folder ID returned from the first creation call. Repeat for additional nesting levels.