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-storage

Tags

Translated version includes tags in frontmatter

SKILL.md Content (Chinese)

View Translation Comparison →

Baidu Netdisk Storage Skill

Baidu Netdisk file management tool, all operations are restricted within the
/apps/bdpan/
directory. Compatible with Claude Code, DuClaw, OpenClaw, etc.
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:
  1. The user explicitly mentions "百度网盘", "bdpan", "网盘"
  2. 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)

  1. Login: Must use
    bash ${CLAUDE_SKILL_DIR}/scripts/login.sh
    , direct call to
    bdpan login
    and any of its subcommands/parameters (including
    --get-auth-url
    ,
    --set-code
    , etc., even in GUI environment) is prohibited
  2. Token/Configuration: Reading or outputting the content of
    ~/.config/bdpan/config.json
    (including sensitive credentials such as access_token) is prohibited
  3. Update/Login: Update must be triggered by explicit user instruction, automatic or silent execution is prohibited; Agent is prohibited from using the
    --yes
    parameter to execute update.sh or login.sh
  4. Environment variables: Agent is prohibited from actively setting environment variables such as
    BDPAN_CONFIG_PATH
    ,
    BDPAN_BIN
    ,
    BDPAN_INSTALL_DIR
    (these variables are for users to manually configure outside the script, Agent should not set them on behalf of the user)
  5. Path security: Path traversal (
    ..
    ,
    ~
    ) is prohibited, access to absolute paths outside the scope of
    /apps/bdpan/
    is prohibited

Pre-checks

Execute in order each time it is triggered:
  1. Installation check:
    command -v bdpan
    , if not installed, inform the user and execute
    bash ${CLAUDE_SKILL_DIR}/scripts/install.sh
    after confirmation (you can add
    --yes
    to skip the internal confirmation of the installer after user confirmation)
  2. Login check:
    bdpan whoami
    , if not logged in, guide to execute
    bash ${CLAUDE_SKILL_DIR}/scripts/login.sh
  3. Path verification: Verify that the remote path is within the scope of
    /apps/bdpan/

Confirmation Rules

Risk LevelOperationPolicy
High (confirmation required)
rm
deletion, upload/download target has a file with the same name
List the scope of impact, wait for user confirmation
Medium (confirm when path is ambiguous)upload, download, mv, rename, cpExecute directly if the path is clear, confirm if not clear
Low (execute directly)ls, search, whoami, mkdir, shareNo 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 whoami

List 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 →
bdpan ls
to check if it already exists on the remote end → execute.

Download

Direct download:
bash
bdpan download <remote path> <local path>
Steps:
bdpan ls
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 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 directory

Transfer

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
?pwd=
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.

Share

bash
bdpan share <path> [path...] [--json]
Steps:
bdpan ls
to confirm that the file exists → execute sharing → display link + extract code + validity period.
Paid 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.
--no-dir
and
--dir-only
are mutually exclusive.

Move / 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

ScenarioFormatExample
Command parametersRelative path (relative to
/apps/bdpan/
)
bdpan upload ./f.txt docs/f.txt
Display to userChinese name"Uploaded to: 我的应用数据/bdpan/docs/f.txt"
Mapping relationship:
我的应用数据
/apps
Prohibited: Use Chinese paths (
我的应用数据/...
) in commands, expose API paths (
/apps/bdpan/...
) when displaying.

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
bash ${CLAUDE_SKILL_DIR}/scripts/login.sh
(do not use
--yes
, retain the security confirmation link).

Management Functions

Installation

bash
bash ${CLAUDE_SKILL_DIR}/scripts/install.sh [--yes]
The installer downloads from Baidu CDN (
issuecdn.baidupcs.com
), 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.

Login / 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]   # Uninstall

Update (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 updates

Reference Documents

Consult as needed when encountering corresponding problems, no need to preload:
DocumentWhen to consult
bdpan-commands.mdNeed complete command parameters, options, JSON output format
authentication.mdAuthentication process details, Token management
examples.mdMore usage examples (batch upload, automatic backup, etc.)
troubleshooting.mdEncounter errors and need to troubleshoot