COSCLI provides binary packages for Windows, macOS, and Linux, which can be used after simple installation and configuration.
GitHub Address | Tencent Cloud Address |
---|---|
Windows | Windows |
Mac | Mac |
Linux | Linux |
Note:The current version is v0.11.1-beta. To get the latest and earlier versions and changelogs of the tool, see Releases.
C:\Users\<username>
directory.coscli-windows.exe
to coscli.exe
.Windows + R
to launch the Run
program.cmd
and press Enter
to open the command line window.coscli --version
in the command line window. If the following information is printed out, the installation is successful:
Note:On Windows, the method for using COSCLI may vary slightly by command line client. If COSCLI does not work properly after
coscli [command]
is entered, try./coscli [command]
.
coscli version v0.11.1-beta
Run the following command to download COSCLI:
wget https://github.com/tencentyun/coscli/releases/download/v0.11.1-beta/coscli-mac
Run the following command to rename the file:
mv coscli-mac coscli
Run the following command to modify the file execution permission:
chmod 755 coscli
Enter the command line ./coscli --version
. If the following information is printed out, the installation is successful:
coscli version v0.11.1-beta
Note:When you use COSCLI on macOS, if the
Unable to open "coscli" because the developer cannot be verified
prompt is displayed, go toSettings > Security & Privacy > General
and selectOpen COSCLI anyway
, and then COSCLI can be used properly.
Download COSCLI for Linux or run the following command to download COSCLI:
wget https://github.com/tencentyun/coscli/releases/download/v0.11.1-beta/coscli-linux
Run the following command to rename the file:
mv coscli-linux coscli
Run the following command to modify the file execution permission:
chmod 755 coscli
Enter ./coscli --version
in the command line window. If the following information is printed out, the installation is successful:
coscli version v0.11.1-beta
You can quickly check how to use COSCLI by running the command ./coscli --help
.
COSCLI will generate a configuration file in ~/.cos.yaml
by default when used for the first time. You can also run the ./coscli config init
command later to interactively generate a configuration file in another location.
The configuration items in the configuration file are as described below:
Configuration Item | Description |
---|---|
Secret ID | Key ID, which can be created and obtained from the CAM console. |
Secret Key | Key, which can be created and obtained from the CAM console. |
Session Token | Temporary key token, which should be specified if a temporary key is used; otherwise, press Enter to skip it. |
APP ID | APP ID is the account you get after successfully registering your Tencent Cloud account. It is automatically assigned by the system and can be obtained from Account Information. The full name of a bucket consists of Bucket Name and APP ID in the format of <bucketname-appid> . For more information about bucket naming conventions, see Bucket Overview. |
Bucket Name | Bucket name, which forms the full name of the bucket together with the APP ID in the format of <bucketname-appid> . For more information about bucket naming conventions, see Bucket Overview. |
Bucket Region | Bucket region. For details, see Regions and Access Endpoints. |
Bucket Alias | Bucket alias, which can be used to replace BucketName-APPID after configuration to shorten required commands. If it is not configured, its value will be the value of BucketName-APPID . |
In addition to interactively generating a configuration file by running ./coscli config init
, you can also manually write a YAML configuration file for COSCLI as shown below:
cos:
base:
secretid: XXXXXXXXXXXXXXX
secretkey: XXXXXXXXXXXXXXXXX
sessiontoken: ""
buckets:
- name: examplebucket1-1250000000
alias: bucket1
region: ap-shanghai
- name: examplebucket2-1250000000
alias: bucket2
region: ap-guangzhou
- name: examplebucket3-1250000000
alias: bucket3
region: ap-chengdu
Note:By default, COSCLI reads configuration items from
~/.cos.yaml
. If you want to use the custom configuration file, select-c (--config-path)
after running commands. The strings (secretid
/secretkey
/sessiontoken
) stored in the configuration file are encrypted.
COSCLI supports multiple buckets; however, it will ask you to configure the information of only one bucket during the initial configuration. You can run the ./coscli config add
command later to add the information of more buckets.
Note:For more configuration file operations, see Generating and Modifying Configuration Files - config.
Apakah halaman ini membantu?