A
alicloud-storage-oss-ossutil-test
About alicloud-storage-oss-ossutil-test
A minimal test skill for checking OSS access with ossutil 2.0. It covers configuration, bucket and object listing, and a small-file upload and download with content verification.
Key features
- 01Check configured region
- 02List buckets and objects
- 03Upload a small file
- 04Download and verify file content
Use cases
- 01Validate AK and region settings
- 02Check read and write access to an OSS bucket
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ cinience/ alicloud-skills --skill alicloud-storage-oss-ossutil-testAfter installing, type/alicloud-storage-oss-ossutil-testin Claude Code to confirm it loaded.
Details
From the project READMECategory: test
OSSUTIL 2.0 Minimal Viable Test
Goals
- 验证 AK/Region 配置正确。
- 验证 OSS 访问(列桶、上传、下载)。
Prerequisites
- 已配置 AK(推荐环境变量或
~/.alibabacloud/credentials)。 - 已准备一个可读写的 OSS Bucket。
Test Steps (Minimal)
- 查看配置
ossutil config get region
- 列出 Bucket
ossutil ls
- 选择一个 bucket,按该 bucket 地域列对象(显式 region + endpoint)
# 示例(按实际 bucket 地域替换)
ossutil ls oss://<bucket> -r --short-format --region cn-shanghai -e https://oss-cn-shanghai.aliyuncs.com --limited-num 20
- 上传小文件
echo "ossutil-test" > /tmp/ossutil-test.txt
ossutil cp /tmp/ossutil-test.txt oss://<bucket>/tests/ossutil-test.txt --region cn-shanghai -e https://oss-cn-shanghai.aliyuncs.com
- 下载并校验
ossutil cp oss://<bucket>/tests/ossutil-test.txt /tmp/ossutil-test-down.txt --region cn-shanghai -e https://oss-cn-shanghai.aliyuncs.com
cat /tmp/ossutil-test-down.txt
Expected Results
ossutil ls能返回至少一个 bucket 或无权限说明。- 指定
--region+-e后,列对象可正常返回。 - 上传/下载成功,文件内容一致。
常见失败
- Region 不匹配:确认
ALIBABACLOUD_REGION_ID或配置文件中的 region。 - AK 无权限:确认 RAM 策略允许
oss:*或最小读写权限。
Comments
Markdown supported