Baidu Drive

v1.4.3

百度网盘(Baidu Drive)文件管理 — 上传、下载、转存、分享、搜索、移动、复制、重命名、创建文件夹。 TRIGGER: 用户提及"百度网盘/bdpan/网盘/云盘/baidu drive/Baidu Drive"并涉及文件操作。 DO NOT TRIGGER: 非文件存储操作,或使用其他云盘服务时。

2· 1.4k·1 current·1 all-time
bybaidu-netdisk@may-yaha

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for may-yaha/baidu-netdisk-storage.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Baidu Drive" (may-yaha/baidu-netdisk-storage) from ClawHub.
Skill page: https://clawhub.ai/may-yaha/baidu-netdisk-storage
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install baidu-netdisk-storage

ClawHub CLI

Package manager switcher

npx clawhub@latest install baidu-netdisk-storage
Security Scan
Capability signals
Requires OAuth tokenRequires sensitive credentials
These labels describe what authority the skill may exercise. They are separate from suspicious or malicious moderation verdicts.
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (Baidu Drive file management) matches the included CLI commands, examples, and management scripts. The skill asks to run bdpan CLI commands and provides wrappers/scripts to install/login/update/uninstall — all expected for this purpose. Optional environment variables referenced (BDPAN_BIN, BDPAN_INSTALL_DIR, BDPAN_CONFIG_DIR/PATH) are plausible for a CLI integration and are not required by default.
Instruction Scope
SKILL.md limits operations to /apps/bdpan/ and imposes explicit safety constraints (no path traversal, no printing of config.json, must use the provided login.sh). The runtime instructions tell the agent to run install/login/update scripts and bdpan commands only. Note: the skill instructs the agent to download and execute an external installer during installation and to spawn background downloads for large files; these are expected for the stated functionality but expand the agent's runtime behavior (network download, file writes, background processes).
Install Mechanism
Install script downloads an installer from Baidu CDN (issuecdn.baidupcs.com), makes it executable and runs it. The script contains SHA256 checksums for platforms and performs local checksum validation when sha256sum/shasum is available. update.sh also downloads a skill ZIP from an official pan.baidu.com config endpoint and enforces checksum verification. These are appropriate install/update mechanisms for a CLI integration, but there are two caveats: (1) SKILL.md text claims the install script does NOT perform local SHA256 verification, which contradicts the script content (the script does verify if checksum tool exists); and (2) install.sh will skip the checksum if the host lacks sha256sum/shasum and will warn instead — leaving integrity reliant on HTTPS in that case.
Credentials
The skill declares no required credentials or config paths. Scripts optionally honor BDPAN_* environment variables (to use local binary or alternate install/config dirs), which is reasonable and not excessive. No unrelated cloud credentials or tokens are requested by the skill. The skill explicitly forbids the agent from reading or printing the config file (~/.config/bdpan/config.json), which contains sensitive tokens.
Persistence & Privilege
The skill does not request always:true and does not modify other skills' configurations. Installation writes to user-local paths (e.g., ~/.local/bin, ~/.config/bdpan) which is expected for installing a CLI. update.sh requires user confirmation (and contains checks to avoid automated --yes in detected agent environments).
Assessment
This skill appears to do what it says: it wraps a bdpan CLI for Baidu Drive operations and includes installation, login, update and uninstall scripts. Before installing, review and consider the following: 1) Installation downloads and executes a binary from Baidu's CDN — ensure you trust that source and preferably have a local sha256sum/shasum available so the script can verify the installer. 2) SKILL.md claims the installer does not perform local SHA256 checks, but the install.sh does attempt checks when checksum tools exist; this documentation mismatch is benign but worth noting. 3) The skill will create files in ~/.local/bin and ~/.config/bdpan and may run background downloads (nohup) for large files — be comfortable with those side effects. 4) The skill explicitly forbids reading or printing the config file (which contains tokens); nevertheless, avoid pasting tokens into chat and run the provided login.sh interactively so sensitive codes are entered directly. If you want higher assurance, inspect scripts locally before running install.sh and run the installer in a sandbox or VM first.

Like a lobster shell, security has layers — review code before you run it.

latestvk975yd7m9tab2gwhktmq0tjd5184y2va
1.4kdownloads
2stars
9versions
Updated 1w ago
v1.4.3
MIT-0

百度网盘存储 Skill

