Xpersona
B

Baidu Cloud BOS

CLAWHUB · Unverified

百度智能云对象存储(BOS)集成技能。支持文件上传/下载/删除/复制、列出文件与 Bucket、获取签名 URL、 图片处理(亮度、对比度、模糊、旋转、缩放、裁剪、圆形裁切、圆角、质量压缩、水印等)、 目录递归上传/下载及增量同步。通过 Node.js SDK 脚本(优先)和 bcecmd 命令行工具双方式管理,...

62
Rank
84
Safety
1.2k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.2K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s179tzn78kp6s0yp6beqp6639s83m2h3:baidu-cloud-bos
  1. Install using `clawhub skill install s179tzn78kp6s0yp6beqp6639s83m2h3:baidu-cloud-bos` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/yangdong2398/baidu-cloud-bos before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-yangdong2398-baidu-cloud-bos/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

144,810 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: baidu-cloud-bos
description: >
  百度智能云对象存储(BOS)集成技能。支持文件上传/下载/删除/复制、列出文件与 Bucket、获取签名 URL、
  图片处理(亮度、对比度、模糊、旋转、缩放、裁剪、圆形裁切、圆角、质量压缩、水印等)、
  目录递归上传/下载及增量同步。通过 Node.js SDK 脚本(优先)和 bcecmd 命令行工具双方式管理,
  凭证持久化支持,新 session 无需重新配置。
---

# 百度智能云 BOS 技能

通过 Node.js SDK 脚本 + bcecmd 工具管理百度智能云对象存储(BOS)。

## 首次使用 — 自动设置

当用户首次要求操作 BOS 时,按以下流程操作:

### 步骤 1:检查当前状态

```bash
{baseDir}/scripts/setup.sh --check-only
```

如果输出显示一切 OK(SDK 已安装、凭证已配置),跳到「执行策略」。

### 步骤 2:如果未配置,引导用户提供凭证

