{"skill":{"slug":"alicloud-storage-oss-ossutil","displayName":"Alicloud Storage Oss Ossutil","summary":"Alibaba Cloud OSS CLI (ossutil 2.0) skill. Install, configure, and operate OSS from the command line based on the official ossutil overview.","description":"---\nname: alicloud-storage-oss-ossutil\ndescription: Alibaba Cloud OSS CLI (ossutil 2.0) skill. Install, configure, and operate OSS from the command line based on the official ossutil overview.\nversion: 1.0.0\n---\n\nCategory: tool\n\n# OSS (ossutil 2.0) CLI Skill\n\n## Validation\n\n```bash\npython skills/storage/oss/alicloud-storage-oss-ossutil/scripts/check_ossutil.py --output output/alicloud-storage-oss-ossutil/validate.txt\n```\n\nPass criteria: command exits 0 and `output/alicloud-storage-oss-ossutil/validate.txt` is generated.\n\n## Output And Evidence\n\n- Save command outputs, object listings, and sync logs under `output/alicloud-storage-oss-ossutil/`.\n- Keep at least one upload or listing result as evidence.\n\n## Goals\n\n- Use ossutil 2.0 to manage OSS: upload, download, sync, and resource management.\n- Provide a unified CLI flow for install, config, credentials, and region/endpoint handling.\n\n## Quick Start Flow\n\n1. Install ossutil 2.0.\n2. Configure AK/SK and default region (`ossutil config` or config file).\n3. Run `ossutil ls` to list buckets, then list objects using the bucket region.\n4. Execute upload/download/sync or API-level commands.\n\n## Install ossutil 2.0\n\n- See `references/install.md` for platform-specific install steps.\n\n## Configure ossutil\n\n- Interactive configuration:\n\n```bash\nossutil config\n```\n\n- Default config file paths:\n  - Linux/macOS：`~/.ossutilconfig`\n  - Windows：`C:\\Users\\issuser\\.ossutilconfig`\n\nMain configuration fields include:\n- `AccessKey ID`\n- `AccessKey Secret`\n- `Region`（example default `cn-hangzhou`; ask the user if the best region is unclear）\n- `Endpoint`（optional; auto-derived from region if omitted）\n\n## AccessKey configuration notes\n\nUse RAM users/roles with least privilege and avoid passing AK in plain text on command line.\n\nRecommended method (environment variables):\n\n```bash\nexport ALICLOUD_ACCESS_KEY_ID=\"<your-ak>\"\nexport ALICLOUD_ACCESS_KEY_SECRET=\"<your-sk>\"\nexport ALICLOUD_REGION_ID=\"cn-beijing\"\n```\n\n`ALICLOUD_REGION_ID` can be used as default region; if unset choose the most reasonable region, ask user if unclear.\n\nOr use the standard shared credentials file:\n\n`~/.alibabacloud/credentials`\n\n```ini\n[default]\ntype = access_key\naccess_key_id = <your-ak>\naccess_key_secret = <your-sk>\n```\n\n\n## Command structure (2.0)\n\n- High-level command example:`ossutil config`\n- API-level command example:`ossutil api put-bucket-acl`\n\n## Common command examples\n\n```bash\nossutil ls\nossutil ls oss://your-bucket -r --short-format --region cn-shanghai -e https://oss-cn-shanghai.aliyuncs.com\nossutil cp ./local.txt oss://your-bucket/path/local.txt\nossutil cp oss://your-bucket/path/remote.txt ./remote.txt\nossutil sync ./local-dir oss://your-bucket/path/ --delete\n```\n\n## Recommended execution flow (list buckets first, then objects)\n\n1) List all buckets\n\n```bash\nossutil ls\n```\n\n2) Get target bucket region from output (e.g. `oss-cn-shanghai`) and convert it to `--region` format (`cn-shanghai`).\n\n3) When listing objects, explicitly set `--region` and `-e` to avoid cross-region signature/endpoint errors.\n\n```bash\nossutil ls oss://your-bucket \\\n  -r --short-format \\\n  --region cn-shanghai \\\n  -e https://oss-cn-shanghai.aliyuncs.com\n```\n\n4) For very large buckets, limit output size first.\n\n```bash\nossutil ls oss://your-bucket --limited-num 100\nossutil ls oss://your-bucket/some-prefix/ -r --short-format --region cn-shanghai -e https://oss-cn-shanghai.aliyuncs.com\n```\n\n## Common errors and handling\n\n- `Error: region must be set in sign version 4.`\n  - Cause: missing region configuration.\n  - Fix: add `region` in config file, or pass `--region cn-xxx`.\n\n- `The bucket you are attempting to access must be addressed using the specified endpoint`\n  - Cause: request endpoint does not match bucket region.\n  - Fix: use endpoint of the bucket region, e.g. `-e https://oss-cn-hongkong.aliyuncs.com`.\n\n- `Invalid signing region in Authorization header`\n  - Cause: signature region does not match bucket region.\n  - Fix: correct both `--region` and `-e`; both must match bucket region.\n\n## Credential and security guidance\n\n- Prefer RAM user AK for access control.\n- CLI options can override config file, but passing secrets on command line has leakage risk.\n- In production, manage secrets via config files or environment variables.\n\n## Clarifying questions (ask when uncertain)\n\n1. Is your target a Bucket or an Object?\n2. Do you need upload/download/sync, or management actions like ACL/lifecycle/CORS?\n3. What are the target region and endpoint?\n4. Are you accessing OSS from ECS in the same region (intranet endpoint may be preferred)?\n\n## References\n\n- OSSUTIL 2.0 overview and install/config:\n  - https://help.aliyun.com/zh/oss/developer-reference/ossutil-overview\n\n- Official source list:`references/sources.md`\n\n## Prerequisites\n\n- Configure least-privilege Alibaba Cloud credentials before execution.\n- Prefer environment variables: `ALICLOUD_ACCESS_KEY_ID`, `ALICLOUD_ACCESS_KEY_SECRET`, optional `ALICLOUD_REGION_ID`.\n- If region is unclear, ask the user before running mutating operations.\n\n## Workflow\n\n1) Confirm user intent, region, identifiers, and whether the operation is read-only or mutating.\n2) Run one minimal read-only query first to verify connectivity and permissions.\n3) Execute the target operation with explicit parameters and bounded scope.\n4) Verify results and save output/evidence files.\n\n","tags":{"latest":"1.0.3"},"stats":{"comments":0,"downloads":1798,"installsAllTime":68,"installsCurrent":4,"stars":1,"versions":4},"createdAt":1770768358281,"updatedAt":1778989716074},"latestVersion":{"version":"1.0.3","createdAt":1773222065063,"changelog":"batch publish from alicloud-skills on 2026-03-11","license":"MIT-0"},"metadata":null,"owner":{"handle":"cinience","userId":"s1707avh05gnzr3g6e3m9ka6fh840rtd","displayName":"cinience","image":"https://avatars.githubusercontent.com/u/557426?v=4"},"moderation":null}