Domestic Site Download Address | GitHub Download Address (for international sites) | SHA256 Checksum |
77c26d2e0226e16c1affa0e0c220cec2f3fd256461d0679162223d54336e5038 | ||
3bebe5d4dc0b82a0bc4e4e266ee9223b50aae3dd8c66fe3b54c9f1f2d03b4c97 | ||
af76ceebe450d2c9656a221112ca0c64e6662545be7a6ad1a39ac888a978cd72 | ||
66b910ec6cc9d182c6b6625b3c6c7c9336fff1967198e5ca9b5581e6b6b8c0ac | ||
78801347f02aa4fac820fa5684b41a256e5c25f8fe9ed2be7a3c7dce90f892a4 | ||
fc8d33b5b654b5a0d00c6f01019193c67c0855180b036cdb42cda18b735b736b | ||
54a6ee193a19a35b57179bcb8e9bb977063e400b76ba25c7f073fba4574ce553 | ||
ca24967718c37e6961bf6167ea10b42b165d8a6fe3a7fa5f07225f0129461dbc |
wget https://cosbrowser.cloud.tencent.com/software/coscli/coscli-darwin-amd64wget https://cosbrowser.cloud.tencent.com/software/coscli/coscli-darwin-arm64wget https://cosbrowser.cloud.tencent.com/software/coscli/coscli-linux-386wget https://cosbrowser.cloud.tencent.com/software/coscli/coscli-linux-amd64wget https://cosbrowser.cloud.tencent.com/software/coscli/coscli-linux-armwget https://cosbrowser.cloud.tencent.com/software/coscli/coscli-linux-arm64windows-amd64 version as an example,move the downloaded Windows version of the COSCLI tool to the C:\\Users\\< username > directory.coscli-windows.exe to coscli.exe.win+r to open the Run program.cmd and press Enter to open the command line window.coscli --version
coscli version v1.0.7, the installation is successful.Windows system, the method of using COSCLI in different command line clients may vary slightly. If entering coscli [command] does not work properly with COSCLI, please try the format ./coscli [command].macOS-amd64 version as an example,run the following command to rename the macOS version COSCLI file.mvcoscli-darwin-amd64coscli
chmod 755 coscli
./coscli --version
coscli version v1.0.7, the installation is successful.Unable to open "coscli" because the developer cannot be verified appears, you can go to Settings > Security and Privacy > General and select Still want to open coscli, afterwards COSCLI can be used normally.Linux-amd64 version as an example,run the following command to rename the Linux version COSCLI file.mv coscli-linux-amd64 coscli
chmod 755 coscli
./coscli --version
coscli version v1.0.7, the installation is successful.Enter to skip../coscli config init to create a configuration file at ~/.cos.yaml. You can complete the setup interactively through the command line. Later, you can also use ./coscli config init to interactively generate a configuration file in another location for COSCLI. You can use ./coscli config show to view the location and configuration parameters of the file.Configuration Item | Required | Description |
Secret ID | Yes | Key ID, it is recommended to use a sub-account key and follow the principle of least privilege to reduce risks. Information on obtaining a sub-account key can be found in Sub-account Access Key Management. Note: Secret IDs configured via initialization or command configuration are stored in encrypted mode. To manually modify the configuration file, set the Disable Encryption parameter to turn off key encryption. |
Secret Key | Yes | Key, it is recommended to use a sub-account key and follow the principle of least privilege to reduce risks. Information on obtaining a sub-account key can be found in Sub-account Access Key Management. Note: Secret Keys configured via initialization or command settings are stored in encrypted mode. To manually edit the configuration file, set the Disable Encryption parameter to turn off key encryption. |
Session Token | No | Temporary key token, needs to be configured when using a temporary key; otherwise you can skip by pressing Enter. For more information on temporary keys, see Accessing COS Using a Temporary Key.Note: Session Tokens configured via initialization or command settings are stored in encrypted mode. To manually edit the configuration file, set the Disable Encryption parameter to turn off key encryption. |
Mode | No | Set the identity mode, supporting enumerated values SecretKey and CvmRole. It can be null, with the default null value being SecretKey, indicating the use of a key request COS. When Mode is CvmRole, it means using Managing Instances Roles to request COS. |
Cvm Role Name | No | |
protocol | No | Network transfer protocol, which is HTTPS by default. If you want to change it to HTTP, directly modify it in the configuration file. |
APPID | Yes | APPID is the account you receive after successfully applying for a Tencent Cloud account, automatically assigned by the system, and can be obtained from Account Information. A bucket's full name is composed of two elements: Bucket Name and APPID, formatted as <BucketName-APPID>, for details please refer to Bucket Naming Conventions. |
Bucket Name | Yes | Bucket name, together with APPID, constitutes the bucket's full name, formatted as <BucketName-APPID>, for details please refer to Bucket Naming Conventions. |
Bucket Endpoint | Yes | Domain name of the region where the bucket is located, default domain format is cos.<region>.myqcloud.com, where <region> represents the bucket's region, such as ap-guangzhou, ap-beijing, etc. For a list of supported regions by COS, see Regions and Access Endpoints.If the bucket has global acceleration enabled, you can configure a global acceleration domain name. For example, the global acceleration domain name is set to cos.accelerate.myqcloud.com; the internal network global acceleration domain name is set to cos-internal.accelerate.tencentcos.cn. |
Bucket Alias | No | Bucket alias, once configured, you can use BucketAlias to replace BucketName-APPID, reducing the command length required for input. If this option is not configured, the value of BucketAlias is the same as BucketName-APPID. |
OFS Bucket | No | Metadata acceleration bucket tag, used to identify whether the bucket has the metadata acceleration feature enabled. |
CloseAutoSwitchHost | No | Set whether to disable automatic switch of a backup domain. Optional values are true and false, which can be null. If the value is not set or set to false, the backup domain switch will be executed; If the value is set to true, the backup domain switch will not be executed. |
Disable Encryption | No | Set whether to disable key encryption. Optional value: true | false, which can be left blank. If not set or the value is false, the key-related information in the configuration file will be encrypted. Set to true, and the key-related information in the configuration file will not be encrypted. |
DisableAutoFetchBucketType | No | Set whether to automatically retrieve the COS bucket type. Available values: true | false. Can be left blank. If not set or set to false, the tool automatically selects the COS bucket type, and authorization cos:HeadBucket is required.If set to true, the tool will not automatically identify the bucket type but preferentially determine it based on the --bucket-type parameter. If this parameter is not set, the bucket type is determined by the ofs parameter in the configuration file (true means an OFS bucket, false means a COS bucket). If the configuration file does not include bucket information, the COS bucket type is used by default. |
./coscli config add command to add bucket configurations. If you need to modify the configuration file or learn more about operations related to the configuration file, refer to the config command or use the ./coscli config --help command for quick access to related instructions../coscli --help../coscli config init command, you can also manually write the COSCLI configuration file. The format of the COSCLI configuration file is in YAML format, with an example configuration as follows:cos:base:secretid: XXXXXXXXXXXXXXXsecretkey: XXXXXXXXXXXXXXXXXsessiontoken: ""protocol: httpsbuckets:- name: examplebucket1-1250000000alias: bucket1region: ap-shanghaiendpoint: cos.ap-shanghai.myqcloud.comofs: false- name: examplebucket2-1250000000alias: bucket2region: ap-guangzhouendpoint: cos.ap-guangzhou.myqcloud.comofs: false- name: examplebucket3-1250000000alias: bucket3region: ap-chengduendpoint: cos.ap-chengdu.myqcloud.comofs: false
Feedback