文件名
大小

aliyunpan-cli

aliyunpan-cli 是一款第三方开源的阿里云盘命令行管理工具,能让你在终端上实现阿里云盘客户端的功能,能更方便地实现本地&云端文件自动化管理,配合web直链挂载程序拓展更多的可能性!

构建日期:2023/02/16

版本:v3.0.9

上游:[52376de]



获取refresh_token

配置 refresh_token

Linux aarch64/x86_64 (glibc):

echo "refresh_token: 'xxxxx'" > ~/.config/aliyunpan.yaml

OpenWrt & Alpine (musl)(日志路径:/tmp/aliyunpan-cli.log):

echo "refresh_token: 'xxxxx'" > /opt/aliyunpan.yaml

Windows:

在桌面按住 Shift 键,在桌面空白处右键并打开 “在此处打开PowerShell窗口”,执行以下命令写入 refresh_token 配置。

echo "refresh_token: 'xxxxx'" | Out-File -Encoding ascii ~/aliyunpan.yaml

功能介绍

指令 描述
download (d) 下载文件/文件夹
ls (dir,l,list) 列目录
mv (move) 移动文件/文件夹
rm (del,delete) 删除文件/文件夹
rename (r) 重命名文件/文件夹
tree (show,t) 查看文件树
upload (u) 上传文件/文件夹
share (s) 分享文件
mkdir (m) 创建文件夹
cat (c) 显示文件内容
tui 文本用户界面
search 搜索文件/文件夹
sync 同步文件夹
token (r,refresh_token) 查看refresh_token

使用指南

aliyunpan-cli -h
参数 描述
-h, --help 查看帮助
--version 查看版本
-c, --config-file 指定配置文件
-t, --refresh-token 指定REFRESH_TOKEN
-u, --username 指定账号
-p, --password 指定密码
-d, --depth 文件递归深度
-T, --timeout 请求超时时间(秒)
-id, --drive-id 指定drive_id
-a, --album 是否访问相册
-s, --share-id 指定分享id
-sp, --share-pwd 指定分享密码
-f, --filter-file 过滤文件(多个)
-w, --whitelist 使用白名单过滤文件
-m, --match 指定使用正则匹配文件
aliyunpan-cli COMMAND -h
指令 参数 描述
download -p, --file 选择文件(多个)
download -s, --share 指定分享的序列文件
download -cs, --chunk-size 分块大小(字节)
download -a, --aria2 发送到aria2
ls,search -l 查看详情
share -p, --file 指定文件(多个)
share -f, --file-id 指定file_id(多个)
share -t, --expire-sec 分享过期时间(秒),默认最大14400
share -l, --share-link 输出分享链接
share -d, --download-link 输出下载链接
share -s, --save 保存序列文件到云盘和本地
share -S, --share-official 官方分享功能(需要账号支持)
upload -p, --file 选择文件(多个)
upload,sync -t, --time-out 分块上传超时时间(秒)
upload,sync -r, --retry 上传失败重试次数
upload -f, --force 强制覆盖文件
upload -s, --share 指定分享的序列文件
upload,sync -cs, --chunk-size 分块大小(字节)
upload -c 断点续传
cat -e, --encoding 文件编码
sync -st, --sync-time 同步间隔时间
sync --no-delete, -n 不删除(云盘/本地)文件(默认)
sync -d, --delete 允许删除(云盘/本地)文件
sync -l, --local 同步云盘文件到本地
token --refresh, -r 刷新配置文件token
token --refresh-time, -t 自动刷新token间隔时间(秒)
token --change, -c 设置新的refresh_token

断点续传

分享

1.分享链接格式

aliyunpan://文件名|sha1|url_base64|文件大小|相对路径

例如

aliyunpan://示例文件.txt|F61851825609372B3D7F802E600B35A497CFC38E|url_base64|24|root

2.文件分享

aliyunpan-cli share 示例文件.txt 

导入

aliyunpan-cli upload "aliyunpan://示例文件.txt|F61851825609372B3D7F802E600B35A497CFC38E|url_base64|24|root"

3.文件夹分享

aliyunpan-cli share 示例文件夹

导入

aliyunpan-cli upload -s "aliyunpan://示例文件夹|80E7E25109D4246653B600FDFEDD8D8B0D97E517|url_base64|970|root"

TUI按键指南

环境变量

ALIYUNPAN_CONF 配置文件路径
ALIYUNPAN_ROOT 根目录(log和tasks输出路径)

项目源码