Write WeChat Mini Programs with AI
Use AI to write Mini Program code, preview in the simulator, and set up cloud database / functions / storage.
This is not the same as “AI features inside a Mini Program for end users.” This page is about your coding workflow. For product AI capabilities, start at AI overview.
WeChat’s own guide (source of truth for menus and version requirements): DevTools Skills.
Before you start
-
WeChat Developer Tools Nightly
This AI surface ships with Nightly; Stable often does not.
Nightly affects local development only — it is not a different publishing channel. Version requirements follow WeChat’s Skills doc. Sign in with WeChat and keep DevTools open while coding. -
An AI coding tool
Pick one path (finishing the selector alone does not mean Skills are connected):- Path A: CloudBase AI inside DevTools (default in the selector below)
- Path B: CodeBuddy, Cursor, Claude Code, etc., then import the DevTools Skill into that Agent
-
A real Mini Program AppID
appidin the project must not be empty ortouristappid, or the Agent cannot open the project window. -
(Recommended) CloudBase skill pack so the Agent writes CloudBase correctly:
npx skills add tencentcloudbase/cloudbase-skills -y
Do I need CloudBase MCP?
Only when you need advanced console-side work (permissions, data models, MySQL/PostgreSQL). See Connect CloudBase MCP.
Connect
1. Install and sign in to Nightly
Open the Nightly download page, install, scan to sign in, keep DevTools running.
2. Choose your AI tool
Configure your AI tool to connect with CloudBase capabilities. Supports local and hosted connection. See connection modes.
Step 1: Install / Configure CloudBase
Step 2: Chat with AI
Enter the following in your AI chat in order:
Install CloudBase Skills: run npx skills add tencentcloudbase/cloudbase-skills -yUse CloudBase Skills: Check whether DevTools is signed in; then build a WeChat Mini Program sample with CloudBase login and a list page, and preview it3. External Agents only: import the DevTools Skill
Path A (built-in DevTools AI): after step 2, go to step 4.
Path B (CodeBuddy / Cursor / …): you must import the Skill, or the Agent cannot drive the simulator:
- Menu → Export DevTools Skill → import into your Agent (menu label follows the current WeChat build)
- Or run
wechatideand give the printed Skill path to the Agent - On first connect, DevTools shows an auth popup — you must allow it, or everything after fails
4. Confirm the project can open
Root folder has project.config.json with a real AppID for your account.
5. One acceptance prompt
Check whether DevTools is signed in, then open this Mini Program and preview it.
After preview works, describe features, e.g. “Build a Mini Program with login and a list page; store data in CloudBase.”
If it does not connect
Check in order — most failures are the first three:
- Nightly installed? Signed in? DevTools window open?
- External Agent: Skill imported? First auth popup allowed?
- Valid
appid(not empty, nottouristappid)? - Still stuck: paste the error to the Agent, or read WeChat’s DevTools Skills
Next
- WeChat Mini Program quick start (project +
wx.cloud) - WeChat DevTools setup
- miniprogram-development Skill
- Connect CloudBase MCP (advanced)