siluzan-website-cli 1.0.1-beta.2 → 1.0.1-beta.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.
@@ -1,16 +1,16 @@
1
1
  ---
2
2
  name: siluzan-website
3
3
  description: >-
4
- 管理丝路赞 WordPress 站点(wp-k8s 托管):列出我的站点、新增/编辑页面、安装/升级插件。
5
- 当用户提到 WordPress、建站后台、新增页面、改官网、装插件、升级插件、站点 guid、
6
- siluzan-website、zionbuilder、visual-edit 时使用。不是 LPS / AI Sites,也不是 SEO JSON 生成。
4
+ 管理丝路赞 WordPress 站点(wp-k8s 托管):列出站点、页面/文章/产品、媒体、分类、插件。
5
+ 当用户提到 WordPress、建站后台、新增页面、发文章、上传图片、改官网、装插件、
6
+ 站点 guid、siluzan-website、zionbuilder、visual-edit 时使用。不是 LPS / AI Sites,也不是 SEO JSON 生成。
7
7
  ---
8
8
 
9
9
  # siluzan-website
10
10
 
11
11
  管理用户账号下的 **WordPress 站点**(TSO 建站 / wp-k8s)。通过 CLI 调平台 all-sites 与站点 WP REST,不要手写 curl,不要猜 guid / 页面 ID。
12
12
 
13
- **不是** `landing-page-system` 的 LPS Agent,也不是 `siluzan-seo` 的 schema 生成。用户要的是「我的官网加一页 / 看插件 / 装插件 / 升级插件」才用本 Skill。
13
+ **不是** `landing-page-system` 的 LPS Agent,也不是 `siluzan-seo` 的 schema 生成。用户要的是「我的官网加一页 / 发一篇资讯 / 上传图片 / 装插件」才用本 Skill。
14
14
 
15
15
  ## 一键安装
16
16
 
@@ -39,8 +39,12 @@ Windows 注意:部分 Agent 通过 PowerShell / cmd 代执行时可能失败
39
39
  | `siluzan-website config show/set/clear` | 查看 / 写入凭据 | [references/setup.md](references/setup.md) |
40
40
  | `siluzan-website init` / `update` | 写入 / 刷新 Skill 文件 | [references/setup.md](references/setup.md) |
41
41
  | `siluzan-website sites list` | 列出我的 WordPress 站点 | [references/sites.md](references/sites.md) |
42
- | `siluzan-website pages list/add/update` | 列出 / 新增 / 覆盖页面 | [references/pages.md](references/pages.md) |
43
- | `siluzan-website plugins list/catalog/install/update` | 已装列表 / 目录 / 安装 / 升级 | [references/plugins.md](references/plugins.md) |
42
+ | `siluzan-website pages list/get/add/update/meta/trash` | Zion 页面 + 元数据 / 回收站 | [references/pages.md](references/pages.md) |
43
+ | `siluzan-website content types/list/get/add/update/trash` | 文章/产品等 REST 类型 | [references/content.md](references/content.md) |
44
+ | `siluzan-website media list/get/upload` | 媒体库 | [references/media.md](references/media.md) |
45
+ | `siluzan-website terms …` | 分类 / 标签 | [references/terms.md](references/terms.md) |
46
+ | `siluzan-website search` | 全站搜索 | [references/search.md](references/search.md) |
47
+ | `siluzan-website plugins list/catalog/install/update/uninstall` | 已装列表 / 目录 / 安装 / 升级 / 卸载 | [references/plugins.md](references/plugins.md) |
44
48
  | `siluzan-website plugins helper-status/update-helper` | 查看 / 用镜像 zip 升级 helper | [references/plugins.md](references/plugins.md) |
45
49
 
46
50
  ---
@@ -51,19 +55,25 @@ Windows 注意:部分 Agent 通过 PowerShell / cmd 代执行时可能失败
51
55
  |--------------|------|--------|
52
56
  | 首次安装 / 登录 | `references/setup.md` | `login` 或复用已有 CSO/TSO 凭据 |
53
57
  | 我有哪些网站 | `references/sites.md` | `sites list`,不要猜 guid |
