Skip to content

TypeScript · ESM · Plugin Runtime

Zhin.js

One bot for your groups on QQ, WeChat, Discord, Telegram and 20+ other platforms: operators run it from the browser, developers write it once in TypeScript. Small by default — add AI when you need it.

IM core <10MBNode ≥20.19MIT
zsh
$ npm create zhin-app my-bot -y
$ cd my-bot && pnpm dev
✔ Bot started — no platform account or model key required

Which kind of user are you?

One bot, two ways to use it: operators manage it in the browser, developers extend it in code. Pick your role, then a goal.

CUSTOMER · OPERATORS / GROUP OWNERSRun your bot without codeGroup owners, community operators, support leads

Read messages, change settings, install features and manage welcomes and reminders in Console. Risky actions wait for approval.

Operator guide
DEVELOPER · PLUGIN / ADAPTER AUTHORSExtend your bot in TypeScriptPeople who write commands, plugins, AI tools and adapters

One command to scaffold, a feature is a file, hot reload on save — one codebase on 20+ platforms.

Start building

What do you want to do?

You don't need the full architecture first. Pick a goal — each path fits in one sitting.

Why Zhin.js

01

One codebase, 20+ platforms

QQ, WeChat, WeCom, DingTalk, Lark, Discord, Telegram, Slack, KOOK, LINE… Your code sees one kind of message; adapters handle the platform differences.

02

A feature is a file

commands/hello/index.ts is the /hello command. Middleware, components, schedules and AI tools work the same way — no registration boilerplate.

03

No restarts while coding

Save to hot-reload. In-flight messages finish on the old version, and if the new code throws, the old version keeps serving.

04

Develop with zero accounts

The built-in Sandbox is a simulated chat window. Build and test everything without any platform account or model key.

05

Manage it in the browser

Open console.zhin.dev, enter your address and token: send test messages, read logs, edit config, manage plugins. Nothing to deploy.

06

Opt-in AI

The default install is an IM core under 10MB. Run npx zhin setup --ai to add models, tools, memory and MCP.

What a bot looks like

Smallest form: one bot.ts is the whole bot.

ts
import { definePlugin } from 'zhin.js';
import { defineCommand } from 'zhin.js/command';

export default definePlugin({
  name: 'my-bot',
  setup({ addCommand }) {
    addCommand('hello', defineCommand({
      description: 'Say hello',
      execute: () => 'Hello from Zhin!',
    }));
  },
});

As it grows: one file per capability, auto-registered from convention folders.

text
my-bot/
├── plugin.ts                 # entry: definePlugin()
├── commands/hello/index.ts   # the /hello command
├── middlewares/…             # keyword replies, filters
├── tools/…                   # tools the AI can call (optional)
└── zhin.config.yml           # port, platform credentials, models

Running in 10 minutes (no accounts or keys):

bash
npm create zhin-app my-bot -y
cd my-bot && pnpm dev
  1. Open console.zhin.dev
  2. Enter the address printed in the terminal and HTTP_TOKEN from .env
  3. Send /hello in the Sandbox

Next