命令行工具

2026-03-17 17:19

智能存储助手提供命令行工具(CLI),方便在服务器环境中管理存储设备。CLI 基于 Python 开发,支持所有核心功能。
安装

bash
pip install smartstorage-cli

配置
首次使用需设置设备地址和 API 密钥:

bash
smartstorage config set --host 192.168.1.100 --port 5000 --apikey YOUR_API_KEY

常用命令

  • smartstorage ls /远程目录:列出目录内容。

  • smartstorage upload 本地文件 远程路径:上传文件。

  • smartstorage download 远程路径 本地文件:下载文件。

  • smartstorage mkdir 远程目录:创建目录。

  • smartstorage rm 远程路径:删除文件/目录。

  • smartstorage share 远程路径 --expire 7 --password 123:生成分享链接。

  • smartstorage backup create --source /data --dest /backup:创建备份任务。

  • smartstorage stats:查看系统状态。
    CLI 支持脚本调用,适合集成到自动化任务中。使用 smartstorage --help 查看所有命令。

相关新闻