@thinkingai/ae-cli 6.0.47 → 6.0.48-workbuddy

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 (84) hide show
  1. package/README.md +93 -36
  2. package/README.zh.md +93 -36
  3. package/assets/workbuddy-host-page/thinkingai.png +0 -0
  4. package/assets/workbuddy-host-page/workbuddy.png +0 -0
  5. package/bin/ae-cli-workbuddy.js +7 -0
  6. package/dist/auth-HJG2L6DR.js +910 -0
  7. package/dist/{capability-RUSV77CO.js → capability-JHYVQNQ4.js} +47 -34
  8. package/dist/chunk-2BDQB42E.js +15 -0
  9. package/dist/{chunk-GJXRF7Y6.js → chunk-6MXFJVNP.js} +47 -78
  10. package/dist/chunk-6ZIQV5GW.js +26 -0
  11. package/dist/{chunk-KZ6ZHF5J.js → chunk-ARTIHWVD.js} +27 -25
  12. package/dist/{chunk-6QK7SYYY.js → chunk-DU5MZQFQ.js} +29 -37
  13. package/dist/{chunk-BVDST5YT.js → chunk-JFOGWBAT.js} +8 -8
  14. package/dist/{chunk-JYMGHGCE.js → chunk-KSQGGXGA.js} +24 -13
  15. package/dist/{chunk-FR2EDAQM.js → chunk-NXRKDG6E.js} +89 -3
  16. package/dist/{chunk-NSIVXKJH.js → chunk-QSO4SA6C.js} +5 -5
  17. package/dist/{chunk-QL6R6TSK.js → chunk-QYJ252CT.js} +6 -5
  18. package/dist/{chunk-B5HMQAOM.js → chunk-UL6SJDYE.js} +1 -1
  19. package/dist/chunk-Y3S2KNNR.js +623 -0
  20. package/dist/{chunk-KEWVSO64.js → chunk-ZCM47ROU.js} +5 -16
  21. package/dist/{community-report-client-6OL6GBQW.js → community-report-client-QE4RC2XG.js} +2 -4
  22. package/dist/{config-XNMACCKX.js → config-XMRP5NDA.js} +8 -9
  23. package/dist/{data-integration-4NZGZ45E.js → data-integration-SGRITHJS.js} +19 -18
  24. package/dist/index.js +53 -80
  25. package/dist/{local-data-upload-client-EFHDLXFG.js → local-data-upload-client-LMVS7YAR.js} +2 -4
  26. package/dist/{memory-HBJQ2GC5.js → memory-5ZC73XBC.js} +4 -6
  27. package/dist/{metadata-PGDJE5RQ.js → metadata-LBX6O24P.js} +7 -9
  28. package/dist/{model-BHLJ2QMT.js → model-CRDIVYN5.js} +4 -6
  29. package/dist/{personal-semantic-preference-E5NZ56DN.js → personal-semantic-preference-7FVUTJZF.js} +6 -8
  30. package/dist/{sync-MUWPRM5I.js → sync-VVNDHU7R.js} +9 -11
  31. package/dist/{te-agent-WQZTMEK4.js → te-agent-4T5TFHD6.js} +393 -90
  32. package/dist/{te-analysis-YWCSSLYL.js → te-analysis-TPYFOIFD.js} +97 -31
  33. package/dist/{te-community-BNE6KREL.js → te-community-PWOTHSEC.js} +9 -32
  34. package/dist/{te-dataops-TXLKM2W6.js → te-dataops-ZJV5QVJU.js} +19 -20
  35. package/dist/{te-engage-VEW4CJHK.js → te-engage-WVHBZAXH.js} +11 -13
  36. package/dist/{te-kb-BUD6N3NI.js → te-kb-PNM2ZKBP.js} +595 -85
  37. package/dist/{te-system-44LZJDTQ.js → te-system-MRCMLAWW.js} +6 -8
  38. package/dist/{te-team-XMP47YXE.js → te-team-Y36TG6AQ.js} +6 -8
  39. package/dist/{update-UODFOZ4P.js → update-UNKCZ5U5.js} +7 -8
  40. package/package.json +15 -10
  41. package/skills/ae-agent/SKILL.md +30 -13
  42. package/skills/ae-agent/references/agent-distribution.md +94 -0
  43. package/skills/ae-agent/references/approval-request.md +4 -0
  44. package/skills/ae-agent/references/command_index.md +9 -2
  45. package/skills/ae-agent/references/create-automation.md +20 -2
  46. package/skills/ae-agent/references/get-agent-context.md +70 -0
  47. package/skills/ae-agent/references/list-automations.md +18 -3
  48. package/skills/ae-agent/references/list-mcp-credentials.md +1 -1
  49. package/skills/ae-agent/references/mcp-token.md +3 -3
  50. package/skills/ae-agent/references/set-mcp-credential.md +0 -1
  51. package/skills/ae-agent/references/update-automation.md +18 -0
  52. package/skills/ae-analysis/SKILL.md +11 -2
  53. package/skills/ae-analysis/references/adhoc_run.md +2 -0
  54. package/skills/ae-analysis/references/ai_models.md +23 -3
  55. package/skills/ae-analysis/references/analysis_gateway_assets.md +2 -2
  56. package/skills/ae-analysis/references/command_index.md +7 -7
  57. package/skills/ae-analysis/references/cross_source_config.md +84 -0
  58. package/skills/ae-analysis/references/dashboard_update.md +1 -1
  59. package/skills/ae-analysis/references/user_tag_create.md +23 -1
  60. package/skills/ae-analysis/references/user_tag_models.md +9 -1
  61. package/skills/ae-analysis/references/user_tag_update.md +14 -2
  62. package/skills/ae-data-integration/SKILL.md +2 -1
  63. package/skills/ae-data-integration/references/dimension-routing.md +36 -0
  64. package/skills/ae-data-integration/references/local-analysis.md +2 -0
  65. package/skills/ae-data-integration/references/source-inspect.md +1 -1
  66. package/skills/ae-data-integration/references/tracking-plan.md +1 -1
  67. package/skills/ae-data-integration/references/transform.md +1 -1
  68. package/skills/ae-data-integration/references/ue-mapping.md +5 -2
  69. package/skills/ae-data-integration/references/ue-routing.md +17 -1
  70. package/skills/ae-generate-tracking-plan/SKILL.md +25 -13
  71. package/skills/ae-generate-tracking-plan/references/business-dimension-mapping.md +1 -1
  72. package/skills/ae-kb/SKILL.md +107 -36
  73. package/skills/ae-kb/references/query-workflow.md +59 -29
  74. package/skills/ae-kb/references/versions.md +46 -0
  75. package/skills/ae-system/SKILL.md +1 -1
  76. package/skills/ae-use-agent/SKILL.md +42 -0
  77. package/skills/ae-use-agent/references/local-agent.md +114 -0
  78. package/dist/auth-QPEVVBKT.js +0 -465
  79. package/dist/auth-UMJAA72O.js +0 -15
  80. package/dist/chunk-533JK3YX.js +0 -72
  81. package/dist/chunk-O6K2ODUE.js +0 -318
  82. package/dist/chunk-RWXIXOZG.js +0 -326
  83. package/dist/client-N7NGZUNI.js +0 -204
  84. package/skills/ae-agent/references/auto-provision-mcp-credentials.md +0 -57
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ae-cli
4
4
 
