@42ailab/42plugin 0.1.0-beta.0 → 0.1.0-beta.1

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 42plugin CLI
2
2
 
3
- Claude Code 插件管理器,支持搜索、安装、管理来自 42plugin 平台的能力、插件与插件列表。
3
+ 活水插件,支持搜索、安装、管理来自 42plugin 平台的能力、插件与插件列表。
4
4
 
5
5
  ## 前提条件
6
6
  - 需要安装 [Bun](https://bun.sh)(用于运行与构建)。
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@42ailab/42plugin",
3
- "version": "0.1.0-beta.0",
4
- "description": "Claude Code 插件管理器",
3
+ "version": "0.1.0-beta.1",
4
+ "description": "活水插件",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
7
7
  "bin": {
@@ -12,12 +12,12 @@
12
12
  "README.md"
13
13
  ],
14
14
  "scripts": {
15
- "dev": "bun run src/index.ts",
16
- "build": "bun run scripts/build.ts",
17
- "test": "bun test",
18
- "lint": "eslint src/",
19
- "format": "prettier --write src/",
20
- "typecheck": "tsc --noEmit"
15
+ "dev": "bun run --env-file=../.env --env-file=.env src/index.ts",
16
+ "build": "bun run --env-file=../.env --env-file=.env scripts/build.ts",
17
+ "test": "bun run --env-file=../.env --env-file=.env test",
18
+ "lint": "eslint --env-file=../.env --env-file=.env src/",
19
+ "format": "prettier --write --env-file=../.env --env-file=.env src/",
20
+ "typecheck": "tsc --noEmit --env-file=../.env --env-file=.env"
21
21
  },
22
22
  "keywords": [
23
23
  "claude",
package/src/cli.ts CHANGED
@@ -10,7 +10,7 @@ export const program = new Command();
10
10
 
11
11
  program
12
12
  .name('42plugin')
13
- .description('Claude Code 插件管理器')
13
+ .description('活水插件')
14
14
  .version('0.1.0', '-v, --version', '显示版本号')
15
15
  .option('--verbose', '详细输出')
16
16
  .option('--no-color', '禁用颜色输出');
@@ -244,7 +244,7 @@ async function installList(
244
244
 
245
245
  console.log();
246
246
  console.log(`列表: ${chalk.cyan(listDownload.list.name)}`);
247
- console.log(`能力: ${listDownload.capabilities.length} 个`);
247
+ console.log(`插件: ${listDownload.capabilities.length} 个`);
248
248
  console.log();
249
249
 
250
250
  // Filter optional items
@@ -285,7 +285,7 @@ async function installList(
285
285
  }
286
286
  }
287
287
 
288
- spinner.succeed(`${chalk.green('已安装')} ${installed}/${capabilities.length} 个能力`);
288
+ spinner.succeed(`${chalk.green('已安装')} ${installed}/${capabilities.length} 个插件`);
289
289
  }
290
290
 
291
291
  async function linkToProject(
@@ -20,11 +20,24 @@ export const searchCommand = new Command('search')
20
20
 
21
21
  async function search(query: string, options: SearchOptions) {
22
22
  try {
23
+ // Map CLI type options to API type parameter
24
+ // API supports: capability | list | all
25
+ // CLI supports: skill | agent | command | hook | list
26
+ const capabilityTypes = ['skill', 'agent', 'command', 'hook'];
27
+ const apiType = options.type === 'list' ? 'list'
28
+ : capabilityTypes.includes(options.type || '') ? 'capability'
29
+ : undefined;
30
+
23
31
  const results = await api.search(query, {
24
- type: options.type,
32
+ type: apiType,
25
33
  per_page: Number(options.limit) || 20,
26
34
  });
27
35
 
36
+ // Filter capabilities by specific type if requested
37
+ if (options.type && capabilityTypes.includes(options.type)) {
38
+ results.capabilities = results.capabilities.filter(cap => cap.type === options.type);
39
+ }
40
+
28
41
  if (options.json) {
29
42
  console.log(JSON.stringify(results, null, 2));
30
43
  return;
@@ -33,7 +46,7 @@ async function search(query: string, options: SearchOptions) {
33
46
  // Display capability results
34
47
  if (results.capabilities.length > 0) {
35
48
  console.log();
36
- console.log(chalk.bold('能力:'));
49
+ console.log(chalk.bold('插件:'));
37
50
  console.log();
38
51
 
39
52
  for (const cap of results.capabilities) {
@@ -58,7 +71,7 @@ async function search(query: string, options: SearchOptions) {
58
71
  for (const list of results.lists) {
59
72
  console.log(` ${chalk.magenta('list')} ${chalk.cyan(list.full_name)}`);
60
73
  console.log(` ${list.name}`);
61
- console.log(` ${chalk.gray(`${list.capability_count} 个能力 · 下载: ${list.downloads}`)}`);
74
+ console.log(` ${chalk.gray(`${list.capability_count} 个插件 · 下载: ${list.downloads}`)}`);
62
75
  console.log();
63
76
  }
64
77
  }
package/src/config.ts CHANGED
@@ -38,7 +38,7 @@ export function getSecretsPath(): string {
38
38
  }
39
39
 
40
40
  export const config = {
41
- apiBase: process.env.API_BASE || 'https://api.42plugin.com',
41
+ apiBase: process.env.API_BASE_URL || 'https://api.42plugin.com',
42
42
  cdnBase: process.env.CDN_BASE || 'https://cdn.42plugin.com',
43
43
  debug: process.env.DEBUG === 'true',
44
44
  };