Updated on 2026-09-15 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 account information to log in to CodeArts Agent CLI.
      • If you are using CodeArts Agent for the first time, the system will automatically activate the free package upon your successful login. 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