bdpan-cli

module
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2026 License: MIT

README

bdpan-cli

百度网盘终端命令行工具,支持命令模式和交互模式。

功能

  • 二维码登录并保存 access token
  • 文件列表与详情查看
  • 上传、下载、删除、重命名
  • 同步任务与备份任务
  • 配置查看、日志追踪、缓存清理

安装

make install

安装后可直接执行:

bdpan --help

配置

默认配置文件路径:~/.config/bdpan-cli/config.yml

可通过全局参数指定:

bdpan -c /path/to/config.yml

access.json 用于保存登录 token,路径可由 config.yml 的 app.accessPath 配置;未配置时默认在配置文件同目录。

常用命令

# 登录
bdpan login

# 列表
bdpan list /apps -P 1 -l 20

# 上传
bdpan upload --local ./local-file --path /apps/target

# 下载
bdpan download /apps/video.mp4 -d ~/Downloads

# 删除
bdpan delete /apps/old-file -y

# 刷新
bdpan refresh /apps --sync

全局参数

  • --verbose, -V:开启详细日志
  • --config, -c:指定配置文件路径
  • --path, -p:指定网盘路径(默认 /)

本次更新(product-v1.0)

  • 修复 login 命令二维码在部分设备上不易识别的问题
  • 登录二维码改为高对比黑白背景块渲染,增强扫码稳定性
  • 登录二维码根据终端高度自动缩放,避免单屏显示不下
  • 增加渲染单元测试,确保输出包含 ANSI 黑白模块与 reset 序列

zsh 补全

make install-completion

并确认 ~/.zshrc 中已配置:

fpath=(~/.zsh/completions $fpath)
autoload -U compinit && compinit

Directories

Path Synopsis
cmd
bdpan command
Package configs used to locate config file.
Package configs used to locate config file.
examples
input command
test command
internal
api
dto
handler
service.go 定义 handler 包的服务接口层。
service.go 定义 handler 包的服务接口层。
model
Package model is the initial database driver and define the data structures corresponding to the tables.
Package model is the initial database driver and define the data structures corresponding to the tables.
output
output 包提供用户友好的终端输出函数。
output 包提供用户友好的终端输出函数。
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL