← 返回 Skills 市场
sky-lv

Baidu Cloud Storage

作者 SKY-lv · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
36
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install baidu-cloud-storage
功能描述
百度网盘(Baidu Drive)文件管理 — 上传、下载、转存、分享、搜索、移动、复制、重命名、创建文件夹。 同时支持 Agent 记忆备份/恢复(kimiclaw/maxclaw/qclaw/openclaw)。 TRIGGER: 用户提及"百度网盘/bdpan/网盘/云盘/baidu drive/Baidu...
使用说明 (SKILL.md)

百度网盘存储 Skill

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

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

触发规则

网盘文件操作触发

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

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

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

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

记忆备份/恢复触发

以下表达即使未提及"网盘"也应触发(仅限 kimiclaw/maxclaw/qclaw/openclaw 环境):

用户说法示例 触发操作
"备份记忆"、"备份我的记忆"、"把记忆存到网盘" backup
"查看记忆备份"、"有哪些备份"、"备份列表" list
"恢复记忆"、"还原记忆"、"回滚记忆"、"记忆回档" restore(需确认日期)
"恢复 3月16号 的记忆"、"恢复 2026-03-16 的备份" restore 指定日期

以下情况不触发记忆备份/恢复:

  • "帮我记住…"、"整理记忆"、"清理记忆"(本地操作,不涉及网盘)
  • "备份我的代码/文件"(操作对象不是记忆)
  • 非以上 4 种 Claw 环境(报错说明不支持,不执行)

