Deploy serverless backends for REST APIs, webhooks, data storage, scheduled jobs, queue workers, and autonomous workflows.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install codehooks-backend或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install codehooks-backend⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/codehooks-backend/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: codehooks-backend description: Deploy serverless backends for REST APIs, webhooks, data storage, scheduled jobs, queue workers, and autonomous workflows. metadata: { "openclaw": { "emoji": "🪝", "requires": { "bins": ["coho"], "env": ["CODEHOOKS_ADMIN_TOKEN"] } } } ---
Give your OpenClaw agent a serverless backend for REST APIs, webhooks, data storage, scheduled jobs, queue workers, and autonomous workflows.
With this skill, your agent can write JavaScript/TypeScript code and deploy it to a live serverless backend in 5 seconds. No human intervention required — the agent iterates autonomously.
Codehooks has a free tier to get started, and paid plans have no extra charges for traffic or API calls — let your agent deploy without worrying about usage costs.
⚠️ Warning: This gives your agent the ability to deploy and run code on a live server. Review your agent's actions, set appropriate permissions, and monitor usage. You are responsible for any code your agent deploys.
crudlify() with schema validationHuman does once:
npm install -g codehooks
coho login
coho create openclaw-backend
coho add-admintoken
Give the admin token to your agent.
Agent uses:
export CODEHOOKS_ADMIN_TOKEN="your-token-here"
coho deploy --admintoken $CODEHOOKS_ADMIN_TOKEN
The agent can now deploy code, query data, and manage the backend.
---
Before building anything, run:
coho prompt
This outputs the complete Codehooks development prompt — routing, database, queues, jobs, workflows, and the full codehooks-js API. Copy it into your context to build any backend feature correctly.
macOS shortcut:
coho prompt | pbcopy
Before modifying an existing project, get the full picture:
# Returns JSON with collections, stats, recent deploys, and error logs
coho doctor
# Describe the app structure — collections, schemas, queues, files
coho describe
coho doctor is the most powerful diagnostic command — it returns structured JSON covering database collections with document counts, deployment history, queue and worker status, and recent error logs. Always run it when joining an existing project or debugging issues.
coho describe complements doctor by showing the structural overview: what collections exist, their schemas, registered queues, and deployed files.
---
All commands accept --admintoken $CODEHOOKS_ADMIN_TOKEN for non-interactive use. Full CLI reference: https://codehooks.io/docs/cli
| Command | What it does | |---------|--------------| | coho prompt | Get the full development context | | coho doctor | Diagnose project state — collections, stats, deploys, error logs | | coho describe | Describe app structure — collections, schemas, queues, files | | coho deploy | Deploy code (5 seconds to live) | | coho info --examples | Get endpoint URLs with cURL examples | | coho log -f | Stream logs in real-time | | coho query -c | Query the database | | coho queue-status | Check queue status | | coho workflow-status | Check workflow status | | coho import -c | Import data | | coho export -c | Export data |
---
import { app } from 'codehooks-js';
import * as Yup from 'yup';
const productSchema = Yup.object({
name: Yup.string().required(),
price: Yup.number().positive().required(),
category: Yup.string().required()
});
// Creates GET, POST, PUT, DELETE endpoints automatically
// OpenAPI docs available at /.well-known/openapi
app.crudlify({ product: productSchema });
export default app.init();
import { app, Datastore } from 'codehooks-js';
// Allow webhook endpoint without JWT authentication
app.auth('/webhook', (req, res, next) => {
next();
});
app.post('/webhook', async (req, res) => {
const conn = await Datastore.open();
await conn.insertOne('events', {
...req.body,
receivedAt: new Date().toISOString()
});
res.json({ ok: true });
});
export default app.init();
import { app, Datastore } from 'codehooks-js';
app.job('0 9 * * *', async (_, { jobId }) => {
console.log(`Running job: ${jobId}`);
const conn = await Datastore.open();
const events = await conn.getMany('events', {}).toArray();
console.log('Daily summary:', events.length, 'events');
});
export default app.init();
import { app, Datastore } from 'codehooks-js';
app.worker('processTask', async (req, res) => {
const { task } = req.body.payload;
const conn = await Datastore.open();
await conn.updateOne('tasks', { _id: task.id }, { $set: { status: 'completed' } });
res.end();
});
export default app.init();
import { app } from 'codehooks-js';
const workflow = app.createWorkflow('myTask', 'Process tasks autonomously', {
begin: async function (state, goto) {
console.log('Starting task:', state.taskId);
goto('process', state);
},
process: async function (state, goto) {
// Do work here - workflow handles retries and state
state = { ...state, result: 'processed' };
goto('complete', state);
},
complete: function (state, goto) {
console.log('Done:', state.result);
goto(null, state); // End workflow
}
});
// Agent starts workflow via API
app.post('/start', async (req, res) => {
const result = await workflow.start(req.body);
res.json(result);
});
export default app.init();
---
getMany() returns a stream — use .toArray() when you need to manipulate data (sort, filter, map)req.rawBody for signature verification, not req.bodyfs, path, os are not available — this is a serverless environmentprocess.env.VARIABLE_NAME for API keys and secretsapp.static({ route: '/app', directory: '/public' }) serves static sites from deployed sourceapp.storage({ route: '/docs', directory: '/uploads' }) serves uploaded files---
coho prompt and loads the development contextcoho doctor and coho describe to understand what's deployedcoho deploy (5 seconds to live)coho log -f or tests endpoints with coho info --examples---
---
...
安装 Codehooks Backend 后,可以对 AI 说这些话来触发它
Help me get started with Codehooks Backend
Explains what Codehooks Backend does, walks through the setup, and runs a quick demo based on your current project
Use Codehooks Backend to deploy serverless backends for REST APIs, webhooks, data storage, s...
Invokes Codehooks Backend with the right parameters and returns the result directly in the conversation
What can I do with Codehooks Backend in my developer & devops workflow?
Lists the top use cases for Codehooks Backend, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/codehooks-backend/ 目录(个人级,所有项目可用),或 .claude/skills/codehooks-backend/(项目级)。重启 AI 客户端后,用 /codehooks-backend 主动调用,或让 AI 根据上下文自动发现并使用。
Codehooks Backend 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Codehooks Backend 可免费安装使用。请查阅仓库了解许可证信息。
Deploy serverless backends for REST APIs, webhooks, data storage, scheduled jobs, queue workers, and autonomous workflows.
Codehooks Backend 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Codehooks Backend
Identifies repetitive steps in your workflow and sets up Codehooks Backend to handle them automatically