[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81485":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":11,"openIssues":13,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":12,"stars7d":12,"stars30d":12,"stars90d":12,"forks30d":12,"starsTrendScore":12,"compositeScore":12,"rankGlobal":9,"rankLanguage":9,"license":14,"archived":15,"fork":15,"defaultBranch":16,"hasWiki":17,"hasPages":15,"topics":18,"createdAt":9,"pushedAt":9,"updatedAt":19,"readmeContent":20,"aiSummary":21,"trendingCount":12,"starSnapshotCount":12,"syncStatus":13,"lastSyncTime":22,"discoverSource":23},81485,"carapace-plugin-sdk","JeffSteinbok\u002Fcarapace-plugin-sdk","JeffSteinbok","SDK for building OpenClaw plugins — types, helpers, CLI generation",null,"TypeScript",29,0,2,"MIT License",false,"main",true,[],"2026-06-12 02:04:15","# 🦞🐚 carapace-plugin-sdk\n\n[![CI](https:\u002F\u002Fgithub.com\u002FJeffSteinbok\u002Fcarapace-plugin-sdk\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002FJeffSteinbok\u002Fcarapace-plugin-sdk\u002Factions\u002Fworkflows\u002Fci.yml)\n[![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fcarapace-plugin-sdk?logo=npm)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fcarapace-plugin-sdk)\n\nSDK for building [OpenClaw](https:\u002F\u002Fgithub.com\u002FJeffSteinbok\u002Fopenclaw) plugins.\n\nDefine your tools and config. The SDK generates a fully typed OpenClaw plugin, a standalone CLI, and a plugin manifest — automatically.\n\n## Install\n\n```bash\nnpm install carapace-plugin-sdk\n```\n\n## Quick start\n\n> **New plugin?** Use [carapace-plugin-template](https:\u002F\u002Fgithub.com\u002FJeffSteinbok\u002Fcarapace-plugin-template) — it scaffolds the full project structure, CI, and tests in one click.\n\nHere's what you write in `src\u002Fplugin.ts`:\n\n```ts\nimport { definePlugin } from \"carapace-plugin-sdk\";\nimport { Type } from \"@sinclair\u002Ftypebox\";\n\n\u002F\u002F The export must be named `createEntry` — the SDK's build tools look for it by name.\nexport const createEntry = definePlugin({\n  id: \"my-plugin\",\n  name: \"My Plugin\",\n  description: \"Does something useful.\",\n\n  configSchema: Type.Object({\n    apiKey: Type.Optional(Type.String({ description: \"API key for the service.\" })),\n  }),\n\n  tools: (tool) => [\n    tool({\n      name: \"do_thing\",\n      description: \"Does the thing.\",\n      parameters: Type.Object({\n        input: Type.String({ description: \"Input value.\" }),\n      }),\n      execute: async ({ input }, config) => {\n        \u002F\u002F input: string ✓   config.apiKey: string | undefined ✓\n        return { result: input, usingKey: !!config.apiKey };\n      },\n    }),\n  ],\n});\n```\n\nRun `npm run build` and you get:\n\n| Generated file | What it is |\n|----------------|-----------|\n| `dist\u002Fadapter.js` | OpenClaw plugin adapter |\n| `dist\u002Fbin\u002Fmy-plugin.js` | Standalone CLI — each tool is a subcommand |\n| `openclaw.plugin.json` | Plugin manifest read by OpenClaw at install time |\n\nNothing else to write. No registration boilerplate, no result wrapping, no manifest to maintain.\n\n## What the SDK handles for you\n\n| You write | SDK handles |\n|-----------|-------------|\n| `execute()` returning a plain object | Wrapping in the OpenClaw result format |\n| `configSchema` TypeBox schema | JSON Schema for the manifest + OpenClaw settings UI (defaults to an empty object schema if omitted) |\n| Tool names | `contracts.tools` list in the manifest — auto-discovered even for raw `register()` plugins |\n| `src\u002Fplugin.ts` | `dist\u002Fadapter.js`, `dist\u002Fbin\u002F*.js`, `openclaw.plugin.json` |\n\n## Build setup\n\nAdd to `package.json`:\n\n```json\n{\n  \"bin\": { \"my-plugin\": \".\u002Fdist\u002Fbin\u002Fmy-plugin.js\" },\n  \"scripts\": {\n    \"build\": \"tsup && carapace-generate-cli --entry .\u002Fdist\u002Fplugin.js --out .\u002Fdist\u002Fbin\"\n  }\n}\n```\n\nThe SDK ships shared configs so your project files stay minimal:\n\n**`tsconfig.json`** — one line:\n```json\n{ \"extends\": \"carapace-plugin-sdk\u002Ftsconfig.base.json\" }\n```\n\n**`tsup.config.ts`** — three lines:\n```ts\nimport { defineConfig } from \"tsup\";\nimport { definePluginConfig } from \"carapace-plugin-sdk\u002Ftsup\";\n\nexport default defineConfig(definePluginConfig());\n```\n\n**`vitest.config.ts`** — not needed. Vitest finds `tests\u002F**\u002F*.test.ts` without configuration.\n\n## CLI — for free\n\nEvery plugin is automatically a standalone CLI. After `npm run build`:\n\n```bash\nmy-plugin --help\nmy-plugin do-thing \"hello\"\nmy-plugin do-thing \"hello\" --json\nMY_PLUGIN_API_KEY=sk-... my-plugin do-thing \"hello\"\n```\n\nConfig fields map to environment variables:\n`\u003CPLUGIN_ID_SCREAMING_SNAKE>_\u003CFIELD_SCREAMING_SNAKE>`\n\n## Reusable CI\u002FCD workflows\n\nCall the shared GitHub Actions workflows from your plugin repo — no workflow logic to copy:\n\n```yaml\n# .github\u002Fworkflows\u002Fci.yml\njobs:\n  ci:\n    uses: JeffSteinbok\u002Fcarapace-plugin-sdk\u002F.github\u002Fworkflows\u002Fplugin-ci.yml@main\n```\n\n```yaml\n# .github\u002Fworkflows\u002Frelease.yml\non:\n  workflow_dispatch:\n    inputs:\n      version-bump:\n        type: choice\n        options: [patch, minor, major]\n      prerelease:\n        type: choice\n        options: ['', alpha, beta, rc]\njobs:\n  release:\n    uses: JeffSteinbok\u002Fcarapace-plugin-sdk\u002F.github\u002Fworkflows\u002Fplugin-release.yml@main\n    with:\n      version-bump: ${{ inputs.version-bump }}\n      prerelease: ${{ inputs.prerelease }}\n    secrets:\n      npm-token: ${{ secrets.NPM_TOKEN }}\n```\n\n## Examples\n\n- [carapace-plugin-template](https:\u002F\u002Fgithub.com\u002FJeffSteinbok\u002Fcarapace-plugin-template) — starter template with CI, tests, and build pre-configured\n- [carapace-stock-quotes](https:\u002F\u002Fgithub.com\u002FJeffSteinbok\u002Fcarapace-stock-quotes) — real plugin with multiple data sources (Yahoo Finance + Finnhub)\n\n## Internals\n\nSee [ARCHITECTURE.md](.\u002FARCHITECTURE.md) for how the SDK works under the hood — the type machinery behind `definePlugin`, how `carapace-generate-cli` generates artifacts, the CLI runtime, and the adapter pattern.\n\n## License\n\nMIT\n","carapace-plugin-sdk 是一个用于构建 OpenClaw 插件的 SDK，提供了类型定义、辅助函数以及 CLI 生成等功能。它支持开发者通过简单的配置和工具定义，自动生成符合 OpenClaw 标准的插件代码、独立的命令行接口及插件清单文件，极大地简化了开发流程。此项目特别适合需要为 OpenClaw 平台快速开发新功能或集成现有服务的场景。基于 TypeScript 编写，并采用 MIT 许可证开放源码，确保了良好的类型安全性和社区友好性。","2026-06-11 04:05:15","CREATED_QUERY"]