dxkj 0.1.0 → 0.1.2
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 +75 -75
- package/bin/dxk.js +11 -11
- package/fixtures/packages/hello-skill/SKILL.md +12 -12
- package/fixtures/packages/hello-skill/tool.js +5 -5
- package/fixtures/sample-registry.json +44 -44
- package/package.json +45 -45
- package/src/cli.js +320 -321
- package/src/lib/config.js +93 -93
- package/src/lib/format.js +49 -49
- package/src/lib/installer.js +69 -68
- package/src/lib/registry.js +93 -92
- package/src/lib/targets.js +50 -50
- package/src/lib/validator.js +84 -84
- package/src/lib/version.js +8 -0
- package/src/opencode.js +71 -71
package/README.md
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
# dxkj
|
|
2
|
-
|
|
3
|
-
dxkj 目录 CLI(prompt / skill / agent / plugin / tool)+ opencode 插件壳。
|
|
4
|
-
|
|
5
|
-
以 `收录.md`(Skill & Agent Tool 分类与命名规范 v1.0)为元数据基线:
|
|
6
|
-
按编号浏览、检索、查看条目(含多图画廊与简介),并单装/批量安装到三种目标。
|
|
7
|
-
|
|
8
|
-
## 安装
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
npm i -g dxkj
|
|
12
|
-
# 或
|
|
13
|
-
npx -y dxkj list
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## 命令
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
dxkj list [--kind skill] [--category CG] [--tag x] [--json]
|
|
20
|
-
dxkj search <关键词>
|
|
21
|
-
dxkj show <编号|id>
|
|
22
|
-
dxkj install <编号...> [--target ai-editor|navlink|generic] [--editor opencode|claude] [--dir 路径]
|
|
23
|
-
dxkj install --all [--kind skill]
|
|
24
|
-
dxkj uninstall <编号...>
|
|
25
|
-
dxkj validate <条目.json>
|
|
26
|
-
dxkj config get [键] | config set <键> <值> | config path
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
站点尚未集成时,可用内置示例数据本地验证:
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
dxkj list --source ./node_modules/dxkj/fixtures/sample-registry.json
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## 三种安装目标
|
|
36
|
-
|
|
37
|
-
| target | 说明 | 目录来源 |
|
|
38
|
-
| :--- | :--- | :--- |
|
|
39
|
-
| `ai-editor` | 按 kind 分派到 opencode / Claude 的 skills / agent / command 等目录 | `config.targets.aiEditor.<editor>`(默认 opencode) |
|
|
40
|
-
| `navlink` | 装入目标 NavLink 实例的 `plugins/` 目录 | `--dir` 或 `config.targets.navlink.pluginsDir` |
|
|
41
|
-
| `generic` | 解压到任意目录 | `--dir` 或 `config.targets.generic.dir` |
|
|
42
|
-
|
|
43
|
-
## 配置
|
|
44
|
-
|
|
45
|
-
配置文件:`~/.dxkj/config.json`
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
dxkj config set serverUrl https://tools.dxkj.online
|
|
49
|
-
dxkj config set target ai-editor
|
|
50
|
-
dxkj config set editor opencode
|
|
51
|
-
dxkj config get
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
优先级:命令行 `--server` > 环境变量 `DXKJ_SERVER_URL` > 配置文件 > 默认 `https://tools.dxkj.online`。
|
|
55
|
-
|
|
56
|
-
## opencode 插件
|
|
57
|
-
|
|
58
|
-
`opencode.json`:
|
|
59
|
-
|
|
60
|
-
```json
|
|
61
|
-
{
|
|
62
|
-
"$schema": "https://opencode.ai/config.json",
|
|
63
|
-
"plugin": ["dxkj"]
|
|
64
|
-
}
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
注册后提供 `dxkj_catalog` 与 `dxkj_install` 两个工具。
|
|
68
|
-
|
|
69
|
-
## 收录规范校验
|
|
70
|
-
|
|
71
|
-
`dxkj validate item.json` 校验命名格式、必填字段、status 生命周期、deprecated 原因、tags 类型等(依据 `收录.md` 第 2/3 章)。
|
|
72
|
-
|
|
73
|
-
## License
|
|
74
|
-
|
|
75
|
-
Apache-2.0
|
|
1
|
+
# dxkj
|
|
2
|
+
|
|
3
|
+
dxkj 目录 CLI(prompt / skill / agent / plugin / tool)+ opencode 插件壳。
|
|
4
|
+
|
|
5
|
+
以 `收录.md`(Skill & Agent Tool 分类与命名规范 v1.0)为元数据基线:
|
|
6
|
+
按编号浏览、检索、查看条目(含多图画廊与简介),并单装/批量安装到三种目标。
|
|
7
|
+
|
|
8
|
+
## 安装
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm i -g dxkj
|
|
12
|
+
# 或
|
|
13
|
+
npx -y dxkj list
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 命令
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
dxkj list [--kind skill] [--category CG] [--tag x] [--json]
|
|
20
|
+
dxkj search <关键词>
|
|
21
|
+
dxkj show <编号|id>
|
|
22
|
+
dxkj install <编号...> [--target ai-editor|navlink|generic] [--editor opencode|claude] [--dir 路径]
|
|
23
|
+
dxkj install --all [--kind skill]
|
|
24
|
+
dxkj uninstall <编号...>
|
|
25
|
+
dxkj validate <条目.json>
|
|
26
|
+
dxkj config get [键] | config set <键> <值> | config path
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
站点尚未集成时,可用内置示例数据本地验证:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
dxkj list --source ./node_modules/dxkj/fixtures/sample-registry.json
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 三种安装目标
|
|
36
|
+
|
|
37
|
+
| target | 说明 | 目录来源 |
|
|
38
|
+
| :--- | :--- | :--- |
|
|
39
|
+
| `ai-editor` | 按 kind 分派到 opencode / Claude 的 skills / agent / command 等目录 | `config.targets.aiEditor.<editor>`(默认 opencode) |
|
|
40
|
+
| `navlink` | 装入目标 NavLink 实例的 `plugins/` 目录 | `--dir` 或 `config.targets.navlink.pluginsDir` |
|
|
41
|
+
| `generic` | 解压到任意目录 | `--dir` 或 `config.targets.generic.dir` |
|
|
42
|
+
|
|
43
|
+
## 配置
|
|
44
|
+
|
|
45
|
+
配置文件:`~/.dxkj/config.json`
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
dxkj config set serverUrl https://tools.dxkj.online
|
|
49
|
+
dxkj config set target ai-editor
|
|
50
|
+
dxkj config set editor opencode
|
|
51
|
+
dxkj config get
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
优先级:命令行 `--server` > 环境变量 `DXKJ_SERVER_URL` > 配置文件 > 默认 `https://tools.dxkj.online`。
|
|
55
|
+
|
|
56
|
+
## opencode 插件
|
|
57
|
+
|
|
58
|
+
`opencode.json`:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"$schema": "https://opencode.ai/config.json",
|
|
63
|
+
"plugin": ["dxkj"]
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
注册后提供 `dxkj_catalog` 与 `dxkj_install` 两个工具。
|
|
68
|
+
|
|
69
|
+
## 收录规范校验
|
|
70
|
+
|
|
71
|
+
`dxkj validate item.json` 校验命名格式、必填字段、status 生命周期、deprecated 原因、tags 类型等(依据 `收录.md` 第 2/3 章)。
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
Apache-2.0
|
package/bin/dxk.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { run } from '../src/cli.js';
|
|
3
|
-
|
|
4
|
-
run(process.argv.slice(2))
|
|
5
|
-
.then((code) => {
|
|
6
|
-
if (typeof code === 'number') process.exit(code);
|
|
7
|
-
})
|
|
8
|
-
.catch((err) => {
|
|
9
|
-
console.error(`dxkj: ${err && err.message ? err.message : err}`);
|
|
10
|
-
process.exit(1);
|
|
11
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { run } from '../src/cli.js';
|
|
3
|
+
|
|
4
|
+
run(process.argv.slice(2))
|
|
5
|
+
.then((code) => {
|
|
6
|
+
if (typeof code === 'number') process.exit(code);
|
|
7
|
+
})
|
|
8
|
+
.catch((err) => {
|
|
9
|
+
console.error(`dxkj: ${err && err.message ? err.message : err}`);
|
|
10
|
+
process.exit(1);
|
|
11
|
+
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: english_sentence_correct
|
|
3
|
-
description: 英文句子语法纠错示例技能(dxkj CLI 安装测试用)。Use when the user asks to correct an English sentence.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# English Sentence Correct (Demo)
|
|
7
|
-
|
|
8
|
-
这是一个用于验证 dxkj CLI 安装流程的最小 SKILL 示例。
|
|
9
|
-
|
|
10
|
-
## 用法
|
|
11
|
-
|
|
12
|
-
给定一句英文,返回纠错后的句子与中文解析。
|
|
1
|
+
---
|
|
2
|
+
name: english_sentence_correct
|
|
3
|
+
description: 英文句子语法纠错示例技能(dxkj CLI 安装测试用)。Use when the user asks to correct an English sentence.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# English Sentence Correct (Demo)
|
|
7
|
+
|
|
8
|
+
这是一个用于验证 dxkj CLI 安装流程的最小 SKILL 示例。
|
|
9
|
+
|
|
10
|
+
## 用法
|
|
11
|
+
|
|
12
|
+
给定一句英文,返回纠错后的句子与中文解析。
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// 示例原子工具(dxkj CLI 安装测试用)
|
|
2
|
-
export function math_calculator(expr) {
|
|
3
|
-
// 仅演示:请勿用于不可信输入
|
|
4
|
-
return Function(`"use strict";return (${expr})`)();
|
|
5
|
-
}
|
|
1
|
+
// 示例原子工具(dxkj CLI 安装测试用)
|
|
2
|
+
export function math_calculator(expr) {
|
|
3
|
+
// 仅演示:请勿用于不可信输入
|
|
4
|
+
return Function(`"use strict";return (${expr})`)();
|
|
5
|
+
}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": "1.0",
|
|
3
|
-
"generatedAt": "2026-10-02T00:00:00.000Z",
|
|
4
|
-
"items": [
|
|
5
|
-
{
|
|
6
|
-
"number": 1,
|
|
7
|
-
"id": "skill.CG.demo.english_sentence_correct@v1.1",
|
|
8
|
-
"kind": "skill",
|
|
9
|
-
"name": "english_sentence_correct",
|
|
10
|
-
"category": "ContentGeneration.TextGen",
|
|
11
|
-
"description": "英文句子语法纠错,并给出中文解析(示例条目)",
|
|
12
|
-
"intro": "面向英语学习者的语法纠错技能。\n输入一句英文,返回修正后的句子与中文讲解。",
|
|
13
|
-
"version": "1.1",
|
|
14
|
-
"status": "active",
|
|
15
|
-
"author": "dxkj-demo",
|
|
16
|
-
"tags": ["english", "grammar", "education"],
|
|
17
|
-
"images": ["https://tools.dxkj.online/uploads/ai-catalog/images/demo-1.png"],
|
|
18
|
-
"install": {
|
|
19
|
-
"format": "zip",
|
|
20
|
-
"url": "./fixtures/packages/hello-skill.zip",
|
|
21
|
-
"entry": "SKILL.md"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"number": 2,
|
|
26
|
-
"id": "tool.CL.demo.math_calculator@v1.2",
|
|
27
|
-
"kind": "tool",
|
|
28
|
-
"name": "math_calculator",
|
|
29
|
-
"category": "Calculation&Logic.MathCompute",
|
|
30
|
-
"description": "自然语言数学表达式计算,支持四则运算、开方(示例条目)",
|
|
31
|
-
"intro": "原子计算工具示例,CLI 安装后可作为本地工具使用。",
|
|
32
|
-
"version": "1.2",
|
|
33
|
-
"status": "experimental",
|
|
34
|
-
"author": "dxkj-demo",
|
|
35
|
-
"tags": ["math", "arithmetic"],
|
|
36
|
-
"images": [],
|
|
37
|
-
"install": {
|
|
38
|
-
"format": "zip",
|
|
39
|
-
"url": "./fixtures/packages/hello-skill.zip",
|
|
40
|
-
"entry": "tool.js"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
]
|
|
44
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0",
|
|
3
|
+
"generatedAt": "2026-10-02T00:00:00.000Z",
|
|
4
|
+
"items": [
|
|
5
|
+
{
|
|
6
|
+
"number": 1,
|
|
7
|
+
"id": "skill.CG.demo.english_sentence_correct@v1.1",
|
|
8
|
+
"kind": "skill",
|
|
9
|
+
"name": "english_sentence_correct",
|
|
10
|
+
"category": "ContentGeneration.TextGen",
|
|
11
|
+
"description": "英文句子语法纠错,并给出中文解析(示例条目)",
|
|
12
|
+
"intro": "面向英语学习者的语法纠错技能。\n输入一句英文,返回修正后的句子与中文讲解。",
|
|
13
|
+
"version": "1.1",
|
|
14
|
+
"status": "active",
|
|
15
|
+
"author": "dxkj-demo",
|
|
16
|
+
"tags": ["english", "grammar", "education"],
|
|
17
|
+
"images": ["https://tools.dxkj.online/uploads/ai-catalog/images/demo-1.png"],
|
|
18
|
+
"install": {
|
|
19
|
+
"format": "zip",
|
|
20
|
+
"url": "./fixtures/packages/hello-skill.zip",
|
|
21
|
+
"entry": "SKILL.md"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"number": 2,
|
|
26
|
+
"id": "tool.CL.demo.math_calculator@v1.2",
|
|
27
|
+
"kind": "tool",
|
|
28
|
+
"name": "math_calculator",
|
|
29
|
+
"category": "Calculation&Logic.MathCompute",
|
|
30
|
+
"description": "自然语言数学表达式计算,支持四则运算、开方(示例条目)",
|
|
31
|
+
"intro": "原子计算工具示例,CLI 安装后可作为本地工具使用。",
|
|
32
|
+
"version": "1.2",
|
|
33
|
+
"status": "experimental",
|
|
34
|
+
"author": "dxkj-demo",
|
|
35
|
+
"tags": ["math", "arithmetic"],
|
|
36
|
+
"images": [],
|
|
37
|
+
"install": {
|
|
38
|
+
"format": "zip",
|
|
39
|
+
"url": "./fixtures/packages/hello-skill.zip",
|
|
40
|
+
"entry": "tool.js"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
package/package.json
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dxkj",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "dxkj CLI — browse and install prompts/skills/agents/plugins/tools from the dxkj catalog, plus an opencode plugin shell.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"license": "Apache-2.0",
|
|
7
|
-
"bin": {
|
|
8
|
-
"dxkj": "bin/dxk.js"
|
|
9
|
-
},
|
|
10
|
-
"main": "./src/opencode.js",
|
|
11
|
-
"exports": {
|
|
12
|
-
".": "./src/opencode.js",
|
|
13
|
-
"./cli": "./src/cli.js",
|
|
14
|
-
"./package.json": "./package.json"
|
|
15
|
-
},
|
|
16
|
-
"files": [
|
|
17
|
-
"bin",
|
|
18
|
-
"src",
|
|
19
|
-
"fixtures",
|
|
20
|
-
"README.md"
|
|
21
|
-
],
|
|
22
|
-
"engines": {
|
|
23
|
-
"node": ">=18.17"
|
|
24
|
-
},
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"adm-zip": "^0.5.16"
|
|
27
|
-
},
|
|
28
|
-
"publishConfig": {
|
|
29
|
-
"registry": "https://registry.npmjs.org",
|
|
30
|
-
"access": "public"
|
|
31
|
-
},
|
|
32
|
-
"keywords": [
|
|
33
|
-
"dxkj",
|
|
34
|
-
"cli",
|
|
35
|
-
"opencode",
|
|
36
|
-
"skill",
|
|
37
|
-
"agent",
|
|
38
|
-
"prompt",
|
|
39
|
-
"catalog"
|
|
40
|
-
],
|
|
41
|
-
"repository": {
|
|
42
|
-
"type": "git",
|
|
43
|
-
"url": "git+https://gitee.com/amdyhaha/navlink_release_amdy.git"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dxkj",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "dxkj CLI — browse and install prompts/skills/agents/plugins/tools from the dxkj catalog, plus an opencode plugin shell.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"bin": {
|
|
8
|
+
"dxkj": "bin/dxk.js"
|
|
9
|
+
},
|
|
10
|
+
"main": "./src/opencode.js",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": "./src/opencode.js",
|
|
13
|
+
"./cli": "./src/cli.js",
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"bin",
|
|
18
|
+
"src",
|
|
19
|
+
"fixtures",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=18.17"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"adm-zip": "^0.5.16"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"registry": "https://registry.npmjs.org",
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"dxkj",
|
|
34
|
+
"cli",
|
|
35
|
+
"opencode",
|
|
36
|
+
"skill",
|
|
37
|
+
"agent",
|
|
38
|
+
"prompt",
|
|
39
|
+
"catalog"
|
|
40
|
+
],
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://gitee.com/amdyhaha/navlink_release_amdy.git"
|
|
44
|
+
}
|
|
45
|
+
}
|