5
- `ae-cli` is the command-line client for the ThinkingAI AgenticEngine (AE) platform. It provides stable, structured interfaces for both AI Agents and human operators across analytics, metadata, tracking, Engage, DataOps, knowledge bases, Agent resources, and system administration.
5
+ `ae-cli` is the command-line client for the ThinkingAI AgenticEngine (AE) platform. It provides stable, structured interfaces for both AI Agents and human operators across analytics and project configuration, metadata, tracking, local-data ingestion, Engage, DataOps, knowledge bases, Agent resources, user memory, and system administration.
6
6
 
7
7
  The CLI is designed around:
8
8
 
@@ -101,30 +101,47 @@ ae-cli capability run analysis.dashboard.list --input '{"project_id":1}'
101
101
  ae-cli capability list --domain analysis --jq '.data.capabilities[] | .id'
102
102
  ```
103
103
 
104
- ## Command Surface
105
-
106
- Run `ae-cli --help` or `ae-cli <command> --help` for the authoritative command list.
107
-
108
- | Command or domain | Purpose |
109
- |---|---|
110
- | `analysis` | Reports, dashboards, ad-hoc analysis, drilldowns, details, alerts, and analysis schemas |
111
- | `analysis-meta` | Event/property metadata, metrics, virtual metadata, tracking governance, and project configuration |
112
- | `analysis-governance` | Asset search, lineage, impact analysis, and governance operations |
113
- | `metadata` | Capability-backed data-table and property operations |
114
- | `tracking` | Tracking-plan lifecycle, SDK samples, checks, ingestion diagnostics, code generation, and bundled wiki |
115
- | `engage-flow`, `engage-task`, `engage-setting`, `engage-scene`, `engage-activity`, `engage-workbench` | Engage flows, tasks, settings, strategies, activities, and workbench operations |
116
- | `community` | Community posts, comments, topics, sentiment, livestream, and report workflows |
117
- | `dataops_repo`, `dataops_datatable`, `dataops_flow`, `dataops_ide`, `dataops_integration`, `dataops_operations` | Data warehouse, data-table, flow, IDE, integration, and operations workflows |
118
- | `kb` | Knowledge-base lifecycle, LLM query, and deterministic index/grep/read retrieval |
119
- | `agent` | Agents, automations, models, MCP servers, Skills, attachments, credentials, and sandbox tools |
120
- | `system` | Root/admin operations for members, sandboxes, shared tools, models, usage, quotas, and IM channels |
121
- | `team` | Agent Team lifecycle and TeamRun execution, chat, result, and artifact workflows |
122
- | `capability` | Capability discovery, schema inspection, validation, dry-run, and generic execution |
123
- | `auth`, `config` | Host-scoped authentication and multi-environment configuration |
124
- | `api` | Raw authenticated HTTP requests for diagnostic or transitional use |
125
- | `sync` | Push or pull local Skills and MCPs to/from the Agent application |
126
- | `model` | Switch the current workspace model inside an Agent sandbox |
127
- | `update` | Synchronize CLI and Skills to the version required by the current host |
104
+ ## Command Map
105
+
106
+ The table covers every current root command individually. Use `ae-cli --help` for root commands and `ae-cli <command> --help` for the next resource or operation; append `--help` at deeper levels, for example `ae-cli project member --help`. Discover server-provided operations with `ae-cli capability list|search|inspect`.
107
+
108
+ <!-- root-command-surface:start -->
109
+ | Category | Root command | Purpose |
110
+ |---|---|---|
111
+ | Analysis and projects | `analysis` | Reports, dashboards, ad-hoc analysis, drilldowns, details, alerts, tags, and cohorts |
112
+ | Analysis and projects | `analysis-meta` | Event/property catalogs, metrics, virtual metadata, tracking governance, and project analysis settings |
113
+ | Analysis and projects | `analysis-governance` | Data-asset search, lineage, impact analysis, certification, and governance |
114
+ | Analysis and projects | `project` | Project information, members, roles, permissions, entities, time zones, and handover settings |
115
+ | Analysis and projects | `metadata` | Capability-backed data-table, property, and dimension-table binding operations |
116
+ | Analysis and projects | `personal-semantic-preference` | Project-scoped lightweight semantic preferences for the current user |
117
+ | Data and tracking | `tracking` | Tracking plans, SDK samples, checks, ingestion diagnostics, code generation, and bundled wiki |
118
+ | Data and tracking | `data-integration` | Inspect, plan, convert, upload, hand off, and reuse local CSV/JSON/Excel data |
119
+ | Community insights | `community` | Community posts, comments, topics, sentiment, livestream, and report workflows |
120
+ | Engage | `engage-flow` | Engage flow management |
121
+ | Engage | `engage-task` | Engage task and delivery-content management |
122
+ | Engage | `engage-setting` | Channel, audience, and Engage settings |
123
+ | Engage | `engage-scene` | Engage scene and strategy management |
124
+ | Engage | `engage-activity` | Activity, topic, and related task management |
125
+ | Engage | `engage-workbench` | Engage workbench and to-do management |
126
+ | Engage | `engage-query` | Engage queries, asynchronous exports, and artifact management |
127
+ | DataOps | `dataops_repo` | Data-warehouse and data-source management |
128
+ | DataOps | `dataops_datatable` | Data-table lifecycle management |
129
+ | DataOps | `dataops_flow` | Development flows, scheduling, and backfill-job management |
130
+ | DataOps | `dataops_ide` | IDE queries and result downloads |
131
+ | DataOps | `dataops_integration` | Data-integration task management |
132
+ | DataOps | `dataops_operations` | Operations, monitoring, and alert workflows |
133
+ | Agent platform | `kb` | Knowledge-base lifecycle, LLM Q&A, and deterministic index/grep/read retrieval |
134
+ | Agent platform | `agent` | Agents, approvals, automations, models, MCP servers, Skills, attachments, credentials, and sandbox tools |
135
+ | Agent platform | `memory` | User memory, Top-K context writing, and actual-usage accounting |
136
+ | Agent platform | `team` | Agent Team and TeamRun execution, chat, results, and artifacts |
137
+ | Agent platform | `system` | Root/admin management of members, sandboxes, tools, models, usage, quotas, and channels |
138
+ | General tools | `capability` | Capability discovery, schema inspection, validation, dry-run, and generic execution |
139
+ | General tools | `auth` | Host-scoped login, status, and multi-account management |
140
+ | General tools | `config` | Add, switch, rename, and remove Host environments |
141
+ | General tools | `sync` | Push or pull local Skills and MCPs to/from the Agent application |
142
+ | General tools | `model` | Inspect and switch the current workspace model inside an Agent sandbox |
143
+ | General tools | `update` | Synchronize CLI and Skills to the version required by the current Host |
144
+ <!-- root-command-surface:end -->
128
145
 
129
146
  ## Capability Gateway
130
147
 
@@ -145,16 +162,24 @@ Use `validate` while fixing complex nested input. Use `dry-run` when you need th
145
162
 
146
163
  Gateway-backed features follow the [Capability command admission rules](docs/capability-command-admission.md). Common workflows may have curated commands; long-tail capabilities remain dynamically discoverable.
147
164
 
165
+ `analysis user-tag create|update` supports periodic refresh in one command: pass `--auto-refresh-schedule '{"frequency":"daily","time":"02:30"}'` (also weekly/monthly), or `--auto-refresh-cron`. Use `--enable-auto-refresh false` to disable it. Scheduling-only updates do not recompute; omitted settings preserve the existing plan. See the [tag create](skills/ae-analysis/references/user_tag_create.md) and [tag update](skills/ae-analysis/references/user_tag_update.md) references.
166
+
148
167
  ## Authentication and Environments
149
168
 
150
169
  Credentials are stored per host. Switching environments does not reuse a token from another host.
151
170
  Run `ae-cli config` in a terminal to add, activate, rename, or remove environments interactively.
171
+ Run `ae-cli auth` to choose the active account for the current host interactively. `ae-cli auth use` opens the same selector when `--account` is omitted.
152
172
  For scripts and agents, use the non-interactive subcommands:
153
173
 
154
174
  ```bash
