tencent cloud

Feedback

Download and Installation Configuration

Last updated: 2022-05-05 15:12:06

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

    Download URL

    Note:

    The current version is 0.11.0-beta. To get the latest version and update logs, go to Releases for download.

    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.0-beta
      

    macOS

    1. Run the following command to download COSCLI:

      wget https://github.com/tencentyun/coscli/releases/download/v0.11.0-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.0-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.0-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.0-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, 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 details, see Naming Conventions.
    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:

    COSCLI reads the configuration items from ~/.cos.yaml by default. If you want to use a custom configuration file, add the -c (--config-path) option after the command.

    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.

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support