tencent cloud

masukan

Download and Installation Configuration

Terakhir diperbarui:2022-07-20 11:34:18

    COSCLI provides binary packages for Windows, macOS, and Linux, which can be used after simple installation and configuration.

    Download Address

    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.

    Installation

    Windows

    1. Download COSCLI for Windows.
    2. Move the downloaded COSCLI executable file to the C:\Users\<username> directory.
    3. Rename coscli-windows.exe to coscli.exe.
    4. Press Windows + R to launch the Run program.
    5. In the dialog box, enter cmd and press Enter to open the command line window.
    6. Enter 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
      

    macOS

    1. Run the following command to download COSCLI:

      wget https://github.com/tencentyun/coscli/releases/download/v0.11.1-beta/coscli-mac
      
    2. Run the following command to rename the file:

      mv coscli-mac coscli
      
    3. Run the following command to modify the file execution permission:

      chmod 755 coscli
      
    4. 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 to Settings > Security & Privacy > General and select Open COSCLI anyway, and then COSCLI can be used properly.

    Linux

    1. 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
      
    2. Run the following command to rename the file:

      mv coscli-linux coscli
      
    3. Run the following command to modify the file execution permission:

      chmod 755 coscli
      
    4. 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
      

    Parameter Configuration

    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.

    Other configuration methods

    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.

    Configuring multiple buckets

    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.

    Hubungi Kami

    Hubungi tim penjualan atau penasihat bisnis kami untuk membantu bisnis Anda.

    Dukungan Teknis

    Buka tiket jika Anda mencari bantuan lebih lanjut. Tiket kami tersedia 7x24.

    Dukungan Telepon 7x24