Aliyun Oss Ossutil
简介
Aliyun Oss Ossutil
原始描述
Use when installing, configuring, or operating Alibaba Cloud OSS from the command line with ossutil 2.0, based on the official ossutil overview.
通过你的 Agent 添加
安装目录:aliyun-oss-ossutil/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: aliyun-oss-ossutil description: Use when installing, configuring, or operating Alibaba Cloud OSS from the command line with ossutil 2.0, based on the official ossutil overview. version: 1.0.0
Category: tool
OSS (ossutil 2.0) CLI Skill
Validation
python skills/storage/oss/aliyun-oss-ossutil/scripts/check_ossutil.py --output output/aliyun-oss-ossutil/validate.txt
Pass criteria: command exits 0 and output/aliyun-oss-ossutil/validate.txt is generated.
Output And Evidence
- Save command outputs, object listings, and sync logs under
output/aliyun-oss-ossutil/.
- Keep at least one upload or listing result as evidence.
Goals
- Use ossutil 2.0 to manage OSS: upload, download, sync, and resource management.
- Provide a unified CLI flow for install, config, credentials, and region/endpoint handling.
Quick Start Flow
- Install ossutil 2.0.
- Configure AK/SK and default region (
ossutil config or config file).
- Run
ossutil ls to list buckets, then list objects using the bucket region.
- Execute upload/download/sync or API-level commands.
Install ossutil 2.0
- See
references/install.md for platform-specific install steps.
Configure ossutil
- Interactive configuration:
ossutil config
- Default config file paths:
- Linux/macOS:
~/.ossutilconfig
- Windows:
C:\Users\issuser\.ossutilconfig
output/aliyun-oss-ossutil/.- Use ossutil 2.0 to manage OSS: upload, download, sync, and resource management.
- Provide a unified CLI flow for install, config, credentials, and region/endpoint handling.
Quick Start Flow
- Install ossutil 2.0.
- Configure AK/SK and default region (
ossutil config or config file).
- Run
ossutil ls to list buckets, then list objects using the bucket region.
- Execute upload/download/sync or API-level commands.
Install ossutil 2.0
- See
references/install.md for platform-specific install steps.
Configure ossutil
- Interactive configuration:
ossutil config
- Default config file paths:
- Linux/macOS:
~/.ossutilconfig
- Windows:
C:\Users\issuser\.ossutilconfig
ossutil config or config file).ossutil ls to list buckets, then list objects using the bucket region.- See
references/install.mdfor platform-specific install steps.
Configure ossutil
- Interactive configuration:
ossutil config
- Default config file paths:
- Linux/macOS:
~/.ossutilconfig
- Windows:
C:\Users\issuser\.ossutilconfig
ossutil config
- Linux/macOS:
~/.ossutilconfig - Windows:
C:\Users\issuser\.ossutilconfig
Main configuration fields include:
AccessKey IDAccessKey SecretRegion(example defaultcn-hangzhou; ask the user if the best region is unclear)Endpoint(optional; auto-derived from region if omitted)
AccessKey configuration notes
Use RAM users/roles with least privilege and avoid passing AK in plain text on command line.
Recommended method (environment variables):
export ALICLOUD_ACCESS_KEY_ID="<your-ak>"
export ALICLOUD_ACCESS_KEY_SECRET="<your-sk>"
export ALICLOUD_REGION_ID="cn-beijing"
ALICLOUD_REGION_ID can be used as default region; if unset choose the most reasonable region, ask user if unclear.
Or use the standard shared credentials file:
~/.alibabacloud/credentials
[default]
type = access_key
access_key_id = <your-ak>
access_key_secret = <your-sk>
Command structure (2.0)
- High-level command example:
ossutil config
- API-level command example:
ossutil api put-bucket-acl
Common command examples
ossutil ls
ossutil ls oss://your-bucket -r --short-format --region cn-shanghai -e https://oss-cn-shanghai.aliyuncs.com
ossutil cp ./local.txt oss://your-bucket/path/local.txt
ossutil cp oss://your-bucket/path/remote.txt ./remote.txt
ossutil sync ./local-dir oss://your-bucket/path/ --delete
Recommended execution flow (list buckets first, then objects)
- List all buckets
ossutil ls
-
Get target bucket region from output (e.g. oss-cn-shanghai) and convert it to --region format (cn-shanghai).
-
When listing objects, explicitly set --region and -e to avoid cross-region signature/endpoint errors.
ossutil ls oss://your-bucket \
-r --short-format \
--region cn-shanghai \
-e https://oss-cn-shanghai.aliyuncs.com
- For very large buckets, limit output size first.
ossutil ls oss://your-bucket --limited-num 100
ossutil ls oss://your-bucket/some-prefix/ -r --short-format --region cn-shanghai -e https://oss-cn-shanghai.aliyuncs.com
Common errors and handling
-
Error: region must be set in sign version 4.
- Cause: missing region configuration.
- Fix: add
region in config file, or pass --region cn-xxx.
-
The bucket you are attempting to access must be addressed using the specified endpoint
- Cause: request endpoint does not match bucket region.
- Fix: use endpoint of the bucket region, e.g.
-e https://oss-cn-hongkong.aliyuncs.com.
-
Invalid signing region in Authorization header
- Cause: signature region does not match bucket region.
- Fix: correct both
--region and -e; both must match bucket region.
Credential and security guidance
- Prefer RAM user AK for access control.
- CLI options can override config file, but passing secrets on command line has leakage risk.
- In production, manage secrets via config files or environment variables.
Clarifying questions (ask when uncertain)
- Is your target a Bucket or an Object?
- Do you need upload/download/sync, or management actions like ACL/lifecycle/CORS?
- What are the target region and endpoint?
- Are you accessing OSS from ECS in the same region (intranet endpoint may be preferred)?
References
-
OSSUTIL 2.0 overview and install/config:
-
Official source list:references/sources.md
Prerequisites
- Configure least-privilege Alibaba Cloud credentials before execution.
- Prefer environment variables:
ALICLOUD_ACCESS_KEY_ID, ALICLOUD_ACCESS_KEY_SECRET, optional ALICLOUD_REGION_ID.
- If region is unclear, ask the user before running mutating operations.
Workflow
- Confirm user intent, region, identifiers, and whether the operation is read-only or mutating.
- Run one minimal read-only query first to verify connectivity and permissions.
- Execute the target operation with explicit parameters and bounded scope.
- Verify results and save output/evidence files.
ossutil configossutil api put-bucket-aclossutil ls
ossutil ls oss://your-bucket -r --short-format --region cn-shanghai -e https://oss-cn-shanghai.aliyuncs.com
ossutil cp ./local.txt oss://your-bucket/path/local.txt
ossutil cp oss://your-bucket/path/remote.txt ./remote.txt
ossutil sync ./local-dir oss://your-bucket/path/ --delete
Recommended execution flow (list buckets first, then objects)
- List all buckets
ossutil ls
-
Get target bucket region from output (e.g. oss-cn-shanghai) and convert it to --region format (cn-shanghai).
-
When listing objects, explicitly set --region and -e to avoid cross-region signature/endpoint errors.
ossutil ls oss://your-bucket \
-r --short-format \
--region cn-shanghai \
-e https://oss-cn-shanghai.aliyuncs.com
- For very large buckets, limit output size first.
ossutil ls oss://your-bucket --limited-num 100
ossutil ls oss://your-bucket/some-prefix/ -r --short-format --region cn-shanghai -e https://oss-cn-shanghai.aliyuncs.com
Common errors and handling
-
Error: region must be set in sign version 4.
- Cause: missing region configuration.
- Fix: add
region in config file, or pass --region cn-xxx.
-
The bucket you are attempting to access must be addressed using the specified endpoint
- Cause: request endpoint does not match bucket region.
- Fix: use endpoint of the bucket region, e.g.
-e https://oss-cn-hongkong.aliyuncs.com.
-
Invalid signing region in Authorization header
- Cause: signature region does not match bucket region.
- Fix: correct both
--region and -e; both must match bucket region.
Credential and security guidance
- Prefer RAM user AK for access control.
- CLI options can override config file, but passing secrets on command line has leakage risk.
- In production, manage secrets via config files or environment variables.
Clarifying questions (ask when uncertain)
- Is your target a Bucket or an Object?
- Do you need upload/download/sync, or management actions like ACL/lifecycle/CORS?
- What are the target region and endpoint?
- Are you accessing OSS from ECS in the same region (intranet endpoint may be preferred)?
References
-
OSSUTIL 2.0 overview and install/config:
-
Official source list:references/sources.md
Prerequisites
- Configure least-privilege Alibaba Cloud credentials before execution.
- Prefer environment variables:
ALICLOUD_ACCESS_KEY_ID, ALICLOUD_ACCESS_KEY_SECRET, optional ALICLOUD_REGION_ID.
- If region is unclear, ask the user before running mutating operations.
Workflow
- Confirm user intent, region, identifiers, and whether the operation is read-only or mutating.
- Run one minimal read-only query first to verify connectivity and permissions.
- Execute the target operation with explicit parameters and bounded scope.
- Verify results and save output/evidence files.
ossutil ls
Get target bucket region from output (e.g. oss-cn-shanghai) and convert it to --region format (cn-shanghai).
When listing objects, explicitly set --region and -e to avoid cross-region signature/endpoint errors.
ossutil ls oss://your-bucket \
-r --short-format \
--region cn-shanghai \
-e https://oss-cn-shanghai.aliyuncs.com
ossutil ls oss://your-bucket --limited-num 100
ossutil ls oss://your-bucket/some-prefix/ -r --short-format --region cn-shanghai -e https://oss-cn-shanghai.aliyuncs.com
-
Error: region must be set in sign version 4.- Cause: missing region configuration.
- Fix: add
regionin config file, or pass--region cn-xxx.
-
The bucket you are attempting to access must be addressed using the specified endpoint- Cause: request endpoint does not match bucket region.
- Fix: use endpoint of the bucket region, e.g.
-e https://oss-cn-hongkong.aliyuncs.com.
-
Invalid signing region in Authorization header- Cause: signature region does not match bucket region.
- Fix: correct both
--regionand-e; both must match bucket region.
Credential and security guidance
- Prefer RAM user AK for access control.
- CLI options can override config file, but passing secrets on command line has leakage risk.
- In production, manage secrets via config files or environment variables.
Clarifying questions (ask when uncertain)
- Is your target a Bucket or an Object?
- Do you need upload/download/sync, or management actions like ACL/lifecycle/CORS?
- What are the target region and endpoint?
- Are you accessing OSS from ECS in the same region (intranet endpoint may be preferred)?
References
-
OSSUTIL 2.0 overview and install/config:
-
Official source list:references/sources.md
Prerequisites
- Configure least-privilege Alibaba Cloud credentials before execution.
- Prefer environment variables:
ALICLOUD_ACCESS_KEY_ID, ALICLOUD_ACCESS_KEY_SECRET, optional ALICLOUD_REGION_ID.
- If region is unclear, ask the user before running mutating operations.
Workflow
- Confirm user intent, region, identifiers, and whether the operation is read-only or mutating.
- Run one minimal read-only query first to verify connectivity and permissions.
- Execute the target operation with explicit parameters and bounded scope.
- Verify results and save output/evidence files.
- Is your target a Bucket or an Object?
- Do you need upload/download/sync, or management actions like ACL/lifecycle/CORS?
- What are the target region and endpoint?
- Are you accessing OSS from ECS in the same region (intranet endpoint may be preferred)?
References
-
OSSUTIL 2.0 overview and install/config:
-
Official source list:references/sources.md
Prerequisites
- Configure least-privilege Alibaba Cloud credentials before execution.
- Prefer environment variables:
ALICLOUD_ACCESS_KEY_ID, ALICLOUD_ACCESS_KEY_SECRET, optional ALICLOUD_REGION_ID.
- If region is unclear, ask the user before running mutating operations.
Workflow
- Confirm user intent, region, identifiers, and whether the operation is read-only or mutating.
- Run one minimal read-only query first to verify connectivity and permissions.
- Execute the target operation with explicit parameters and bounded scope.
- Verify results and save output/evidence files.
OSSUTIL 2.0 overview and install/config:
Official source list:references/sources.md
- Configure least-privilege Alibaba Cloud credentials before execution.
- Prefer environment variables:
ALICLOUD_ACCESS_KEY_ID,ALICLOUD_ACCESS_KEY_SECRET, optionalALICLOUD_REGION_ID. - If region is unclear, ask the user before running mutating operations.
Workflow
- Confirm user intent, region, identifiers, and whether the operation is read-only or mutating.
- Run one minimal read-only query first to verify connectivity and permissions.
- Execute the target operation with explicit parameters and bounded scope.
- Verify results and save output/evidence files.
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。