CommunityCoding & Developmentgithub.com

CloudDrive2 Cloud Disk Management

Manage cloud drives (115, Baidu Netdisk, Xunlei, etc.) via the local CloudDrive2 gRPC service: list, search, move, copy, delete files, create folders, encrypt, offline download, get download links, manage mounts/cloud accounts/backups/transfer tasks/API tokens. Trigger words: 115, Baidu Netdisk, Xunlei, CloudDrive, CD2, offline download, transfer, scrape, mount, STRM.

What is CloudDrive2 Cloud Disk Management?

This skill provides a comprehensive interface to manage cloud drives and local directories through CloudDrive2's local gRPC service (127.0.0.1:19798). It supports a wide range of operations including listing, searching, moving, copying, deleting files, creating folders, encrypting, offline downloading, and generating download links. It also enables management of mount points, cloud accounts, backups, transfer tasks, and API tokens, with platform triggers for 115, Baidu Netdisk, Xunlei, and CloudDrive. The skill is primarily designed for Claude Code and similar command-line AI agents, offering both high-level convenience commands (cd2cmd.py) and direct access to all 227 RPC methods (cd2.py). Authentication is automatically handled via environment variables, a local API token file, or a GET request for a token. The skill includes auto-updating documentation and client code, ensuring it stays synchronized with the latest CloudDrive2 gRPC API changes. This makes it ideal for users who need to automate or simplify cloud file management tasks from an AI-powered terminal environment.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/eutopiazen/clouddrive2-skill/tree/main

Installed? Explore more Coding & Development skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

What does CloudDrive2 Cloud Disk Management do?

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.

Related Skills