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
docsdirectory - Method 2: Start an HTTP server in the
docsdirectory, 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
cd /path/to/docsStart a simple HTTP server
- for Python3.x:
Click to expand: python3 -m http.server 8000
python3 -m http.server 8000- Method 3: Visit the webpage I have deployed directly <https://wildboarg.github.io/Ai-Thinker-WB2/>

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.
First, download it — using Ubuntu as an example:
- Enter the following in the command line:
Click to expand: wget -O wb2-cli [https://githu
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
chmod
+x wb2-cli- Move it to a directory that the PATH environment variable can recognize
Click to expand: sudo
sudo
mv
wb2-cli /usr/bin/.- Usage First, specify the path of your downloaded Ai-WB2 SDK
Click to expand: wb2-cli init
wb2-cli initThe SDK path can be specified in multiple config file locations:
Under the current directory (not recommended)
user/.config/WB2-CLI/cli.json
user/.WB2-CLI/cli.json
/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.
Generate a new project
In any directory:
Click to expand full code
wb2-cli create
#
#提示输入新工程名字:newprojectThen 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/
wb2-cli create --sdk /path/to/yoursdkpath/
