Alibaba Cloud CLI integrates the Object Storage Service (OSS) command-line tool, ossutil 1.0. This lets you use the unified Alibaba Cloud CLI command format to quickly manage your data in OSS.
Concepts
The Alibaba Cloud CLI is a command-line tool built on Alibaba Cloud OpenAPI. You can use the Alibaba Cloud CLI in Cloud Shell to manage Alibaba Cloud resources efficiently. For more information, see What Is Alibaba Cloud CLI?.
ossutil is the official Alibaba Cloud command-line tool for managing OSS. Use ossutil to manage the following OSS data:
Manage buckets, such as creating, listing, or deleting buckets.
Manage objects, such as uploading, downloading, listing, copying, or deleting objects.
Manage parts, such as listing or deleting parts.
For more information, see ossutil 1.0 command-line tool.
Procedure
Step 1: Start Cloud Shell
Before you start Cloud Shell, log on to the Alibaba Cloud console using a RAM identity that has the required permissions. Cloud Shell automatically configures your identity credentials based on your current logon session. No manual configuration is needed. To prevent issues with automatic credential configuration, do not modify or delete the initial default configuration file.
You can start Cloud Shell in one of the following ways:
Run the command in the console.
Click the Cloud Shell button in the top navigation bar of the console home page to start Cloud Shell.

As a standalone application
In a browser, navigate to https://shell.aliyun.com to open the Cloud Shell interface.
When Cloud Shell starts, a virtual machine is created for your session. This process can take up to 30 seconds.
You can open up to five Cloud Shell windows at the same time. All windows connect to the same virtual machine. New windows do not create additional virtual machines.
For more information, see What is Cloud Shell?.
Step 2: Use Cloud Assistant CLI to manage data in OSS
Command format
Cloud Shell comes with Cloud Assistant CLI pre-installed and authorized. Use Cloud Assistant CLI to manage your OSS data. The general command format is as follows:
aliyun oss [command] [options and parameters]Command examples
Run the following command to create a bucket named
vmeixmeand set its storage class toStandard.aliyun oss mb oss://vmeixme --storage-class StandardRun the following command to create a folder named
horsein the bucket.aliyun oss mkdir oss://vmeixme/horse/Run the following command to list the OSS resources under your account, including buckets, objects, and parts. Set the maximum number of returned results to 20.
aliyun oss ls --limited-num 20
Help information
In Cloud Assistant CLI, use the --help option with any command to retrieve help information.
Run the
aliyun oss --helpcommand to view all OSS management commands supported by Cloud Assistant CLI.aliyun oss --helpRun the following command to retrieve detailed information and available options for a specific operation.
aliyun oss [command] --help
Command example
Run the following command to retrieve detailed information and available options for the folder creation operation.
aliyun oss mkdir --helpThe following information is expected to be returned.

Common operation commands
The following table lists the OSS operation commands supported by Cloud Assistant CLI.
Command | Description |
appendfromfile (append upload) | Appends content to the end of an uploaded appendable object. |
bucket-encryption (server-side encryption) | Adds, modifies, queries, or deletes the encryption configuration of a bucket. |
bucket-policy (authorization policy) | Adds, modifies, queries, or deletes a bucket policy. |
bucket-tagging (bucket tagging) | Adds, modifies, queries, or deletes the tag configuration of a bucket. |
cat (output file content) | Outputs the content of an object in a bucket to the screen. |
cors (cross-origin resource sharing) | Adds, modifies, queries, or deletes the cross-origin resource sharing (CORS) configuration of a bucket. |
cors-options (detect cross-origin request) | Sends an HTTP OPTIONS request to OSS to check whether a specified cross-origin access request is allowed. |
cp (upload, download, and copy files) | Uploads, downloads, and copies objects in a bucket. |
create-symlink (create symbolic link) | Creates a symbolic link to quickly open the source file. |
du (get size) | Gets the total size of all objects in a specified bucket or folder. |
getallpartsize (get part size) | Gets information about the parts generated by all incomplete multipart upload tasks in a bucket. |
hash (calculate CRC-64 or MD5) | Calculates the MD5 or CRC-64 value of a local file. |
help (get help information) | Gets help information for a command. |
lifecycle | Adds, queries, lists, or deletes a lifecycle rule. |
listpart (list parts) | Lists information about the parts of an object for which a multipart upload is not complete. |
logging (log storage) | Enables, queries, or disables the log storage configuration of a bucket. |
ls (list resources at the account level) | Lists information about the buckets, objects, and parts under the current account. |
mb (create bucket) | Creates a bucket. |
mkdir (create folder) | Creates a folder. |
object-tagging (object tagging) | Adds, modifies, retrieves, or deletes object tags. |
probe (detect status) | Troubleshoots the network status between your local machine and OSS, upload and download bandwidth, and the status of local symbolic links. |
read-symlink (read symbolic link) | Reads the description of a symbolic link file, including its ETag value and last update time. |
referer (hotlink protection) | Adds, modifies, queries, or deletes the hotlink protection configuration of a bucket. |
request-payment (pay by requester) | Sets the pay-by-requester mode. |
restore (file) | Restores archived, Cold Archive, and Deep Cold Archive objects. |
rm (delete) | Deletes unneeded objects, parts, or buckets to avoid unnecessary storage fees. |
set-acl (set or modify ACL) | Sets or modifies the access control list (ACL) of a bucket or an object. |
set-meta (manage object metadata) | Sets, modifies, or deletes the metadata of an uploaded object. |
sign (generate signed URL) | Creates a signed URL to grant a third-party user permissions to download or preview an object within a specified period. |
stat (view bucket and object information) | Views information about a specified bucket or object. |
website (static website hosting and origin fetch configuration) | Adds, modifies, queries, or deletes the static website hosting and origin fetch configurations of a bucket. |