← Back to Skills Marketplace
jsoncm

agentdrive-cli

by jsoncm · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ pending
43
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install agentdrive-cli
Description
AgentDrive 云存储命令行工具。通过 Shell 命令直接操作云盘:浏览目录、搜索文件、上传下载、移动重命名、删除、分享、保存 URL/文本到云盘、追加文件内容、检测重名文件、配置文件读写、查看用户信息。输出结构化 JSON,支持 jq 管道处理和批量操作。当用户需要管理云盘文件、在脚本/CI 中操作云盘...
README (SKILL.md)

AgentDrive CLI

重要指令: 根据用户意图,直接执行最合适的命令;不要先把所有命令罗列给用户。

执行模式(必须先确定)

默认使用 npx(热更新):

AGENTDRIVE_CLI='npx -y -p @aicloud360/agentdrive@latest agentdrive'

当用户要求“固定版本/可复现”时,使用:

AGENTDRIVE_CLI='npx -y -p @aicloud360/agentdrive@\x3Cexact-version> agentdrive'

如果用户明确要求全局安装,才使用 npm install -g @aicloud360/agentdrive。 若用户已全局安装且确认可用,也可用 AGENTDRIVE_CLI='agentdrive'

鉴权前检查(每次会话先做)

  1. 先执行 $AGENTDRIVE_CLI auth whoami 检查登录状态。
  2. 若未登录,执行 $AGENTDRIVE_CLI auth login --api-key \x3CKEY>,或提示设置 API_KEY 环境变量。
  3. 继续执行业务命令。

说明:鉴权优先级为 --api-key > API_KEY > ~/.agentdrive/config.json

意图与命令映射表

用户意图 命令模板
查看/浏览云盘目录、列出文件 $AGENTDRIVE_CLI dir ls [path]
创建新文件夹 $AGENTDRIVE_CLI dir mkdir \x3Cpath>
按关键词搜索文件 $AGENTDRIVE_CLI file search \x3Ckeyword>
上传本地文件到云盘 $AGENTDRIVE_CLI file upload \x3Cfiles> --dest \x3Cpath>
下载云盘文件到本地 $AGENTDRIVE_CLI file download \x3Cnid> --dir \x3Cpath>
移动文件或文件夹 $AGENTDRIVE_CLI file mv \x3Csrc> \x3Cdest>
转移或复制文件到目标目录 $AGENTDRIVE_CLI file trans-copy \x3Csrc> \x3Cdest> --delete/--replace
重命名文件或文件夹 $AGENTDRIVE_CLI file rename \x3Cpath> \x3Cnew_name>
删除文件或文件夹 $AGENTDRIVE_CLI file rm \x3Cpath>
生成文件分享链接 $AGENTDRIVE_CLI file share \x3Cpaths>
获取文件下载链接 $AGENTDRIVE_CLI file url \x3Cpath>
根据 nid 获取节点信息 `$AGENTDRIVE_CLI file node-info \x3Cnid> [--ks-ext 0
统计目录递归原始大小 $AGENTDRIVE_CLI file origin-size \x3Cpath>
清空目录下文件并保留目录 $AGENTDRIVE_CLI file clear-dir \x3Cpath>(每次一个目录)
读取/写入配置文件(INI/JSON/YAML) `$AGENTDRIVE_CLI file config --path \x3Cpath> --command \x3Cconfig:*> --type \x3Cini
通过 URL 或文本保存文件到云盘 $AGENTDRIVE_CLI file save --url/--content/--stdin
向云盘文本文件末尾追加内容 $AGENTDRIVE_CLI file append \x3Cpath> --content/--stdin
检测目录下是否存在同名文件 $AGENTDRIVE_CLI file exists --path \x3Cpath> --files/--stdin
微信扫码登录(无 API Key 时使用) $AGENTDRIVE_CLI auth login-wechat
退出登录、清除本地配置 $AGENTDRIVE_CLI auth logout
查看当前用户信息 $AGENTDRIVE_CLI user info
查看鉴权状态 $AGENTDRIVE_CLI auth whoami
将本地文件/目录备份到云盘 $AGENTDRIVE_CLI claw-backup --source \x3Cpath> --dest \x3Cpath>
OpenClaw 模式备份(按白名单) $AGENTDRIVE_CLI claw-backup --source-dir \x3Cpath> --claw-name \x3Cname>
将云盘目录递归恢复到本地 $AGENTDRIVE_CLI claw-restore --remote \x3Cpath> --target \x3Cpath>
启用自动备份监听 $AGENTDRIVE_CLI claw-auto-backup enable --source-dir \x3Cpath> --claw-name \x3Cname>
停用自动备份监听 $AGENTDRIVE_CLI claw-auto-backup disable
查看自动备份状态 $AGENTDRIVE_CLI claw-auto-backup status

详细的命令参数说明,请按需查阅 references/commands.md

