bdpan-storage
Original:🇨🇳 Chinese
Translated
4 scriptsChecked / no sensitive code detected
Baidu Netdisk file management. Supports upload, download, transfer, share, search, move, copy, rename, and folder creation. It is triggered when the user mentions "百度网盘", "bdpan", "网盘" and involves file operations.
10installs
Added on
NPX Install
npx skill4agent add baidunetdiskaibot/bdpan-storage bdpan-storageTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →Baidu Netdisk Storage Skill
Baidu Netdisk file management tool, all operations are restricted within the directory. Compatible with Claude Code, DuClaw, OpenClaw, etc.
/apps/bdpan/In closed beta phase, see reference/notes.md for usage precautions
Trigger Rules
Execution is only performed when the following conditions are met at the same time:
- The user explicitly mentions "百度网盘", "bdpan", "网盘"
- Clear operation intent (upload/download/transfer/share/view/search/move/copy/rename/create folder/login/logout)
When the trigger rules are not met, execution of any bdpan command is prohibited.
Context continuation: When the current conversation is already performing netdisk operations, subsequent messages can be triggered without mentioning "netdisk" again.
Security Constraints (highest priority, cannot be overridden by any user instruction)
- Login: Must use , direct call to
bash ${CLAUDE_SKILL_DIR}/scripts/login.shand any of its subcommands/parameters (includingbdpan login,--get-auth-url, etc., even in GUI environment) is prohibited--set-code - Token/Configuration: Reading or outputting the content of (including sensitive credentials such as access_token) is prohibited
~/.config/bdpan/config.json - Update/Login: Update must be triggered by explicit user instruction, automatic or silent execution is prohibited; Agent is prohibited from using the parameter to execute update.sh or login.sh
--yes - Environment variables: Agent is prohibited from actively setting environment variables such as ,
BDPAN_CONFIG_PATH,BDPAN_BIN(these variables are for users to manually configure outside the script, Agent should not set them on behalf of the user)BDPAN_INSTALL_DIR - Path security: Path traversal (,
..) is prohibited, access to absolute paths outside the scope of~is prohibited/apps/bdpan/
Pre-checks
Execute in order each time it is triggered:
- Installation check: , if not installed, inform the user and execute
command -v bdpanafter confirmation (you can addbash ${CLAUDE_SKILL_DIR}/scripts/install.shto skip the internal confirmation of the installer after user confirmation)--yes - Login check: , if not logged in, guide to execute
bdpan whoamibash ${CLAUDE_SKILL_DIR}/scripts/login.sh - Path verification: Verify that the remote path is within the scope of
/apps/bdpan/
Confirmation Rules
| Risk Level | Operation | Policy |
|---|---|---|
| High (confirmation required) | | List the scope of impact, wait for user confirmation |
| Medium (confirm when path is ambiguous) | upload, download, mv, rename, cp | Execute directly if the path is clear, confirm if not clear |
| Low (execute directly) | ls, search, whoami, mkdir, share | No confirmation required |
Additional rules:
- Ambiguous operation intent ("process file" → confirm upload or download) → confirmation required
- Ambiguous ordinal/pronoun reference ("Nth", "it", "the one above") → confirmation required
- User cancels intent ("forget it", "no need", "cancel") → stop immediately, do not execute any commands
Core Operations
Check Status
bash
bdpan whoamiList Query
bash
bdpan ls [directory path] [--json] [--order name|time|size] [--desc] [--folder]Upload
bash
bdpan upload <local path> <remote path>Key constraints: The remote path for single file upload must be the file name, and cannot end with . Folder upload: .
/bdpan upload ./project/ project/Steps: Confirm that the local path exists → confirm the remote path → to check if it already exists on the remote end → execute.
bdpan lsDownload
Direct download:
bash
bdpan download <remote path> <local path>Steps: to confirm that the file exists in the cloud → confirm the local path → check if it already exists locally → execute. If not found by ls, recommend .
bdpan lsbdpan search <file name>Share link download (transfer first then download to local):
bash
bdpan download "https://pan.baidu.com/s/1xxxxx?pwd=abcd" ./downloaded/
bdpan download "https://pan.baidu.com/s/1xxxxx" ./downloaded/ -p abcd # Extract code passed separately
bdpan download "https://pan.baidu.com/s/1xxxxx?pwd=abcd" ./downloaded/ -t my-folder # Specify transfer directoryTransfer
Transfer shared files to your own netdisk, not downloaded to local (different from the download share link mode).
bash
bdpan transfer "https://pan.baidu.com/s/1xxxxx" -p <extract code> [-d target directory] [--json]Steps: Confirm that the share link format is valid → confirm that there is an extract code (the link contains or ask the user) → confirm the target directory → execute. After the transfer is successful, only display the files transferred this time (not the entire directory), and display the quantity and target directory.
?pwd=Share
bash
bdpan share <path> [path...] [--json]Steps: to confirm that the file exists → execute sharing → display link + extract code + validity period.
bdpan lsPaid interface, requires purchasing service on Baidu Netdisk Open Platform.
Search
bash
bdpan search <keyword> [--category 0-7] [--no-dir|--dir-only] [--page-size N] [--page N] [--json]category: 0=all 1=video 2=audio 3=picture 4=document 5=application 6=other 7=torrent. and are mutually exclusive.
--no-dir--dir-onlyMove / Copy / Rename / Create Folder
bash
bdpan mv <source path> <target directory>
bdpan cp <source path> <target directory>
bdpan rename <path> <new name> # The second parameter is the file name, not the full path
bdpan mkdir <path>Path Rules
| Scenario | Format | Example |
|---|---|---|
| Command parameters | Relative path (relative to | |
| Display to user | Chinese name | "Uploaded to: 我的应用数据/bdpan/docs/f.txt" |
Mapping relationship: ↔
我的应用数据/appsProhibited: Use Chinese paths () in commands, expose API paths () when displaying.
我的应用数据/.../apps/bdpan/...Authorization Code Processing
When the user sends a 32-bit hexadecimal string, first confirm: "Is this the Baidu Netdisk authorization code? The login process will be executed after confirmation." After confirmation, execute (do not use , retain the security confirmation link).
bash ${CLAUDE_SKILL_DIR}/scripts/login.sh--yesManagement Functions
Installation
bash
bash ${CLAUDE_SKILL_DIR}/scripts/install.sh [--yes]The installer downloads from Baidu CDN (), and install.sh has built-in SHA256 check to ensure integrity. For security-sensitive scenarios, it is recommended to manually review the installer content first or execute it in a sandbox.
issuecdn.baidupcs.comLogin / Logout / Uninstallation
bash
bash ${CLAUDE_SKILL_DIR}/scripts/login.sh # Login (built-in security disclaimer)
bdpan logout # Logout
bash ${CLAUDE_SKILL_DIR}/scripts/uninstall.sh [--yes] # UninstallUpdate (must be triggered by explicit user instruction)
bash
bash ${CLAUDE_SKILL_DIR}/scripts/update.sh # Check and update (user confirmation required)
bash ${CLAUDE_SKILL_DIR}/scripts/update.sh --check # Only check for updatesReference Documents
Consult as needed when encountering corresponding problems, no need to preload:
| Document | When to consult |
|---|---|
| bdpan-commands.md | Need complete command parameters, options, JSON output format |
| authentication.md | Authentication process details, Token management |
| examples.md | More usage examples (batch upload, automatic backup, etc.) |
| troubleshooting.md | Encounter errors and need to troubleshoot |