google-drive-setup

Configure Google Drive mount on Linux via rclone + gog OAuth. Use when user wants to mount Google Drive as local filesystem, set up auto-mount on boot, or configure rclone with Google OAuth. Covers OAuth setup with gog, rclone configuration, and systemd auto-mount.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "google-drive-setup" with this command: npx skills add tonglinmu/google-drive-setup

Google Drive Setup

Mount Google Drive as a local filesystem using rclone, with OAuth via gog CLI.

Prerequisites

  • gog CLI installed and authenticated (see gog skill)
  • rclone installed
  • fuse / fusermount available

Step 1: Get OAuth Credentials from gog

gog already has a valid refresh token. Export it:

export GOG_KEYRING_PASSWORD=<your-password>
gog auth tokens export <email@gmail.com> --out /tmp/gog_token.json --overwrite

Extract the refresh_token, client_id, and client_secret from:

  • /tmp/gog_token.json → refresh_token
  • ~/.config/gogcli/credentials.json → client_id, client_secret

Step 2: Configure rclone

Write ~/.config/rclone/rclone.conf:

[GoogleDrive]
type = drive
client_id = <client_id>
client_secret = <client_secret>
scope = drive
token = {"access_token":"","token_type":"Bearer","refresh_token":"<refresh_token>","expiry":"2026-01-01T00:00:00Z"}
team_drive =

Manually refresh the access token (rclone will auto-refresh thereafter):

curl -s -X POST https://oauth2.googleapis.com/token \
  -d client_id=<client_id> \
  -d client_secret=<client_secret> \
  -d refresh_token=<refresh_token> \
  -d grant_type=refresh_token

Update rclone.conf with the returned access_token and real expiry time.

Verify: rclone lsd GoogleDrive:

Step 3: Mount to Filesystem

mkdir -p /mnt/gdrive
rclone mount GoogleDrive: /mnt/gdrive \
  --daemon \
  --vfs-cache-mode full \
  --vfs-cache-max-size 2G \
  --dir-cache-time 72h \
  --allow-other

Step 4: Auto-mount on Boot (systemd)

Create /etc/systemd/system/rclone-gdrive.service:

[Unit]
Description=rclone mount Google Drive
After=network-online.target
Wants=network-online.target

[Service]
Type=notify
ExecStart=/usr/bin/rclone mount GoogleDrive: /mnt/gdrive --vfs-cache-mode full --vfs-cache-max-size 2G --dir-cache-time 72h --allow-other
ExecStop=/bin/fusermount -u /mnt/gdrive
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

Enable:

systemctl daemon-reload
systemctl enable rclone-gdrive
systemctl start rclone-gdrive

Troubleshooting

  • "empty token found": rclone config has no valid token. Re-do Step 2.
  • "token expired and no refresh token": refresh_token missing from rclone.conf.
  • "Object does not exist at path /": gog keyring backend issue. Switch to file: gog auth keyring file and set GOG_KEYRING_PASSWORD.
  • "access_denied" / "developer hasn't given you access": Add user as test user in Google Cloud Console → OAuth consent screen.
  • OAuth app type must be "Desktop app": Web-type credentials redirect_uri won't work for remote servers. Use Desktop type.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

WeChat Official Accounts Article Engagement Metrics API

Call GET /api/weixin/get-article-feedback/v1 for WeChat Official Accounts Article Engagement Metrics through JustOneAPI with articleUrl.

Registry SourceRecently Updated
General

03 Logistics Alert

对菜鸟物流订单进行异常监控、预警分级和赔偿标准匹配。 基于淘宝/天猫物流时效规则(2024最新版)、菜鸟专线赔付标准 和行业物流SLA基准数据,帮助内控人员快速识别异常订单、 预判风险并给出处置建议和赔偿预算。 v1.7 新增:AE-03细分规则(退件/异地/乱序)、AE-10联动供应商评分规则、赔偿封顶规则明确...

Registry SourceRecently Updated
General

Xiaohongshu (RedNote) User Published Notes API

Call 2 get-user-note-list versions for Xiaohongshu (RedNote) User Published Notes through JustOneAPI with userId.

Registry SourceRecently Updated
General

01 Complaint Classification

基于 GB/T 42499-2023 国家标准和阿里巴巴平台规则, 对用户投诉进行智能分类、优先级评定、责任方判断和派发建议。 适用于菜鸟物流、菜鸟驿站、淘宝闪购三条业务线。 v1.7 新增:统一引用 GLOSSARY.md、INSUFFICIENCY-HANDLING.md、RULE-UPDATE-SOP.md。

Registry SourceRecently Updated