openclaw 网盘下载
OpenClaw

技能详情(站内镜像,无评论)

首页 > 技能库 > aliyun-oss

阿里云 OSS 对象存储技能。支持文件上传、下载、列出、删除、获取 URL 等操作。 两层架构:Node.js SDK(优先)→ ossutil CLI。

数据与表格

许可证:MIT-0

MIT-0 ·免费使用、修改和重新分发。无需归因。

版本:v1.0.2

统计:⭐ 0 · 262 · 3 current installs · 3 all-time installs

0

安装量(当前) 3

🛡 VirusTotal :良性 · OpenClaw :可疑

Package:aohoyo/aliyun-oss-skill

安全扫描(ClawHub)

  • VirusTotal :良性
  • OpenClaw :可疑

OpenClaw 评估

The skill appears to implement Alibaba Cloud OSS functionality as described, but there are small inconsistencies in declared requirements and the installer persistently writes credentials into a config file and appends environment variables to the user's shell rc — review before installing.

目的

Name, description, and code align: the skill uses the ali-oss Node.js SDK to upload/download/list/delete/generate URLs for OSS. Declared runtime (node + ali-oss) matches implementation. Minor mismatch: top-level registry metadata lists no required config paths but the runtime scripts expect config/oss-config.json (the code will throw if it does not exist). _meta.json documents the config location but the skill summary/registry entry omitted it.

说明范围

SKILL.md instructs running scripts/setup.sh and node scripts/oss_node.mjs. setup.sh will create/modify config/oss-config.json, set file permissions, and append ALIYUN_* environment variables to the user's shell rc (~/.bashrc or ~/.zshrc). Those persistent changes to the user's shell profile and credential storage are outside a minimal scope for a 'library wrapper' and should be reviewed. Other runtime behavior (reading local files to upload, l…

安装机制

Install uses the ali-oss npm package (package.json and the install script call npm install). No downloads from untrusted URLs, no extract of arbitrary archives, and no obscure third‑party installers. This is a standard npm dependency installation.

证书

The skill legitimately needs OSS credentials (accessKeyId/accessKeySecret) to operate; it stores them in config/oss-config.json and setup.sh optionally exports them into shell environment variables. However the registry metadata listed no required env vars or config paths while the runtime requires the config file — a minor inconsistency. The skill does not request unrelated third-party credentials.

持久

The installer modifies the user's shell rc file to export ALIYUN_ACCESS_KEY_ID, ALIYUN_ACCESS_KEY_SECRET, ALIYUN_BUCKET, and ALIYUN_REGION. This is a persistent change to the user's environment and increases blast radius if credentials are compromised. always:false (normal) and the skill does not alter other skills, but the shell modification is a notable privilege.

安装(复制给龙虾 AI)

将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。

请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「aliyun-oss」。简介:阿里云 OSS 对象存储技能。支持文件上传、下载、列出、删除、获取 URL 等操作。 两层架构:Node.js SDK(优先)→ ossutil CLI。。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/aohoyo/aliyun-oss-skill/SKILL.md
(来源:yingzhi8.cn 技能库)

SKILL.md

打开原始 SKILL.md(GitHub raw)

---
name: aliyun-oss
description: |
  阿里云 OSS 对象存储技能。支持文件上传、下载、列出、删除、获取 URL 等操作。
  两层架构:Node.js SDK(优先)→ ossutil CLI。
metadata:
  {
    "openclaw":
      {
        "emoji": "☁️",
        "requires": { "bins": ["node"], "packages": ["ali-oss"] },
        "install":
          [
            { "id": "ali-oss-sdk", "kind": "node", "package": "ali-oss", "label": "Install ali-oss Node.js SDK" },
          ],
      },
  }
---

# ☁️ 阿里云 OSS 技能

通过 **Node.js SDK** / **ossutil CLI** 管理阿里云对象存储。

---

## 🎯 执行策略(两层降级)

| 优先级 | 工具 | 使用场景 |
|--------|------|----------|
| **1** | Node.js SDK (`ali-oss`) | 优先使用 |
| **2** | ossutil CLI | 备选 |

---

## 🚀 快速开始

### 1. 安装依赖

```bash
# 进入技能目录
cd ~/.openclaw/workspace/skills/aliyun-oss-skill

# 运行自动安装
bash scripts/setup.sh
```

### 2. 配置凭证

```bash
bash scripts/setup.sh 
  --access-key-id "YOUR_ACCESS_KEY_ID" 
  --access-key-secret "YOUR_ACCESS_KEY_SECRET" 
  --region "oss-cn-hangzhou" 
  --bucket "mybucket"
```

### 3. 测试连接

```bash
node scripts/oss_node.mjs test-connection
```

---

## 📋 使用示例

### 上传文件

```bash
node scripts/oss_node.mjs upload 
  --local "/path/to/file.txt" 
  --key "uploads/file.txt"
```

### 列出文件

```bash
node scripts/oss_node.mjs list --prefix "uploads/" --limit 100
```

### 下载文件

```bash
node scripts/oss_node.mjs download 
  --key "uploads/file.txt" 
  --local "/path/to/save.txt"
```

### 删除文件

```bash
node scripts/oss_node.mjs delete --key "uploads/file.txt" --force
```

### 获取文件 URL

```bash
# 公开空间
node scripts/oss_node.mjs url --key "uploads/file.txt"

# 私有空间(1小时有效)
node scripts/oss_node.mjs url --key "uploads/file.txt" --private --expires 3600
```

---

## 🔧 Node.js SDK API

| 命令 | 说明 |
|------|------|
| `upload --local <path> --key <key>` | 上传文件 |
| `download --key <key> --local <path>` | 下载文件 |
| `list [--prefix <p>] [--limit <n>]` | 列出文件 |
| `delete --key <key> [--force]` | 删除文件 |
| `url --key <key> [--private] [--expires <s>]` | 获取 URL |
| `stat --key <key>` | 文件信息 |
| `move --src-key <a> --dest-key <b>` | 移动文件 |
| `copy --src-key <a> --dest-key <b>` | 复制文件 |
| `test-connection` | 测试连接 |

---

## ⚙️ 配置文件

**config/oss-config.json**

```json
{
  "accessKeyId": "YOUR_ACCESS_KEY_ID",
  "accessKeySecret": "YOUR_ACCESS_KEY_SECRET",
  "bucket": "mybucket",
  "region": "oss-cn-hangzhou",
  "domain": "https://cdn.example.com"
}
```

**常用区域**:
- `oss-cn-hangzhou` - 华东1(杭州)
- `oss-cn-shanghai` - 华东2(上海)
- `oss-cn-beijing` - 华北2(北京)
- `oss-cn-shenzhen` - 华南1(深圳)

---

## 🐛 故障排查

| 问题 | 解决 |
|------|------|
| `Cannot find module 'ali-oss'` | `npm install ali-oss` |
| `403 Forbidden` | 检查 AccessKey 权限 |
| `连接超时` | 检查区域代码和网络 |

---

## 📚 相关链接

- [阿里云 OSS Node.js SDK](https://help.aliyun.com/document_detail/32068.html)
- [ossutil 工具](https://help.aliyun.com/document_detail/120075.html)

---

## 📄 许可证

MIT License