TypeScript · ESM · Plugin Runtime
Write a chat bot once in TypeScript and run it on QQ, WeChat, Discord, Telegram and 20+ other platforms. A small IM framework by default — add AI when you need it.
$ npm create zhin-app my-bot -y
$ cd my-bot && pnpm dev
✔ Bot started — no platform account or model key requiredYou don't need the full architecture first. Pick a goal — each path fits in one sitting.
One page on what Zhin does and which parts make up a bot.
5-minute overview RUNRun your first botNo platform account or model key — get a reply in the browser Sandbox.
Start the quick start BUILDWrite your own featuresCommands, keyword replies, schedules, AI tools — drop a file in a folder and it works.
Write a first plugin SHIPConnect platforms and go livePick adapters for QQ / WeChat / Discord and more, then deploy, monitor and upgrade.
Choose a platformQQ, WeChat, WeCom, DingTalk, Lark, Discord, Telegram, Slack, KOOK, LINE… Your code sees one kind of message; adapters handle the platform differences.
commands/hello/index.ts is the /hello command. Middleware, components, schedules and AI tools work the same way — no registration boilerplate.
Save to hot-reload. In-flight messages finish on the old version, and if the new code throws, the old version keeps serving.
The built-in Sandbox is a simulated chat window. Build and test everything without any platform account or model key.
Open console.zhin.dev, enter your address and token: send test messages, read logs, edit config, manage plugins. Nothing to deploy.
The default install is an IM core under 10MB. Run npx zhin setup --ai to add models, tools, memory and MCP.
Smallest form: one bot.ts is the whole bot.
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.
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, modelsRunning in 10 minutes (no accounts or keys):
npm create zhin-app my-bot -y
cd my-bot && pnpm devHTTP_TOKEN from .env/hello in the SandboxNext