155
175
  ae-cli auth login --host https://host-a.example.com
156
176
  ae-cli auth status --host https://host-a.example.com
177
+ # For the uncommon case where one Host needs multiple accounts
178
+ ae-cli auth login --host https://host-a.example.com --add
179
+ ae-cli auth list --host https://host-a.example.com
180
+ ae-cli auth use --host https://host-a.example.com --account <login-name-or-open-id>
157
181
  ae-cli auth logout --host https://host-a.example.com
182
+ ae-cli auth logout --host https://host-a.example.com --all
158
183
 
159
184
  ae-cli config list
160
185
  ae-cli config current
@@ -166,6 +191,10 @@ ae-cli config remove pre-production --yes
166
191
 
167
192
  `<env>` accepts either an exact URL or a unique label. The active environment is clearly marked in the interactive manager and in `config list`. Removing an active environment is rejected while other environments remain; switch first so replacement is explicit. `config set-host` remains available as a compatibility command that adds or updates a host and activates it.
168
193
 
194
+ A regular `auth login` keeps the simple one-Host/one-account behavior and replaces credentials for that Host; use `--add` only when other accounts must be retained. `auth status` reports CLI-token state only. A new backend can also provide account identity and expiration; when an older backend does not support `/validate`, the CLI preserves the historical behavior of trusting the stored CLI token and omits `account` instead of returning null fields.
195
+
196
+ The new CLI persists only CLI tokens, never access or refresh tokens. Multiple accounts live in an encrypted V1 vault while the active account is projected into the historical file shape for automatic downgrades. When the CLI upgrades again, it reconciles login, switch, or logout changes made by the old CLI.
197
+
169
198
  Login uses a cross-platform device-code flow. Use `--no-browser` when the environment cannot open a browser.
