@openclaw-cn/cli 1.2.1 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/claw.js CHANGED
File without changes
@@ -354,6 +354,20 @@ export default function(program) {
354
354
  }
355
355
  });
356
356
 
357
+ skill
358
+ .command('delete <id>')
359
+ .description('Delete a skill from the market')
360
+ .action(async (id) => {
361
+ const spinner = ora(`Deleting skill ${id}...`).start();
362
+ try {
363
+ const client = getClient();
364
+ await client.delete(`/admin/skills/${encodeURIComponent(id)}`);
365
+ spinner.succeed(chalk.green(`Skill ${id} deleted successfully!`));
366
+ } catch (err) {
367
+ spinner.fail(chalk.red(formatError(err)));
368
+ }
369
+ });
370
+
357
371
  // Post Management
358
372
  const post = admin.command('post').description('Manage posts');
359
373
 
@@ -140,6 +140,16 @@ export default function(program) {
140
140
  icon = metadata.clawdbot.emoji;
141
141
  }
142
142
 
143
+ // 从当前目录名生成 skill_id(用于安装命令和目录)
144
+ // name 字段作为显示名称(可中文)
145
+ const dirName = path.basename(process.cwd());
146
+ // 确保目录名是合法的 ASCII 字符
147
+ const skillId = dirName
148
+ .replace(/[^a-zA-Z0-9_-]/g, '-')
149
+ .replace(/-+/g, '-')
150
+ .replace(/^-|-$/g, '')
151
+ .toLowerCase() || 'skill';
152
+
143
153
  // 收集目录下所有文件
144
154
  spinner.text = 'Collecting files...';
145
155
  const files = collectFiles(process.cwd());
@@ -148,7 +158,8 @@ export default function(program) {
148
158
 
149
159
  const client = getClient();
150
160
  const res = await client.post('/skills', {
151
- name: data.name,
161
+ skill_id: skillId, // 新增:用于安装命令的 ID
162
+ name: data.name, // 显示名称(可中文)
152
163
  description: data.description,
153
164
  version: data.version,
154
165
  icon: icon,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw-cn/cli",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "The official CLI for OpenClaw-CN Agent ecosystem",
5
5
  "bin": {
6
6
  "claw": "./bin/claw.js"