TypeScript · ESM · Plugin Runtime
A multi-channel IM framework built for assistant bots. Plugins are Lego blocks, hot reload is the norm, and Console lives in your browser.
$ npm create zhin-app my-bot
$ cd my-bot && pnpm dev
✔ IM golden path started — no model key requiredYou do not need the full architecture first. Choose the outcome you need now.
Move from Sandbox to one real platform through a repeatable message path.
Run the golden path AUTHORShip a pluginClose capability, configuration, lifecycle, testing, and release as one loop.
Open the delivery path OPERATEDeploy and operateOwn TLS, supervision, monitoring, backup, upgrades, and rollback.
Open production guide AGENTBuild an Agent teamGovern Prompt, Tool, Workroom, and repository collaboration boundaries.
Choose an Agent solutionA package.json#zhin manifest plus a plugin.ts is all you need. Commands, components, and adapters are discovered from convention directories. Edit a file, get instant hot reload.
QQ, OneBot, Discord, Telegram, Slack, KOOK, DingTalk, Lark, WeCom, LINE… 20+ adapters mount on demand, all sharing the same send chain.
Host exposes only API. Open your browser to manage plugins, view instances, browse logs, and edit config — the frontend does not need to run alongside the bot.
Only the IM core ships by default. Install @zhin.js/agent when you need it — providers, MCP, sub-agents, and scheduled tasks unlock layer by layer.
Drop a zhin.config.yml in a plugin directory and zhin runtime start runs it directly. No host project required.
basic → kernel → ai → core → agent → zhin. Dependencies only flow downward. Each layer is usable standalone — kernel is a pure plugin engine, ai is a pure LLM engine.
bot.ts — your entire bot can be just this one file.
import { defineCommand } from 'zhin.js/command';
import { definePlugin } from 'zhin.js';
export default definePlugin({
name: 'my-bot',
setup({ addCommand }) {
addCommand('hello', defineCommand({
description: 'Say hello',
execute: () => 'Hello from Zhin!',
}));
},
});Three steps to get running (no model key needed):
npm create zhin-app my-bot -y
cd my-bot && pnpm devOpen console.zhin.dev → Sandbox → /hello.
Want convention directories instead? Default-export the same defineCommand(...) from commands/hello.ts — see minimal-bot.
Full single-file example: single-file-bot. Database, cron, proactive push, Agent? Check out definePlugin overview for what setup can do.