with one click
google-drive-backup
// Back up the whole `notes/` directory to Google Drive using local OAuth credentials. Creates a timestamped version folder under a target Drive folder.
// Back up the whole `notes/` directory to Google Drive using local OAuth credentials. Creates a timestamped version folder under a target Drive folder.
| name | google-drive-backup |
| description | Back up the whole `notes/` directory to Google Drive using local OAuth credentials. Creates a timestamped version folder under a target Drive folder. |
Use this skill when the user wants to back up the local notes/ directory to Google Drive.
notes/.env.git/node_modules/dist/notes/This skill uses local OAuth files in ~/.gdrive-backup/:
gcp-oauth.keys.jsoncredentials.jsonIf credentials.json does not exist yet, first put your Google OAuth client JSON at ~/.gdrive-backup/gcp-oauth.keys.json, then run:
npx tsx .opencode/skills/google-drive-backup/scripts/auth.ts
The script starts a temporary localhost callback server, opens the Google consent flow URL, and saves tokens to ~/.gdrive-backup/credentials.json.
Preferred: set GDRIVE_NOTES_BACKUP_FOLDER_ID in your shell or .env, then run:
printf '%s' '{}' | npx tsx .opencode/skills/google-drive-backup/scripts/backup.ts
Important: do not use printenv GDRIVE_NOTES_BACKUP_FOLDER_ID as the only check when the value may live in the project's .env. The backup script loads .env via dotenv, so shell inspection can incorrectly suggest the variable is missing.
Or pass the target folder explicitly:
printf '%s' '{"folderId":"<google-drive-folder-id>"}' | npx tsx .opencode/skills/google-drive-backup/scripts/backup.ts
Optional fields:
{
"folderId": "<google-drive-folder-id>",
"sourceDir": "notes",
"versionLabel": "manual-backup"
}
The script prints JSON with:
folderId: the created version folder IDfolderName: the created version folder namefileCount: uploaded file countfiles: uploaded relative paths and file IDs.env; do not rely on printenv alone. If it is still missing, stop and ask for it or tell the user to set GDRIVE_NOTES_BACKUP_FOLDER_ID.[HINT] Download the complete skill directory including SKILL.md and all related files