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
/apps/bdpan/
directory.
Compatible products: OpenClaw, Claude Code, DuClaw, KimiClaw, Manus, etc.
In beta testing phase, please refer to reference/notes.md for usage precautions

触发规则

Trigger Rules

同时满足以下两个条件才执行:
  1. 用户明确提及百度网盘——消息中包含 "百度网盘"、"bdpan"、"网盘" 等关键词
  2. 操作意图明确——能确定是以下操作之一:上传、下载、转存、分享、列表查看、登录、注销
不满足时,不执行任何 bdpan 命令。

Execution is only triggered when both of the following conditions are met:
  1. User explicitly mentions Baidu Netdisk — The message contains keywords such as "百度网盘", "bdpan", "网盘" (cloud disk)
  2. 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:
ScenarioDescription
Unclear pathUser does not specify the specific file path or target path
Remote path already existsThere is a file with the same name at the upload target location, ask: Overwrite/Rename/Cancel
Local path already existsThere 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 命令前:
  1. bdpan whoami
    检查登录状态,未登录则引导执行
    @skills/bdpan-storage/scripts/login.sh
  2. 验证路径合法性(禁止
    ../
    ,禁止
    /apps/bdpan
    以外的绝对路径)

Before executing any bdpan command:
  1. Use
    bdpan whoami
    to check login status; if not logged in, guide the user to execute
    @skills/bdpan-storage/scripts/login.sh
  2. Verify path validity (prohibit
    ../
    , prohibit absolute paths outside
    /apps/bdpan
    )

核心功能

Core Features

上传

Upload

bash
bdpan upload <本地路径> <远程路径>
bdpan upload ./project/ project/          # 文件夹需加 /
步骤:确认本地路径存在 → 确认远程路径 → 用
bdpan ls
检查远程是否已存在 → 执行上传
bash
bdpan upload <local path> <remote path>
bdpan upload ./project/ project/          # Add / for folders
Steps: Confirm local path exists → Confirm remote path → Check if remote path exists using
bdpan ls
→ Execute upload

下载

Download

bash
bdpan download <远程路径> <本地路径>
bdpan download report.pdf ./report.pdf
bdpan download backup/ ./backup/          # 文件夹需加 /
步骤:用
bdpan ls
确认云端路径存在 → 确认本地路径 → 检查本地是否已存在 → 执行下载
bash
bdpan download <remote path> <local path>
bdpan download report.pdf ./report.pdf
bdpan download backup/ ./backup/          # Add / for folders
Steps: Confirm cloud path exists using
bdpan ls
→ Confirm local path → Check if local path exists → Execute download

转存(仅转存到网盘,不下载到本地)

Transfer (Only transfer to Netdisk, no local download)

bash
undefined
bash
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

指定目标目录

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
undefined
bash
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
    脚本
  • 禁止直接使用
    bdpan login
    (即使在 GUI 环境)
  • 禁止直接调用
    bdpan login --get-auth-url
    bdpan login --set-code
登录脚本内置了完整的安全免责声明和授权流程,确保用户知情同意。
Must use the login script for login:
bash
bash scripts/login.sh
Mandatory Requirements:
  • Must use the
    @skills/bdpan-storage/scripts/login.sh
    script
  • Prohibit direct use of
    bdpan login
    (even in GUI environments)
  • Prohibit direct calls to
    bdpan login --get-auth-url
    ,
    bdpan login --set-code
The login script includes a complete security disclaimer and authorization process to ensure user informed consent.

注销

Logout

bash
bdpan logout
bash
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 upload ./f.txt docs/f.txt
展示给用户使用中文名"已上传到:我的应用数据/bdpan/docs/f.txt"
映射关系:
我的应用数据
/apps
禁止:
  • 命令中使用中文路径(
    我的应用数据/bdpan/...
  • 展示时暴露 API 路径(
    /apps/bdpan/...
  • 路径包含
    ..
    ~
  • 绝对路径不在
    /apps/bdpan

All remote paths are relative to
/apps/bdpan/
. There are two mapping rules:
ScenarioRuleExample
In commandsUse API paths
bdpan upload ./f.txt docs/f.txt
Displayed to usersUse Chinese names"Uploaded to: My App Data/bdpan/docs/f.txt"
Mapping relationship:
My App Data
/apps
Prohibited:
  • 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 --yes
.
If 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):
DocumentWhen to consult
bdpan-commands.mdNeed complete command parameters, options, JSON output format
authentication.mdDetails of login authentication process, configuration file location, Token management
examples.mdNeed more usage examples (batch upload, automatic backup scripts, etc.)
troubleshooting.mdNeed to troubleshoot errors