@cli-skill/cli 0.0.1-beta.20260402142556 → 0.0.3-beta.20260402154312

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cli-skill/cli",
3
- "version": "0.0.1-beta.20260402142556",
3
+ "version": "0.0.3-beta.20260402154312",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -17,7 +17,7 @@
17
17
  "test": "tsc -p tsconfig.test.json && bun test ./test"
18
18
  },
19
19
  "dependencies": {
20
- "@cli-skill/core": "^0.0.1-beta.20260402142556",
20
+ "@cli-skill/core": "^0.0.3-beta.20260402154312",
21
21
  "cac": "^6.7.14",
22
22
  "lodash": "^4.17.21",
23
23
  "zod": "^4.3.6"
@@ -213,11 +213,7 @@ export default defineSkill({
213
213
 
214
214
  这也是为什么生成出来的 skill 模板会把 `zod` 放在自己的 `dependencies` 里。
215
215
 
216
- 生成出来的 skill 模板还会把 `@cli-skill/cli` 放进 `devDependencies`,用于在 skill 项目目录里直接执行:
217
-
218
- - `cli-skill build`
219
- - `cli-skill mount`
220
- - `cli-skill publish`
216
+ skill 项目默认只依赖 `@cli-skill/core`。平台 CLI 通过全局安装的 `cli-skill` 提供,不会再写进模板依赖里。
221
217
 
222
218
  ## 什么时候继续往下看
223
219
 
@@ -3,6 +3,16 @@ import { rm } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { resolveRegisteredSkillProject, removeRegistryEntry, unregisterProjectBins } from "../registry";
5
5
 
6
+ function getInstalledSkillRoot(projectPath: string): string {
7
+ const segments = projectPath.split(path.sep);
8
+ const nodeModulesIndex = segments.lastIndexOf("node_modules");
9
+ if (nodeModulesIndex === -1) {
10
+ return projectPath;
11
+ }
12
+
13
+ return segments.slice(0, nodeModulesIndex).join(path.sep) || path.sep;
14
+ }
15
+
6
16
  export function registerUninstallCommand(cli: CAC): void {
7
17
  cli
8
18
  .command("uninstall <packageName>", "Uninstall a managed cli skill")
@@ -13,7 +23,9 @@ export function registerUninstallCommand(cli: CAC): void {
13
23
  for (const agentPath of resolved.agentPaths) {
14
24
  await rm(agentPath, { recursive: true, force: true });
15
25
  }
16
- await rm(path.join(resolved.projectPath, "..", ".."), { recursive: true, force: true });
26
+ if (resolved.source === "installed") {
27
+ await rm(getInstalledSkillRoot(resolved.projectPath), { recursive: true, force: true });
28
+ }
17
29
  await removeRegistryEntry(skillName);
18
30
  console.log(resolved.projectPath);
19
31
  });
package/src/project.ts CHANGED
@@ -56,7 +56,6 @@ export async function createSkillProject(
56
56
  const usingLocalTemplates = await hasLocalTemplatesPackage();
57
57
  const cliPackageVersion = await getCliPackageVersion();
58
58
  const corePackageSpec = cliPackageVersion;
59
- const cliPackageSpec = cliPackageVersion;
60
59
  const templatePackageSpec = usingLocalTemplates
61
60
  ? `file:${LOCAL_TEMPLATE_PACKAGE_PATH}`
62
61
  : `@cli-skill/templates@${cliPackageVersion}`;
@@ -76,8 +75,6 @@ export async function createSkillProject(
76
75
  targetDir,
77
76
  "--core-package-spec",
78
77
  corePackageSpec,
79
- "--cli-package-spec",
80
- cliPackageSpec,
81
78
  ],
82
79
  process.cwd(),
83
80
  );