54
- | 加一页 / 改一页 | `references/pages.md` | 先 `sites list` 再 `pages add/update` |
58
+ | 加一页 / 改一页正文 | `references/pages.md` | 先 `sites list` 再 `pages add/update` |
59
+ | 改页面 slug / 状态 / 回收站 | `references/pages.md` | `pages meta` / `pages trash` |
60
+ | 发资讯 / 改文章 / 产品字段 | `references/content.md` | `content types` → `list` → `add/update` |
61
+ | 上传图片 | `references/media.md` | `media upload`,记下 id |
62
+ | 分类标签 | `references/terms.md` | `terms list` 再 add/update |
63
+ | 按关键词找内容 | `references/search.md` | `search --q` |
55
64
  | 这个站装了哪些插件 | `references/plugins.md` | `plugins list`(全部已装,不只是目录) |
56
65
  | 安装 / 启用目录插件 | `references/plugins.md` | `catalog` 找 slug → 确认 → `install --slug` |
57
66
  | 安装外部插件 | `references/plugins.md` | 确认 → `install --zip` |
58
67
  | 升级已装插件 | `references/plugins.md` | `list` 拿 plugin → 确认 → `update --plugin`;外部再加 `--zip` |
68
+ | 卸载插件 | `references/plugins.md` | `list` 拿 plugin → 确认 → `uninstall --plugin` |
59
69
 
60
70
  ---
61
71
 
62
72
  ## AI 行为规范
63
73
 
64
74
  1. **计划 → 确认 → 执行 → 验证**
65
- - 写操作(`pages add` / `pages update` / `plugins install` / `plugins update` / `plugins update-helper`)会立刻生效,执行前必须复述目标站点与内容,获得用户确认。
66
- - 只读(`sites list` / `pages list` / `plugins list` / `plugins catalog` / `plugins helper-status` / `config show`)可直接跑。
75
+ - 写操作(`pages add/update/meta/trash`、`content add/update/trash`、`media upload`、`terms add/update/delete`、`plugins install/update/uninstall/update-helper`)会立刻生效,执行前必须复述目标站点与内容,获得用户确认。
76
+ - 只读(`sites list`、`pages list/get`、`content types/list/get`、`media list/get`、`terms taxonomies/list`、`search`、`plugins list/catalog/helper-status`、`config show`)可直接跑。
67
77
  2. **不猜 ID**:站点用 `sites list` 的 `guid`;页面用 `pages list` 的 `id`。
68
78
  3. **先查再写**:改页面前先 `pages list` 确认目标页存在。
69
79
  4. **只认 API Key**:所有命令走 `x-api-key`(`SILUZAN_API_KEY` 或 `login` 写入的 config)。Agent 沙箱只注入 Key,不要向用户要 JWT,也不要设 `SILUZAN_AUTH_TOKEN`。
@@ -75,6 +85,6 @@ Windows 注意:部分 Agent 通过 PowerShell / cmd 代执行时可能失败
75
85
 
76
86
  - 创建 / 删除 / 重启站点(SiteMan)
77
87
  - 绑定域名 / CDN / SSL
78
- - 停用 / 删除插件
88
+ - 单独停用插件但留在磁盘(停用只作为卸载的一步)
79
89
  - 推荐插件的业务配置(选择器、Cron、模型)
80
90
  - LPS / AI Sites / SEO JSON 灌入
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "slug": "siluzan-website",
3
- "version": "1.0.1-beta.2",
4
- "publishedAt": 1789633076915,
3
+ "version": "1.0.1-beta.3",
4
+ "publishedAt": 1789638021415,
5
5
  "homepage": "https://www.siluzan.com",
6
6
  "source": "https://dev.azure.com/jack4it/Sammamish/_git/siluzan-skill",