区分原则: 操作对象是否为 Agent 记忆文件(AGENTS.md、SOUL.md、MEMORY.md、memory/*.md 等)。


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

  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/ 范围外的绝对路径
  6. 记忆备份约束:禁止直接用裸 bdpan upload/download 命令操作记忆目录;必须通过 bash ${CLAUDE_SKILL_DIR}/scripts/memory-backup.sh 脚本执行,以确保 manifest 生成、路径安全检查、safety net 备份等机制正常运行

前置检查

每次触发时按顺序执行:

  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 \x3C本地路径> \x3C远端路径>

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

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

下载

直接下载:

bdpan download \x3C远端路径> \x3C本地路径>

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

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

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

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

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

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

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

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

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

分享

bdpan share \x3C路径> [路径...] [--period \x3C天数>] [--json]

--period / -d 参数: 分享有效期(天),取值:0=永久, 1, 7, 30(默认:7)

智能选择规则:

Agent 必须根据用户的语义意图判断有效期,而非仅匹配固定关键词。

  • 用户表达了"希望长期有效/永久/不过期/一直能用"等语义 → 使用 --period 0,并提示用户:永久链接无法自动过期,请注意文件安全
  • 用户指定了具体天数或时间范围 → 选择最接近的枚举值(1、7、30)
  • 用户未表达任何有效期偏好 → 默认 --period 7

步骤:bdpan ls 确认文件存在 → 根据用户意图选择有效期 → 执行分享 → 展示链接+提取码+有效期。

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

搜索

bdpan search \x3C关键词> [--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 \x3C源路径> \x3C目标目录>
bdpan cp \x3C源路径> \x3C目标目录>
bdpan rename \x3C路径> \x3C新名称>       # 第二参数是文件名,非完整路径
bdpan mkdir \x3C路径>

路径规则

场景 格式 示例
命令参数 相对路径(相对于 /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       # 仅检查更新

记忆备份与恢复

仅支持 4 种 Claw 产品(kimiclaw、maxclaw、qclaw、openclaw),自动检测当前环境。

网盘存储路径: /apps/bdpan/agent-memory/\x3Cagent>/\x3Cdevice>/manual/\x3Ctimestamp>/

备份内容: 7 个 Workspace 文件(AGENTS.md、SOUL.md、USER.md、IDENTITY.md、TOOLS.md、MEMORY.md、HEARTBEAT.md)+ memory/*.md + manifest.json

备份记忆

bash ${CLAUDE_SKILL_DIR}/scripts/memory-backup.sh backup

查看备份列表

bash ${CLAUDE_SKILL_DIR}/scripts/memory-backup.sh list

恢复备份

# 按日期模糊匹配(如只输入日期部分)
bash ${CLAUDE_SKILL_DIR}/scripts/memory-backup.sh restore 2026-03-16

# 跳过兼容性警告强制恢复(跨 Agent 类型时使用)
bash ${CLAUDE_SKILL_DIR}/scripts/memory-backup.sh restore 2026-03-16 --force

恢复安全机制: 恢复前自动将当前本地记忆备份到 \x3Cworkspace>/.backup-before-restore/\x3Ctimestamp>/,防止误操作数据丢失。

操作流程

  1. 执行前自动检查:bdpan 是否安装 → 是否已登录(未满足则引导处理)
  2. 检测当前 Agent 类型 → 不支持的环境报错退出
  3. 执行对应操作(backup/list/restore)

参考文档

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

文档 何时查阅
bdpan-commands.md 需要完整命令参数、选项、JSON 输出格式
authentication.md 认证流程细节、Token 管理
examples.md 更多使用示例(批量上传、自动备份等)
troubleshooting.md 遇到错误需要排查
安全使用建议
Install only if you want an agent to manage Baidu Drive files and, on request, back up agent memory files to Baidu Drive. Review uploads, share-link creation, restores, updates, and uninstall actions before approving them, and avoid using the login flow on shared or untrusted machines.
能力标签
requires-oauth-tokenrequires-sensitive-credentials
能力评估
Purpose & Capability
The capabilities match the stated purpose: Baidu Drive file operations, OAuth login, install/update helpers, and agent memory backup/restore to Baidu Drive.
Instruction Scope
The main skill defines trigger rules, path limits under /apps/bdpan/, credential-handling restrictions, and confirmation rules; some examples are less privacy-explicit, but the primary instructions disclose the sensitive operations.
Install Mechanism
The installer downloads and runs the bdpan CLI from a Baidu CDN with platform checks and SHA256 verification; the updater can replace skill files from Baidu-provided update metadata after user confirmation.
Credentials
Bash, filesystem access, OAuth credentials, and network use are proportionate for managing a cloud-drive CLI and backing up selected agent memory files.
Persistence & Privilege
The skill stores/uses Baidu Drive authentication via the bdpan CLI config and can delete it on uninstall; it explicitly tells agents not to read or print token config contents.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install baidu-cloud-storage
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /baidu-cloud-storage 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
baidu-cloud-storage 1.0.0 - Initial release as "bdpan-storage": provides comprehensive Baidu Netdisk file management (upload, download, transfer, share, search, move, copy, rename, create folders). - Supports memory backup/restore for kimiclaw, maxclaw, qclaw, and openclaw agents. - Detailed triggering, confirmation, and security rules implemented for safe operations. - Enforces operations only within the /apps/bdpan/ directory and uses custom scripts for login/authentication flow. - Special handling for large file downloads (background tasks with progress reporting). - Includes full management, backup, and restore workflows with layered checks and user confirmations.
元数据
Slug baidu-cloud-storage
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Baidu Cloud Storage 是什么?

百度网盘(Baidu Drive)文件管理 — 上传、下载、转存、分享、搜索、移动、复制、重命名、创建文件夹。 同时支持 Agent 记忆备份/恢复(kimiclaw/maxclaw/qclaw/openclaw)。 TRIGGER: 用户提及"百度网盘/bdpan/网盘/云盘/baidu drive/Baidu... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 36 次。

如何安装 Baidu Cloud Storage?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install baidu-cloud-storage」即可一键安装,无需额外配置。

Baidu Cloud Storage 是免费的吗?

是的,Baidu Cloud Storage 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Baidu Cloud Storage 支持哪些平台?

Baidu Cloud Storage 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Baidu Cloud Storage?

由 SKY-lv(@sky-lv)开发并维护,当前版本 v1.0.0。

💬 留言讨论