This topic describes how to start the Tablestore CLI and configure the information that is required to access Tablestore, such as the AccessKey pair and Tablestore instance.

Prerequisites

An AccessKey pair that consists of an AccessKey ID and an AccessKey secret is obtained. For more information, see Obtain an AccessKey pair.
Note If a RAM user is required to perform operations, make sure that the required permissions are granted to the RAM user. For more information, see Grant permissions to a RAM user.

Procedure

  1. Decompress the Tablestore CLI package that you downloaded. Go to the root directory of the Tablestore CLI and select a method that is used to start the Tablestore CLI based on your operating system.
    • For Windows, double-click the ts.exe file.
    • For Linux or macOS, run the ./ts command.
      Note If you do not have execute permissions to run the command in Linux or macOS, run the chmod 755 ts command to obtain permissions and start the Tablestore CLI.
    The following code shows a sample Tablestore startup interface:
    # Welcome to use Command Line Tool for Aliyun Tablestore. Current Version is '2021-11-11'.
    #    _______      _      _              _
    #   |__   __|    | |    | |            | |
    #      | |  __ _ | |__  | |  ___   ___ | |_   ___  _ __    ___
    #      | | / _' || '_ \ | | / _ \ / __|| __| / _ \ | '__| / _ \
    #      | || (_| || |_) || ||  __/ \__ \| |_ | (_) || |   |  __/
    #      |_| \__,_||_.__/ |_| \___| |___/ \__| \___/ |_|    \___|
    #
    # Please visit our product website: https://www.aliyun.com/product/ots
    # You can also join our DingTalk Chat Group (ID: 11789671 or 23307953) to discuss and ask Tablestore related questions.
    #
    tablestore>
  2. Configure access information.

    The following sample code shows how to configure access information by using an existing instance:

    config --endpoint https://myinstance.cn-hangzhou.ots.aliyuncs.com --instance myinstance --id NTSVLeBHzgX2iZfcaXXPJ**** --key 7NR2DiotscDbauohSq9kSHX8BDp99bjs7eNpCR7o****
    If no instance is created, you need only to specify the AccessKey ID and AccessKey secret. The following sample code shows how to specify the AccessKey ID and AccessKey secret:
    config --id NTSVLeBHzgX2iZfcaXXPJ**** --key 7NR2DiotscDbauohSq9kSHX8BDp99bjs7eNpCR7o****
    The following table describes the parameters that you can configure to specify access information.
    Parameter Required Example Description
    --endpoint No https://myinstance.cn-hangzhou.ots.aliyuncs.com The endpoint of the instance. For more information, see Endpoint. This parameter is required only if you use an existing instance to configure the access information.
    --instance No myinstance The name of the instance. This parameter is required only if you use an existing instance to configure the access information.
    --id Yes NTSVLeBHzgX2iZfcaXXPJ**** The AccessKey ID and AccessKey secret of an Alibaba Cloud account or a RAM user.
    --key Yes 7NR2DiotscDbauohSq9kSHX8BDp99bjs7eNpCR7o****