| name | gi-drive-utils |
| description | Google Drive file management utilities for The Great Inversion asset pipeline. Use when Tim says "move files to Drive," "set up Drive auth," "Drive setup," or when any pipeline skill needs to move uploaded files from the Drive root into the correct GreatInvert subfolder automatically. Provides a one-time OAuth setup (drive_auth.py), folder-path resolver and file mover (drive_move.py), and first-run verification (drive_setup.py). After the one-time auth, no browser is required for any Drive file operations. |
| metadata | {"author":"Tim Dickey","version":"1.0","pipeline-step":"utility"} |
GI Drive Utils
Eliminates manual file-moving in Google Drive. After a one-time OAuth setup,
all pipeline skills automatically move uploaded files to the correct GreatInvert
folder — no browser, no manual drag-and-drop.
First-Time Setup (Run Once)
python skills/gi-drive-utils/scripts/drive_auth.py
This opens a browser tab, asks you to sign into Google, then caches a
refresh token to ~/.gi_drive_token.json. After this runs once, the token
refreshes automatically forever.
Then verify the folder structure is ready:
python skills/gi-drive-utils/scripts/drive_setup.py
Moving Files After Upload
Move a single file by Drive ID
python skills/gi-drive-utils/scripts/drive_move.py FILE_ID "04-Generated-Drafts/Images"
Move a file by name (finds it in Drive root automatically)
python skills/gi-drive-utils/scripts/drive_move.py --by-name "GI_playbook_hero.png" "04-Generated-Drafts/Images"
Move a batch of files (JSON)
python skills/gi-drive-utils/scripts/drive_move.py --batch '[
{"name": "GI_playbook_hero.png", "folder": "04-Generated-Drafts/Images"},
{"name": "greatinvert-asset-pipeline-tracker.xlsx", "folder": "08-Admin/Asset-Tracker"}
]'
List files currently in Drive root
python skills/gi-drive-utils/scripts/drive_move.py --list-root
Known Folder Paths
Use these exact strings as the folder argument:
| Path | Contents |
|---|
01-Source | Raw source material |
02-Structured-Briefs/Product-Briefs | Product-level briefs |
02-Structured-Briefs/Chapter-Briefs | Chapter briefs |
02-Structured-Briefs/Campaign-Briefs | Campaign briefs |
04-Generated-Drafts/Images | Generated image drafts |
05-Approved-Assets/Website | Approved website assets |
05-Approved-Assets/Social/LinkedIn | Approved LinkedIn assets |
06-Web-Ready/Optimized-Images | Web-optimized images |
06-Web-Ready/Thumbnails | Thumbnail versions |
06-Web-Ready/OpenGraph | OG images |
06-Web-Ready/Feature-Strips | Feature strip crops |
07-Published | Published assets |
08-Admin/Asset-Tracker | Tracker spreadsheet |
How Pipeline Skills Use This
After any export_files call to Google Drive, pipeline skills run:
from skills.gi_drive_utils.scripts.drive_move import batch_move
moves = [
{"id": "DRIVE_FILE_ID", "folder": "04-Generated-Drafts/Images"},
{"id": "TRACKER_FILE_ID", "folder": "08-Admin/Asset-Tracker"},
]
result = batch_move(moves)
print(f"Moved {result['moved']} files")
Token Management
- Token cached at:
~/.gi_drive_token.json
- Access tokens auto-refresh using the stored refresh token
- To re-authenticate:
rm ~/.gi_drive_token.json then re-run drive_auth.py
- Token is scoped to
https://www.googleapis.com/auth/drive