shoplazza-ai-dev-cli 0.1.0

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 ADDED
@@ -0,0 +1,113 @@
1
+ # shoplazza-ai-dev-cli
2
+
3
+ Shoplazza Forge 的 skill CLI——为 Claude Code / Cursor / Codex 安装、发布、管理 AI agent 的 skill 与 rule。
4
+
5
+ > Based on [vercel-labs/skills](https://github.com/vercel-labs/skills) (MIT). 二开内容详见 `docs/superpowers/specs/2026-04-21-ai-dev-cli-design.md`。Third-party 归属见 `ThirdPartyNoticeText.txt`。
6
+
7
+ ---
8
+
9
+ ## 快速开始
10
+
11
+ ```bash
12
+ # 安装一个公共 skill 到当前项目(自动检测 agent)
13
+ npx shoplazza-ai-dev-cli add @public/skills --skill systematic-debugging
14
+
15
+ # 安装到全局
16
+ npx shoplazza-ai-dev-cli add @public/skills --skill <name> -g
17
+
18
+ # 安装到指定 agent
19
+ npx shoplazza-ai-dev-cli add @public/skills --skill <name> --agent claude-code cursor
20
+
21
+ # 装 team 名下指定 skill
22
+ npx shoplazza-ai-dev-cli add @teams/<scope>/skills --skill <name>
23
+
24
+ # 一次装该 team 所有 skill + rule
25
+ npx shoplazza-ai-dev-cli add @teams/<scope>
26
+
27
+ # 浏览器 SSO 登录(publish 前需要)
28
+ npx shoplazza-ai-dev-cli login
29
+
30
+ # 发布本地 skill 到 Forge 门户
31
+ npx shoplazza-ai-dev-cli publish ./my-skill --scope @teams/infra
32
+ ```
33
+
34
+ ---
35
+
36
+ ## 命令一览
37
+
38
+ | 命令 | 说明 |
39
+ |---|---|
40
+ | `add <source>` | 安装 skill / rule。`<source>` 可以是 `@public/...`、`@teams/<scope>/...`、git URL 或本地路径 |
41
+ | `remove [skills]` | 移除已安装 skill |
42
+ | `list` / `ls` | 列出已安装 skill |
43
+ | `find [query]` | 交互式搜索 |
44
+ | `update [skills...]` | 升级到最新版本 |
45
+ | `init [name]` | 初始化一个 skill 模板 |
46
+ | `login` | 浏览器 SSO 换 CLI token |
47
+ | `publish <path>` | 上传本地 skill 到门户审核 |
48
+
49
+ 完整 flag 看 `shoplazza-ai-dev-cli --help`。
50
+
51
+ ---
52
+
53
+ ## 引用语法
54
+
55
+ | 写法 | 解析后 |
56
+ |---|---|
57
+ | `@public/skills --skill <name>` | Portal `/api/cli/skills/archive` 接口下载 tar.gz;CLI 不直连 GitLab。推荐写法,与 fork(vercel-labs/skills)一致 |
58
+ | `@public/rules --skill <name>` | 同上,rule 类型 |
59
+ | `@teams/<scope>/skills --skill <name>` | Portal 代理下载;需要 `shoplazza-ai-dev-cli login` 后取得 portal token |
60
+ | `@teams/<scope>` | Portal 代理批量下载 team 名下所有 skill + rule;需要 `shoplazza-ai-dev-cli login` 后取得 portal token |
61
+ | `@public/skills/<name>` | 旧写法,兼容保留;等价于 `@public/skills --skill <name>` |
62
+ | `@teams/<scope>/skills/<name>` | 旧写法,兼容保留 |
63
+ | `<git-url>` | 任意 git 仓库(如外部 vercel-labs/skills) |
64
+ | `./local/path` | 本地目录 |
65
+
66
+ `@public/...` 走匿名下载(portal 代理 GitLab),`@teams/<scope>/...` 需要先 `shoplazza-ai-dev-cli login` 拿 portal token;token 由 portal 用自己的 GitLab service token 代换文件,CLI 与终端用户都不直接持有 GitLab 凭证。
67
+
68
+ SSOT 仓的实际地址仍由门户接口 `GET /api/cli/bootstrap` 提供(用于 legacy / fallback 路径),对用户屏蔽。
69
+
70
+ ---
71
+
72
+ ## 配置
73
+
74
+ | 项 | 默认 | 覆盖方式 |
75
+ |---|---|---|
76
+ | 门户地址 | `https://forge.shoplazza.site` | `SHOPLAZZA_FORGE_PORTAL` 环境变量 / `--portal` flag |
77
+ | token 存储 | `~/.ai-dev-cli/config.json`(mode 0600) | `login` 命令写入 |
78
+ | 埋点开关 | 默认开启 | `shoplazza-ai-dev-cli config set telemetry_enabled false` |
79
+
80
+ ---
81
+
82
+ ## 安装路径
83
+
84
+ | Agent | 项目级 | 全局级 |
85
+ |---|---|---|
86
+ | Claude Code | `.claude/skills/` | `~/.claude/skills/` |
87
+ | Cursor | `.agents/skills/` | `~/.cursor/skills/` |
88
+ | Codex | `.agents/skills/` | `~/.codex/skills/` |
89
+
90
+ ---
91
+
92
+ ## 开发
93
+
94
+ ```bash
95
+ cd cli
96
+ npm install # 或 pnpm install
97
+ npm run dev -- add @public/skills/<name> # 直接跑 src/cli.ts
98
+ npm test # vitest
99
+ npm run type-check # tsc --noEmit
100
+ npm run build # obuild → dist/
101
+ ```
102
+
103
+ 发布到内部 npm registry(CI 自动):
104
+
105
+ ```bash
106
+ npm publish --registry https://gitlab.shoplazza.site/api/v4/packages/npm/
107
+ ```
108
+
109
+ ---
110
+
111
+ ## License
112
+
113
+ MIT,见根仓库 LICENSE。Fork 自 `vercel-labs/skills`,遵循其原 MIT 协议;上游版权与第三方依赖归属见 `ThirdPartyNoticeText.txt`。
@@ -0,0 +1,117 @@
1
+ /*!----------------- Skills CLI ThirdPartyNotices -------------------------------------------------------
2
+
3
+ The Skills CLI incorporates third party material from the projects listed below.
4
+ The original copyright notice and the license under which this material was received
5
+ are set forth below. These licenses and notices are provided for informational purposes only.
6
+
7
+ ---------------------------------------------
8
+ Third Party Code Components
9
+ --------------------------------------------
10
+
11
+ ================================================================================
12
+ Package: @clack/prompts@0.11.0
13
+ License: MIT
14
+ Repository: https://github.com/bombshell-dev/clack
15
+ --------------------------------------------------------------------------------
16
+
17
+ MIT License
18
+
19
+ Copyright (c) Nate Moore
20
+
21
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
22
+
23
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
24
+
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
+
27
+
28
+ ================================================================================
29
+ Package: picocolors@1.1.1
30
+ License: ISC
31
+ Repository: https://github.com/alexeyraspopov/picocolors
32
+ --------------------------------------------------------------------------------
33
+
34
+ ISC License
35
+
36
+ Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
37
+
38
+ Permission to use, copy, modify, and/or distribute this software for any
39
+ purpose with or without fee is hereby granted, provided that the above
40
+ copyright notice and this permission notice appear in all copies.
41
+
42
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
43
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
44
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
45
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
46
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
47
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
48
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
49
+
50
+
51
+ ================================================================================
52
+ Package: simple-git@3.30.0
53
+ License: MIT
54
+ Repository: https://github.com/steveukx/git-js
55
+ --------------------------------------------------------------------------------
56
+
57
+ MIT License
58
+
59
+ Permission is hereby granted, free of charge, to any person obtaining a copy
60
+ of this software and associated documentation files (the "Software"), to deal
61
+ in the Software without restriction, including without limitation the rights
62
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
63
+ copies of the Software, and to permit persons to whom the Software is
64
+ furnished to do so, subject to the following conditions:
65
+
66
+ The above copyright notice and this permission notice shall be included in all
67
+ copies or substantial portions of the Software.
68
+
69
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
70
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
71
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
72
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
73
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
74
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
75
+ SOFTWARE.
76
+
77
+
78
+ ================================================================================
79
+ Package: xdg-basedir@5.1.0
80
+ License: MIT
81
+ Repository: https://github.com/sindresorhus/xdg-basedir
82
+ --------------------------------------------------------------------------------
83
+
84
+ MIT License
85
+
86
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
87
+
88
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
89
+
90
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
91
+
92
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
93
+
94
+
95
+ ================================================================================
96
+ Package: yaml@2.8.3
97
+ License: ISC
98
+ Repository: https://github.com/eemeli/yaml
99
+ --------------------------------------------------------------------------------
100
+
101
+ Copyright Eemeli Aro <eemeli@gmail.com>
102
+
103
+ Permission to use, copy, modify, and/or distribute this software for any purpose
104
+ with or without fee is hereby granted, provided that the above copyright notice
105
+ and this permission notice appear in all copies.
106
+
107
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
108
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
109
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
110
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
111
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
112
+ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
113
+ THIS SOFTWARE.
114
+
115
+
116
+ ================================================================================
117
+ */
package/bin/cli.mjs ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+
3
+ import module from 'node:module';
4
+
5
+ // https://nodejs.org/api/module.html#module-compile-cache
6
+ if (module.enableCompileCache && !process.env.NODE_DISABLE_COMPILE_CACHE) {
7
+ try {
8
+ module.enableCompileCache();
9
+ } catch {
10
+ // Ignore errors
11
+ }
12
+ }
13
+
14
+ await import('../dist/cli.mjs');