Xdrop
Use the bundled scripts inside this skill directory.
Available scripts
- -
scripts/upload.mjs — Upload local files or directories to an Xdrop server and print the share link - INLINECODE1 — 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
Upload
CODEBLOCK0
Prefer these flags when relevant:
- -
--quiet: suppress progress output and keep stdout clean - INLINECODE3 : return
transferId, shareUrl, and INLINECODE6 - INLINECODE7 : choose a supported expiry
- INLINECODE8 : override the default INLINECODE9
- INLINECODE10 : set the transfer display name
- INLINECODE11 : limit parallel uploads per file
Useful examples:
CODEBLOCK1
If the user wants verification, upload a small temporary file and then confirm the public transfer API or browser can open the returned link.
Download
Require the full share link, including #k=.... Without the fragment key, the transfer cannot be decrypted.
CODEBLOCK2
Prefer these flags when relevant:
- -
--output <dir>: choose the destination directory - INLINECODE14 : suppress progress output and keep stdout clean
- INLINECODE15 : return
transferId, outputRoot, and saved file paths - INLINECODE18 : override the default INLINECODE19
Useful examples:
CODEBLOCK3
By default the downloader writes to ./xdrop-<transferId> and preserves the manifest's relative paths.
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.
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.
Xdrop
使用此技能目录内的捆绑脚本。
可用脚本
- - scripts/upload.mjs — 将本地文件或目录上传至Xdrop服务器并打印分享链接
- scripts/download.mjs — 下载Xdrop分享链接,在本地解密并保存文件
环境要求:
- - Bun
- 本地文件系统访问权限
- 目标Xdrop服务器的网络访问权限
上传
bash
bun scripts/upload.mjs --server [...]
相关情况下优先使用以下标志:
- - --quiet:抑制进度输出,保持标准输出干净
- --json:返回transferId、shareUrl和expiresAt
- --expires-in :选择支持的过期时间
- --api-url :覆盖默认的/api/v1
- --name :设置传输显示名称
- --concurrency :限制每个文件的并行上传数
实用示例:
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或浏览器能打开返回的链接。
下载
需要完整的分享链接,包含#k=...。缺少片段密钥则无法解密传输。
bash
bun scripts/download.mjs
相关情况下优先使用以下标志:
- - --output :选择目标目录
- --quiet:抑制进度输出,保持标准输出干净
- --json:返回transferId、outputRoot和保存的文件路径
- --api-url :覆盖默认的/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-目录,并保留清单文件的相对路径。
注意事项
- - 缺少#k=...片段的下载链接无法解密。请索取完整的原始分享URL。
- 当其他命令或调用者需要捕获标准输出时,请使用--quiet。进度日志默认输出到标准错误,但最终结果仍然重要。
安全护栏
- - 当其他命令或脚本需要捕获标准输出时,优先使用--quiet。
- 下载时保持完整分享链接片段不变。
- 除非用户明确要求,否则不要使用手动临时命令绕过脚本内置的路径清理或传输清理行为。