xdrop

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Xdrop

Xdrop

Use the bundled scripts inside this skill directory.
使用本skill目录下内置的脚本。

Available scripts

可用脚本

  • scripts/upload.mjs
    — Upload local files or directories to an Xdrop server and print the share link
  • scripts/download.mjs
    — Download an Xdrop share link, decrypt it locally, and save the files
Environment requirements:
  • Bun
  • Local filesystem access
  • Network access to the target Xdrop server
  • scripts/upload.mjs
    — 将本地文件或目录上传到Xdrop服务器并打印分享链接
  • scripts/download.mjs
    — 下载Xdrop分享链接,本地解密后保存文件
环境要求:
  • Bun
  • 本地文件系统访问权限
  • 可访问目标Xdrop服务器的网络

Upload

上传

bash
bun scripts/upload.mjs --server <xdrop-site-url> <file-or-directory> [...]
Prefer these flags when relevant:
  • --quiet
    : suppress progress output and keep stdout clean
  • --json
    : return
    transferId
    ,
    shareUrl
    , and
    expiresAt
  • --expires-in <seconds>
    : choose a supported expiry
  • --api-url <url>
    : override the default
    <server>/api/v1
  • --name <value>
    : set the transfer display name
  • --concurrency <n>
    : limit parallel uploads per file
Useful examples:
bash
bun scripts/upload.mjs --server http://localhost:8080 ./dist/report.pdf
bun scripts/upload.mjs --server http://localhost:8080 --quiet ./archive.zip
bun scripts/upload.mjs --server http://localhost:8080 --expires-in 600 --json ./notes.txt
If the user wants verification, upload a small temporary file and then confirm the public transfer API or browser can open the returned link.
bash
bun scripts/upload.mjs --server <xdrop-site-url> <file-or-directory> [...]
相关场景下优先使用以下参数:
  • --quiet
    : 关闭进度输出,保持stdout干净
  • --json
    : 返回
    transferId
    shareUrl
    expiresAt
    信息
  • --expires-in <seconds>
    : 设置支持的过期时长
  • --api-url <url>
    : 覆盖默认的
    <server>/api/v1
    地址
  • --name <value>
    : 设置传输任务的显示名称
  • --concurrency <n>
    : 限制单个文件的并行上传数
实用示例:
bash
bun scripts/upload.mjs --server http://localhost:8080 ./dist/report.pdf
bun scripts/upload.mjs --server http://localhost:8080 --quiet ./archive.zip
bun scripts/upload.mjs --server http://localhost:8080 --expires-in 600 --json ./notes.txt
如果用户需要验证功能可用性,可以先上传一个小型临时文件,然后确认公共传输API或浏览器可以正常打开返回的链接。

Download

下载

Require the full share link, including
#k=...
. Without the fragment key, the transfer cannot be decrypted.
bash
bun scripts/download.mjs "<share-url>"
Prefer these flags when relevant:
  • --output <dir>
    : choose the destination directory
  • --quiet
    : suppress progress output and keep stdout clean
  • --json
    : return
    transferId
    ,
    outputRoot
    , and saved file paths
  • --api-url <url>
    : override the default
    <share-origin>/api/v1
Useful examples:
bash
bun scripts/download.mjs "http://localhost:8080/t/abc123#k=..."
bun scripts/download.mjs --output ./downloads "http://localhost:8080/t/abc123#k=..."
bun scripts/download.mjs --quiet --json --output ./downloads "http://localhost:8080/t/abc123#k=..."
By default the downloader writes to
./xdrop-<transferId>
and preserves the manifest's relative paths.
需要完整的分享链接,包括
#k=...
片段。缺少该片段密钥的话,无法解密传输内容。
bash
bun scripts/download.mjs "<share-url>"
相关场景下优先使用以下参数:
  • --output <dir>
    : 指定目标存储目录
  • --quiet
    : 关闭进度输出,保持stdout干净
  • --json
    : 返回
    transferId
    outputRoot
    和已保存文件路径信息
  • --api-url <url>
    : 覆盖默认的
    <share-origin>/api/v1
    地址
实用示例:
bash
bun scripts/download.mjs "http://localhost:8080/t/abc123#k=..."
bun scripts/download.mjs --output ./downloads "http://localhost:8080/t/abc123#k=..."
bun scripts/download.mjs --quiet --json --output ./downloads "http://localhost:8080/t/abc123#k=..."
默认情况下,下载器会将文件写入
./xdrop-<transferId>
目录,并保留清单中的相对路径。

Gotchas

注意事项

  • A download link without the
    #k=...
    fragment is not decryptable. Ask for the full original share URL.
  • Use
    --quiet
    whenever another command or caller needs to capture stdout. Progress logs otherwise go to stderr, but the final result still matters.
  • 没有
    #k=...
    片段的下载链接无法解密,请向用户索要完整的原始分享URL。
  • 当其他命令或调用方需要捕获stdout时,请使用
    --quiet
    参数。否则进度日志会输出到stderr,但最终结果仍然有效。

Guardrails

使用限制

  • Prefer
    --quiet
    when another command or script needs to capture stdout.
  • Keep the full share link fragment intact for downloads.
  • Do not bypass the scripts' built-in path sanitization or transfer cleanup behavior with manual ad hoc commands unless the user explicitly asks.
  • 当其他命令或脚本需要捕获stdout时,优先使用
    --quiet
    参数。
  • 下载时请保留完整的分享链接片段不变。
  • 除非用户明确要求,否则不要使用临时手动命令绕过脚本内置的路径消毒或传输清理逻辑。