Updated on 2026-10-27 GMT+08:00

CodeArts Agent CLI

Preparations

Step 1: Install CodeArts Agent CLI and Complete the Authorization

  1. Right-click inside your target project directory and choose Open in Terminal. The PowerShell window will open automatically. Run the installation command to complete the deployment, enter codearts, and press Enter.

    irm https://apsoutheast1-cloudide-marketplace.obs.ap-southeast-1.myhuaweicloud.com/codearts/cli_tui/install_script/install.ps1 | iex

  2. Complete the login authorization.

    • If you are not logged in, the system will automatically redirect you to the Huawei Cloud login page in an external browser. Enter your Huawei Cloud account information to log in to CodeArts Agent CLI.
      • If this is your first time using the service, after you sign in successfully, the system automatically activates an free package for you. The package is valid for one month and is automatically extended upon expiration. No fees are charged, so you do not need to worry about being billed. If you want to unlock more advanced features, you can upgrade your package at any time from the Subscriptions page.
      • If the browser is not automatically opened, disable the pop-up blocker, or manually copy and visit the login link in the terminal.
    • If you are already logged in to CodeArts Agent, you will enter the TUI development environment directly.

Step 2: Write a Snake Game

In the autonomous mode of the TUI environment, simply enter your instructions in the chat window. The agent will automatically generate standard, production-ready code based on your requirements, code comments, and natural language prompts.

  1. In the TUI development environment, send your requirements to AI.

    Write a Snake game using HTML.

  2. Select the file directory access permission for the TUI development environment, for example, Allow always. Then click Confirm.

    Figure 1 Selecting the file access permissions

  3. Wait until the task is completed, and go to the address of the snake.html file as prompted.
  4. Use a browser to open the snake.html file for preview.

    Figure 2 First attempt

  5. You can continue the conversation with the AI, and the agent will modify the code based on your requirements. For example, input "Please change the color of the snake to yellow" and press Enter.

    Figure 3 Continuing the conversation

  6. Wait until the task is completed. Verify that the color of the snake is changed to yellow.

    Figure 4 Second attempt