告诉用户:
> 我需要你的百度智能云凭证来连接 BOS 存储服务。请提供:
> 1. **AccessKeyId** — 百度云 AK
> 2. **SecretAccessKey** — 百度云 SK
> 3. **Endpoint** — BOS 服务端点(如 `bj.bcebos.com`、`gz.bcebos.com`、`su.bcebos.com`)
> 4. **Bucket** — 存储桶名称(如 `my-bucket`)
> 5. **StsToken**(可选) — 临时安全凭证的 SessionToken
>
> 你可以在 [百度智能云控制台 > 安全认证 > Access Key](https://console.bce.baidu.com/iam/#/iam/accesslist) 获取密钥,
> 在 [BOS 控制台](https://console.bce.baidu.com/bos/) 查看存储桶信息。
>
**Endpoint 对照表**:

| 区域 | Endpoint |
|------|----------|
| 北京 | `bj.bcebos.com` |
| 广州 | `gz.bcebos.com` |
| 苏州 | `su.bcebos.com` |
| 保定 | `bd.bcebos.com` |
| 香港 | `hkg.bcebos.com` |

### 步骤 3:用户提供凭证后,运行自动设置

```bash
{baseDir}/scripts/setup.sh --ak "<AccessKeyId>" --sk "<SecretAccessKey>" --endpoint "<Endpoint>" --bucket "<Bucket>"
```

脚本会自动:
- 检查并安装 `@baiducloud/sdk`(Node.js SDK)
- 检查 bcecmd 是否已安装
- 将凭证持久化到 `~/.config/openclaw/baidu-cloud-bos/credentials.json`(权限 600)
- 将凭证导出到当前 session 环境变量
- 配置 bcecmd(如已安装)
- 验证 BOS 连接

凭证读取优先级:**环境变量 > credentials.json 配置文件**。后续新 session 无需重新配置。

## 执行策略

两种方式按优先级降级,确保操作始终可完成:

1. **方式一:Node.js SDK 脚本**(优先) — 通过 `scripts/bos_node.mjs` 执行存储操作
2. **方式二:bcecmd 命令行** — 通过 shell 命令执行存储操作,支持目录同步

```
Node.js + @baiducloud/sdk 可用?
  ├─ 是 → 使用方式一(单文件操作,JSON 输出,适合程序化处理)
  └─ 否 → bcecmd 可用?(which bcecmd)
            ├─ 是 → 使用方式二(全功能,含目录同步)
            └─ 否 → 运行 setup.sh 安装
```

**判断方式一**:`node -e "require('@baiducloud/sdk')"` 成功则可用。
**判断方式二**:`which bcecmd` 有输出则可用。

---

## 方式一:Node.js SDK 脚本(优先)

> 官方文档: https://cloud.baidu.com/doc/BOS/s/Djwvyrhiw

当使用方式一时,通过 `scripts/bos_node.mjs` 执行存储操作。凭证读取优先级:环境变量 > `~/.config/openclaw/baidu-cloud-bos/credentials.json`。

支持的凭证来源:
- **环境变量**(优先):`BCE_ACCESS_KEY_ID` / `BCE_SECRET_ACCESS_KEY` / `BCE_BOS_ENDPOINT` / `BCE_BOS_BUCKET`(必需),`BCE_STS_TOKEN`(可选,临时凭证)
- **配置文件**(回退):`~/.config/openclaw/baidu-cloud-bos/credentials.json`

### 常用命令

> 以下省略 `node {baseDir}/scripts/bos_node.mjs` 前缀。完整格式:`node {baseDir}/scripts/bos_node.mjs <action> [options]`

```bash
# 上传文件
upload --file /path/to/file.jpg --key remote/path/file.jpg

# 上传字符串内容
put-string --content "文本内容" --key remote/file.txt --content-type "text/plain"

# 下载文件
download --key remote/path/file.jpg --output /path/to/save/file.jpg

# 列出文件
list --prefix "images/" --max-keys 100

# 获取签名 URL
sign-url --key remote/path/file.jpg --expires 3600

# 图片处理:亮度调整(-100 到 100)
sign-url --key remote/path/image.jpg --bright -5

# 图片处理:对比度调整(-100 到 100)
sign-url --key remote/path/image.jpg --contrast -30

# 图片处理:模糊(半径,标准差,各 1-50)
sign-url --key remote/path/image.j

_meta.json

{
  "ownerId": "kn7dsjpc12x7nmh3cf8pe056898250rw",
  "slug": "baidu-cloud-bos",
  "version": "1.1.2",
  "publishedAt": 1776049098977
}

references/api_reference.md

# 百度智能云 BOS 操作参考

本文档记录两种操作方式的详细参数定义,供执行操作时查阅。

**环境设置**:首次使用请运行 `scripts/setup.sh`,详见 `SKILL.md` 首次使用章节。

**官方文档链接:**
- BOS Node.js SDK: https://cloud.baidu.com/doc/BOS/s/Djwvyrhiw
- bcecmd 工具: https://cloud.baidu.com/doc/BOS/s/kmcn3zrup

---

## 方式一:scripts/bos_node.mjs 命令参考

脚本位于 `scripts/bos_node.mjs`,依赖 `@baiducloud/sdk`(`npm install @baiducloud/sdk`)。
所有凭证通过环境变量读取。输出 JSON 格式。

### 环境变量

| 变量 | 必需 | 说明 |
|------|:----:|------|
| `BCE_ACCESS_KEY_ID` | ✅ | 百度云 Access Key ID |
| `BCE_SECRET_ACCESS_KEY` | ✅ | 百度云 Secret Access Key |
| `BCE_BOS_ENDPOINT` | ✅ | BOS 服务端点(如 `bj.bcebos.com`) |
| `BCE_BOS_BUCKET` | ✅ | 存储桶名称 |
| `BCE_STS_TOKEN` | ❌ | 临时安全凭证 SessionToken |

### 可用操作

| 操作 | 命令 | 说明 |
|------|------|------|
| upload | `node bos_node.mjs upload --file <path> --key <key>` | 上传本地文件 |
| put-string | `node bos_node.mjs put-string --content <text> --key <key> [--content-type <mime>]` | 上传字符串内容 |
| download | `node bos_node.mjs download --key <key> --output <path>` | 下载文件到本地 |
| list | `node bos_node.mjs list [--prefix <prefix>] [--max-keys <n>] [--marker <m>]` | 列出文件 |
| sign-url | `node bos_node.mjs sign-url --key <key> [--expires <s>] [--bright <n>] [--contrast <n>] [--blur <r,s>] [--rotate <a>] [--auto-orient <o>] [--process <str>]` | 获取签名下载链接(可选图片处理) |
| head | `node bos_node.mjs head --key <key>` | 查看文件元信息 |
| delete | `node bos_node.mjs delete --key <key>` | 删除文件 |
| copy | `node bos_node.mjs copy --source-key <key> --key <dest-key> [--source-bucket <bucket>]` | 复制文件 |
| list-buckets | `node bos_node.mjs list-buckets` | 列出所有 Bucket |

### 操作详细参数

#### upload
上传本地文件到存储桶。
- `--file` (string, **必需**): 本地文件路径
- `--key` (string, 可选): 存储桶中的目标路径,默认取文件名

#### put-string
上传字符串内容到存储桶。
- `--content` (string, **必需**): 要上传的字符串内容
- `--key` (string, **必需**): 存储桶中的目标路径
- `--content-type` (string, 可选): MIME 类型,默认 `text/plain`

#### download
下载存储桶中的文件到本地。
- `--key` (string, **必需**): 文件在存储桶中的路径
- `--output` (string, 可选): 本地保存路径,默认取文件名

#### list
列出存储桶中的文件。
- `--prefix` (string, 可选): 路径前缀过滤
- `--max-keys` (number, 可选): 最大返回数量,默认 100
- `--marker` (string, 可选): 分页标记,用于获取下一页

#### sign-url
获取文件的预签名下载链接,可选图片处理。
- `--key` (string, **必需**): 文件在存储桶中的路径
- `--expires` (number, 可选): 链接有效期(秒),默认 3600
- `--process` (string, 可选): BOS 图片处理指令,格式 `image/<op>,<p>_<v>[/<op2>,...]`,与便捷 flag 同时使用时优先
- `--bright` (number, 可选): 亮度调整,范围 -100 到 100(负值变暗,正值变亮)
- `--contrast` (number, 可选): 对比度调整,范围 -100 到 100(负值降低,正值提高)
- `--blur` (string, 可选): 模糊,格式 `<r>,<s>`,r 为半径(1-50),s 为标准差(1-50),如 `2,50`
- `--rotate` (number, 可选): 旋转角度,范围 -360 到 360(正数顺时针,负数逆时针)
- `--auto-orient` (number, 可选): 自适应旋转,0=不旋转,1=按 EXIF 旋转

#### head
获取文件的元信息。
- `--key` (string, **必需**): 文件在存储桶中的路径

#### delete
删除存储桶中的文件。
- `--key` (string, **必需**): 文件在存储桶中的路径

#### copy
复制文件(同桶或跨桶)。
- `--source-key` (string, **必需**): 源文件路径
- `--key` (string, **必需**): 目标文件路径
- `--source-bucket` (string, 可选): 源 Bucket,默认当前 Bucket

#### list-buckets
列出账号下的所有 Bucket。
- 无参数

### 返回格式

成功时 `success: true`,退出码 0;失败时 `success: false`,退出码 

skill-card.md

## Description:

Baidu Cloud BOS helps agents manage Baidu Intelligent Cloud Object Storage buckets, including file upload, download, delete, copy, listing, signed URLs, image processing, recursive transfers, and sync workflows through Node.js SDK scripts or bcecmd.

This skill is ready for commercial/non-commercial use.

## Publisher:

[yangdong2398](https://clawhub.ai/user/yangdong2398)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and operators use this skill to configure Baidu Cloud BOS access and perform object storage operations from an agent workflow. It is suited for managing buckets, files, signed access links, image processing, and directory sync tasks where BOS credentials and storage scope have been reviewed.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: BOS credentials can grant read, write, and delete access to storage data.

Mitigation: Use short-lived, bucket- and prefix-scoped STS credentials where possible, avoid placing real secrets directly in shell commands, and review the credential scope before use.

Risk: Recursive delete, bucket delete, and sync operations with delete flags can remove storage data.

Mitigation: Manually review destructive commands before execution, confirm target bucket and prefix, and prefer backups or non-destructive listing checks before running delete workflows.

## Reference(s):

- [Baidu Cloud BOS API Reference](references/api_reference.md)
- [Baidu Cloud BOS Node.js SDK Documentation](https://cloud.baidu.com/doc/BOS/s/Djwvyrhiw)
- [Baidu Cloud bcecmd Documentation](https://cloud.baidu.com/doc/BOS/s/kmcn3zrup)
- [ClawHub Skill Page](https://clawhub.ai/yangdong2398/skills/baidu-cloud-bos)

## Skill Output:

**Output Type(s):** [text, markdown, shell commands, configuration, guidance, JSON]

**Output Format:** [Markdown guidance with inline shell commands and JSON command responses]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [May create or update local BOS credential configuration and may invoke Baidu Cloud storage APIs when credentials are provided.]

## Skill Version(s):

1.1.2 (source: package.json, ClawHub release metadata)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

package.json

{
  "name": "baidu-cloud-bos",
  "version": "1.1.2",
  "description": "百度智能云对象存储(BOS)集成技能",
  "author": "yangdong2398",
  "license": "MIT-0",
  "dependencies": {
    "@baiducloud/sdk": "^1.0.7"
  }
}

Sponsored

Ads related to Baidu Cloud BOS and adjacent AI workflows.