open-index/open-npm huggingface dataset:
npm package: @superdad/xiaochuang
Description: OpenClaw Xiaochuang channel plugin — real-time AI integration via Bridge
Latest version: 0.0.6

# @superdad/xiaochuang

OpenClaw channel plugin for [Xiaochuang](https://xiaochuang.ai) — real-time AI interaction via xcai-cli Bridge.

## Quick Start

One command to install, activate, and configure:

```bash
npx -y @superdad/xiaochuang@latest install
```

For test environment:

```bash
npx -y @superdad/xiaochuang@latest install-test
```

The install script will:

1. Check OpenClaw is installed
2. Install the plugin via `openclaw plugins install`
3. Download the xcai-cli Bridge binary for your platform
4. Prompt for an activation code (from the Xiaochuang miniprogram)
5. Activate and save the token
6. Enable the plugin and restart the gateway

## Architecture

```
OpenClaw ── xiaochuang plugin ── stdio ── xcai-cli Bridge ── WebSocket ── xcai-server
```

- **Plugin** spawns `xcai-cli bridge` as a subprocess, communicates via NDJSON over stdin/stdout
- **Bridge** manages the WebSocket connection, heartbeat, reconnection, token rotation, and offline queue
- **Token/auth** managed by xcai-cli (`~/.xcai/config.yaml`), not by OpenClaw config

## CLI Commands

```bash
npx -y @superdad/xiaochuang@latest install        # Install + setup (production)
npx -y @superdad/xiaochuang@latest install-test    # Install + setup (test environment)
npx -y @superdad/xiaochuang@latest status          # Check connection status
npx -y @superdad/xiaochuang@latest help            # Show help
```

## Configuration

Most configuration is managed automatically. These optional settings can be set in `openclaw.json`:

| Key | Description | Default |
|-----|-------------|---------|
| `channels.xiaochuang.enabled` | Enable/disable the channel | `true` |
| `channels.xiaochuang.bridgePath` | Path to xcai-cli binary (auto-detected) | — |
| `channels.xiaochuang.dmPolicy` | DM policy: `open` / `pairing` / `allowlist` | `open` |
| `channels.xiaochuang.allowFrom` | Allowed sender IDs when dmPolicy is `allowlist` | — |
| `channels.xiaochuang.blockStreaming` | Enable streaming replies | `true` |

xcai-cli configuration (`~/.xcai/config.yaml`):

| Key | Description |
|-----|-------------|
| `bridge_token` | API token (auto-populated after activation) |
| `bridge_ws_url` | WebSocket server URL (set by install script) |
| `api_key` | OpenAPI key (auto-populated by server on connect) |
| `endpoint` | OpenAPI endpoint URL |

## Updating

- **Plugin update**: `openclaw plugins update xiaochuang`
- **xcai-cli update**: Re-run `npx -y @superdad/xiaochuang@latest install` (auto-detects and downloads new version)

## License

MIT