Updated on 2026-08-07 GMT+08:00

Authorization

CodeArts Agent CLI uses Huawei Cloud AK/SK for identity authentication and offers two authorization modes to adapt to different scenarios.

  • Process-level temporary authorization: is valid only within the current terminal session and automatically expires when the window is closed. It requires no persistent key storage, making it safe, convenient, and ideal for temporary debugging or testing on public machines.
  • Permanent authorization using system environment variables: writes authentication credentials into system Shell or Windows environment variables. It remains valid after opening a new terminal or restarting the device, making it ideal for long-term local development and avoiding repetitive configuration.

Preparations

  1. Create access keys by referring to Access Keys.
  2. In the Create Access Key dialog box, select the agreement check box and click Next. Enter a description for the access key and click OK.

    After the access key is created, download it and keep it secure. Once the dialog box is closed, the key cannot be obtained.

  3. Configure environment variables based on your operating system (see the following). Obtain the values of Access Key Id and Secret Access Key from the downloaded credentials.csv file.

Windows

The following describes how to perform authorization by configuring process-level variables and system environment variables in Windows.

macOS

The following describes how to perform authorization by configuring process-level variables and system environment variables in macOS.

Linux

You can select an authorization method as required.

Table 1 Comparison of different authorization methods

Authorization Method

Effective Scope

Lifecycle

Applicable Shell

Permission Requirements

Typical Scenarios

Temporary process authorization

Current terminal window only

Expires immediately after the terminal is closed; cleared upon a server restart

bash, zsh, and sh

Common users

Temporary debugging, one-off tests, and temporary script execution, without the need to retain keys

Permanent Bash user authorization

Currently logged-in users and all new terminals

Persists permanently; remains effective after a terminal or server restart

Linux default Bash (CentOS, Ubuntu, or Kylin)

Common users

Personal servers, frequent daily use, operations only performed by the user