CLI 目录 横向对比 FCRS-1.0 标准 /llms.txt
← 返回 CLI 目录

aria2

$ aria2c 社区开源 低风险
aria2 · 浏览器与网页抓取 · GPL-2.0 · macos / linux / windows

aria2(aria2c)通过分段多连接(-x、-s)加速文件下载,支持 BitTorrent 与 Metalink、断点续传(-c)及可选 JSON-RPC/XML-RPC 接口(--enable-rpc),适合在无头自动化中稳定拉取大体积产物。

FCRS-1.0 综合评分
80 /100
良好 (Good)
中置信度 (源码/文档)
零摩擦安装命令
brew install aria2
CLI vs MCP 选型建议 仅 CLI 可用

aria2c 直接将数 GB 分段下载流式写入本地磁盘并完成断点续传与校验和验证,无法经由 MCP 服务器中转。

Agent 友好度体检单

— 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
— 只读模式开关
— 支持 NO_COLOR
✓ 自省/Schema 发现
— 官方 SKILL.md

当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。

FCRS-1.0 六维评分拆解

Agent 友好度 18 / 25

参数确定性强(-x、-s、-d、-o、--checksum、--show-files)且支持 JSON-RPC,但标准 CLI 默认输出进度文本而非 --json。

  • Supports non-interactive batch downloads (-i urls.txt) and JSON-RPC (--enable-rpc)
  • CLI progress stdout is unstructured unless silenced (-q)
安全与权限边界 20 / 25

支持 --checksum 哈希校验且默认采用 --allow-overwrite=false 避免静默覆盖,但下载落盘需配合 -d/-o 约束路径。

  • Built-in --checksum hash verification and --rpc-secret auth
  • Refuses silent overwrites unless --allow-overwrite=true is passed
安装与运行摩擦 15 / 15

原生 C++ 二进制,已收录于 Homebrew、apt、apk、winget 等全平台包管理器。

  • Lightweight C++ binary available across all major package managers
能力覆盖与边际价值 12 / 15

在大文件多线程并发、断点续传与多源校验方面显著优于单连接 curl。

  • Supports HTTP/HTTPS, FTP, SFTP, BitTorrent, and Metalink in one binary
维护与来源背书 7 / 10

成熟的 GPL-2.0 社区项目(aria2/aria2),核心稳定但版本迭代较慢。

  • Long-standing aria2/aria2 repository under GPL-2.0
文档与可验证性 8 / 10

官方手册详尽,并支持按分类检索帮助(如 --help=#<tag>、--help=#http)。

  • Manual at aria2.github.io/manual and categorized --help=#http

安全边界、鉴权与放权指南

鉴权方式
无需鉴权 本地配置文件
凭证存储位置

可选从 ~/.netrc 或 ~/.aria2/aria2.conf 读取 HTTP/FTP 凭据,并通过 --rpc-secret 保护 RPC 接口。

潜在副作用
只读查询 本地写入
费用与配额提示

GPL-2.0 开源 C++ 二进制,完全免费。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# aria2 (aria2c) Agent Rules
- Always specify an explicit output directory (`-d`) and filename (`-o`) when downloading.
- Use `--checksum=sha-256=<hex>` when verifying downloaded artifacts.
- Inspect `.torrent` contents with `--show-files` before starting a transfer.

Agent 高频安全命令配方

只读查询(安全推荐)

不下载仅查看 Torrent 文件清单
aria2c --show-files package.torrent

解析 .torrent 或 .metalink 中的文件索引、大小与 Infohash 元数据后立即退出。

查看支持的 HTTP 下载选项
aria2c --help=#http

在本地打印所有 HTTP/HTTPS 传输参数与默认值。

受控写入与预演

使用 16 连接并发下载大文件
aria2c -x 16 -s 16 -c -d /tmp/downloads -o archive.tar.gz https://example.com/archive.tar.gz

启用 16 并发连接与断点续传(-c),将远端归档下载到 /tmp/downloads。

核心优势

  • + 分段并发 -x 16 -s 16、断点续传 -c 与 --checksum 校验在拉取大文件时优于 curl。
  • + 无运行时依赖,内存占用极低。

注意事项与踩坑点

  • ! 默认标准输出会刷新动态进度条,脚本中建议附加 -q 或 --summary-interval=0。
  • ! 单次下载模式不支持 --json 摘要输出(JSON 仅用于 RPC 模式)。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI