@geoly-ai/social-hub-cli 0.0.12 → 0.0.13

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.
Files changed (53) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/admin-index-gates.test.d.ts +2 -0
  3. package/dist/admin-index-gates.test.d.ts.map +1 -0
  4. package/dist/admin-index-gates.test.js +33 -0
  5. package/dist/admin-index-gates.test.js.map +1 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +684 -63
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.test.js +87 -5
  10. package/dist/index.test.js.map +1 -1
  11. package/dist/permission-runner.d.ts +11 -0
  12. package/dist/permission-runner.d.ts.map +1 -0
  13. package/dist/permission-runner.js +30 -0
  14. package/dist/permission-runner.js.map +1 -0
  15. package/dist/permission-runner.test.d.ts +2 -0
  16. package/dist/permission-runner.test.d.ts.map +1 -0
  17. package/dist/permission-runner.test.js +69 -0
  18. package/dist/permission-runner.test.js.map +1 -0
  19. package/dist/permissions-gates-admin.d.ts +4 -0
  20. package/dist/permissions-gates-admin.d.ts.map +1 -0
  21. package/dist/permissions-gates-admin.js +80 -0
  22. package/dist/permissions-gates-admin.js.map +1 -0
  23. package/dist/permissions-gates-admin.test.d.ts +2 -0
  24. package/dist/permissions-gates-admin.test.d.ts.map +1 -0
  25. package/dist/permissions-gates-admin.test.js +25 -0
  26. package/dist/permissions-gates-admin.test.js.map +1 -0
  27. package/dist/permissions.d.ts.map +1 -1
  28. package/dist/permissions.js +2 -3
  29. package/dist/permissions.js.map +1 -1
  30. package/dist/register-admin.d.ts.map +1 -1
  31. package/dist/register-admin.js +343 -29
  32. package/dist/register-admin.js.map +1 -1
  33. package/dist/register-extensions.d.ts.map +1 -1
  34. package/dist/register-extensions.js +16 -19
  35. package/dist/register-extensions.js.map +1 -1
  36. package/package.json +2 -2
  37. package/skills/README.md +7 -5
  38. package/skills/manifest.json +17 -7
  39. package/skills/social-hub-accounts/SKILL.md +46 -13
  40. package/skills/social-hub-admin/SKILL.md +76 -10
  41. package/skills/social-hub-calendar-jobs/SKILL.md +26 -10
  42. package/skills/social-hub-cli/SKILL.md +35 -191
  43. package/skills/social-hub-cli/evals/evals.json +4 -4
  44. package/skills/social-hub-events-observability/SKILL.md +49 -0
  45. package/skills/social-hub-graph-compliance/SKILL.md +60 -0
  46. package/skills/social-hub-intelligence/SKILL.md +72 -7
  47. package/skills/social-hub-migration/SKILL.md +18 -5
  48. package/skills/social-hub-openclaw-context/SKILL.md +21 -6
  49. package/skills/social-hub-ops-runtime/SKILL.md +10 -5
  50. package/skills/social-hub-posts/SKILL.md +54 -23
  51. package/skills/social-hub-posts/evals/evals.json +23 -0
  52. package/skills/social-hub-publishing/SKILL.md +75 -11
  53. package/skills/social-hub-shared/SKILL.md +8 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geoly-ai/social-hub-cli",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "type": "module",
5
5
  "description": "social-hub CLI for Social Ops Hub",
6
6
  "repository": {
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "commander": "^12.1.0",
24
24
  "@geoly-ai/social-hub-authz": "0.0.3",
25
- "@geoly-ai/social-hub-sdk": "0.0.5"
25
+ "@geoly-ai/social-hub-sdk": "0.0.6"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^22.10.2",
package/skills/README.md CHANGED
@@ -99,16 +99,18 @@ pnpm skills:check
99
99
 
100
100
  | Skill | 用途 |
101
101
  |-------|------|
102
- | [social-hub-cli](social-hub-cli) | 总路由 + 命令速查 |
102
+ | [social-hub-cli](social-hub-cli) | 总路由 + 领域 skill 索引 |
103
103
  | [social-hub-shared](social-hub-shared) | config、auth、doctor、context |
104
104
  | [social-hub-ops-runtime](social-hub-ops-runtime) | claim / complete / fail |
105
105
  | [social-hub-openclaw-context](social-hub-openclaw-context) | DB 聚合上下文 |
106
- | [social-hub-accounts](social-hub-accounts) | 账号 |
107
- | [social-hub-posts](social-hub-posts) | Reddit |
106
+ | [social-hub-accounts](social-hub-accounts) | 账号 CRUD、browser-envs、personas |
107
+ | [social-hub-posts](social-hub-posts) | Reddit 帖快照 CRUD、batch-upsert |
108
108
  | [social-hub-calendar-jobs](social-hub-calendar-jobs) | 日历与任务 |
109
109
  | [social-hub-publishing](social-hub-publishing) | 发布闭环 |
110
- | [social-hub-admin](social-hub-admin) | 系统/团队管理 |
111
- | [social-hub-intelligence](social-hub-intelligence) | 板块情报 |
110
+ | [social-hub-events-observability](social-hub-events-observability) | events、dashboard、audit、reports |
111
+ | [social-hub-graph-compliance](social-hub-graph-compliance) | 图谱与合规风控 |
112
+ | [social-hub-admin](social-hub-admin) | 系统/团队管理、通知渠道 |
113
+ | [social-hub-intelligence](social-hub-intelligence) | 板块情报与 insights |
112
114
  | [social-hub-migration](social-hub-migration) | 导入导出与 replay |
113
115
 
114
116
  清单见 [manifest.json](manifest.json)。与 API/CLI 对齐情况见仓库 `docs/cli-api-coverage.md`。
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 1,
3
3
  "package": "social-ops-hub",
4
- "cliVersion": "0.0.12",
4
+ "cliVersion": "0.0.13",
5
5
  "repository": "social-ops-hub",
6
6
  "publish": {
7
7
  "registry": "https://skill.sh",
@@ -32,12 +32,12 @@
32
32
  {
33
33
  "id": "social-hub-accounts",
34
34
  "path": "social-hub-accounts",
35
- "description": "账号 CRUD、品牌绑定、状态快照"
35
+ "description": "账号 CRUD、品牌绑定、状态快照、browser-envs、personas"
36
36
  },
37
37
  {
38
38
  "id": "social-hub-posts",
39
39
  "path": "social-hub-posts",
40
- "description": "Reddit 帖快照、刷新、统计"
40
+ "description": "Reddit 帖快照 CRUD、刷新、batch-upsert"
41
41
  },
42
42
  {
43
43
  "id": "social-hub-calendar-jobs",
@@ -47,22 +47,32 @@
47
47
  {
48
48
  "id": "social-hub-publishing",
49
49
  "path": "social-hub-publishing",
50
- "description": "campaign 到 report 发布闭环"
50
+ "description": "brand/campaign/plan/draft 到 report 发布闭环"
51
+ },
52
+ {
53
+ "id": "social-hub-events-observability",
54
+ "path": "social-hub-events-observability",
55
+ "description": "events、dashboard、audit、reports"
56
+ },
57
+ {
58
+ "id": "social-hub-graph-compliance",
59
+ "path": "social-hub-graph-compliance",
60
+ "description": "graph v1/v2、sanctions、risk、rule-caches"
51
61
  },
52
62
  {
53
63
  "id": "social-hub-admin",
54
64
  "path": "social-hub-admin",
55
- "description": "settings、invites、members、api-keys"
65
+ "description": "settings、invites、members、api-keys、notification-channels"
56
66
  },
57
67
  {
58
68
  "id": "social-hub-intelligence",
59
69
  "path": "social-hub-intelligence",
60
- "description": "板块情报 watchlists、hot posts、industry pools"
70
+ "description": "watchlists、hot-posts、tier-rules、runs、insights"
61
71
  },
62
72
  {
63
73
  "id": "social-hub-migration",
64
74
  "path": "social-hub-migration",
65
- "description": "JSONL 导入导出、runbook replay"
75
+ "description": "JSONL 导入导出、runbook replay、openclaw-ingest"
66
76
  }
67
77
  ]
68
78
  }
@@ -1,30 +1,63 @@
1
1
  ---
2
2
  name: social-hub-accounts
3
3
  description: >-
4
- Social Hub 社交账号:social-hub accounts list/get/create/update/delete、brand-bindings、status-snapshots。
5
- 用户要查 Reddit 账号、改 handle、绑品牌、看账号状态快照、同步飞书账号字段时用本 skill。
4
+ Social Hub 社交账号:social-hub accounts list/get/create/update/delete、
5
+ brand-bindings、status-snapshots、browser-envs、personas。用户要查 Reddit 账号、
6
+ 改 handle、绑品牌、看账号状态快照、管理浏览器环境或人设时用本 skill。
6
7
  metadata:
7
- cliVersion: ">=0.0.6"
8
+ cliVersion: ">=0.0.12"
8
9
  ---
9
10
 
10
11
  # social-hub-accounts
11
12
 
12
13
  > **前置条件:** 先阅读 [`../social-hub-shared/SKILL.md`](../social-hub-shared/SKILL.md),
13
- > 确认已通过 `social-hub auth login` 授权,并已 `social-hub context use <team-id>`。
14
- > 命令使用 `-t <team-id>`(来自 `social-hub context current`);不要用环境变量传 API key。
14
+ > 确认已 `auth login` `context use <team-id>`。
15
+
16
+ ## 职责边界
17
+
18
+ | 做 | 不做 |
19
+ |---|---|
20
+ | Hub 内社交账号 CRUD、品牌绑定、状态快照 | 从飞书通讯录同步账号字段(那是外部 ETL 流程) |
21
+ | 浏览器环境、人设 markdown 管理 | 解析 agent 工作区 `account-profiles/*.md` |
22
+
23
+ OpenClaw 执行前优先 `social-hub context account`(见 `social-hub-openclaw-context`)。
24
+
25
+ ## 账号 CRUD
15
26
 
16
27
  ```bash
17
- social-hub accounts list -t <team-id> -n 50
28
+ social-hub accounts list -t <team-id> -n 50 [--status active]
18
29
  social-hub accounts get -t <team-id> --account <uuid>
19
- social-hub accounts create -t <team-id> -j '{"platform":"reddit","handle":"u/example",...}'
20
- social-hub accounts update -t <team-id> --account <uuid> -j '{"workflowStage":"active",...}'
21
- social-hub accounts delete -t <team-id> --account <uuid> # 危险:需确认用户意图
30
+ social-hub accounts create -t <team-id> -j '{"platform":"reddit","handle":"u/example","credentialsRef":"vault:team/main"}'
31
+ social-hub accounts update -t <team-id> --account <uuid> -j '{"workflowStage":"active","karma":1200}'
32
+ social-hub accounts delete -t <team-id> --account <uuid> --dry-run
33
+ social-hub accounts delete -t <team-id> --account <uuid> # 危险
34
+ ```
22
35
 
36
+ ## 品牌绑定
37
+
38
+ ```bash
23
39
  social-hub accounts brand-bindings list -t <team-id> --account <uuid>
24
- social-hub accounts brand-bindings add -t <team-id> --account <uuid> -j '{"brandId":"..."}'
25
- social-hub accounts brand-bindings remove -t <team-id> --account <uuid> --brand <brandId>
40
+ social-hub accounts brand-bindings add -t <team-id> --account <uuid> --brand <brand-uuid>
41
+ social-hub accounts brand-bindings remove -t <team-id> --account <uuid> --brand <brand-uuid>
42
+ ```
43
+
44
+ ## 状态快照
26
45
 
27
- social-hub accounts status-snapshots list -t <team-id> --account <uuid>
46
+ ```bash
47
+ social-hub accounts status-snapshots -t <team-id> --account <uuid> [-n 20]
48
+ ```
49
+
50
+ ## 浏览器环境
51
+
52
+ ```bash
53
+ social-hub accounts browser-envs list-team -t <team-id>
54
+ social-hub accounts browser-envs list -t <team-id> --account <uuid>
55
+ social-hub accounts browser-envs create -t <team-id> --account <uuid> -j '{"label":"prod","profilePath":"..."}'
28
56
  ```
29
57
 
30
- OpenClaw 执行前优先 `social-hub context account`(见 `social-hub-openclaw-context`),不要只读本地 `account-profiles/*.md`。
58
+ ## 人设(Persona)
59
+
60
+ ```bash
61
+ social-hub accounts personas list -t <team-id> --account <uuid>
62
+ social-hub accounts personas create -t <team-id> --account <uuid> -j '{"markdown":"# Persona\n..."}'
63
+ ```
@@ -1,17 +1,17 @@
1
1
  ---
2
2
  name: social-hub-admin
3
3
  description: >-
4
- Social Hub 管理面:settings、invites、members、agent-teams、users
5
- 用户要改系统设置、发团队邀请、列成员、管理团队结构时用本 skill;高风险写操作需 --apply。
6
- API Key 的创建/轮换属于管理员资源管理,不是 CLI 日常登录方式(见 social-hub-shared)。
4
+ Social Hub 管理面:settings、invites、members、agent-teams、users、notification-channels、
5
+ api-keys、permissions。用户要改系统设置、发团队邀请、列成员、管理团队结构或通知渠道时用本 skill
6
+ 高风险写操作需 --apply。API Key 创建/轮换是管理员资源,不是 CLI 日常登录方式。
7
7
  metadata:
8
- cliVersion: ">=0.0.6"
8
+ cliVersion: ">=0.0.12"
9
9
  ---
10
10
 
11
11
  # social-hub-admin
12
12
 
13
13
  > **前置条件:** 先阅读 [`../social-hub-shared/SKILL.md`](../social-hub-shared/SKILL.md),
14
- > 确认已 `auth login` 且 role 满足操作要求(多数管理命令需 admin 或 manager)。
14
+ > 确认已 `auth login` 且 role 满足操作要求。
15
15
 
16
16
  ## Settings(admin)
17
17
 
@@ -20,14 +20,15 @@ social-hub settings list
20
20
  social-hub settings get <key>
21
21
  social-hub settings set <key> --value "..." --dry-run
22
22
  social-hub settings set <key> --value "..." --apply
23
+ social-hub settings batch-set -j '{"settings":[{"key":"post_refresh_cron","value":"0 */6 * * *"}]}' --apply
23
24
  ```
24
25
 
25
26
  ## Invites
26
27
 
27
28
  ```bash
28
- social-hub invites list -t <team-id>
29
- social-hub invites create -t <team-id> --email user@example.com --role manager --dry-run
29
+ social-hub invites list -t <team-id> [--status pending]
30
30
  social-hub invites create -t <team-id> --email user@example.com --role manager --apply
31
+ social-hub invites create -t <team-id> --email client@example.com --role client --brand <brand-uuid> --apply
31
32
  social-hub invites revoke -t <team-id> --id <inviteId> --apply
32
33
  ```
33
34
 
@@ -35,9 +36,74 @@ social-hub invites revoke -t <team-id> --id <inviteId> --apply
35
36
 
36
37
  ```bash
37
38
  social-hub members list
39
+ social-hub members system-teams
40
+ social-hub members update-role --user <userId> --role manager --apply
41
+ social-hub members remove --user <userId> --apply
42
+ social-hub members teams-list --user <userId>
43
+ social-hub members teams-add --user <userId> -t <team-id> --role internal --apply
44
+ social-hub members teams-remove --user <userId> -t <team-id> --apply
45
+ social-hub members team-list -t <team-id>
46
+ social-hub members team-update-role -t <team-id> --user <userId> --role supervisor --apply
47
+ social-hub members team-remove -t <team-id> --user <userId> --apply
38
48
  ```
39
49
 
40
- ## 团队 / 用户 / API Key(管理员)
50
+ ## Users
41
51
 
42
- - **团队与用户**:`agent-teams`、`users` 命令见 `social-hub-cli` 管理章节。
43
- - **API Key**(`social-hub api-keys *`):仅用于集成/服务端密钥管理;**Agent 日常操作仍用 Device Code**,不要把新建 API Key 当作 CLI 登录步骤。
52
+ ```bash
53
+ social-hub users system-list
54
+ social-hub users system-create -j '{"email":"ops@example.com","name":"Ops","password":"..."}' --apply
55
+ social-hub users list -t <team-id>
56
+ social-hub users create -t <team-id> -j '{"email":"ops@example.com","password":"...","role":"manager"}'
57
+ ```
58
+
59
+ `users system-create` 创建系统用户;`users create` 将用户加入 team;`agent-teams add-member` 调整 team 成员关系。
60
+
61
+ ## Brand members
62
+
63
+ ```bash
64
+ social-hub brand-members system-list [--user <userId>]
65
+ social-hub brand-members system-create -j '{"brandId":"<uuid>","userId":"<uuid>","role":"client"}' --apply
66
+ social-hub brand-members system-remove --id <memberId> --apply
67
+ social-hub brand-members list -t <team-id>
68
+ social-hub brand-members create -t <team-id> -j '{"brandId":"<uuid>","userId":"<uuid>"}' --apply
69
+ social-hub brand-members remove -t <team-id> -m <memberId> --apply
70
+ ```
71
+
72
+ ## Agent teams
73
+
74
+ ```bash
75
+ social-hub agent-teams list
76
+ social-hub agent-teams create --slug my-team --name "My Agent Team" --apply
77
+ social-hub agent-teams update -t <team-id> -j '{"name":"New Name"}' --apply
78
+ social-hub agent-teams add-member -t <team-id> --user <userId> --role manager --apply
79
+ social-hub agent-teams workspace-docs -t <team-id> # 只读:Hub 内工作区文档索引
80
+ ```
81
+
82
+ ## 通知渠道
83
+
84
+ ```bash
85
+ social-hub notification-channels list -t <team-id>
86
+ social-hub notification-channels create -t <team-id> -j '{"provider":"feishu","externalId":"https://..."}'
87
+ social-hub notification-channels update -t <team-id> --id <uuid> -j '{"enabled":true}'
88
+ social-hub notification-channels delete -t <team-id> --id <uuid>
89
+ social-hub notification-channels test -t <team-id> --id <uuid>
90
+ ```
91
+
92
+ `provider: "feishu"` 是 CLI 支持的 provider 枚举,不是飞书数据同步流程。
93
+
94
+ ## API Key 与权限矩阵
95
+
96
+ ```bash
97
+ social-hub api-keys list -t <team-id>
98
+ social-hub api-keys create -t <team-id> -j '{"name":"integration","role":"manager"}' --apply
99
+ social-hub api-keys delete -t <team-id> --key <uuid> --apply
100
+ social-hub api-keys rotate -t <team-id> --key <uuid> --apply
101
+ social-hub api-keys batch-revoke -t <team-id> -j '{"apiKeyIds":["uuid1"]}' --apply
102
+ social-hub api-keys batch-rotate -t <team-id> -j '{"apiKeyIds":["uuid1"]}' --apply
103
+
104
+ social-hub permissions matrix -t <team-id>
105
+ social-hub permissions-update -t <team-id> -j '{...}'
106
+ ```
107
+
108
+ - **API Key**:集成/服务端密钥管理;Agent 日常仍用 Device Code(见 `social-hub-shared`)
109
+ - admin 写操作建议先 `--dry-run` 再 `--apply`
@@ -1,34 +1,50 @@
1
1
  ---
2
2
  name: social-hub-calendar-jobs
3
3
  description: >-
4
- 发布日历与调度任务:social-hub calendar list、jobs list/create/batch/retry/cancel。
5
- 用户要排期、查 scheduled job、重试失败任务、取消任务时用本 skill;Agent 执行态回填优先 ops-runtime。
4
+ 发布日历与调度任务:social-hub calendar list/patch/list-full、jobs list/create/batch/
5
+ summary/retry/cancel/list-full。用户要排期、查 scheduled job、重试失败任务、取消任务时用本 skill;
6
+ Agent 执行态回填优先 ops-runtime。
6
7
  metadata:
7
- cliVersion: ">=0.0.6"
8
+ cliVersion: ">=0.0.12"
8
9
  ---
9
10
 
10
11
  # social-hub-calendar-jobs
11
12
 
12
13
  > **前置条件:** 先阅读 [`../social-hub-shared/SKILL.md`](../social-hub-shared/SKILL.md),
13
- > 确认已 auth login 并选定 team(`context use`)。下文 `-t <team-id>` 来自 `context current`。
14
+ > 确认已 `auth login` `context use <team-id>`。
15
+
16
+ ## 日历
14
17
 
15
18
  ```bash
16
- social-hub calendar list -t <team-id>
19
+ social-hub calendar list -t <team-id> [--status scheduled]
17
20
  social-hub calendar list-full -t <team-id> --account <accountId> --status scheduled
18
21
  social-hub calendar patch -t <team-id> -e <entryId> --body '{"status":"succeeded","permalink":"..."}'
22
+ ```
19
23
 
20
- social-hub jobs list -t <team-id> --status scheduled
21
- social-hub jobs list-full -t <team-id> --account <accountId>
24
+ ## 调度任务
25
+
26
+ ```bash
27
+ social-hub jobs list -t <team-id> [--status scheduled]
28
+ social-hub jobs list-full -t <team-id> --account <accountId> --status scheduled
29
+ social-hub jobs summary -t <team-id>
22
30
  social-hub jobs create -t <team-id> -j '{"socialAccountId":"...","action":"engage","subreddit":"...","runAt":"..."}'
31
+ social-hub jobs batch -t <team-id> -j '{"items":[...]}'
23
32
  social-hub jobs retry -t <team-id> -i <jobId>
24
33
  social-hub jobs cancel -t <team-id> -i <jobId>
25
34
  ```
26
35
 
27
- OpenClaw / Agent 运行时优先:
36
+ ## OpenClaw / Agent 运行时
37
+
38
+ 优先 ops 链路(见 `social-hub-ops-runtime`):
28
39
 
29
40
  ```bash
30
- social-hub ops claim-next -t <team-id> --agent <agentId>
41
+ social-hub ops claim-next -t <team-id> --agent <agent-id>
31
42
  social-hub ops heartbeat|complete|fail|skip ...
32
43
  ```
33
44
 
34
- `social-hub-ops-runtime`。遗留 `jobs agent-status` 仅在未接 ops 链路时使用。
45
+ 遗留 `jobs agent-status` 仅在未接 ops 链路时使用。
46
+
47
+ ## 与 publishing 的关系
48
+
49
+ - `plans create` 生成 calendar entries(见 `social-hub-publishing`)
50
+ - `ops complete` 原子更新 job + calendar;手动 `calendar patch` 仅在没有 ops job 时使用
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: social-hub-cli
3
3
  description: >-
4
- Social Ops Hub 命令行 social-hub:账号、事件、日历、调度任务、Reddit 帖、报告、OpenClaw 回填等。
5
- 只要用户提到 social-hub、Social Ops Hub、Hub 写数据、查账号、发帖计划、permalink 回填、openclaw、
6
- 调度任务、互动事件,或要在 Hub 里查/改运营数据,就应使用本 skill(即使用户没说 CLI)。
7
- 先读本 skill 做路由;执行任何命令前必须先读 social-hub-shared 完成 auth login 与 context。
4
+ Social Ops Hub 命令行总路由:social-hub 安装、健康检查、领域 skill 索引。
5
+ 只要用户提到 social-hub、Social Ops Hub、Hub 写数据、查账号、发帖计划、permalink 回填、
6
+ openclaw、调度任务、互动事件,或要在 Hub 里查/改运营数据,就应使用本 skill 做路由。
7
+ 执行任何命令前必须先读 social-hub-shared 完成 auth login 与 context。
8
8
  metadata:
9
- cliVersion: ">=0.0.6"
9
+ cliVersion: ">=0.0.12"
10
10
  homepage: https://github.com/geoly-ai/geoly-reddit/tree/main/social-ops-hub/skills
11
11
  ---
12
12
 
@@ -16,9 +16,8 @@ metadata:
16
16
 
17
17
  > **前置条件:** 执行 Hub 命令前 MUST 先读 [`../social-hub-shared/SKILL.md`](../social-hub-shared/SKILL.md),
18
18
  > 完成 `social-hub auth login`(Device Code)并 `social-hub context use <team-id>`。
19
- > 日常**不要**使用 `SOCIAL_HUB_API_KEY` / `SOCIAL_HUB_API_URL` 环境变量。
20
19
 
21
- ## 快速开始(生产)
20
+ ## 快速开始
22
21
 
23
22
  ```bash
24
23
  social-hub auth login --api-url https://reddit.eclick-geo.com/api
@@ -26,212 +25,57 @@ social-hub auth whoami
26
25
  social-hub context use <team-uuid>
27
26
  social-hub doctor
28
27
  social-hub health
28
+ social-hub version --json
29
29
  ```
30
30
 
31
- 生产 API 基址:**`https://reddit.eclick-geo.com/api`**。下文示例中 `<team-id>` 指当前 context 的 team UUID。
32
-
33
- ## 安装 CLI 与 Skill
34
-
35
- ```bash
36
- npm install -g @geoly-ai/social-hub-cli@latest
37
- social-hub version
38
- ```
39
-
40
- 安装 Agent Skills:
41
-
42
- - **交互式(推荐,默认)**:`social-hub skills install` 或 `social-hub skills install <skillId>`(TTY 下打开 TUI,CLI 参数会预填 agent/skill/scope)
43
- - **Cursor 全局(脚本)**:`social-hub skills install --agent cursor --global --yes`
44
- - **单 skill 脚本化**:`social-hub skills install social-hub-cli --agent cursor --global --yes`
45
- - **更新已装 skills**:`social-hub skills update --agent cursor --global --yes`
46
- - **所有已检测 agent 目录(显式 opt-in)**:`social-hub skills install --agent '*' --global --yes`
47
- - **免全局安装**:`npx @geoly-ai/social-hub-cli skills bootstrap`
48
- - **GitHub 最新**:`social-hub skills install --source github --repo geoly-ai/geoly-reddit --agent cursor --global --yes`
49
- - **检查状态**:`social-hub skills doctor`
50
-
51
31
  ## 领域 Skill 路由
52
32
 
53
33
  | 场景 | Skill |
54
34
  |------|--------|
55
- | 鉴权 / config / doctor / context | **`social-hub-shared`**(必读) |
35
+ | 鉴权 / config / doctor / context list·use·current | **`social-hub-shared`**(必读) |
56
36
  | OpenClaw 领任务 / 回填 | `social-hub-ops-runtime` |
57
37
  | 账号/任务上下文(DB) | `social-hub-openclaw-context` |
58
- | 账号 CRUD | `social-hub-accounts` |
59
- | Reddit | `social-hub-posts` |
60
- | 日历 / jobs | `social-hub-calendar-jobs` |
61
- | 发布闭环 | `social-hub-publishing` |
62
- | settings / invites / 成员 | `social-hub-admin` |
63
- | 情报 | `social-hub-intelligence` |
64
- | 导入导出 replay | `social-hub-migration` |
38
+ | 社交账号 CRUD / browser-envs / personas | `social-hub-accounts` |
39
+ | Reddit 帖快照 CRUD / batch-upsert | `social-hub-posts` |
40
+ | 日历 / scheduled jobs | `social-hub-calendar-jobs` |
41
+ | 发布闭环(brand→report) | `social-hub-publishing` |
42
+ | 事件 / dashboard / audit / reports | `social-hub-events-observability` |
43
+ | 图谱 / 合规 / 风控 | `social-hub-graph-compliance` |
44
+ | settings / invites / members / api-keys | `social-hub-admin` |
45
+ | 板块情报 / KOL / insights | `social-hub-intelligence` |
46
+ | 导入导出 / runbook / openclaw-ingest | `social-hub-migration` |
47
+
48
+ 命中上表场景时,**打开对应领域 skill**;不要在总路由里重复展开领域命令细节。
65
49
 
66
- 命中上表场景时,打开对应领域 skill,**不要**只在总览里硬写命令而跳过子 skill。
50
+ ## 安装 CLI 与 Skill
67
51
 
68
- ## 同仓开发 Build
52
+ ```bash
53
+ npm install -g @geoly-ai/social-hub-cli@latest
54
+ social-hub skills install --agent cursor --global --yes
55
+ social-hub skills update --agent cursor --global --yes
56
+ social-hub skills doctor
57
+ ```
69
58
 
70
- **social-ops-hub monorepo** 内改 CLI/SDK 后:
59
+ ## 同仓开发 Build
71
60
 
72
61
  ```bash
73
62
  pnpm --filter @geoly-ai/social-hub-sdk run build
74
63
  pnpm --filter @geoly-ai/social-hub-cli run build
64
+ pnpm --filter @geoly-ai/social-hub-cli test
75
65
  ```
76
66
 
77
- ## 本地 API 冷启动(仅开发)
78
-
79
- 部署/seed 细节见仓库文档;CLI 侧只需改 API 地址并重新 login:
67
+ ## 本地 API(仅开发)
80
68
 
81
69
  ```bash
82
- cp .env.example .env # 填写 DATABASE_URL、REDIS_URL 等
83
- pnpm run db:migrate
84
- SOCIAL_OPS_SEED_MODE=minimal-admin pnpm run db:seed
85
- pnpm dev
86
70
  social-hub auth login --api-url http://localhost:3000
87
- social-hub context use <seed 输出的 team uuid>
88
- social-hub health
89
- ```
90
-
91
- 创建新 team、用户等业务初始化:在 **已 auth login 且 role 足够** 的前提下执行下方「团队与用户管理」命令;**不要**再 export API Key。
92
-
93
- ### 业务数据初始化示例
94
-
95
- ```bash
96
- # 创建品牌 → campaign → 账号 → 计划(<team-id> 来自 context current)
97
- BRAND_ID=$(social-hub brands create -t <team-id> -j '{"name":"My Brand","slug":"my-brand"}' | jq -r '.id')
98
- CAMP_ID=$(social-hub campaigns create -t <team-id> -j "{\"brandId\":\"$BRAND_ID\",\"name\":\"2026 Q3 Launch\"}" | jq -r '.id')
99
- ACCOUNT_ID=$(social-hub accounts create -t <team-id> -j '{"platform":"reddit","handle":"u/my_ops_account","credentialsRef":"vault:javis/main"}' | jq -r '.id')
100
- DRAFT_ID=$(social-hub drafts create -t <team-id> -j "{\"campaignId\":\"$CAMP_ID\",\"title\":\"Launch Post\",\"body\":\"...\"}" | jq -r '.id')
101
- social-hub plans create -t <team-id> -j "{\"campaignId\":\"$CAMP_ID\",\"name\":\"Q3 Week 1\",\"entries\":[{\"socialAccountId\":\"$ACCOUNT_ID\",\"subreddit\":\"LocalLLaMA\",\"plannedAt\":\"2026-07-01T09:00:00Z\",\"contentDraftId\":\"$DRAFT_ID\"}]}"
102
- social-hub calendar list -t <team-id> --status scheduled
103
- social-hub jobs list -t <team-id> --status scheduled
104
- ```
105
-
106
- ---
107
-
108
- ## 命令速查表
109
-
110
- 以下 `-t <team-id>` 可换为 `social-hub context current` 中的 `currentTeamId`。
111
-
112
- ### health & dashboard
113
-
114
- ```bash
115
- social-hub health
116
- social-hub dashboard summary -t <team-id>
117
- ```
118
-
119
- ### 互动事件
120
-
121
- ```bash
122
- social-hub events append -t <team-id> --type comment --payload '{"permalink":"https://..."}'
123
- social-hub events list -t <team-id> -n 20
124
- social-hub events list-full -t <team-id> --account <uuid>
125
- social-hub events export-csv -t <team-id> > events.csv
126
- ```
127
-
128
- ### 发布日历
129
-
130
- ```bash
131
- social-hub calendar list -t <team-id> --status scheduled
132
- social-hub calendar list-full -t <team-id> --account <accountId> --status scheduled
133
- social-hub calendar patch -t <team-id> -e <entryId> --body '{"status":"succeeded","permalink":"https://..."}'
134
- ```
135
-
136
- ### 调度任务
137
-
138
- ```bash
139
- social-hub jobs list -t <team-id> --status scheduled
140
- social-hub jobs create -t <team-id> -j '{"socialAccountId":"<uuid>","action":"engage","subreddit":"LocalLLaMA","runAt":"2026-05-07T09:00:00Z"}'
141
- social-hub jobs retry -t <team-id> -i <jobId>
142
- social-hub jobs cancel -t <team-id> -i <jobId>
71
+ social-hub context use <seed-team-uuid>
143
72
  ```
144
73
 
145
- OpenClaw 执行态优先 `social-hub ops *`(见 `social-hub-ops-runtime`);`jobs agent-status` 为遗留路径。
146
-
147
- ### 发布计划 / 草稿 / 报告
148
-
149
- ```bash
150
- social-hub plans list -t <team-id>
151
- social-hub plans create -t <team-id> -j '{"campaignId":"<uuid>","name":"Q3 Week1","entries":[...]}'
152
- social-hub drafts list -t <team-id> -n 20
153
- social-hub reports list -t <team-id> -n 20
154
- ```
155
-
156
- ### 账号 / 品牌 / Campaign
157
-
158
- ```bash
159
- social-hub accounts list -t <team-id> --status active
160
- social-hub accounts get -t <team-id> --account <uuid>
161
- social-hub brands list -t <team-id>
162
- social-hub campaigns list -t <team-id> --brand <brandId>
163
- ```
164
-
165
- ### 板块情报
166
-
167
- ```bash
168
- social-hub intelligence hot-posts -t <team-id> --subreddit LocalLLaMA --sort score -n 50
169
- social-hub intelligence dispatch -t <team-id> -j '{"hotPostId":"<uuid>","socialAccountId":"<uuid>","action":"engage"}'
170
- social-hub intelligence watchlists-list -t <team-id>
171
- ```
172
-
173
- ### 团队与用户管理
174
-
175
- ```bash
176
- social-hub agent-teams list
177
- social-hub agent-teams create --slug javis --name "Javis Agent Team" # admin only
178
- social-hub users list -t <team-id>
179
- social-hub users create -t <team-id> -j '{"email":"ops@example.com","password":"...","role":"manager"}'
180
- ```
181
-
182
- ### 通知渠道
183
-
184
- ```bash
185
- social-hub notification-channels list -t <team-id>
186
- social-hub notification-channels create -t <team-id> -j '{"provider":"feishu","externalId":"https://..."}'
187
- ```
188
-
189
- ### API Key 管理(管理员资源,非 CLI 登录方式)
190
-
191
- ```bash
192
- social-hub api-keys list -t <team-id>
193
- social-hub api-keys create -t <team-id> -j '{"name":"integration","role":"manager"}'
194
- ```
195
-
196
- ---
197
-
198
- ## 典型工作流
199
-
200
- ### Agent 执行完成后回填
201
-
202
- 优先 `social-hub ops complete --permalink ...`(见 `social-hub-ops-runtime`)。手动 patch 示例:
203
-
204
- ```bash
205
- social-hub calendar patch -t <team-id> -e <entryId> \
206
- --body '{"status":"succeeded","permalink":"https://www.reddit.com/r/.../..."}'
207
- social-hub events append -t <team-id> --type post.published \
208
- --payload '{"permalink":"...","calendarEntryId":"<entryId>"}'
209
- ```
210
-
211
- ### 查看账号运营数据
212
-
213
- ```bash
214
- social-hub accounts get -t <team-id> --account <accountId>
215
- social-hub events list-full -t <team-id> --account <accountId> -n 20
216
- social-hub jobs list-full -t <team-id> --account <accountId> --status scheduled
217
- social-hub compliance risk-get -t <team-id> -a <accountId>
218
- ```
219
-
220
- ### 情报热帖派发
221
-
222
- ```bash
223
- social-hub intelligence hot-posts -t <team-id> --sort score -n 10
224
- social-hub accounts list -t <team-id> --status active
225
- social-hub intelligence dispatch -t <team-id> -j '{"hotPostId":"...","socialAccountId":"...","action":"engage","runAt":"..."}'
226
- social-hub jobs list -t <team-id> --status scheduled -n 5
227
- ```
228
-
229
- ---
74
+ 业务初始化(创建 brand/campaign/account)见 `social-hub-publishing` `social-hub-admin`。
230
75
 
231
76
  ## 注意事项
232
77
 
233
- - 命令输出多为 **JSON**,可管道 `jq`。
234
- - `DELETE` / cancel 成功时可能返回 204,CLI 打印 `OK`。
235
- - `events export-csv`、`intelligence hot-posts-export` 输出 CSV stdout。
236
- - 团队管理(`agent-teams create` 等)需要 **admin** role 的 CLI token。
237
- - CLI 凭证来自 **Device Code**(`auth login`),不是 Web Session Cookie,也不是日常手动创建的 API Key。
78
+ - 命令输出多为 **JSON**,可管道 `jq`
79
+ - `events export-csv`、`intelligence hot-posts-export` 输出 CSV stdout
80
+ - CLI 凭证来自 **Device Code**,不是 Web Session Cookie,也不是日常手动创建的 API Key
81
+ - 覆盖矩阵见仓库 `docs/cli-api-coverage.md`
@@ -3,20 +3,20 @@
3
3
  "evals": [
4
4
  {
5
5
  "id": 0,
6
- "prompt": "我要连生产 Social Ops Hub(https://reddit.eclick-geo.com/api),用 social-hub 登录并确认当前身份和 team,然后在 Hub 里注册一个新团队 javis(slug 也是 javis),给这个团队添加管理员用户 ops@javis.local,密码 Javis2026!,最后确认团队列表里有 javis。不要用 SOCIAL_HUB_API_KEY 环境变量。",
7
- "expected_output": "先读 social-hub-shared:auth login --api-url 生产地址、auth whoami、context use;再读 social-hub-cli/admin:agent-teams create、users create、agent-teams list;全程 Device Code 凭证,不 export API key",
6
+ "prompt": "我要连生产 Social Ops Hub(https://reddit.eclick-geo.com/api),用 social-hub 登录并确认当前身份和 team,然后在 Hub 里注册一个新团队 my-ops-team(slug 也是 my-ops-team),给这个团队添加管理员用户 ops@example.com,最后确认团队列表里有 my-ops-team。不要用 SOCIAL_HUB_API_KEY 环境变量。",
7
+ "expected_output": "先读 social-hub-shared:auth loginauth whoami、context use;再读 social-hub-admin:agent-teams create、users system-create 或 agent-teams add-member、agent-teams list;全程 Device Code 凭证",
8
8
  "assertions": []
9
9
  },
10
10
  {
11
11
  "id": 1,
12
12
  "prompt": "Reddit 账号 u/example_user 刚在 r/LocalLLaMA 发帖,permalink 是 https://www.reddit.com/r/LocalLLaMA/comments/abc123/test_post/,日历条目 def456-uuid。我已在生产 Hub auth login 并 context use 了 team。帮我把日历标 succeeded、写 post.published 事件,并查该账号最近事件。优先 ops complete,若需手动则 calendar patch + events append。",
13
- "expected_output": "确认已 auth/context;执行 ops complete calendar patch + events append + events list-full;不要求设置 SOCIAL_HUB_API_KEY",
13
+ "expected_output": "路由 social-hub-ops-runtimesocial-hub-events-observability + social-hub-calendar-jobs;不要求 SOCIAL_HUB_API_KEY",
14
14
  "assertions": []
15
15
  },
16
16
  {
17
17
  "id": 2,
18
18
  "prompt": "查生产 Hub 里 r/Entrepreneur 按 score 前 5 热帖,给账号 ghi789-uuid 派发 engage 任务,runAt 2026-05-07T01:00:00Z,并确认 jobs 列表有新任务。我已 social-hub auth login 到 reddit.eclick-geo.com。",
19
- "expected_output": "路由 social-hub-intelligence:hot-posts、dispatch;social-hub-calendar-jobs:jobs list;使用 -t team-id 来自 context,不用 localhost 或 API key env",
19
+ "expected_output": "路由 social-hub-intelligence:hot-posts、dispatch;social-hub-calendar-jobs:jobs list",
20
20
  "assertions": []
21
21
  }
22
22
  ]