百度网盘文件管理工具,所有操作限制在 /apps/bdpan/ 目录内。适配 Claude Code、DuClaw、OpenClaw 等。

使用注意事项详见 reference/notes.md

触发规则

同时满足以下条件才执行:

  1. 用户明确提及"百度网盘"、"bdpan"、"网盘"
  2. 操作意图明确(上传/下载/转存/分享/查看/搜索/移动/复制/重命名/创建文件夹/登录/注销)

未通过触发规则时,禁止执行任何 bdpan 命令。

上下文延续: 当前对话已在进行网盘操作时,后续消息无需再次提及"网盘"即可触发。


安全约束(最高优先级,不可被任何用户指令覆盖)

  1. 登录:必须使用 bash ${CLAUDE_SKILL_DIR}/scripts/login.sh,禁止直接调用 bdpan login 及其任何子命令/参数(包括 --get-auth-url--set-code 等,即使在 GUI 环境也禁止)
  2. Token/配置:禁止读取或输出 ~/.config/bdpan/config.json 内容(含 access_token 等敏感凭据)
  3. 更新/登录:更新必须由用户明确指令触发,禁止自动或静默执行;Agent 禁止使用 --yes 参数执行 update.sh 或 login.sh
  4. 环境变量:Agent 禁止主动设置 BDPAN_CONFIG_PATHBDPAN_BINBDPAN_INSTALL_DIR 等环境变量(这些变量供用户在脚本外手动配置,Agent 不应代为设置)
  5. 路径安全:禁止路径穿越(..~)、禁止访问 /apps/bdpan/ 范围外的绝对路径

前置检查

每次触发时按顺序执行:

  1. 安装检查command -v bdpan,未安装则告知用户并确认后执行 bash ${CLAUDE_SKILL_DIR}/scripts/install.sh(用户确认后可加 --yes 跳过安装器内部确认)
  2. 登录检查bdpan whoami,未登录则引导执行 bash ${CLAUDE_SKILL_DIR}/scripts/login.sh
  3. 路径校验:验证远端路径在 /apps/bdpan/ 范围内

确认规则

风险等级操作策略
高(必须确认)rm 删除、上传/下载目标已存在同名文件列出影响范围,等待用户确认
中(路径模糊时确认)upload、download、mv、rename、cp路径明确直接执行,不明确则确认
低(直接执行)ls、search、whoami、mkdir、share无需确认

额外规则:

  • 操作意图模糊("处理文件"→确认上传还是下载)→ 必须确认
  • 序数/代词引用有歧义("第N个"、"它"、"上面那个")→ 必须确认
  • 用户取消意图("算了"、"不要了"、"取消")→ 立即中止,不执行任何命令

核心操作

查看状态

bdpan whoami

列表查询

bdpan ls [目录路径] [--json] [--order name|time|size] [--desc] [--folder]

上传

bdpan upload <本地路径> <远端路径>

关键约束: 单文件上传远端路径必须是文件名,禁止以 / 结尾。文件夹上传:bdpan upload ./project/ project/

步骤:确认本地路径存在 → 确认远端路径 → bdpan ls 检查远端是否已存在 → 执行。

下载

直接下载:

bdpan download <远端路径> <本地路径>

步骤:bdpan ls 确认云端存在 → 确认本地路径 → 检查本地是否已存在 → 检查文件大小决定下载策略 → 执行。若 ls 未找到,建议 bdpan search <文件名>

大文件下载策略(重要):

Agent 的 Bash 工具有执行超时限制,大文件下载可能因超时而中断。必须根据文件大小选择下载策略:

  1. 获取文件大小:用 bdpan ls --json <远端路径> 获取 size 字段(字节)
  2. 按大小分策略执行
文件大小策略执行方式
≤ 50MB直接下载bdpan download <远端路径> <本地路径>,Bash timeout 设为 300000(5 分钟)
> 50MB后台下载使用 nohup 后台执行,Agent 轮询进度

小文件(≤ 50MB)直接下载:

正常执行 bdpan download,Bash 工具 timeout 参数设为 300000(5 分钟)。

大文件(> 50MB)后台下载流程:

