bdpan-storage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese百度网盘存储 Skill
Baidu Netdisk Storage Skill
百度网盘文件管理工具,支持上传、下载、转存、分享、列表查询。所有操作限制在 目录内。
/apps/bdpan/适配产品: OpenClaw, Claude Code, DuClaw, KimiClaw, Manus 等。
内测阶段,使用注意事项详见 reference/notes.md
Baidu Netdisk file management tool that supports upload, download, transfer, sharing, and list query. All operations are restricted to the directory.
/apps/bdpan/Compatible products: OpenClaw, Claude Code, DuClaw, KimiClaw, Manus, etc.
In beta testing phase, please refer to reference/notes.md for usage precautions
触发规则
Trigger Rules
同时满足以下两个条件才执行:
- 用户明确提及百度网盘——消息中包含 "百度网盘"、"bdpan"、"网盘" 等关键词
- 操作意图明确——能确定是以下操作之一:上传、下载、转存、分享、列表查看、登录、注销
不满足时,不执行任何 bdpan 命令。
Execution is only triggered when both of the following conditions are met:
- User explicitly mentions Baidu Netdisk — The message contains keywords such as "百度网盘", "bdpan", "网盘" (cloud disk)
- Clear operation intent — Can confirm it is one of the following operations: upload, download, transfer, sharing, list query, login, logout
No bdpan commands will be executed if the conditions are not met.
确认规则
Confirmation Rules
以下场景必须先向用户确认,不得直接执行:
| 场景 | 说明 |
|---|---|
| 路径不明确 | 用户未指定具体文件路径或目标路径 |
| 远程路径已存在 | 上传目标位置有同名文件,询问:覆盖/重命名/取消 |
| 本地路径已存在 | 下载目标位置有同名文件,询问:覆盖/重命名/取消 |
| 操作意图模糊 | "处理文件"→确认上传还是下载;"同步"→确认方向;"备份"→确认方向 |
确认时使用以下格式:
操作类型: [上传/下载/分享/列表]
源路径: [路径]
目标路径: [路径]
请确认是否执行?Must confirm with the user first in the following scenarios, do not execute directly:
| Scenario | Description |
|---|---|
| Unclear path | User does not specify the specific file path or target path |
| Remote path already exists | There is a file with the same name at the upload target location, ask: Overwrite/Rename/Cancel |
| Local path already exists | There is a file with the same name at the download target location, ask: Overwrite/Rename/Cancel |
| Ambiguous operation intent | "Process file" → Confirm upload or download; "Sync" → Confirm direction; "Backup" → Confirm direction |
Use the following format for confirmation:
Operation Type: [Upload/Download/Share/List]
Source Path: [Path]
Target Path: [Path]
Please confirm execution?前置检查
Pre-checks
每次执行 bdpan 命令前:
- 检查登录状态,未登录则引导执行
bdpan whoami@skills/bdpan-storage/scripts/login.sh - 验证路径合法性(禁止 ,禁止
../以外的绝对路径)/apps/bdpan
Before executing any bdpan command:
- Use to check login status; if not logged in, guide the user to execute
bdpan whoami@skills/bdpan-storage/scripts/login.sh - Verify path validity (prohibit , prohibit absolute paths outside
../)/apps/bdpan
核心功能
Core Features
上传
Upload
bash
bdpan upload <本地路径> <远程路径>
bdpan upload ./project/ project/ # 文件夹需加 /步骤:确认本地路径存在 → 确认远程路径 → 用 检查远程是否已存在 → 执行上传
bdpan lsbash
bdpan upload <local path> <remote path>
bdpan upload ./project/ project/ # Add / for foldersSteps: Confirm local path exists → Confirm remote path → Check if remote path exists using → Execute upload
bdpan ls下载
Download
bash
bdpan download <远程路径> <本地路径>
bdpan download report.pdf ./report.pdf
bdpan download backup/ ./backup/ # 文件夹需加 /步骤:用 确认云端路径存在 → 确认本地路径 → 检查本地是否已存在 → 执行下载
bdpan lsbash
bdpan download <remote path> <local path>
bdpan download report.pdf ./report.pdf
bdpan download backup/ ./backup/ # Add / for foldersSteps: Confirm cloud path exists using → Confirm local path → Check if local path exists → Execute download
bdpan ls转存(仅转存到网盘,不下载到本地)
Transfer (Only transfer to Netdisk, no local download)
bash
undefinedbash
undefined基本用法 - 转存到应用根目录 /apps/bdpan/
Basic usage - Transfer to app root directory /apps/bdpan/
bdpan transfer <分享链接> -p <提取码>
bdpan transfer <share link> -p <extraction code>
提取码在链接中
Extraction code included in the link
bdpan transfer "https://pan.baidu.com/s/1xxxxx?pwd=abcd"
bdpan transfer "https://pan.baidu.com/s/1xxxxx?pwd=abcd"
指定目标目录
Specify target directory
bdpan transfer <分享链接> -p <提取码> -d my-folder/
bdpan transfer <share link> -p <extraction code> -d my-folder/
JSON 输出
JSON output
bdpan transfer <分享链接> -p <提取码> --json
步骤:验证链接格式 → 确认有提取码 → 确认目标目录 → 执行转存bdpan transfer <share link> -p <extraction code> --json
Steps: Verify link format → Confirm extraction code is provided → Confirm target directory → Execute transfer分享链接下载
Share Link Download
bash
undefinedbash
undefined链接中含提取码
Extraction code included in the link
bdpan download "https://pan.baidu.com/s/1xxxxx?pwd=abcd" <本地路径>
bdpan download "https://pan.baidu.com/s/1xxxxx?pwd=abcd" <local path>
单独传入提取码
Pass extraction code separately
bdpan download "https://pan.baidu.com/s/1xxxxx" <本地路径> -p <提取码>
bdpan download "https://pan.baidu.com/s/1xxxxx" <local path> -p <extraction code>
指定转存目录
Specify transfer directory
bdpan download "<链接>" <本地路径> -t <转存目录>
步骤:验证链接格式 → 确认有提取码 → 确认本地保存路径 → 执行下载bdpan download "<link>" <local path> -t <transfer directory>
Steps: Verify link format → Confirm extraction code is provided → Confirm local save path → Execute download分享
Sharing
bash
bdpan share <远程路径>
bdpan share <路径1> <路径2> # 多文件分享bash
bdpan share <remote path>
bdpan share <path1> <path2> # Share multiple files列表查询
List Query
bash
bdpan ls # 根目录
bdpan ls <目录路径> # 指定目录
bdpan ls --json # JSON 输出bash
bdpan ls # Root directory
bdpan ls <directory path> # Specified directory
bdpan ls --json # JSON output登录
Login
必须使用登录脚本执行登录:
bash
bash scripts/login.sh强制要求:
- ✅ 必须使用 脚本
@skills/bdpan-storage/scripts/login.sh - ❌ 禁止直接使用 (即使在 GUI 环境)
bdpan login - ❌ 禁止直接调用 、
bdpan login --get-auth-urlbdpan login --set-code
登录脚本内置了完整的安全免责声明和授权流程,确保用户知情同意。
Must use the login script for login:
bash
bash scripts/login.shMandatory Requirements:
- ✅ Must use the script
@skills/bdpan-storage/scripts/login.sh - ❌ Prohibit direct use of (even in GUI environments)
bdpan login - ❌ Prohibit direct calls to ,
bdpan login --get-auth-urlbdpan login --set-code
The login script includes a complete security disclaimer and authorization process to ensure user informed consent.
注销
Logout
bash
bdpan logoutbash
bdpan logout版本管理
Version Management
bash
bdpan update check # 检查更新
bdpan update # 执行更新(需用户确认)
bdpan update rollback # 回滚(需用户确认)bash
bdpan update check # Check for updates
bdpan update # Execute update (requires user confirmation)
bdpan update rollback # Rollback (requires user confirmation)路径规则
Path Rules
所有远程路径相对于 。有两条映射规则:
/apps/bdpan/| 场景 | 规则 | 示例 |
|---|---|---|
| 命令中 | 使用 API 路径 | |
| 展示给用户 | 使用中文名 | "已上传到:我的应用数据/bdpan/docs/f.txt" |
映射关系: ↔
我的应用数据/apps禁止:
- 命令中使用中文路径()
我的应用数据/bdpan/... - 展示时暴露 API 路径()
/apps/bdpan/... - 路径包含 或
..~ - 绝对路径不在 下
/apps/bdpan
All remote paths are relative to . There are two mapping rules:
/apps/bdpan/| Scenario | Rule | Example |
|---|---|---|
| In commands | Use API paths | |
| Displayed to users | Use Chinese names | "Uploaded to: My App Data/bdpan/docs/f.txt" |
Mapping relationship: ↔
My App Data/appsProhibited:
- Using Chinese paths in commands ()
我的应用数据/bdpan/... - Exposing API paths when displaying ()
/apps/bdpan/... - Paths containing or
..~ - Absolute paths outside
/apps/bdpan
授权码处理
Authorization Code Handling
当用户在对话中发送 32 位十六进制字符串且上下文与百度网盘登录相关时,将其作为授权码处理,执行 。
bash scripts/login.sh --yes如果上下文不明确,先向用户确认:"这是百度网盘授权码吗?"
When the user sends a 32-bit hexadecimal string in the conversation and the context is related to Baidu Netdisk login, treat it as an authorization code and execute .
bash scripts/login.sh --yesIf the context is unclear, first confirm with the user: "Is this the Baidu Netdisk authorization code?"
参考文档
Reference Documents
详细信息参见 reference 目录(遇到对应问题时查阅):
| 文档 | 何时查阅 |
|---|---|
| bdpan-commands.md | 需要完整命令参数、选项、JSON 输出格式时 |
| authentication.md | 登录认证流程细节、配置文件位置、Token 管理时 |
| examples.md | 需要更多使用示例(批量上传、自动备份脚本等)时 |
| troubleshooting.md | 遇到错误需要排查时 |
For detailed information, refer to the reference directory (consult when encountering corresponding issues):
| Document | When to consult |
|---|---|
| bdpan-commands.md | Need complete command parameters, options, JSON output format |
| authentication.md | Details of login authentication process, configuration file location, Token management |
| examples.md | Need more usage examples (batch upload, automatic backup scripts, etc.) |
| troubleshooting.md | Need to troubleshoot errors |