/install google-drive-setup
Google Drive Setup
Mount Google Drive as a local filesystem using rclone, with OAuth via gog CLI.
Prerequisites
gogCLI installed and authenticated (see gog skill)rcloneinstalledfuse/fusermountavailable
Step 1: Get OAuth Credentials from gog
gog already has a valid refresh token. Export it:
export GOG_KEYRING_PASSWORD=\x3Cyour-password>
gog auth tokens export \[email protected]> --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 = \x3Cclient_id>
client_secret = \x3Cclient_secret>
scope = drive
token = {"access_token":"","token_type":"Bearer","refresh_token":"\x3Crefresh_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=\x3Cclient_id> \
-d client_secret=\x3Cclient_secret> \
-d refresh_token=\x3Crefresh_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 fileand setGOG_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.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install google-drive-setup - 安装完成后,直接呼叫该 Skill 的名称或使用
/google-drive-setup触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
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 co... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 100 次。
如何安装 Google Drive Setup?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install google-drive-setup」即可一键安装,无需额外配置。
Google Drive Setup 是免费的吗?
是的,Google Drive Setup 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Google Drive Setup 支持哪些平台?
Google Drive Setup 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Google Drive Setup?
由 TonglinMu(@tonglinmu)开发并维护,当前版本 v1.1.0。