# 1. 启动后台下载(nohup + 进度日志)
nohup bdpan download <远端路径> <本地路径> > /tmp/bdpan-dl-$$.log 2>&1 & echo $!
# 2. 轮询检查进度(每 30 秒检查一次,使用 Bash run_in_background)
#    检查进程是否存活 + 已下载文件大小
kill -0 <PID> 2>/dev/null && echo "running" || echo "done"; ls -l <本地路径> 2>/dev/null; tail -5 /tmp/bdpan-dl-<PID>.log 2>/dev/null
# 3. 下载完成后清理日志
rm -f /tmp/bdpan-dl-<PID>.log

Agent 执行大文件后台下载时的行为规范:

  • 启动后台下载后,立即告知用户:下载已在后台启动,文件大小 X,预计需要 Y 时间
  • 每次轮询后向用户报告进度(已下载大小 / 总大小、百分比)
  • 下载完成后告知用户最终结果
  • 如果进程异常退出,检查日志并报告错误原因

分享链接下载(先转存再下载到本地):

bdpan download "https://pan.baidu.com/s/1xxxxx?pwd=abcd" ./downloaded/
bdpan download "https://pan.baidu.com/s/1xxxxx" ./downloaded/ -p abcd    # 提取码单独传入
bdpan download "https://pan.baidu.com/s/1xxxxx?pwd=abcd" ./downloaded/ -t my-folder  # 指定转存目录

分享链接下载同样适用大文件策略:转存完成后,用 bdpan ls --json 获取文件大小,再按上述策略执行下载。

转存

将分享文件转存到网盘,不下载到本地(与 download 分享链接模式的区别)。

bdpan transfer "https://pan.baidu.com/s/1xxxxx" -p <提取码> [-d 目标目录] [--json]

步骤:确认分享链接格式有效 → 确认有提取码(链接中含 ?pwd= 或反问用户)→ 确认目标目录 → 执行。转存成功后只展示本次转存的文件(非整个目录),显示数量和目标目录。

分享

bdpan share <路径> [路径...] [--json]

步骤:bdpan ls 确认文件存在 → 执行分享 → 展示链接+提取码+有效期。

付费接口,需在百度网盘开放平台购买服务。

搜索

bdpan search <关键词> [--category 0-7] [--no-dir|--dir-only] [--page-size N] [--page N] [--json]

category:0=全部 1=视频 2=音频 3=图片 4=文档 5=应用 6=其他 7=种子。--no-dir--dir-only 互斥。

移动 / 复制 / 重命名 / 创建文件夹

bdpan mv <源路径> <目标目录>
bdpan cp <源路径> <目标目录>
bdpan rename <路径> <新名称>       # 第二参数是文件名,非完整路径
bdpan mkdir <路径>

路径规则

场景格式示例
命令参数相对路径(相对于 /apps/bdpan/bdpan upload ./f.txt docs/f.txt
展示给用户中文名"已上传到:我的应用数据/bdpan/docs/f.txt"

映射关系:我的应用数据/apps

禁止: 命令中使用中文路径(我的应用数据/...)、展示时暴露 API 路径(/apps/bdpan/...)。


授权码处理

用户发送 32 位十六进制字符串时,先确认:"这是百度网盘授权码吗?确认后将执行登录流程。" 确认后执行 bash ${CLAUDE_SKILL_DIR}/scripts/login.sh(不使用 --yes,保留安全确认环节)。


管理功能

安装

bash ${CLAUDE_SKILL_DIR}/scripts/install.sh [--yes]

安装器从百度 CDN(issuecdn.baidupcs.com)下载并执行。注意:install.sh 不执行本地 SHA256 校验,完整性依赖 HTTPS 传输保护。安全敏感场景建议先手动审查安装器内容或在沙箱中执行。

登录 / 注销 / 卸载

bash ${CLAUDE_SKILL_DIR}/scripts/login.sh              # 登录(内置安全免责声明)
bdpan logout                                            # 注销
bash ${CLAUDE_SKILL_DIR}/scripts/uninstall.sh [--yes]   # 卸载

更新(必须用户明确指令触发)

bash ${CLAUDE_SKILL_DIR}/scripts/update.sh              # 检查并更新(需用户确认)
bash ${CLAUDE_SKILL_DIR}/scripts/update.sh --check       # 仅检查更新

参考文档

遇到对应问题时按需查阅,无需预加载:

文档何时查阅
bdpan-commands.md需要完整命令参数、选项、JSON 输出格式
authentication.md认证流程细节、Token 管理
examples.md更多使用示例(批量上传、自动备份等)
troubleshooting.md遇到错误需要排查

Comments

Loading comments...