skillhub/document/docs/04-developer/api/cli-compat.md
tww 3e2f25a42f feat(docs): initialize Docusaurus documentation website
- Initialize Docusaurus project structure
- Add Chinese documentation (all sections)
- Add English documentation (getting started section)
- Custom iFlytek blue theme styling
- Enterprise value focused homepage design
2026-03-15 18:27:32 +08:00

1.7 KiB

title sidebar_position description
CLI 兼容层 4 ClawHub CLI 协议兼容层

CLI 兼容层

SkillHub 提供 ClawHub CLI 协议兼容层,现有工具可无缝迁移。

Well-known 发现

GET /.well-known/clawhub.json

响应:

{
  "apiBase": "/api/compat/v1"
}

兼容层 API

Whoami

GET /api/compat/v1/whoami

响应:

{
  "handle": "username",
  "displayName": "User Name",
  "role": "user"
}

搜索

GET /api/compat/v1/search?q={keyword}&page={page}&limit={limit}

响应:

{
  "results": [
    {
      "slug": "my-skill",
      "name": "My Skill",
      "description": "...",
      "author": {
        "handle": "username",
        "displayName": "User Name"
      },
      "version": "1.2.0",
      "downloadCount": 100,
      "starCount": 50,
      "createdAt": "2026-01-01T00:00:00Z",
      "updatedAt": "2026-03-01T00:00:00Z"
    }
  ],
  "total": 1,
  "page": 1,
  "limit": 20
}

解析

GET /api/compat/v1/resolve?slug={slug}&version={version}

响应:

{
  "slug": "my-skill",
  "version": "1.2.0",
  "downloadUrl": "/api/compat/v1/download/my-skill/1.2.0"
}

下载

GET /api/compat/v1/download/{slug}/{version}

发布

POST /api/compat/v1/publish
Content-Type: multipart/form-data

file: <zip-file>

响应:

{
  "slug": "my-skill",
  "version": "1.0.0",
  "status": "published"
}

坐标映射

SkillHub 坐标 ClawHub canonical slug
@global/my-skill my-skill
@team-name/my-skill team-name--my-skill

下一步