Community编程与开发github.com

eutopiazen/clouddrive2

CloudDrive2 云盘管理: 通过本机 gRPC (127.0.0.1:19798) 列出/搜索/移动/复制/删除云盘文件, 创建文件夹, 加密, 离线下载, 获取下载链接, 管理挂载点/云盘/备份/传输任务/API令牌/账户. 触发词: 115, 百度网盘, 迅雷, 云盘, CloudDrive, CD2, 离线下载, 转存, 刮削, 挂载, strm.

clouddrive2 是什么?

clouddrive2 is a Claude Code agent skill that cloudDrive2 云盘管理: 通过本机 gRPC (127.0.0.1:19798) 列出/搜索/移动/复制/删除云盘文件, 创建文件夹, 加密, 离线下载, 获取下载链接, 管理挂载点/云盘/备份/传输任务/API令牌/账户. 触发词: 115, 百度网盘, 迅雷, 云盘, CloudDrive, CD2, 离线下载, 转存, 刮削, 挂载, strm.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/eutopiazen/clouddrive2-skill/tree/main

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

CloudDrive2 Cloud Disk Management

Perform file operations and system management on cloud drives (115/Baidu Netdisk/Xunlei/local directories) via the local CloudDrive2 gRPC service. Service address 127.0.0.1:19798, already logged in, authentication is automatic.

Prerequisites

  • Service runs as a daemon; no need to start it manually.
  • Authentication is automatic: prefers CD2_TOKEN/CLOUDDRIVEAPI environment variables → API token from local file /opt/clouddrive2/config/api_tokens.json → GET token.txt. Generally directly usable.
  • Tool directory: /root/.openclaw/workspace/skills/clouddrive2/
    • cd2.py — Universal caller, supports all 227 RPCs
    • cd2cmd.py — Convenience wrapper for common commands
    • gen/proto/ — Generated Python gRPC client (do not modify)
    • clouddrive.proto — Latest proto definition (1.0.17)
    • docs/ — Official gRPC documentation snapshot (reference manual for errors)

Official Documentation Reference

  • Local snapshot: docs/CloudDrive2_gRPC_API_Guide_en.md (automatically synced with official updates)
  • Check this first when you encounter errors or need field definitions: method names, request/response fields, enum values, common error explanations are all there
  • Online version: https://www.clouddrive2.com/api/CloudDrive2_gRPC_API_Guide.html
  • Auto-update: Every Monday, it automatically checks for official documentation and proto changes. If changes are found, it regenerates the client and synchronizes three locations (this working copy, ~/.agents/skills/clouddrive2, GitHub eutopiazen/clouddrive2-skill). The summary of changes is written to scripts/cd2doc-watch/changes/

Usage

A. Quick Commands (cd2cmd.py, preferred for frequent operations)

cd /root/.openclaw/workspace/skills/clouddrive2
python3 cd2cmd.py ls /115open            # List directory: name<TAB>size<TAB>type
python3 cd2cmd.py ls / --refresh         # Force refresh cache
python3 cd2cmd.py find /115open movie     # Fuzzy search
python3 cd2cmd.py info /115open/xx.mkv   # File details
python3 cd2cmd.py mkdir /115open new_folder
python3 cd2cmd.py mv /115open/a.mkv /115open/movies        # Move (default: rename on conflict)
python3 cd2cmd.py cp /115open/a.mkv /115open/backup --policy overwrite
python3 cd2cmd.py rm /115open/trash.mkv                    # Delete (to recycle bin)
python3 cd2cmd.py rmperm /115open/trash.mkv                # Permanently delete
python3 cd2cmd.py rn /115open/a.mkv b.mkv                 # Rename
python3 cd2cmd.py dl /115open/a.mkv                      # Download URL + curl/wget
python3 cd2cmd.py mounts | clouds | copy-tasks           # Mount points/cloud drives/copy tasks
python3 cd2cmd.py dl-tasks | ul-tasks                    # Download/upload queues
python3 cd2cmd.py backups                                # Backup status
python3 cd2cmd.py settings | acct | tokens               # Settings/account/tokens
python3 cd2cmd.py token-create name --perm allow_read allow_list
python3 cd2cmd.py unlock /path password [--permanent]
python3 cd2cmd.py stat                                   # System info

B. Any RPC (cd2.py) — All documented functions

python3 cd2.py <RpcName> [field=value ...] [--json|--raw|--no-auth|--list]
  • Field names use camelCase (consistent with documentation), nesting with .: subField=value
  • Values are parsed as JSON (numbers/bool/arrays auto-converted); streaming methods are auto-aggregated.
  • --list prints all 227 method names
  • Common examples:
python3 cd2.py GetSubFiles path=/115open forceRefresh=true
python3 cd2.py FindFileByPath parentPath=/115open path=/115open/movies/xxx.mkv
python3 cd2.py GetSearchResults searchFor=movie path=/ fuzzyMatch=true
python3 cd2.py CreateFolder parentPath=/115open folderName=new_directory
python3 cd2.py RenameFile theFilePath=/115open/a.mkv newName=b.mkv
python3 cd2.py MoveFile theFilePaths=/115open/a.mkv destPath=/115open/movies conflictPolicy=Rename
python3 cd2.py CopyFile theFilePaths=/115open/a.mkv destPath=/115open/backup conflictPolicy=Skip
python3 cd2.py DeleteFiles path=/115open/trash1.mkv path=/115open/trash2.mkv
python3 cd2.py GetMountPoints
python3 cd2.py GetAllCloudApis
python3 cd2.py GetDownloadUrlPath path=/115open/a.mkv preview=false
python3 cd2.py GetCopyTasks
python3 cd2.py BackupGetAll
python3 cd2.py GetAccountStatus
python3 cd2.py ListTokens
python3 cd2.py GetSystemSettings

Key Concepts

  • Path prefix (cloud drive root): /115open, /BaiduNetdisk, /XunleiCloudDisk, /mnt (local disk), /CD2 (local /ssd/CD2)
  • Conflict policy conflictPolicy: Overwrite=0 / Rename=1 / Skip=2
  • Cloud drive list: python3 cd2.py GetAllCloudApis
  • Mount points: By default only /mnt/115open is mounted; check with GetMountPoints
  • Delete sends to recycle bin by default; DeleteFilesPermanently/rmperm is required for permanent deletion.
  • Download: GetDownloadUrlPath returns a constructed URL (directUrl preferred, otherwise downloadUrlPath contains {SCHEME}/{HOST}/{PREVIEW} placeholders that need to be replaced); use address 127.0.0.1:19798
  • Large file operations (move/copy across cloud drives) generate background tasks; track them with GetCopyTasks

Authentication Troubleshooting

  • No valid auth token → missing certificate file/environment variables; check if api_tokens.json exists.
  • 2FA prompt → requires CD2_TOTP or switch to using an API token.
  • Public methods (GetSystemInfo/GetToken/Login, etc.) do not require authentication; add --no-auth.

Verification

After each operation, confirm success via result fields:

  • Create/Move/Copy/Delete → returns FileOperationResult containing success/errorMessage
  • List/Search → check entry count matches the target.
  • If an operation fails, first check errorMessage, then decide whether to retry or check task status.

相关技能