diff --git a/website/docs/user-guide/messaging/wecom.md b/website/docs/user-guide/messaging/wecom.md index 937872b9a..1a98c8225 100644 --- a/website/docs/user-guide/messaging/wecom.md +++ b/website/docs/user-guide/messaging/wecom.md @@ -17,24 +17,52 @@ Connect Hermes to [WeCom](https://work.weixin.qq.com/) (企业微信), Tencent's ## Setup -### 1. Create an AI Bot +### Step 1: Create an AI Bot -1. Log in to the [WeCom Admin Console](https://work.weixin.qq.com/wework_admin/frame) -2. Navigate to **Applications** → **Create Application** → **AI Bot** -3. Configure the bot name and description -4. Copy the **Bot ID** and **Secret** from the credentials page - -### 2. Configure Hermes - -Run the interactive setup: +#### Recommended: Scan-to-Create (one command) ```bash hermes gateway setup ``` -Select **WeCom** and enter your Bot ID and Secret. +Select **WeCom** and scan the QR code with your WeCom mobile app. Hermes will automatically create a bot application with the correct permissions and save the credentials. -Or set environment variables in `~/.hermes/.env`: +The setup wizard will: +1. Display a QR code in your terminal +2. Wait for you to scan it with the WeCom mobile app +3. Automatically retrieve the Bot ID and Secret +4. Guide you through access control configuration + +#### Alternative: Manual Setup + +If scan-to-create is not available, the wizard falls back to manual input: + +1. Log in to the [WeCom Admin Console](https://work.weixin.qq.com/wework_admin/frame) +2. Navigate to **Applications** → **Create Application** → **AI Bot** +3. Configure the bot name and description +4. Copy the **Bot ID** and **Secret** from the credentials page +5. Run `hermes gateway setup`, select **WeCom**, and enter the credentials when prompted + +:::warning +Keep the Bot Secret private. Anyone with it can impersonate your bot. +::: + +### Step 2: Configure Hermes + +#### Option A: Interactive Setup (Recommended) + +```bash +hermes gateway setup +``` + +Select **WeCom** and follow the prompts. The wizard will guide you through: +- Bot credentials (via QR scan or manual entry) +- Access control settings (allowlist, pairing mode, or open access) +- Home channel for notifications + +#### Option B: Manual Configuration + +Add the following to `~/.hermes/.env`: ```bash WECOM_BOT_ID=your-bot-id @@ -47,7 +75,7 @@ WECOM_ALLOWED_USERS=user_id_1,user_id_2 WECOM_HOME_CHANNEL=chat_id ``` -### 3. Start the gateway +### Step 3: Start the gateway ```bash hermes gateway