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/CLOUDDRIVEAPIenvironment 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 RPCscd2cmd.py— Convenience wrapper for common commandsgen/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, GitHubeutopiazen/clouddrive2-skill). The summary of changes is written toscripts/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.
--listprints 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/115openis mounted; check withGetMountPoints - Delete sends to recycle bin by default;
DeleteFilesPermanently/rmpermis required for permanent deletion. - Download:
GetDownloadUrlPathreturns a constructed URL (directUrlpreferred, otherwisedownloadUrlPathcontains{SCHEME}/{HOST}/{PREVIEW}placeholders that need to be replaced); use address127.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 ifapi_tokens.jsonexists.- 2FA prompt → requires
CD2_TOTPor 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
FileOperationResultcontainingsuccess/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.