命令构造规则

  • 全局选项(--api-key--format--quiet--timeout--retries)放在子命令之前。
  • 云盘路径必须以 / 开头;目录路径建议以 / 结尾。
  • 多文件操作用 | 分隔,包含 | 的参数必须整体加引号。

输出与解析

默认输出结构化 JSON;--quiet 只输出 result,便于管道解析:

# 默认 JSON(含 success/meta 包装)
$AGENTDRIVE_CLI dir ls /

# 仅返回 result 数据(适合 jq 处理)
$AGENTDRIVE_CLI --quiet dir ls / | jq '.data.list[].name'

跨平台管道模板

# macOS/Linux: 搜索文档并下载第一个结果
NID=$($AGENTDRIVE_CLI --quiet file search "月报" | jq -r '.data.list[0].nid')
$AGENTDRIVE_CLI file download "$NID" --dir ./

# macOS/Linux: 将命令输出保存到云盘
date | $AGENTDRIVE_CLI file save --stdin --dest /日志/ --filename "timestamp.txt"

# macOS/Linux: 批量删除(stdin 路径列表)
cat paths.txt | $AGENTDRIVE_CLI file rm _ --batch

# macOS/Linux: 将本地配置整文件写入云盘(config:write + --stdin)
cat local-config.json | $AGENTDRIVE_CLI file config --path /mcp/app.json --command config:write --type json --stdin

# macOS/Linux: 将本地日志追加到云盘已有文件
cat local_log.md | $AGENTDRIVE_CLI file append /项目/开发日志.md --stdin

Windows 等价模板:

# cmd: 从本地文件读取内容并保存
type report.md | npx -y -p @aicloud360/agentdrive@latest agentdrive file save --stdin --dest /文件夹/ --filename report.md

# PowerShell: 从本地文件读取内容并保存
Get-Content report.md -Raw | npx -y -p @aicloud360/agentdrive@latest agentdrive file save --stdin --dest /文件夹/ --filename report.md

# cmd: 将本地 JSON 整文件写入云盘配置(file config;勿用 cat,cmd 无该命令)
type local-config.json | npx -y -p @aicloud360/agentdrive@latest agentdrive file config --path /mcp/app.json --command config:write --type json --stdin

# PowerShell: 同上
Get-Content .\local-config.json -Raw | npx -y -p @aicloud360/agentdrive@latest agentdrive file config --path /mcp/app.json --command config:write --type json --stdin

# cmd: 追加本地文件内容到云盘(勿用 cat)
type local_log.md | npx -y -p @aicloud360/agentdrive@latest agentdrive file append /项目/开发日志.md --stdin

# PowerShell: 同上
Get-Content .\local_log.md -Raw | npx -y -p @aicloud360/agentdrive@latest agentdrive file append /项目/开发日志.md --stdin

# cmd:file exists --stdin 勿用 echo '...' |(单引号会进管道,JSON 非法);先把 UTF-8 JSON 写入 files.json
type files.json | npx -y -p @aicloud360/agentdrive@latest agentdrive file exists --path /目录/ --stdin

# PowerShell:同上
Get-Content .\files.json -Raw -Encoding utf8 | npx -y -p @aicloud360/agentdrive@latest agentdrive file exists --path /目录/ --stdin

失败恢复(执行失败时)

  • code=3(鉴权):先 auth whoami,再 auth login,重试原命令。
  • code=4(资源不存在):先 dir lsfile search 校验路径,再重试。
  • code=6(网络问题):增加 --retries 2 --timeout 60000 重试。
  • 其他错误:保留原错误输出,并提示查阅 references/commands.md 的错误码说明。
Capability Tags
requires-sensitive-credentials
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install agentdrive-cli
  3. After installation, invoke the skill by name or use /agentdrive-cli
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of agentdrive-cli skill. - Provides detailed intent-to-command mapping for all major AgentDrive CLI operations. - Introduces authentication flow guidance and command templates for common scenarios. - Offers platform-specific (macOS/Linux/Windows/PowerShell) pipeline usage examples. - Lists error handling and recovery strategies based on exit codes. - Ensures commands output structured JSON, enabling easy integration with jq and automation scripts.
Metadata
Slug agentdrive-cli
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is agentdrive-cli?

AgentDrive 云存储命令行工具。通过 Shell 命令直接操作云盘:浏览目录、搜索文件、上传下载、移动重命名、删除、分享、保存 URL/文本到云盘、追加文件内容、检测重名文件、配置文件读写、查看用户信息。输出结构化 JSON,支持 jq 管道处理和批量操作。当用户需要管理云盘文件、在脚本/CI 中操作云盘... It is an AI Agent Skill for Claude Code / OpenClaw, with 43 downloads so far.

How do I install agentdrive-cli?

Run "/install agentdrive-cli" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is agentdrive-cli free?

Yes, agentdrive-cli is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does agentdrive-cli support?

agentdrive-cli is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created agentdrive-cli?

It is built and maintained by jsoncm (@jsoncm); the current version is v1.0.0.

💬 Comments