Skip to content

Commit 07f2b8a

Browse files
authored
Merge pull request #72 from iflytek/fix/global-public-download-anon
Allow anonymous downloads for global public skills
2 parents dc19874 + d93a297 commit 07f2b8a

File tree

8 files changed

+751
-30
lines changed

8 files changed

+751
-30
lines changed

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -302,22 +302,26 @@ Run it against a local backend:
302302

303303
SkillHub works as a skill registry backend for several agent platforms. Point any of the clients below at your SkillHub instance to publish, discover, and install skills.
304304

305-
### [openclaw](https://github.com/openclaw/openclaw)
305+
### [OpenClaw](https://github.com/openclaw/openclaw)
306306

307-
[openclaw](https://github.com/openclaw/openclaw) is an open-source agent skill CLI. Configure it to use your SkillHub endpoint as the registry:
307+
[OpenClaw](https://github.com/openclaw/openclaw) is an open-source agent skill CLI. Configure it to use your SkillHub endpoint as the registry:
308308

309309
```bash
310-
# Log in to your SkillHub instance
311-
openclaw login --registry https://<your-skillhub-host>
312-
313-
# Publish a skill
314-
openclaw push <skill-package>
310+
# Configure registry URL
311+
export CLAWHUB_REGISTRY_URL=https://skillhub.your-company.com
312+
export CLAWHUB_API_TOKEN=YOUR_API_TOKEN
315313

316314
# Search and install skills
317-
openclaw search <keyword>
318-
openclaw install <namespace>/<skill>
315+
npx clawhub search email
316+
npx clawhub install my-skill
317+
npx clawhub install my-namespace--my-skill
318+
319+
# Publish a skill
320+
npx clawhub publish ./my-skill
319321
```
320322

323+
📖 **[Complete OpenClaw Integration Guide →](./docs/openclaw-integration.md)**
324+
321325
### [AstronClaw](https://agent.xfyun.cn/astron-claw)
322326

323327
[AstronClaw](https://agent.xfyun.cn/astron-claw) is the skill marketplace provided by iFlytek's Astron platform. You can connect it to a self-hosted SkillHub registry to manage and distribute private skills within your organization, or browse publicly shared skills on the Astron platform.

README_zh.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,26 @@ SkillHub 采用清晰的分层架构:
255255

256256
SkillHub 设计为与各种智能体平台和框架无缝集成。
257257

258+
### [OpenClaw](https://github.com/openclaw/openclaw)
259+
260+
[OpenClaw](https://github.com/openclaw/openclaw) 是开源的智能体技能 CLI 工具。配置它使用您的 SkillHub 端点作为注册中心:
261+
262+
```bash
263+
# 配置注册中心地址
264+
export CLAWHUB_REGISTRY_URL=https://skillhub.your-company.com
265+
export CLAWHUB_API_TOKEN=YOUR_API_TOKEN
266+
267+
# 搜索和安装技能
268+
npx clawhub search email
269+
npx clawhub install my-skill
270+
npx clawhub install my-namespace--my-skill
271+
272+
# 发布技能
273+
npx clawhub publish ./my-skill
274+
```
275+
276+
📖 **[完整 OpenClaw 集成指南 →](./docs/openclaw-integration.md)**
277+
258278
### [AstronClaw](https://agent.xfyun.cn/astron-claw)
259279

260280
[AstronClaw](https://agent.xfyun.cn/astron-claw) 是科大讯飞星火平台提供的技能市场。您可以将其连接到自托管的 SkillHub 注册中心,在组织内管理和分发私有技能,或在星火平台上浏览公开共享的技能。

docs/openclaw-integration-en.md

Lines changed: 307 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,307 @@
1+
# OpenClaw Integration Guide
2+
3+
This document explains how to configure OpenClaw CLI to connect to a SkillHub private registry for publishing, searching, and downloading skills.
4+
5+
## Overview
6+
7+
SkillHub provides a ClawHub-compatible API layer, allowing OpenClaw CLI to seamlessly integrate with private registries. With simple configuration, you can:
8+
9+
- 🔍 Search for private skills within your organization
10+
- 📥 Download and install skill packages
11+
- 📤 Publish new skills to the private registry
12+
- ⭐ Star and rate skills
13+
14+
## Quick Start
15+
16+
### 1. Configure Registry URL
17+
18+
Set the SkillHub registry address in your OpenClaw configuration:
19+
20+
```bash
21+
# Via environment variable
22+
export CLAWHUB_REGISTRY_URL=https://skillhub.your-company.com
23+
```
24+
25+
### 2. Authentication (Optional)
26+
27+
For **global namespace (@global) PUBLIC skills**, no login is required to download. Authentication is required for:
28+
29+
- Team namespace skills (regardless of visibility)
30+
- NAMESPACE_ONLY or PRIVATE skills
31+
- Write operations like publishing, starring, etc.
32+
33+
```bash
34+
# Using API Token
35+
export CLAWHUB_API_TOKEN=YOUR_API_TOKEN
36+
```
37+
38+
#### Obtaining an API Token
39+
40+
1. Log in to SkillHub Web UI
41+
2. Navigate to **Settings → API Tokens**
42+
3. Click **Create New Token**
43+
4. Set token name and permissions
44+
5. Copy the generated token
45+
46+
### 3. Search Skills
47+
48+
```bash
49+
# Search for skills
50+
npx clawhub search email
51+
52+
# View skill details
53+
npx clawhub info my-skill
54+
```
55+
56+
### 4. Install Skills
57+
58+
```bash
59+
# Install latest version
60+
npx clawhub install my-skill
61+
62+
# Install specific version
63+
npx clawhub install my-skill@1.2.0
64+
65+
# Install skill from team namespace
66+
npx clawhub install my-namespace--my-skill
67+
```
68+
69+
### 5. Publish Skills
70+
71+
```bash
72+
# Publish a skill (requires appropriate permissions)
73+
npx clawhub publish ./my-skill
74+
```
75+
76+
## API Endpoints
77+
78+
SkillHub compatibility layer provides the following endpoints:
79+
80+
| Endpoint | Method | Description | Auth Required |
81+
|----------|--------|-------------|---------------|
82+
| `/api/v1/whoami` | GET | Get current user info | Yes |
83+
| `/api/v1/search` | GET | Search skills | Optional |
84+
| `/api/v1/resolve` | GET | Resolve skill version | Optional |
85+
| `/api/v1/download/{slug}` | GET | Download skill (redirect) | Optional* |
86+
| `/api/v1/download` | GET | Download skill (query params) | Optional* |
87+
| `/api/v1/skills/{slug}` | GET | Get skill details | Optional |
88+
| `/api/v1/skills/{slug}/star` | POST | Star a skill | Yes |
89+
| `/api/v1/skills/{slug}/unstar` | DELETE | Unstar a skill | Yes |
90+
| `/api/v1/publish` | POST | Publish a skill | Yes |
91+
92+
\* Download endpoint authentication requirements:
93+
- **Global namespace (@global) PUBLIC skills**: No authentication required
94+
- **All team namespace skills**: Authentication required
95+
- **NAMESPACE_ONLY and PRIVATE skills**: Authentication required
96+
97+
## Skill Visibility Levels
98+
99+
SkillHub supports three visibility levels with the following download permission rules:
100+
101+
### PUBLIC
102+
- ✅ Anyone can search and view
103+
-**Global namespace (@global)**: No login required to download
104+
- 🔒 **Team namespaces**: Authentication required to download
105+
- 📍 Suitable for organization-wide, publicly shareable skills
106+
107+
### NAMESPACE_ONLY
108+
- ✅ Namespace members can search and view
109+
- 🔒 Login required and must be namespace member to download
110+
- 📍 Suitable for team-internal skills
111+
112+
### PRIVATE
113+
- ✅ Only owner can view
114+
- 🔒 Login required and must be owner to download
115+
- 📍 Suitable for skills under personal development
116+
117+
**Important Notes**:
118+
- Global namespace (`@global`) PUBLIC skills support anonymous downloads for wide distribution within the organization
119+
- All team namespace skills (including PUBLIC) require authentication to ensure team boundary security
120+
121+
## Canonical Slug Mapping
122+
123+
SkillHub internally uses `@{namespace}/{skill}` format, but the compatibility layer automatically converts to ClawHub-style canonical slugs:
124+
125+
| SkillHub Internal | Canonical Slug | Description |
126+
|-------------------|----------------|-------------|
127+
| `@global/my-skill` | `my-skill` | Global namespace skill |
128+
| `@my-team/my-skill` | `my-team--my-skill` | Team namespace skill |
129+
130+
OpenClaw CLI uses canonical slug format, and SkillHub handles the conversion automatically.
131+
132+
## Configuration Examples
133+
134+
### ClawHub CLI Environment Variables
135+
136+
ClawHub CLI is configured via environment variables:
137+
138+
```bash
139+
# Registry configuration
140+
export CLAWHUB_REGISTRY_URL=https://skillhub.your-company.com
141+
export CLAWHUB_API_TOKEN=sk_your_api_token_here
142+
```
143+
144+
### Environment Variables
145+
146+
```bash
147+
# Registry configuration
148+
export CLAWHUB_REGISTRY_URL=https://skillhub.your-company.com
149+
export CLAWHUB_API_TOKEN=sk_your_api_token_here
150+
151+
# Optional: Skip SSL verification (development only)
152+
export CLAWHUB_SKIP_SSL_VERIFY=false
153+
```
154+
155+
## FAQ
156+
157+
### Q: How do I switch back to public ClawHub?
158+
159+
```bash
160+
# Unset custom registry
161+
unset CLAWHUB_REGISTRY_URL
162+
163+
# ClawHub CLI will use the default public registry
164+
```
165+
166+
### Q: Getting 403 Forbidden when downloading?
167+
168+
Possible causes:
169+
1. Skill belongs to a team namespace, authentication required
170+
2. Skill is NAMESPACE_ONLY or PRIVATE, authentication required
171+
3. You're not a member of the namespace
172+
4. API Token has expired
173+
174+
Solution:
175+
```bash
176+
# Set new token
177+
export CLAWHUB_API_TOKEN=YOUR_NEW_TOKEN
178+
179+
# Test connection
180+
curl https://skillhub.your-company.com/api/v1/whoami \
181+
-H "Authorization: Bearer $CLAWHUB_API_TOKEN"
182+
```
183+
184+
**Tip**: Global namespace (@global) PUBLIC skills can be downloaded anonymously without authentication.
185+
186+
### Q: How do I see all skills I have access to?
187+
188+
```bash
189+
# Search all skills (filtered by permissions)
190+
npx clawhub search ""
191+
```
192+
193+
### Q: Permission denied when publishing?
194+
195+
- Publishing to global namespace (`@global`) requires `SUPER_ADMIN` permission
196+
- Publishing to team namespace requires OWNER or ADMIN role in that namespace
197+
- Contact your administrator for appropriate permissions
198+
199+
### Q: Which OpenClaw versions are supported?
200+
201+
SkillHub compatibility layer is designed to work with tools using ClawHub CLI. ClawHub CLI is distributed via npm:
202+
203+
```bash
204+
# Install ClawHub CLI
205+
npm install -g clawhub
206+
207+
# Or use npx directly
208+
npx clawhub install my-skill
209+
```
210+
211+
If you encounter compatibility issues, please file an issue.
212+
213+
## API Response Formats
214+
215+
### Search Response Example
216+
217+
```json
218+
{
219+
"results": [
220+
{
221+
"slug": "my-team--email-sender",
222+
"name": "Email Sender",
223+
"description": "Send emails via SMTP",
224+
"author": {
225+
"handle": "user123",
226+
"displayName": "John Doe"
227+
},
228+
"version": "1.2.0",
229+
"downloadCount": 150,
230+
"starCount": 25,
231+
"createdAt": "2026-01-15T10:00:00Z",
232+
"updatedAt": "2026-03-10T14:30:00Z"
233+
}
234+
],
235+
"total": 1,
236+
"page": 1,
237+
"limit": 20
238+
}
239+
```
240+
241+
### Version Resolution Response Example
242+
243+
```json
244+
{
245+
"slug": "my-skill",
246+
"version": "1.2.0",
247+
"downloadUrl": "/api/v1/skills/global/my-skill/versions/1.2.0/download"
248+
}
249+
```
250+
251+
### Publish Response Example
252+
253+
```json
254+
{
255+
"id": "12345",
256+
"version": {
257+
"id": "67890"
258+
}
259+
}
260+
```
261+
262+
## Security Recommendations
263+
264+
1. **Use HTTPS**: Always use HTTPS in production
265+
2. **Token Management**:
266+
- Rotate API tokens regularly
267+
- Never hardcode tokens in code
268+
- Use environment variables or secret management tools
269+
3. **Least Privilege**: Assign minimum required permissions to tokens
270+
4. **Audit Logs**: Regularly review SkillHub audit logs
271+
272+
## Troubleshooting
273+
274+
### Enable Debug Logging
275+
276+
```bash
277+
# View detailed request logs
278+
DEBUG=clawhub:* npx clawhub search my-skill
279+
280+
# Or use verbose mode
281+
npx clawhub --verbose install my-skill
282+
```
283+
284+
### Test Connection
285+
286+
```bash
287+
# Test registry connection
288+
curl https://skillhub.your-company.com/api/v1/whoami \
289+
-H "Authorization: Bearer YOUR_TOKEN"
290+
291+
# Test search
292+
curl "https://skillhub.your-company.com/api/v1/search?q=test"
293+
```
294+
295+
## Further Reading
296+
297+
- [SkillHub API Design](./06-api-design.md)
298+
- [Skill Protocol Specification](./07-skill-protocol.md)
299+
- [Authentication & Authorization](./03-authentication-design.md)
300+
- [Deployment Guide](./09-deployment.md)
301+
302+
## Support
303+
304+
For questions or suggestions:
305+
- 📖 Full Documentation: https://zread.ai/iflytek/skillhub
306+
- 💬 GitHub Discussions: https://github.com/iflytek/skillhub/discussions
307+
- 🐛 Submit Issues: https://github.com/iflytek/skillhub/issues

0 commit comments

Comments
 (0)