跳转到主要内容
OpenClaw is an AI bot framework that connects to Qhaigc. This tutorial walks you through the one-click installation script and the full Feishu (Lark) enterprise bot setup. The process works on macOS, Linux, and Windows via WSL.

Prerequisites

  • macOS, Linux, or Windows 10 2004+ / Windows 11 (with WSL)
  • A Qhaigc API key — get yours from the API Tokens page
  • A Feishu account with permission to create enterprise apps at open.feishu.cn

Windows: Install WSL First

macOS and Linux users can skip this section and start directly at Step 1.
Windows users must install WSL before running the script.
  1. Confirm CPU virtualization is enabled. Check in Task Manager → Performance → CPU. If it is not enabled, follow your motherboard’s instructions to enable it in BIOS.
  2. Install Ubuntu from the Microsoft Store: open the Store app and search for Ubuntu, or visit the Ubuntu product page directly.
  3. On first launch, Ubuntu prompts you to create a Linux username and password. The password does not display as you type — press Enter when done.

Step 1: Run the Installation Script

Open a terminal (or Ubuntu on Windows) and run:
curl -fsSL "https://opendoc.qhaigc.net/openclaw/install.sh" | bash
If prompted for a system password, type it and press Enter (no characters appear). Installation typically takes a few minutes to complete.

Step 2: Enter Your Qhaigc API Key

During installation, the script pauses and asks for your Qhaigc API key. Paste your key into the terminal and press Enter to continue.

Step 3: Create a Feishu App

  1. Go to open.feishu.cn and log in with your Feishu account.
  2. Click Create AppEnterprise Self-Built App.
  3. Enter an app name and description, then complete the creation.

Step 4: Configure Feishu Permissions

  1. In your new app, open Permission Management.
  2. Click Bulk Import and paste the following JSON to import all required permissions at once:
{
  "scopes": {
    "tenant": [
      "aily:file:read",
      "aily:file:write",
      "application:application.app_message_stats.overview:readonly",
      "application:application:self_manage",
      "application:bot.menu:write",
      "cardkit:card:write",
      "contact:user.employee_id:readonly",
      "corehr:file:download",
      "docs:document.content:read",
      "event:ip_list",
      "im:chat",
      "im:chat.access_event.bot_p2p_chat:read",
      "im:chat.members:bot_access",
      "im:message",
      "im:message.group_at_msg:readonly",
      "im:message.group_msg",
      "im:message.p2p_msg:readonly",
      "im:message:readonly",
      "im:message:send_as_bot",
      "im:resource",
      "sheets:spreadsheet",
      "wiki:wiki:readonly"
    ],
    "user": [
      "aily:file:read",
      "aily:file:write",
      "im:chat.access_event.bot_p2p_chat:read"
    ]
  }
}

Step 5: Publish the Feishu App for the First Time

Go to Version Management & Release, create a new version, submit for review, and publish it.
You must complete this initial publish before entering your credentials in the terminal. Skipping this step can prevent subsequent steps from taking effect.

Step 6: Enter Your Feishu Credentials in the Terminal

  1. In your Feishu app, go to Credentials & Basic Info.
  2. Copy the App ID and paste it into the terminal prompt.
  3. Copy the App Secret and paste it into the next prompt.
After you enter both values, OpenClaw completes the Feishu integration and prints the WebUI URL and access token. Open the URL in your browser to access the configuration page.

Step 7: Configure Event Subscriptions

In your Feishu app, go to Events & Callbacks:
  1. Select Receive events using long connection (WebSocket mode).
  2. Add the event im.message.receive_v1.

Step 8: Save Changes and Republish

Return to Version Management & Release, save the current changes, and publish again to ensure all configuration (including event subscriptions) takes effect.

Step 9: Complete the Pairing in Feishu

  1. Open the Feishu client and create a new group chat.
  2. Add your bot to the group.
  3. Send a test message such as “Hello”.
  4. The bot responds with an English message containing a pairing command similar to:
    openclaw pairing approve feishu URPJSW9K
    
  5. Copy that command and run it in the terminal where OpenClaw is installed.
Once the command succeeds, the pairing is complete. Subsequent messages to the bot will receive normal AI-powered replies.

Common Questions

How do I know if OpenClaw installed successfully? The terminal prints a clear success message at the end of installation and then continues to the API key prompt. If installation fails, an error message is shown instead. Why does the bot reply in English with a command on first message? This is OpenClaw’s security pairing flow. Run the openclaw pairing approve feishu ... command once in your terminal to authorize the connection. How do I uninstall OpenClaw? Run openclaw uninstall in your terminal. When should I publish the Feishu app? Publish twice: once after creating the app (before entering credentials in the terminal), and again after configuring event subscriptions. The pairing step happens last.