170
199
  Trial guidance is emitted only when no Host is configured; normal commands and authentication flows for configured environments do not display it.
171
200
 
@@ -197,23 +226,35 @@ Manage the server-side knowledge-base lifecycle:
197
226
 
198
227
  ```bash
199
228
  ae-cli kb +new --scope company --name engineering-handbook --description "Team docs"
200
- ae-cli kb +add --name engineering-handbook --files '["./docs/guide.md","https://example.com/page"]'
201
- ae-cli kb +schema --name engineering-handbook
202
- ae-cli kb +compile --name engineering-handbook
203
- ae-cli kb +status --name engineering-handbook
229
+ ae-cli kb +import --file ./knowledge-base.zip --name "Imported handbook"
230
+ ae-cli kb +import-status --request-id <requestId>
231
+ ae-cli kb +add --name engineering-handbook --scope company --files '["./docs/guide.md","https://example.com/page"]'
232
+ ae-cli kb +list-sources --name engineering-handbook --scope company
233
+ ae-cli kb +rm-source --name engineering-handbook --scope company --id <source-id>
234
+ # Legacy compatibility when a source ID is unavailable:
235
+ ae-cli kb +rm-source --name engineering-handbook --scope company --display-name kb-1780046712-guide.md
236
+ ae-cli kb +schema --name engineering-handbook --scope company --model <model-ref>
237
+ ae-cli kb +compile --name engineering-handbook --scope company --model <model-ref>
238
+ ae-cli kb +status --name engineering-handbook --scope company
204
239
  ae-cli kb +ask -q "How is the sandbox configured?"
205
240
  # Submit only, poll later:
206
241
  ae-cli kb +ask -q "Another question" --no-wait
207
242
  ae-cli kb +ask-status --execution-id <id>
208
243
  ```
209
244
 
245
+ `kb +list-sources` returns stable source `id` values. Copy the exact `id` into `kb +rm-source`; do not guess it from a filename or URL. The `--display-name` selector remains available only for legacy compatibility when an ID is unavailable.
246
+
247
+ Name-based management commands accept optional `--scope personal|company`; omit it to keep the legacy personal-to-company lookup. For Schema and Compile, prefer the model record `id` from `ae-cli agent +list-models`; historical `modelId` and `modelId::scope` remain compatible, while `displayName` is not a stable reference.
248
+
249
+ `kb +import` accepts a compiled Markdown ZIP up to 50 MB with root `index.md` and `wiki/**/*.md` pages. It returns `{requestId, status: "queued"}` immediately; use `ae-cli kb +import-status --request-id <requestId>` to read `queued`, `running`, `succeeded`, or `failed`. A succeeded personal read-only snapshot supports list, Index/Wiki, grep/read, Ask, and delete operations; source, Schema, usage, compile, member/settings, ownership transfer, and company publication are unavailable.
250
+
210
251
  External Agents can use deterministic retrieval without a server-side LLM:
211
252
 
212
253
  ```bash
213
254
  ae-cli kb +list
214
255
  ae-cli kb +index --sources '[{"scope":"company","name":"engineering-handbook"}]'
215
256
  ae-cli kb +grep -q "sandbox config" --sources '[{"scope":"company","name":"engineering-handbook"}]' --paths '["wiki/sandbox.md"]'
216
- ae-cli kb +read --source '{"scope":"company","name":"engineering-handbook"}' --path "wiki/sandbox.md"
257
+ ae-cli kb +read --source '{"scope":"company","name":"engineering-handbook"}' --path "wiki/sandbox.md" --limit 2000 --expand block
217
258
  ```
218
259
 
219
260
  ## Agent and System Administration
@@ -227,19 +268,32 @@ ae-cli agent +list-mcps
227
268
  ae-cli agent +list-skills
228
269
  ae-cli agent +list-automations
229
270
  ae-cli agent +list-attachments
271
+ ae-cli agent approval-type list
272
+ ae-cli agent approval-request list --status pending
273
+ ae-cli agent approval-task list --status pending
274
+ ae-cli agent approval-effect list --status manual_required
230
275
  ```
231
276
 
232
- The `system` domain calls administrative `/api/admin/**` endpoints and requires a `root` or `agent_admin` role:
277
+ Generic approval commands use versioned CLI-token REST under the Agent application's `/agent` base path. Use `approval-type get` before submitting type-specific snake_case payloads. Effect retry is a `high-risk-write` and requires an auditable reason plus explicit `--yes`. Write-command `--dry-run` output is a local request preview only; it does not verify server permissions, current state, or future conditional routing.
278
+
279
+ The `system` domain calls administrative `/api/admin/**` and versioned channel `/api/cli/channel/v1/**` endpoints and requires a `root` or `agent_admin` role:
233
280
 
234
281
  ```bash
235
282
  ae-cli system +list-members --status enabled
236
283
  ae-cli system +list-sandboxes
237
- ae-cli system +get-usage-summary --days 30
284
+ ae-cli system +get-sandbox-config
285
+ ae-cli system +get-usage-summary --days 30 --refresh true
286
+ ae-cli system +export-usage --start-date 2026-07-01 --end-date 2026-07-31 --group-by user --output ./system-usage.csv
238
287
  ae-cli system +list-quota-rules
239
288
  ae-cli system +list-channels
289
+ ae-cli system channel routing get --endpoint-id <endpoint-id>
290
+ ae-cli --dry-run system +bind-feishu-users --channel-id <channel-id> --endpoint-id <endpoint-id> --bindings @bindings.json
291
+ ae-cli system +list-sandbox-tools
240
292
  ```
241
293
 
242
- Authorization is always enforced by the server. Do not retry or bypass a permission error.
294
+ The system domain now exposes 71 commands across members, sandboxes, shared sandbox tools, models and pricing, usage drill-down/CSV export, cost controls, quotas, and channels. Channel management covers nine channel types, endpoint routing, WhatsApp Web QR linking, and 1-100 item Feishu binding batches with per-item results and optional default/per-user Agent assignment. CSV exports stream to a required local path, never overwrite an existing file, and remove partial files on failure.
295
+
296
+ Authorization and company/resource ownership are always enforced by the server. A missing CLI command is not an access-control boundary: an Agent with Bash/network access can still construct HTTP requests. Do not retry or bypass a permission error, do not use excluded internal member-delete or sandbox-orchestration routes, and obtain explicit user confirmation before every administrative write. Skill instructions, dry-run, and the CLI confirmation prompt are safeguards against mistakes, not substitutes for server authorization; `--yes` bypasses that prompt.
243
297
 
244
298
  ## Agent Skills
245
299
 
@@ -253,8 +307,9 @@ The npm package includes the same `skills/` directory used by the public reposit
253
307
  | `ae-engage` | Engage operations and workflow guidance |
254
308
  | `ae-dataops` | Data warehouse, flow, IDE, integration, and operations |
255
309
  | `ae-community` | Community analysis and reporting |
256
- | `ae-kb` | Knowledge-base lifecycle and retrieval |
257
- | `ae-agent`, `ae-system`, `ae-team` | Agent resources, administration, and TeamRun workflows |
310
+ | `ae-data-integration` | Local CSV/JSON/Excel inspection, mapping, conversion, upload, and reusable handoff |
311
+ | `ae-kb`, `ae-kb-discovery` | Knowledge-base lifecycle, Q&A, deterministic retrieval, and read-only knowledge-base discovery |
312
+ | `ae-agent`, `ae-system`, `ae-team` | Agent resources and user memory, administration, and TeamRun workflows |
258
313
  | `ae-generate-tracking-plan`, `ae-generate-tracking-code` | Tracking-plan and tracking-code generation |
259
314
  | `ae-data-integration-helper` | SDK and LogBus2 integration guidance |
260
315
 
@@ -286,7 +341,6 @@ Core structure:
286
341
  src/
287
342
  ├── core/ # auth, config, clients, compatibility, version sync
288
343
  ├── framework/ # command registration, lifecycle, output, errors
289
- ├── api/ # raw authenticated API access
290
344
  └── commands/ # business domains and CLI utilities
291
345
  skills/ # Agent Skills shipped with the npm package
292
346
  self-check/ # release and documentation consistency checks
@@ -297,9 +351,12 @@ Useful verification commands:
297
351
 
298
352
  ```bash
299
353
  npm run build
354
+ npm test
300
355
  npm run qa-changed
301
356
  npm run self-check
302
357
  npm run check:release
358
+ npm run verify:readme
359
+ npm run verify:auth-credentials
303
360
  npm run verify:update-check
304
361
  npm run verify:version-sync
305
362
  ```
package/README.zh.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ae-cli
4
4
 
5
- `ae-cli` 是 ThinkingAI AgenticEngine(AE)平台的命令行客户端,为 AI Agent 和人工操作提供稳定、结构化的接口,覆盖分析、元数据、埋点、运营、DataOps、知识库、Agent 资源及系统管理。
5
+ `ae-cli` 是 ThinkingAI AgenticEngine(AE)平台的命令行客户端,为 AI Agent 和人工操作提供稳定、结构化的接口,覆盖分析与项目配置、元数据、埋点、本地数据接入、运营、DataOps、知识库、Agent 资源、用户记忆及系统管理。
6
6
 
7
7
  CLI 的核心设计包括:
8
8
 
@@ -105,30 +105,47 @@ ae-cli capability run analysis.dashboard.list --input '{"project_id":1}'
105
105
  ae-cli capability list --domain analysis --jq '.data.capabilities[] | .id'
106
106
  ```
107
107
 
108
- ## 命令范围
109
-
110
- 运行 `ae-cli --help` `ae-cli <command> --help` 获取权威命令清单。
111
-
112
- | 命令或业务域 | 用途 |
113
- |---|---|
114
- | `analysis` | 报告、看板、即席分析、下钻、详情、告警和分析模型 |
115
- | `analysis-meta` | 事件/属性元数据、指标、虚拟元数据、埋点治理和项目配置 |
116
- | `analysis-governance` | 资产搜索、血缘、影响分析和治理操作 |
117
- | `metadata` | 基于 Capability Gateway 的数据表和属性操作 |
118
- | `tracking` | 埋点方案生命周期、SDK 示例、检查、采集诊断、代码生成和内置 Wiki |
119
- | `engage-flow`、`engage-task`、`engage-setting`、`engage-scene`、`engage-activity`、`engage-workbench` | 运营流程、任务、设置、策略、活动和工作台 |
120
- | `community` | 社区帖子、评论、话题、情感、直播和报告工作流 |
121
- | `dataops_repo`、`dataops_datatable`、`dataops_flow`、`dataops_ide`、`dataops_integration`、`dataops_operations` | 数仓、数据表、任务流、IDE、数据集成和运维工作流 |
122
- | `kb` | 知识库生命周期、LLM 查询及确定性的 index/grep/read 检索 |
123
- | `agent` | Agent、自动化、模型、MCP、Skills、附件、凭证和沙盒工具 |
124
- | `system` | root/admin 的成员、沙盒、共享工具、模型、用量、配额和 IM 渠道管理 |
125
- | `team` | Agent Team 生命周期,以及 TeamRun 执行、对话、结果和产物 |
126
- | `capability` | 能力发现、Schema 查看、参数校验、dry-run 和通用执行 |
127
- | `auth`、`config` | Host 隔离的认证和多环境配置 |
128
- | `api` | 用于诊断或过渡场景的原始认证 HTTP 请求 |
129
- | `sync` | 在本地工作区与 Agent 应用之间推送或拉取 Skills 和 MCP |
130
- | `model` | Agent 沙盒中切换当前工作区模型 |
131
- | `update` | CLI 和 Skills 同步到当前 Host 要求的版本 |
108
+ ## 命令地图
109
+
110
+ 下表逐项覆盖当前所有根命令。使用 `ae-cli --help` 查看根命令,使用 `ae-cli <命令> --help` 查看下一层资源或操作;层级命令可以继续追加 `--help`,例如 `ae-cli project member --help`。服务端动态能力通过 `ae-cli capability list|search|inspect` 发现。
111
+
112
+ <!-- root-command-surface:start -->
113
+ | 类别 | 根命令 | 用途 |
114
+ |---|---|---|
115
+ | 分析与项目 | `analysis` | 报告、看板、即席分析、下钻、详情、告警、标签和分群 |
116
+ | 分析与项目 | `analysis-meta` | 事件/属性目录、指标、虚拟元数据、埋点治理和项目分析配置 |
117
+ | 分析与项目 | `analysis-governance` | 数据资产搜索、血缘、影响分析、认证和治理 |
118
+ | 分析与项目 | `project` | 项目信息、成员、角色、权限、实体、时区和交接配置 |
119
+ | 分析与项目 | `metadata` | 基于 Capability Gateway 的数据表、属性及维度表绑定 |
120
+ | 分析与项目 | `personal-semantic-preference` | 当前用户按项目维护轻量个人语义偏好 |
121
+ | 数据与埋点 | `tracking` | 埋点方案、SDK 示例、检查、采集诊断、代码生成和内置 Wiki |
122
+ | 数据与埋点 | `data-integration` | 检查、规划、转换、上传、交接和复用本地 CSV/JSON/Excel 数据 |
123
+ | 社区洞察 | `community` | 社区帖子、评论、话题、情感、直播和报告工作流 |
124
+ | 运营 | `engage-flow` | 运营流程管理 |
125
+ | 运营 | `engage-task` | 运营任务及触达内容管理 |
126
+ | 运营 | `engage-setting` | 渠道、受众和运营设置 |
127
+ | 运营 | `engage-scene` | 运营场景和策略管理 |
128
+ | 运营 | `engage-activity` | 活动、专题及其任务管理 |
129
+ | 运营 | `engage-workbench` | 运营工作台和待办管理 |
130
+ | 运营 | `engage-query` | 运营查询、异步导出和产物管理 |
131
+ | DataOps | `dataops_repo` | 数仓和数据源管理 |
132
+ | DataOps | `dataops_datatable` | 数据表生命周期管理 |
133
+ | DataOps | `dataops_flow` | 开发流程、调度和补数作业管理 |
134
+ | DataOps | `dataops_ide` | IDE 查询及结果下载 |
135
+ | DataOps | `dataops_integration` | 数据集成任务管理 |
136
+ | DataOps | `dataops_operations` | 运维、监控和告警工作流 |
137
+ | Agent 平台 | `kb` | 知识库生命周期、LLM 问答及确定性的 index/grep/read 检索 |
138
+ | Agent 平台 | `agent` | Agent、审批、自动化、模型、MCP、Skills、附件、凭证和沙盒工具 |
139
+ | Agent 平台 | `memory` | 用户记忆、Top-K 上下文写入和实际采用计数 |
140
+ | Agent 平台 | `team` | Agent Team 和 TeamRun 的执行、对话、结果及产物 |
141
+ | Agent 平台 | `system` | root/admin 的成员、沙盒、工具、模型、用量、配额和渠道管理 |
142
+ | 通用工具 | `capability` | 能力发现、Schema 查看、参数校验、dry-run 和通用执行 |
143
+ | 通用工具 | `auth` | 按 Host 登录、查看状态及管理同一 Host 的多个账号 |
144
+ | 通用工具 | `config` | 添加、切换、重命名和删除 Host 环境 |
145
+ | 通用工具 | `sync` | 在本地工作区与 Agent 应用之间推送或拉取 Skills 和 MCP |
146
+ | 通用工具 | `model` | 在 Agent 沙盒中查看并切换当前工作区模型 |
147
+ | 通用工具 | `update` | 将 CLI 和 Skills 同步到当前 Host 要求的版本 |
148
+ <!-- root-command-surface:end -->
132
149
 
133
150
  ## Capability Gateway
134
151
 
@@ -149,16 +166,24 @@ ae-cli capability run analysis.report.list --input input.json
149
166
 
150
167
  Gateway 命令遵循 [Capability 命令收录规则](docs/capability-command-admission.md)。常见工作流可以提供精选命令,长尾能力则保持动态发现。
151
168
 
169
+ `analysis user-tag create|update` 支持一次配置自动更新:传入 `--auto-refresh-schedule '{"frequency":"daily","time":"02:30"}'`(也支持每周、每月),或使用 `--auto-refresh-cron`。用 `--enable-auto-refresh false` 关闭自动更新。仅修改调度计划不触发即时重算;省略调度参数则保留原计划。详见[创建标签](skills/ae-analysis/references/user_tag_create.md)和[更新标签](skills/ae-analysis/references/user_tag_update.md)。
170
+
152
171
  ## 认证与多环境
153
172
 
154
173
  凭证按 Host 独立存储,切换环境不会复用其他 Host 的 token。
155
174
  在终端运行 `ae-cli config`,可以交互式添加、激活、重命名或删除环境。
175
+ 运行 `ae-cli auth` 可以交互式选择当前 Host 的 active 账号;省略 `--account` 的 `ae-cli auth use` 也会打开同一个选择器。
156
176
  脚本和 Agent 应使用非交互子命令:
157
177
 
158
178
  ```bash
159
179
  ae-cli auth login --host https://host-a.example.com
160
180
  ae-cli auth status --host https://host-a.example.com
181
+ # 少量需要同一 Host 多账号的场景
182
+ ae-cli auth login --host https://host-a.example.com --add
183
+ ae-cli auth list --host https://host-a.example.com
184
+ ae-cli auth use --host https://host-a.example.com --account <login-name-or-open-id>
161
185
  ae-cli auth logout --host https://host-a.example.com
186
+ ae-cli auth logout --host https://host-a.example.com --all
162
187
 
163
188
  ae-cli config list
164
189
  ae-cli config current
@@ -170,6 +195,10 @@ ae-cli config remove pre-production --yes
170
195
 
171
196
  `<env>` 可以是完整 URL 或唯一 label。交互管理器和 `config list` 都会明确标识 active 环境。当还存在其他环境时,不允许直接删除 active 环境;应先显式切换。`config set-host` 作为兼容命令继续保留,其语义是添加或更新 Host 并立即激活。
172
197
 
198
+ 普通 `auth login` 保持一个 Host 一个账号的简单语义,并替换该 Host 已保存的账号;仅在需要时使用 `--add` 保留其他账号。`auth status` 只展示 CLI Token 状态;新版后端可同时返回账号和到期时间,旧版后端不支持 `/validate` 时仍按历史行为信任本地 CLI Token,且不会输出含 null 字段的 `account`。
199
+
200
+ 新版 CLI 只持久化 CLI Token,不保存 access token 或 refresh token。多账号保存在加密的 V1 凭据文件中,同时维护旧文件格式的当前账号投影,保证 CLI 自动降级后仍可登录;再次升级时会合并旧 CLI 对投影的登录、切换或退出变更。
201
+
173
202
  登录使用跨平台设备码流程。当前环境无法打开浏览器时,可使用 `--no-browser`。
174
203
  试用引导仅在尚未配置 Host 时出现;已配置环境的正常命令和认证流程不会展示该提示。
175
204
 
@@ -201,23 +230,35 @@ JSON 参数通常支持内联 JSON、`@file`、文件路径或通过 `-` 从 std
201
230
 
202
231
  ```bash
203
232
  ae-cli kb +new --scope company --name engineering-handbook --description "Team docs"
204
- ae-cli kb +add --name engineering-handbook --files '["./docs/guide.md","https://example.com/page"]'
205
- ae-cli kb +schema --name engineering-handbook
206
- ae-cli kb +compile --name engineering-handbook
207
- ae-cli kb +status --name engineering-handbook
233
+ ae-cli kb +import --file ./knowledge-base.zip --name "Imported handbook"
234
+ ae-cli kb +import-status --request-id <requestId>
235
+ ae-cli kb +add --name engineering-handbook --scope company --files '["./docs/guide.md","https://example.com/page"]'
236
+ ae-cli kb +list-sources --name engineering-handbook --scope company
237
+ ae-cli kb +rm-source --name engineering-handbook --scope company --id <source-id>
238
+ # 兼容旧命令:无法取得来源 ID 时仍可使用精确展示名
239
+ ae-cli kb +rm-source --name engineering-handbook --scope company --display-name kb-1780046712-guide.md
240
+ ae-cli kb +schema --name engineering-handbook --scope company --model <model-ref>
241
+ ae-cli kb +compile --name engineering-handbook --scope company --model <model-ref>
242
+ ae-cli kb +status --name engineering-handbook --scope company
208
243
  ae-cli kb +ask -q "如何配置沙盒?"
209
244
  # 仅提交,后续轮询:
210
245
  ae-cli kb +ask -q "另一个问题" --no-wait
211
246
  ae-cli kb +ask-status --execution-id <id>
212
247
  ```
213
248
 
249
+ `kb +list-sources` 返回稳定的来源 `id`。请把精确的 `id` 复制到 `kb +rm-source`,不要根据文件名或 URL 猜测。`--display-name` 仅用于无法取得 ID 时的旧版兼容。
250
+
251
+ 按名称管理知识库的命令都支持可选 `--scope personal|company`;省略时保留 personal 到 company 的旧查找顺序。Schema 与 Compile 优先使用 `ae-cli agent +list-models` 返回的模型记录 `id`;历史 `modelId` 和 `modelId::scope` 仍兼容,`displayName` 不是稳定引用。
252
+
253
+ `kb +import` 接受最大 50 MB 的编译后 Markdown ZIP,根目录必须包含 `index.md`,页面放在 `wiki/**/*.md`。命令立即返回 `{requestId, status: "queued"}`;通过 `ae-cli kb +import-status --request-id <requestId>` 查询 `queued`、`running`、`succeeded` 或 `failed`。导入成功后可执行列表、Index/Wiki、grep/read、Ask 和删除;个人只读快照不支持来源、Schema、用量、编译、成员/设置、所有权转移和公司发布。
254
+
214
255
  外部 Agent 可以使用不依赖服务端 LLM 的确定性检索:
215
256
 
216
257
  ```bash
217
258
  ae-cli kb +list
218
259
  ae-cli kb +index --sources '[{"scope":"company","name":"engineering-handbook"}]'
219
260
  ae-cli kb +grep -q "沙盒配置" --sources '[{"scope":"company","name":"engineering-handbook"}]' --paths '["wiki/sandbox.md"]'
220
- ae-cli kb +read --source '{"scope":"company","name":"engineering-handbook"}' --path "wiki/sandbox.md"
261
+ ae-cli kb +read --source '{"scope":"company","name":"engineering-handbook"}' --path "wiki/sandbox.md" --limit 2000 --expand block
221
262
  ```
222
263
 
223
264
  ## Agent 与系统管理
@@ -231,19 +272,32 @@ ae-cli agent +list-mcps
231
272
  ae-cli agent +list-skills
232
273
  ae-cli agent +list-automations
233
274
  ae-cli agent +list-attachments
275
+ ae-cli agent approval-type list
276
+ ae-cli agent approval-request list --status pending
277
+ ae-cli agent approval-task list --status pending
278
+ ae-cli agent approval-effect list --status manual_required
234
279
  ```
235
280
 
236
- `system` 域调用管理接口 `/api/admin/**`,要求当前用户拥有 `root` `agent_admin` 角色:
281
+ 通用审批命令使用 Agent 应用 `/agent` base path 下的版本化 CLI-token REST。提交类型专属的 snake_case payload 前,先用 `approval-type get` 获取契约。Effect 人工重试属于 `high-risk-write`,必须提供可审计理由并显式传入 `--yes`。写命令的 `--dry-run` 仅在本地预览请求,不验证服务端权限、实时状态或未来条件流转。
282
+
283
+ `system` 域调用管理接口 `/api/admin/**` 和版本化渠道接口 `/api/cli/channel/v1/**`,要求当前用户拥有 `root` 或 `agent_admin` 角色:
237
284
 
238
285
  ```bash
239
286
  ae-cli system +list-members --status enabled
240
287
  ae-cli system +list-sandboxes
241
- ae-cli system +get-usage-summary --days 30
288
+ ae-cli system +get-sandbox-config
289
+ ae-cli system +get-usage-summary --days 30 --refresh true
290
+ ae-cli system +export-usage --start-date 2026-07-01 --end-date 2026-07-31 --group-by user --output ./system-usage.csv
242
291
  ae-cli system +list-quota-rules
243
292
  ae-cli system +list-channels
293
+ ae-cli system channel routing get --endpoint-id <endpoint-id>
294
+ ae-cli --dry-run system +bind-feishu-users --channel-id <channel-id> --endpoint-id <endpoint-id> --bindings @bindings.json
295
+ ae-cli system +list-sandbox-tools
244
296
  ```
245
297
 
246
- 最终权限始终由服务端校验。遇到权限错误时不要重试或绕过。
298
+ system 域现有 71 条命令,覆盖成员、沙箱、共享沙箱工具、模型与价格、用量下钻与 CSV 导出、成本控制、配额和渠道。渠道管理覆盖九类渠道、Endpoint 路由、WhatsApp Web 扫码关联,以及 1-100 人飞书批量绑定的逐项结果与公共/逐人默认 Agent 分配。CSV 导出必须显式指定本地路径,采用流式写入,不覆盖已有文件,失败时清理不完整文件。
299
+
300
+ 最终权限、公司隔离和资源归属始终由服务端校验。“没有对应 CLI 命令”不是安全边界:拥有 Bash/网络能力的 Agent 仍可直接构造 HTTP 请求。遇到权限错误时不要重试或绕过,不要调用明确排除的其他系统成员删除或底层沙箱编排接口;所有管理员写操作都应先 dry-run 并取得用户明确确认。Skill、dry-run 和 CLI 确认提示只是防误操作措施,不能替代服务端鉴权;`--yes` 会跳过该提示。
247
301
 
248
302
  ## Agent Skills
249
303
 
@@ -257,8 +311,9 @@ npm 包内包含与公开仓库一致的 `skills/` 目录:
257
311
  | `ae-engage` | 运营操作和工作流指南 |
258
312
  | `ae-dataops` | 数仓、任务流、IDE、数据集成和运维 |
259
313
  | `ae-community` | 社区分析和报告 |
260
- | `ae-kb` | 知识库生命周期和检索 |
261
- | `ae-agent`、`ae-system`、`ae-team` | Agent 资源、系统管理和 TeamRun 工作流 |
314
+ | `ae-data-integration` | 本地 CSV/JSON/Excel 数据的检查、映射、转换、上传和可复用交接 |
315
+ | `ae-kb`、`ae-kb-discovery` | 知识库生命周期、问答、确定性检索及只读知识库发现 |
316
+ | `ae-agent`、`ae-system`、`ae-team` | Agent 资源与用户记忆(含 `memory +write-context`)、系统管理和 TeamRun 工作流 |
262
317
  | `ae-generate-tracking-plan`、`ae-generate-tracking-code` | 埋点方案和埋点代码生成 |
263
318
  | `ae-data-integration-helper` | SDK 和 LogBus2 集成指南 |
264
319
 
@@ -290,7 +345,6 @@ npm run dev -- --help
290
345
  src/
291
346
  ├── core/ # 认证、配置、客户端、兼容性和版本同步
292
347
  ├── framework/ # 命令注册、生命周期、输出和错误
293
- ├── api/ # 原始认证 API 访问
294
348
  └── commands/ # 业务域和 CLI 工具
295
349
  skills/ # 随 npm 包发布的 Agent Skills
296
350
  self-check/ # 发布和文档一致性检查
@@ -301,9 +355,12 @@ test/, tests/ # 命令、契约和回归测试
301
355
 
302
356
  ```bash
303
357
  npm run build
358
+ npm test
304
359
  npm run qa-changed
305
360
  npm run self-check
306
361
  npm run check:release
362
+ npm run verify:readme
363
+ npm run verify:auth-credentials
307
364
  npm run verify:update-check
308
365
  npm run verify:version-sync
309
366
  ```
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import os from 'node:os';
3
+ import path from 'node:path';
4
+
5
+ process.env.AE_CLI_CONFIG_DIR = path.join(os.homedir(), '.ae-cli-workbuddy');
6
+
7
+ await import('../dist/index.js');