Help Center/ CodeArts Agent/ FAQs/ CodeArts Agent CLI/ How Do I Configure a Proxy?
Updated on 2026-07-30 GMT+08:00

How Do I Configure a Proxy?

Symptom

If any of the following scenarios occurs, no proxy is configured:

  • Running a task returns the error "Access error. Please check the network or proxy."
  • In TUI development mode, initial startup takes more than 10 seconds, and the model list cannot be loaded.

Cause Analysis

If you have completed authorization but are on an enterprise intranet, you need to configure a proxy.

Solution

Select a solution based on your operating system.

Windows

  1. Open the System Properties dialog box and click Environment Variables on the Advanced tab.
  2. Modify the user variables and create http_proxy and https_proxy.

    The value of http_proxy is http://<proxy_user>:<proxy_password>@<proxy_host>:<proxy_port>, and the value of https_proxy is http://<proxy_user>:<proxy_password>@<proxy_host>:<proxy_port>. For details about how to set the parameters, see Table 1.

    Table 1 Configuring a proxy

    Parameter

    Description

    <proxy_user>:<proxy_password>

    Account and password for proxy login.

    CAUTION:

    If your password contains special characters such as @ and %, escape them using URL encoding before entering the password. Otherwise, the proxy configuration will be invalid.

    For example, if your password is Admin%@test, the password after URL encoding is Admin%25%40test. For details about URL encoding for common special characters, see Table 2 URL encoding for common characters.

    If no username and password authentication is required, delete this parameter and the following @. The simplified format is http://<proxy_host>:<proxy_port>.

    <proxy_host>

    Proxy server domain name.

    <proxy_port>

    Proxy service listening port.

    Table 2 URL encoding for common characters

    Character

    URL Encoded Value

    @

    %40

    %

    %25

    &

    %26

    =

    %3D

    +

    %2B

    Space

    %20 or /

    #

    %23

    /

    %2F

  3. Configure http_proxy and https_proxy.
  4. Click OK.
  5. After configuring the proxy, check whether the proxy configuration takes effect.

    1. Open the root directory of the target project.
    2. Right-click in the blank area and select Open Windows Terminal here.
    3. Enter /codearts in the terminal and press Enter to enter the TUI development environment. If models are displayed properly, the proxy configuration is successful. If models are still not displayed, you can submit a service ticket to get help from Huawei Cloud customer service.

      If the issue persists, submit a service ticket to get help from Huawei Cloud customer service.

macOS/Linux

Perform the following steps to temporarily configure a proxy in the macOS terminal or Linux window:

  1. Run the following commands to configure a proxy for the current window:

    export http_proxy="http://<proxy_user>:<proxy_password>@<proxy_host>:<proxy_port>"
    export https_proxy="http://<proxy_user>:<proxy_password>@<proxy_host>:<proxy_port>"

    For details about how to set the parameters, see Table 1.

  2. Run codearts models to check whether the proxy configuration takes effect.

    • If information similar to the following is displayed, the proxy is successfully configured.
      model_id                                           model_name
      -------------------------------------------------------------
      huaweicloud-maas/deepseek-v3.2                     DeepSeek-V3.2
      huaweicloud-maas/GLM-4.7-SFT-Harmony               GLM-4.7-ArkTS-SPARK
      huaweicloud-maas/Glm-5-internal                    GLM-5
      huaweicloud-maas/GLM-5.1                           GLM-5.1
    • If an authentication failure or error message is displayed, run the following commands to check whether the proxy is correctly configured:
      echo $http_proxy
      echo $https_proxy

      If the issue persists, submit a service ticket to get help from Huawei Cloud customer service.