
Aliyun Oss Ossutil
- 70 installs
- 396 repo stars
- Updated July 18, 2026
- cinience/alicloud-skills
Install, configure, and operate Alibaba Cloud OSS object storage from the command line with ossutil 2.0 for upload, download, and sync.
About
Uses ossutil 2.0 to manage Alibaba Cloud OSS buckets and objects from the CLI, covering install, config, and upload/download/sync. A developer uses it to move and manage files in OSS.
- Install and configure ossutil 2.0 with AK/SK and region
- Upload, download, sync, and list bucket objects
Aliyun Oss Ossutil by the numbers
- 70 all-time installs (skills.sh)
- Ranked #656 of 1,039 Cloud & Infrastructure skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/cinience/alicloud-skills --skill aliyun-oss-ossutilAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 70 |
|---|---|
| repo stars | ★ 396 |
| Last updated | July 18, 2026 |
| Repository | cinience/alicloud-skills ↗ |
What it does
Install, configure, and operate Alibaba Cloud OSS object storage from the command line with ossutil 2.0 for upload, download, and sync.
Files
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.txtPass 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
1. Install ossutil 2.0. 2. Configure AK/SK and default region (ossutil config or config file). 3. Run ossutil ls to list buckets, then list objects using the bucket region. 4. Execute upload/download/sync or API-level commands.
Install ossutil 2.0
- 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
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 ALIBABACLOUD_ACCESS_KEY_ID="<your-ak>"
export ALIBABACLOUD_ACCESS_KEY_SECRET="<your-sk>"
export ALIBABACLOUD_REGION_ID="cn-beijing"ALIBABACLOUD_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/ --deleteRecommended execution flow (list buckets first, then objects)
1) List all buckets
ossutil ls2) Get target bucket region from output (e.g. oss-cn-shanghai) and convert it to --region format (cn-shanghai).
3) 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.com4) 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.comCommon errors and handling
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)
1. Is your target a Bucket or an Object? 2. Do you need upload/download/sync, or management actions like ACL/lifecycle/CORS? 3. What are the target region and endpoint? 4. Are you accessing OSS from ECS in the same region (intranet endpoint may be preferred)?
References
- OSSUTIL 2.0 overview and install/config:
- https://help.aliyun.com/zh/oss/developer-reference/ossutil-overview
- Official source list:
references/sources.md
Prerequisites
- Configure least-privilege Alibaba Cloud credentials before execution.
- Prefer environment variables:
ALIBABACLOUD_ACCESS_KEY_ID,ALIBABACLOUD_ACCESS_KEY_SECRET, optionalALIBABACLOUD_REGION_ID. - If region is unclear, ask the user before running mutating operations.
Workflow
1) Confirm user intent, region, identifiers, and whether the operation is read-only or mutating. 2) Run one minimal read-only query first to verify connectivity and permissions. 3) Execute the target operation with explicit parameters and bounded scope. 4) Verify results and save output/evidence files.
interface:
display_name: "Alibaba Cloud Storage OSS Ossutil"
short_description: "OSS object storage workflows"
default_prompt: "Use $aliyun-oss-ossutil to complete this storage/oss task on Alibaba Cloud."
ossutil 2.0 安装(按平台)
请优先使用官方文档中的最新地址。历史路径(例如 /ossutil/2.2.0/...)可能返回 404。Linux
if command -v yum >/dev/null 2>&1; then
sudo yum install -y unzip
else
sudo apt-get update && sudo apt-get install -y unzip
fi
curl -fL -o ossutil.zip https://gosspublic.alicdn.com/ossutil/v2/2.2.1/ossutil-2.2.1-linux-amd64.zip
unzip ossutil.zip
sudo chmod 755 ossutil-2.2.1-linux-amd64/ossutil
sudo mv ossutil-2.2.1-linux-amd64/ossutil /usr/local/bin/ossutil
ossutil versionmacOS
curl -fL -o ossutil.zip https://gosspublic.alicdn.com/ossutil/v2/2.2.1/ossutil-2.2.1-darwin-amd64.zip
unzip ossutil.zip
sudo chmod 755 ossutil-2.2.1-darwin-amd64/ossutil
sudo mv ossutil-2.2.1-darwin-amd64/ossutil /usr/local/bin/ossutil
ossutil versionWindows
- 下载对应平台压缩包并解压。
- 将
ossutil.exe所在目录加入系统PATH。 - 在 PowerShell/CMD 中运行
ossutil version验证安装。
官方文档来源(用于后续更新) ============================
- https://gosspublic.alicdn.com/ossutil/v2/2.2.1/ossutil-2.2.1-darwin-amd64.zip
- https://gosspublic.alicdn.com/ossutil/v2/2.2.1/ossutil-2.2.1-linux-amd64.zip
- https://help.aliyun.com/zh/oss/developer-reference/ossutil-overview
#!/usr/bin/env python3
from __future__ import annotations
import argparse
from pathlib import Path
import shutil
import subprocess
import sys
def main() -> int:
parser = argparse.ArgumentParser(description="Validate ossutil skill prerequisites and write evidence.")
parser.add_argument("--check-binary", action="store_true", help="Check ossutil binary availability and version")
parser.add_argument("--output", default="output/aliyun-oss-ossutil/validate.txt")
args = parser.parse_args()
install_doc = Path("skills/storage/oss/aliyun-oss-ossutil/references/install.md")
skill_doc = Path("skills/storage/oss/aliyun-oss-ossutil/SKILL.md")
lines = [
f"install_doc_exists={install_doc.exists()}",
f"skill_doc_exists={skill_doc.exists()}",
]
if args.check_binary:
binary = shutil.which("ossutil")
lines.append(f"ossutil_path={binary or 'NOT_FOUND'}")
if binary:
proc = subprocess.run([binary, "--version"], capture_output=True, text=True, check=False)
lines.append(f"ossutil_version_exit={proc.returncode}")
lines.append(proc.stdout.strip() or proc.stderr.strip())
out = Path(args.output)
out.parent.mkdir(parents=True, exist_ok=True)
out.write_text("\n".join(lines) + "\n", encoding="utf-8")
print(f"wrote: {out}")
return 0
if __name__ == "__main__":
sys.exit(main())