Skip to content

Contributed by WildboarG, organized by Ai-Thinker

API Compilation for Ai-WB2

WB2 API


https://github.com/WildboarG/Ai-Thinker-WB2.git


Over the past two weeks, I've taken some free time to compile the WB2-related APIs into visual documentation, with a Chinese version for easy reference. I cloned the SDK directly from the official Ai-Thinker-WB2 repository, created a branch, and added the docs. I hope the official team can merge the PR.

How to Use


  • Method 1: Open it directly with a Markdown viewer in the docs directory
  • Method 2: Start an HTTP server in the docs directory, then open the server's ip:port in your browser and view it elegantly. For example: Using Python (if you have Python installed):
  • Navigate to the docs directory:
Click to expand: cd /path/to/docs
shell
cd /path/to/docs

Start a simple HTTP server

  • for Python3.x:
Click to expand: python3 -m http.server 8000
shell
python3 -m http.server 8000

Side Notes


Recently I also wrote a small tool in Go for quickly creating AI-WB2 projects, aiming to help those who have trouble configuring SDK project paths to quickly generate a project demo and validate their ideas.

  1. First, download it — using Ubuntu as an example:

    • Enter the following in the command line:
Click to expand: wget -O wb2-cli [https://githu
shell
wget -O wb2-cli [https://github.com/WildboarG/wb2-cli/releases/latest/download/wb2-cli-linux-amd64](https://github.com/WildboarG/wb2-cli/releases/latest/download/wb2-cli-linux-amd64)
  • Grant the file execute permission
Click to expand: chmod
sh
chmod
 +x wb2-cli
  • Move it to a directory that the PATH environment variable can recognize
Click to expand: sudo
sh
sudo
mv
 wb2-cli /usr/bin/.
  1. Usage First, specify the path of your downloaded Ai-WB2 SDK
Click to expand: wb2-cli init
shell
wb2-cli init

The SDK path can be specified in multiple config file locations:

  1. Under the current directory (not recommended)

  2. user/.config/WB2-CLI/cli.json

  3. user/.WB2-CLI/cli.json

  4. /etc/WB2-CLI/cli.json The last three only need to be initialized once. After that, you can generate new projects in any folder at any time without worrying about the SDK path. The first one only works when creating a project under the current directory.

  5. Generate a new project

In any directory:

Click to expand full code
SHELL
wb2-cli create

#
#提示输入新工程名字:newproject

Then you can write your own logic code in the new project.

Or specify the SDK path when generating the project

Click to expand: wb2-cli create --sdk /path/to/
sh
wb2-cli create --sdk /path/to/yoursdkpath/

Released under the MIT License. Build Time 2026-09-11 14:52:23