7
7
  "requiredBinaries": [
@@ -0,0 +1,39 @@
1
+ # 通用内容(文章 / 产品等)
2
+
3
+ 走 WordPress 核心 `GET/POST/DELETE /wp-json/wp/v2/{rest_base}`。**页面正文不要用这组命令**,用 [pages.md](pages.md)(Zion visual-edit)。
4
+
5
+ 先看站点有哪些类型:
6
+
7
+ ```bash
8
+ siluzan-website content types --site <guid>
9
+ ```
10
+
11
+ 记下 `rest_base`,后面都传 `--type`。常见:`posts`(文章)。产品若已 `show_in_rest`,一般是 `product` 或目录里写的 rest_base。
12
+
13
+ ## 列出 / 查看
14
+
15
+ ```bash
16
+ siluzan-website content list --site <guid> --type posts
17
+ siluzan-website content list --site <guid> --type posts --status draft
18
+ siluzan-website content get --site <guid> --type posts --id 12
19
+ ```
20
+
21
+ ## 新增 / 更新
22
+
23
+ 写操作,执行前确认站点、类型、标题。默认新增为 **draft**。
24
+
25
+ ```bash
26
+ siluzan-website content add --site <guid> --type posts --title "资讯标题" --content "<p>正文</p>" --status draft
27
+ siluzan-website content update --site <guid> --type posts --id 12 --status publish --featured-media 34
28
+ ```
29
+
30
+ 分类 / 标签用术语 ID(先 `terms list`):`--categories 3,5` `--tags 8`。
31
+
32
+ ## 回收站
33
+
34
+ ```bash
35
+ siluzan-website content trash --site <guid> --type posts --id 12
36
+ siluzan-website content trash --site <guid> --type posts --id 12 --force
37
+ ```
38
+
39
+ `--force` 永久删除,必须再确认一次。
@@ -0,0 +1,11 @@
1
+ # 媒体库
2
+
3
+ `GET/POST /wp-json/wp/v2/media`。上传走 multipart,不接受任意 URL 拉文件。
4
+
5
+ ```bash
6
+ siluzan-website media list --site <guid>
7
+ siluzan-website media get --site <guid> --id 34
8
+ siluzan-website media upload --site <guid> --file ./hero.png --title "首页图" --alt "工厂外观"
9
+ ```
10
+
11
+ 单文件不超过 20MB。上传成功后记下 `id`,给 `content update --featured-media` 或 `pages meta --featured-media` 用。
@@ -19,6 +19,18 @@ siluzan-website pages list --url https://{guid}-prod.admin.mysiluzan.com --json
19
19
 
20
20
  记下 `id`,更新时必须用这个 id,不要猜。
21
21
 
22
+ ## 查看 / 改元数据 / 回收站
23
+
24
+ 正文仍走 Zion。只改 slug、状态、父页、特色图:
25
+
26
+ ```bash
27
+ siluzan-website pages get --site <guid> --id 123
28
+ siluzan-website pages meta --site <guid> --id 123 --slug about --status publish
29
+ siluzan-website pages trash --site <guid> --id 123
30
+ ```
31
+
32
+ `--force` 永久删除。特色图 ID 来自 `media upload` / `media list`。
33
+
22
34
  ## 新增
23
35
 
24
36
  ```bash
@@ -16,7 +16,7 @@ siluzan-website plugins list --site <guid> --json
16
16
 
17
17
  字段:`plugin`、名称、`status`、版本、`updateSource`(有目录命中则为 `catalog`)、目录版本。
18
18
 
19
- `plugin` 列是后续 `update --plugin` 要用的值,不要猜。
19
+ `plugin` 列是后续 `update --plugin` / `uninstall --plugin` 要用的值,不要猜。
20
20
 
21
21
  ## 可安装目录
22
22
 
@@ -53,6 +53,16 @@ siluzan-website plugins update --site <guid> --plugin theme-manage/theme-manage
53
53
  siluzan-website plugins update --site <guid> --plugin zasp-smart-recommender/zasp-smart-recommender --zip ./zasp.zip
54
54
  ```
55
55
 
56
+ ## 卸载
57
+
58
+ 写操作。会先停用再删除文件。`siluzan-helper-plugin` 和 `wp-oauth2` 拒绝卸载。
59
+
60
+ ```bash
61
+ siluzan-website plugins uninstall --site <guid> --plugin dummy-plugin/dummy-plugin
62
+ ```
63
+
64
+ `--plugin` 与 `plugins list` 的 plugin 列一致;只写目录名且能唯一对上也可以。
65
+
56
66
  ## helper
57
67
 
58
68
  ```bash
@@ -68,8 +78,9 @@ siluzan-website plugins update-helper --site <guid>
68
78
  2. 用户要「装了哪些插件」→ `plugins list`
69
79
  3. 用户要装目录插件 → `catalog` 对上 slug → 确认 → `install --slug`
70
80
  4. 用户要升级已装插件 → `list` 拿到 `plugin` → 确认 → `update --plugin`;外部插件再加 `--zip`
71
- 5. catalog / install / update 报路由 404 → 命令会自动 `update-helper` 再重试;oauth2 本身 404 / 401 → 告诉用户要先 SiteMan 镜像升级
72
- 6. 看复核列表里是否 `active`
81
+ 5. 用户要卸载 → `list` 拿到 `plugin` → 确认不是 helper / oauth2 → `uninstall --plugin`
82
+ 6. catalog / install / update 报路由 404 → 命令会自动 `update-helper` 再重试;oauth2 本身 404 / 401 → 告诉用户要先 SiteMan 镜像升级
83
+ 7. 装完看复核列表是否 `active`;卸完确认列表里已经没有该项
73
84
 
74
85
  匹配到多个目录项时让用户选,不要猜。
75
86
 
@@ -85,4 +96,4 @@ siluzan-website plugins update-helper --site <guid>
85
96
  | zip 结构不对 | 重新打包,根目录必须是插件目录 |
86
97
  | 安装成功但激活失败 | 把站点返回的 message 原文告诉用户 |
87
98
 
88
- 本 Skill **不能**停用、删除插件,也不能传任意下载 URL。
99
+ 本 Skill **不能**单独停用后留在磁盘上(停用只作为卸载的一步),也不能传任意下载 URL。不能卸载 helper / oauth2。
@@ -0,0 +1,12 @@
1
+ # 搜索
2
+
3
+ `GET /wp-json/wp/v2/search`。用来找页面 / 文章 / 媒体,不要猜 ID。
4
+
5
+ ```bash
6
+ siluzan-website search --site <guid> --q "关于我们"
7
+ siluzan-website search --site <guid> --q "泵" --type post
8
+ ```
9
+
10
+ 记下结果里的 `id` 和 `type`,再决定走 `pages` 还是 `content`。
11
+
12
+ WordPress 搜索只返回**对外可见**的内容(已发布页面 / 文章 / 媒体)。草稿、私密、回收站不会出现;那些请用 `content list --status draft` 或 `pages list`。
@@ -0,0 +1,14 @@
1
+ # 分类与标签
2
+
3
+ `/wp-json/wp/v2/categories`、`/tags`,以及其它 `show_in_rest` 的分类法。
4
+
5
+ ```bash
6
+ siluzan-website terms taxonomies --site <guid>
7
+ siluzan-website terms list --site <guid> --taxonomy category
8
+ siluzan-website terms list --site <guid> --taxonomy post_tag
9
+ siluzan-website terms add --site <guid> --taxonomy category --name "行业新闻"
10
+ siluzan-website terms update --site <guid> --id 3 --name "新名称"
11
+ siluzan-website terms delete --site <guid> --id 3
12
+ ```
13
+
14
+ `--taxonomy` 可用 slug(`category`)或 rest_base(`categories`)。删除不可进回收站,执行前确认。
@@ -9,7 +9,7 @@ $ErrorActionPreference = 'Stop'
9
9
  # -- Package info (injected at build time) ------------------------------------
10
10
  $PKG_NAME = 'siluzan-website-cli'
11
11
  # PKG_VERSION 锁定到与本脚本同批构建产物一致的版本,避免与 dist/skill 错位
12
- $PKG_VERSION = '1.0.1-beta.2'
12
+ $PKG_VERSION = '1.0.1-beta.3'
13
13
  $CLI_BIN = 'siluzan-website'
14
14
  $SKILL_LABEL = 'Siluzan Website'
15
15
  $INSTALL_CMD = 'npm install -g siluzan-website-cli@beta'
@@ -9,7 +9,7 @@ set -euo pipefail
9
9
  # -- Package info (injected at build time) ------------------------------------
10
10
  readonly PKG_NAME="siluzan-website-cli"
11
11
  # PKG_VERSION 锁定到与本脚本同批构建产物一致的版本,避免与 dist/skill 错位
12
- readonly PKG_VERSION="1.0.1-beta.2"
12
+ readonly PKG_VERSION="1.0.1-beta.3"
13
13
  readonly CLI_BIN="siluzan-website"
14
14
  readonly SKILL_LABEL="Siluzan Website"
15
15
  readonly INSTALL_CMD="npm install -g siluzan-website-cli@beta"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siluzan-website-cli",
3
- "version": "1.0.1-beta.2",
3
+ "version": "1.0.1-beta.3",
4
4
  "description": "Siluzan WordPress 站点管理 Skill CLI — 列出站点、新增/编辑页面、安装/升级插件。",
5
5
  "keywords": [
6
6
  "ai-skill",