You can use Log Service CLI to perform various operations. For example, you can manage projects, manage Logstores, query logs, and replicate data across multiple regions and accounts. This topic describes how to install Log Service CLI.

Supported Python versions and runtime environments

  • Current CLI version: 0.2.0
  • Source code: aliyun-log-cli
  • Supported Python versions

    Python 2.6, 2.7, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, and 3.9

  • Supported runtime environments

    Windows, Linux, and macOS

  • Dependent components
    • docopt
    • aliyun-log-python-sdk-0.6.11
    • jmespath
    • aliyun-python-sdk-core
    • aliyun-python-sdk-sts
    • requests

    If an error occurs when you install Log Service CLI, we recommend that you run the pip install package_name command to install the preceding components and try again.

Install Log Service CLI in Linux

  1. Log on to a Linux server.
  2. Run the following command to install Log Service CLI:
    pip3 install aliyun-log-python-sdk aliyun-log-cli -U --no-cache
  3. Verify the installation result.
    Run the following command:
    aliyunlog --version
    If information similar to the following example is returned, Log Service CLI is installed:
    Successfully installed aliyun-log-cli-0.2.0 aliyun-log-python-sdk-0.7.2 backports.zoneinfo-0.2.1 ...

Install Log Service CLI in Windows

  1. Log on to a Windows server.
  2. Open Command Prompt.
  3. Run the following command to install Log Service CLI:
    pip3 install aliyun-log-python-sdk aliyun-log-cli -U --no-cache
  4. Verify the installation result.
    Run the following command:
    aliyunlog --version
    If information similar to the following example is returned, Log Service CLI is installed:
    log-cli-v-0.2.0, log-python-sdk-v-0.7.2, sys.version_info(major=3, minor=7, micro=0, releaselevel='final', serial=0), win32

Install Log Service CLI in macOS

We recommend that you use pip3 to install Log Service CLI. Example:
brew install python3
pip3 install -U aliyun-log-cli --no-cache

The other steps that you must perform to install Log Service CLI in macOS are similar to the steps to install Log Service CLI in Linux. For more information, see Install Log Service CLI in Linux.

What to do next

Configure Log Service CLI