quick_publish
Publish Hexo blog posts to GitHub Pages and automatically back up source code with Git commits in a single operation.
Instructions
一键完成博客发布和源码备份(deploy + backup 组合操作)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | No | 可选的 Git 提交信息 |
Implementation Reference
- src/tools/git-tools.ts:30-63 (handler)The 'quick_publish' tool is defined using server.tool, with its handler function implementing the deployment and backup logic.
server.tool( "quick_publish", "一键完成博客发布和源码备份(deploy + backup 组合操作)", { message: z.string().optional().describe("可选的 Git 提交信息"), }, async ({ message }) => { try { // 1. 部署 await hexoCommand("clean"); await hexoCommand("generate"); await hexoCommand("deploy"); // 2. 备份 const backupResult = await backupSource( message || "Publish & backup" ); return { content: [ { type: "text" as const, text: `🎉 一键发布完成!\n\n✅ 博客已发布: https://leejersey.github.io\n✅ ${backupResult}\n\n⚠️ GitHub Pages 需要 1~3 分钟刷新缓存。`, }, ], }; } catch (e: any) { return { content: [{ type: "text" as const, text: `发布失败: ${e.message}` }], isError: true, }; } } );