@thinkingai/ae-cli 6.1.19 → 6.1.20

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 (82) hide show
  1. package/README.md +95 -38
  2. package/README.zh.md +95 -38
  3. package/dist/{auth-QPEVVBKT.js → auth-FUM37MHF.js} +236 -127
  4. package/dist/{capability-ASI62I4A.js → capability-AXFQW5WM.js} +45 -32
  5. package/dist/{chunk-FR2EDAQM.js → chunk-4P355ZWB.js} +69 -1
  6. package/dist/chunk-6ZIQV5GW.js +26 -0
  7. package/dist/chunk-ATSM5XAW.js +623 -0
  8. package/dist/{chunk-6QK7SYYY.js → chunk-BBEFP4SB.js} +29 -37
  9. package/dist/{chunk-KEWVSO64.js → chunk-CZU3V3DQ.js} +4 -15
  10. package/dist/chunk-ECBLHAZO.js +15 -0
  11. package/dist/{chunk-B5HMQAOM.js → chunk-I4WQAEYB.js} +1 -1
  12. package/dist/{chunk-QL6R6TSK.js → chunk-LNZBEQXW.js} +6 -5
  13. package/dist/{chunk-GJXRF7Y6.js → chunk-QJQZH5GQ.js} +47 -78
  14. package/dist/{chunk-S5PONFBM.js → chunk-RSG4ONOI.js} +7 -7
  15. package/dist/{chunk-DKEXH6Q5.js → chunk-TAL6CZH6.js} +6 -6
  16. package/dist/{chunk-JYMGHGCE.js → chunk-VXNMYUXU.js} +24 -13
  17. package/dist/{chunk-KZ6ZHF5J.js → chunk-WZ6YVQSF.js} +14 -14
  18. package/dist/{community-report-client-6OL6GBQW.js → community-report-client-XXWGSBSD.js} +2 -4
  19. package/dist/{config-XNMACCKX.js → config-EXUGQN5T.js} +8 -9
  20. package/dist/{data-integration-4NZGZ45E.js → data-integration-4NZ53OMT.js} +17 -15
  21. package/dist/index.js +52 -79
  22. package/dist/{local-data-upload-client-EFHDLXFG.js → local-data-upload-client-KYOKVYZV.js} +2 -4
  23. package/dist/{memory-HBJQ2GC5.js → memory-ATNKZNW5.js} +4 -6
  24. package/dist/{metadata-62EWBEIG.js → metadata-VZVC7YMH.js} +7 -9
  25. package/dist/{model-BHLJ2QMT.js → model-E4JMQ4V2.js} +4 -6
  26. package/dist/{personal-semantic-preference-JBVMAI7L.js → personal-semantic-preference-7S2SQ3UV.js} +6 -8
  27. package/dist/{project-semantic-BQ4MPUS5.js → project-semantic-2SZP2OPO.js} +11 -13
  28. package/dist/{sync-MUWPRM5I.js → sync-YV3E66IF.js} +6 -8
  29. package/dist/{te-agent-WQZTMEK4.js → te-agent-JB5T3PO7.js} +393 -90
  30. package/dist/{te-analysis-MNCG65LU.js → te-analysis-3YJAAT2D.js} +99 -33
  31. package/dist/{te-community-BNE6KREL.js → te-community-UDBI672N.js} +9 -32
  32. package/dist/{te-dataops-TXLKM2W6.js → te-dataops-ZLYOCXZ4.js} +19 -20
  33. package/dist/{te-engage-TPKLRVTL.js → te-engage-4XG6OJML.js} +12 -14
  34. package/dist/{te-experiment-6BYKTCY7.js → te-experiment-VXUWPINJ.js} +6 -8
  35. package/dist/{te-kb-BUD6N3NI.js → te-kb-WYQWHFSC.js} +595 -85
  36. package/dist/{te-system-44LZJDTQ.js → te-system-7G6F2LJA.js} +6 -8
  37. package/dist/{te-team-XMP47YXE.js → te-team-E7FBBXMQ.js} +6 -8
  38. package/dist/{update-UODFOZ4P.js → update-D47BUG25.js} +7 -8
  39. package/package.json +12 -9
  40. package/skills/ae-agent/SKILL.md +30 -13
  41. package/skills/ae-agent/references/agent-distribution.md +94 -0
  42. package/skills/ae-agent/references/approval-request.md +4 -0
  43. package/skills/ae-agent/references/command_index.md +9 -2
  44. package/skills/ae-agent/references/create-automation.md +20 -2
  45. package/skills/ae-agent/references/get-agent-context.md +70 -0
  46. package/skills/ae-agent/references/list-automations.md +18 -3
  47. package/skills/ae-agent/references/list-mcp-credentials.md +1 -1
  48. package/skills/ae-agent/references/mcp-token.md +3 -3
  49. package/skills/ae-agent/references/set-mcp-credential.md +0 -1
  50. package/skills/ae-agent/references/update-automation.md +18 -0
  51. package/skills/ae-analysis/SKILL.md +11 -2
  52. package/skills/ae-analysis/references/adhoc_run.md +2 -0
  53. package/skills/ae-analysis/references/ai_models.md +23 -3
  54. package/skills/ae-analysis/references/analysis_gateway_assets.md +2 -2
  55. package/skills/ae-analysis/references/command_index.md +7 -7
  56. package/skills/ae-analysis/references/cross_source_config.md +84 -0
  57. package/skills/ae-analysis/references/dashboard_update.md +1 -1
  58. package/skills/ae-analysis/references/user_tag_create.md +23 -1
  59. package/skills/ae-analysis/references/user_tag_models.md +9 -1
  60. package/skills/ae-analysis/references/user_tag_update.md +14 -2
  61. package/skills/ae-data-integration/SKILL.md +2 -1
  62. package/skills/ae-data-integration/references/dimension-routing.md +36 -0
  63. package/skills/ae-data-integration/references/local-analysis.md +2 -0
  64. package/skills/ae-data-integration/references/source-inspect.md +1 -1
  65. package/skills/ae-data-integration/references/tracking-plan.md +1 -1
  66. package/skills/ae-data-integration/references/transform.md +1 -1
  67. package/skills/ae-data-integration/references/ue-mapping.md +5 -2
  68. package/skills/ae-data-integration/references/ue-routing.md +17 -1
  69. package/skills/ae-generate-tracking-plan/SKILL.md +25 -13
  70. package/skills/ae-generate-tracking-plan/references/business-dimension-mapping.md +1 -1
  71. package/skills/ae-kb/SKILL.md +107 -36
  72. package/skills/ae-kb/references/query-workflow.md +59 -29
  73. package/skills/ae-kb/references/versions.md +46 -0
  74. package/skills/ae-system/SKILL.md +1 -1
  75. package/skills/ae-use-agent/SKILL.md +42 -0
  76. package/skills/ae-use-agent/references/local-agent.md +114 -0
  77. package/dist/auth-UMJAA72O.js +0 -15
  78. package/dist/chunk-533JK3YX.js +0 -72
  79. package/dist/chunk-O6K2ODUE.js +0 -318
  80. package/dist/chunk-RWXIXOZG.js +0 -326
  81. package/dist/client-N7NGZUNI.js +0 -204
  82. 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, experimentation, 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, experimentation, 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,31 +101,49 @@ 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
- | `experiment` | Atlas experiments, reports, traffic layers, buckets, Features, metrics, and operation logs |
112
- | `analysis-meta` | Event/property metadata, metrics, virtual metadata, tracking governance, and project configuration |
113
- | `analysis-governance` | Asset search, lineage, impact analysis, and governance operations |
114
- | `metadata` | Capability-backed data-table and property operations |
115
- | `tracking` | Tracking-plan lifecycle, SDK samples, checks, ingestion diagnostics, code generation, and bundled wiki |
116
- | `engage-flow`, `engage-task`, `engage-setting`, `engage-scene`, `engage-activity`, `engage-workbench` | Engage flows, tasks, settings, strategies, activities, and workbench operations |
117
- | `community` | Community posts, comments, topics, sentiment, livestream, and report workflows |
118
- | `dataops_repo`, `dataops_datatable`, `dataops_flow`, `dataops_ide`, `dataops_integration`, `dataops_operations` | Data warehouse, data-table, flow, IDE, integration, and operations workflows |
119
- | `kb` | Knowledge-base lifecycle, LLM query, and deterministic index/grep/read retrieval |
120
- | `agent` | Agents, automations, models, MCP servers, Skills, attachments, credentials, and sandbox tools |
121
- | `system` | Root/admin operations for members, sandboxes, shared tools, models, usage, quotas, and IM channels |
122
- | `team` | Agent Team lifecycle and TeamRun execution, chat, result, and artifact workflows |
123
- | `capability` | Capability discovery, schema inspection, validation, dry-run, and generic execution |
124
- | `auth`, `config` | Host-scoped authentication and multi-environment configuration |
125
- | `api` | Raw authenticated HTTP requests for diagnostic or transitional use |
126
- | `sync` | Push or pull local Skills and MCPs to/from the Agent application |
127
- | `model` | Switch the current workspace model inside an Agent sandbox |
128
- | `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 | `experiment` | Atlas experiments, reports, traffic layers, buckets, Features, metrics, and operation logs |
113
+ | Analysis and projects | `analysis-meta` | Event/property catalogs, metrics, virtual metadata, tracking governance, and project analysis settings |
114
+ | Analysis and projects | `analysis-governance` | Data-asset search, lineage, impact analysis, certification, and governance |
115
+ | Analysis and projects | `project` | Project information, members, roles, permissions, entities, time zones, and handover settings |
116
+ | Analysis and projects | `metadata` | Capability-backed data-table, property, and dimension-table binding operations |
117
+ | Analysis and projects | `personal-semantic-preference` | Project-scoped lightweight semantic preferences for the current user |
118
+ | Analysis and projects | `project-semantic` | Governed project semantics, asset packages, candidate validation, review, and publishing |
119
+ | Data and tracking | `tracking` | Tracking plans, SDK samples, checks, ingestion diagnostics, code generation, and bundled wiki |
120
+ | Data and tracking | `data-integration` | Inspect, plan, convert, upload, hand off, and reuse local CSV/JSON/Excel data |
121
+ | Community insights | `community` | Community posts, comments, topics, sentiment, livestream, and report workflows |
122
+ | Engage | `engage-flow` | Engage flow management |
123
+ | Engage | `engage-task` | Engage task and delivery-content management |
124
+ | Engage | `engage-setting` | Channel, audience, and Engage settings |
125
+ | Engage | `engage-scene` | Engage scene and strategy management |
126
+ | Engage | `engage-activity` | Activity, topic, and related task management |
127
+ | Engage | `engage-workbench` | Engage workbench and to-do management |
128
+ | Engage | `engage-query` | Engage queries, asynchronous exports, and artifact management |
129
+ | DataOps | `dataops_repo` | Data-warehouse and data-source management |
130
+ | DataOps | `dataops_datatable` | Data-table lifecycle management |
131
+ | DataOps | `dataops_flow` | Development flows, scheduling, and backfill-job management |
132
+ | DataOps | `dataops_ide` | IDE queries and result downloads |
133
+ | DataOps | `dataops_integration` | Data-integration task management |
134
+ | DataOps | `dataops_operations` | Operations, monitoring, and alert workflows |
135
+ | Agent platform | `kb` | Knowledge-base lifecycle, LLM Q&A, and deterministic index/grep/read retrieval |
136
+ | Agent platform | `agent` | Agents, approvals, automations, models, MCP servers, Skills, attachments, credentials, and sandbox tools |
137
+ | Agent platform | `memory` | User memory, Top-K context writing, and actual-usage accounting |
138
+ | Agent platform | `team` | Agent Team and TeamRun execution, chat, results, and artifacts |
139
+ | Agent platform | `system` | Root/admin management of members, sandboxes, tools, models, usage, quotas, and channels |
140
+ | General tools | `capability` | Capability discovery, schema inspection, validation, dry-run, and generic execution |
141
+ | General tools | `auth` | Host-scoped login, status, and multi-account management |
142
+ | General tools | `config` | Add, switch, rename, and remove Host environments |
143
+ | General tools | `sync` | Push or pull local Skills and MCPs to/from the Agent application |
144
+ | General tools | `model` | Inspect and switch the current workspace model inside an Agent sandbox |
145
+ | General tools | `update` | Synchronize CLI and Skills to the version required by the current Host |
146
+ <!-- root-command-surface:end -->
129
147
 
130
148
  ## Capability Gateway
131
149
 
@@ -146,16 +164,24 @@ Use `validate` while fixing complex nested input. Use `dry-run` when you need th
146
164
 
147
165
  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.
148
166
 
167
+ `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.
168
+
149
169
  ## Authentication and Environments
150
170
 
151
171
  Credentials are stored per host. Switching environments does not reuse a token from another host.
152
172
  Run `ae-cli config` in a terminal to add, activate, rename, or remove environments interactively.
173
+ 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.
153
174
  For scripts and agents, use the non-interactive subcommands:
154
175
 
155
176
  ```bash
156
177
  ae-cli auth login --host https://host-a.example.com
157
178
  ae-cli auth status --host https://host-a.example.com
179
+ # For the uncommon case where one Host needs multiple accounts
180
+ ae-cli auth login --host https://host-a.example.com --add
181
+ ae-cli auth list --host https://host-a.example.com
182
+ ae-cli auth use --host https://host-a.example.com --account <login-name-or-open-id>
158
183
  ae-cli auth logout --host https://host-a.example.com
184
+ ae-cli auth logout --host https://host-a.example.com --all
159
185
 
160
186
  ae-cli config list
161
187
  ae-cli config current
@@ -167,6 +193,10 @@ ae-cli config remove pre-production --yes
167
193
 
168
194
  `<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.
169
195
 
196
+ 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.
197
+
198
+ 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.
199
+
170
200
  Login uses a cross-platform device-code flow. Use `--no-browser` when the environment cannot open a browser.
171
201
  Trial guidance is emitted only when no Host is configured; normal commands and authentication flows for configured environments do not display it.
172
202
 
@@ -198,23 +228,35 @@ Manage the server-side knowledge-base lifecycle:
198
228
 
199
229
  ```bash
200
230
  ae-cli kb +new --scope company --name engineering-handbook --description "Team docs"
201
- ae-cli kb +add --name engineering-handbook --files '["./docs/guide.md","https://example.com/page"]'
202
- ae-cli kb +schema --name engineering-handbook
203
- ae-cli kb +compile --name engineering-handbook
204
- ae-cli kb +status --name engineering-handbook
231
+ ae-cli kb +import --file ./knowledge-base.zip --name "Imported handbook"
232
+ ae-cli kb +import-status --request-id <requestId>
233
+ ae-cli kb +add --name engineering-handbook --scope company --files '["./docs/guide.md","https://example.com/page"]'
234
+ ae-cli kb +list-sources --name engineering-handbook --scope company
235
+ ae-cli kb +rm-source --name engineering-handbook --scope company --id <source-id>
236
+ # Legacy compatibility when a source ID is unavailable:
237
+ ae-cli kb +rm-source --name engineering-handbook --scope company --display-name kb-1780046712-guide.md
238
+ ae-cli kb +schema --name engineering-handbook --scope company --model <model-ref>
239
+ ae-cli kb +compile --name engineering-handbook --scope company --model <model-ref>
240
+ ae-cli kb +status --name engineering-handbook --scope company
205
241
  ae-cli kb +ask -q "How is the sandbox configured?"
206
242
  # Submit only, poll later:
207
243
  ae-cli kb +ask -q "Another question" --no-wait
208
244
  ae-cli kb +ask-status --execution-id <id>
209
245
  ```
210
246
 
247
+ `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.
248
+
249
+ 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.
250
+
251
+ `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.
252
+
211
253
  External Agents can use deterministic retrieval without a server-side LLM:
212
254
 
213
255
  ```bash
214
256
  ae-cli kb +list
215
257
  ae-cli kb +index --sources '[{"scope":"company","name":"engineering-handbook"}]'
216
258
  ae-cli kb +grep -q "sandbox config" --sources '[{"scope":"company","name":"engineering-handbook"}]' --paths '["wiki/sandbox.md"]'
217
- ae-cli kb +read --source '{"scope":"company","name":"engineering-handbook"}' --path "wiki/sandbox.md"
259
+ ae-cli kb +read --source '{"scope":"company","name":"engineering-handbook"}' --path "wiki/sandbox.md" --limit 2000 --expand block
218
260
  ```
219
261
 
220
262
  ## Agent and System Administration
@@ -228,19 +270,32 @@ ae-cli agent +list-mcps
228
270
  ae-cli agent +list-skills
229
271
  ae-cli agent +list-automations
230
272
  ae-cli agent +list-attachments
273
+ ae-cli agent approval-type list
274
+ ae-cli agent approval-request list --status pending
275
+ ae-cli agent approval-task list --status pending
276
+ ae-cli agent approval-effect list --status manual_required
231
277
  ```
232
278
 
233
- The `system` domain calls administrative `/api/admin/**` endpoints and requires a `root` or `agent_admin` role:
279
+ 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.
280
+
281
+ The `system` domain calls administrative `/api/admin/**` and versioned channel `/api/cli/channel/v1/**` endpoints and requires a `root` or `agent_admin` role:
234
282
 
235
283
  ```bash
236
284
  ae-cli system +list-members --status enabled
237
285
  ae-cli system +list-sandboxes
238
- ae-cli system +get-usage-summary --days 30
286
+ ae-cli system +get-sandbox-config
287
+ ae-cli system +get-usage-summary --days 30 --refresh true
288
+ ae-cli system +export-usage --start-date 2026-07-01 --end-date 2026-07-31 --group-by user --output ./system-usage.csv
239
289
  ae-cli system +list-quota-rules
240
290
  ae-cli system +list-channels
291
+ ae-cli system channel routing get --endpoint-id <endpoint-id>
292
+ ae-cli --dry-run system +bind-feishu-users --channel-id <channel-id> --endpoint-id <endpoint-id> --bindings @bindings.json
293
+ ae-cli system +list-sandbox-tools
241
294
  ```
242
295
 
243
- Authorization is always enforced by the server. Do not retry or bypass a permission error.
296
+ 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.
297
+
298
+ 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.
244
299
 
245
300
  ## Agent Skills
246
301
 
@@ -250,13 +305,13 @@ The npm package includes the same `skills/` directory used by the public reposit
250
305
  |---|---|
251
306
  | `ae-capability` | Capability discovery and generic invocation |
252
307
  | `ae-analysis`, `ae-analysis-global` | Analysis, audience, metadata, governance, and multi-cluster workflows |
253
- | `ae-experiment` | Atlas experiment, Feature, metric, traffic-layer, and report workflows |
254
308
  | `ae-metadata` | Capability-backed metadata data-table operations |
255
309
  | `ae-engage` | Engage operations and workflow guidance |
256
310
  | `ae-dataops` | Data warehouse, flow, IDE, integration, and operations |
257
311
  | `ae-community` | Community analysis and reporting |
258
- | `ae-kb` | Knowledge-base lifecycle and retrieval |
259
- | `ae-agent`, `ae-system`, `ae-team` | Agent resources, administration, and TeamRun workflows |
312
+ | `ae-data-integration` | Local CSV/JSON/Excel inspection, mapping, conversion, upload, and reusable handoff |
313
+ | `ae-kb`, `ae-kb-discovery` | Knowledge-base lifecycle, Q&A, deterministic retrieval, and read-only knowledge-base discovery |
314
+ | `ae-agent`, `ae-system`, `ae-team` | Agent resources and user memory, administration, and TeamRun workflows |
260
315
  | `ae-generate-tracking-plan`, `ae-generate-tracking-code` | Tracking-plan and tracking-code generation |
261
316
  | `ae-data-integration-helper` | SDK and LogBus2 integration guidance |
262
317
 
@@ -288,7 +343,6 @@ Core structure:
288
343
  src/
289
344
  ├── core/ # auth, config, clients, compatibility, version sync
290
345
  ├── framework/ # command registration, lifecycle, output, errors
291
- ├── api/ # raw authenticated API access
292
346
  └── commands/ # business domains and CLI utilities
293
347
  skills/ # Agent Skills shipped with the npm package
294
348
  self-check/ # release and documentation consistency checks
@@ -299,10 +353,13 @@ Useful verification commands:
299
353
 
300
354
  ```bash
301
355
  npm run build
356
+ npm test
302
357
  npm run qa-changed
303
358
  npm run self-check
304
359
  npm run check:release
305
360
  npm run verify:experiment-tools
361
+ npm run verify:readme
362
+ npm run verify:auth-credentials
306
363
  npm run verify:update-check
307
364
  npm run verify:version-sync
308
365
  ```
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,31 +105,49 @@ 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
- | `experiment` | Atlas 实验、报表、流量层、分桶、Feature、指标和操作日志 |
116
- | `analysis-meta` | 事件/属性元数据、指标、虚拟元数据、埋点治理和项目配置 |
117
- | `analysis-governance` | 资产搜索、血缘、影响分析和治理操作 |
118
- | `metadata` | 基于 Capability Gateway 的数据表和属性操作 |
119
- | `tracking` | 埋点方案生命周期、SDK 示例、检查、采集诊断、代码生成和内置 Wiki |
120
- | `engage-flow`、`engage-task`、`engage-setting`、`engage-scene`、`engage-activity`、`engage-workbench` | 运营流程、任务、设置、策略、活动和工作台 |
121
- | `community` | 社区帖子、评论、话题、情感、直播和报告工作流 |
122
- | `dataops_repo`、`dataops_datatable`、`dataops_flow`、`dataops_ide`、`dataops_integration`、`dataops_operations` | 数仓、数据表、任务流、IDE、数据集成和运维工作流 |
123
- | `kb` | 知识库生命周期、LLM 查询及确定性的 index/grep/read 检索 |
124
- | `agent` | Agent、自动化、模型、MCP、Skills、附件、凭证和沙盒工具 |
125
- | `system` | root/admin 的成员、沙盒、共享工具、模型、用量、配额和 IM 渠道管理 |
126
- | `team` | Agent Team 生命周期,以及 TeamRun 执行、对话、结果和产物 |
127
- | `capability` | 能力发现、Schema 查看、参数校验、dry-run 和通用执行 |
128
- | `auth`、`config` | Host 隔离的认证和多环境配置 |
129
- | `api` | 用于诊断或过渡场景的原始认证 HTTP 请求 |
130
- | `sync` | 在本地工作区与 Agent 应用之间推送或拉取 Skills 和 MCP |
131
- | `model` | Agent 沙盒中切换当前工作区模型 |
132
- | `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
+ | 分析与项目 | `experiment` | Atlas 实验、报表、流量层、分桶、Feature、指标和操作日志 |
117
+ | 分析与项目 | `analysis-meta` | 事件/属性目录、指标、虚拟元数据、埋点治理和项目分析配置 |
118
+ | 分析与项目 | `analysis-governance` | 数据资产搜索、血缘、影响分析、认证和治理 |
119
+ | 分析与项目 | `project` | 项目信息、成员、角色、权限、实体、时区和交接配置 |
120
+ | 分析与项目 | `metadata` | 基于 Capability Gateway 的数据表、属性及维度表绑定 |
121
+ | 分析与项目 | `personal-semantic-preference` | 当前用户按项目维护轻量个人语义偏好 |
122
+ | 分析与项目 | `project-semantic` | 项目语义治理、资产包、候选校验、审核和发布 |
123
+ | 数据与埋点 | `tracking` | 埋点方案、SDK 示例、检查、采集诊断、代码生成和内置 Wiki |
124
+ | 数据与埋点 | `data-integration` | 检查、规划、转换、上传、交接和复用本地 CSV/JSON/Excel 数据 |
125
+ | 社区洞察 | `community` | 社区帖子、评论、话题、情感、直播和报告工作流 |
126
+ | 运营 | `engage-flow` | 运营流程管理 |
127
+ | 运营 | `engage-task` | 运营任务及触达内容管理 |
128
+ | 运营 | `engage-setting` | 渠道、受众和运营设置 |
129
+ | 运营 | `engage-scene` | 运营场景和策略管理 |
130
+ | 运营 | `engage-activity` | 活动、专题及其任务管理 |
131
+ | 运营 | `engage-workbench` | 运营工作台和待办管理 |
132
+ | 运营 | `engage-query` | 运营查询、异步导出和产物管理 |
133
+ | DataOps | `dataops_repo` | 数仓和数据源管理 |
134
+ | DataOps | `dataops_datatable` | 数据表生命周期管理 |
135
+ | DataOps | `dataops_flow` | 开发流程、调度和补数作业管理 |
136
+ | DataOps | `dataops_ide` | IDE 查询及结果下载 |
137
+ | DataOps | `dataops_integration` | 数据集成任务管理 |
138
+ | DataOps | `dataops_operations` | 运维、监控和告警工作流 |
139
+ | Agent 平台 | `kb` | 知识库生命周期、LLM 问答及确定性的 index/grep/read 检索 |
140
+ | Agent 平台 | `agent` | Agent、审批、自动化、模型、MCP、Skills、附件、凭证和沙盒工具 |
141
+ | Agent 平台 | `memory` | 用户记忆、Top-K 上下文写入和实际采用计数 |
142
+ | Agent 平台 | `team` | Agent Team 和 TeamRun 的执行、对话、结果及产物 |
143
+ | Agent 平台 | `system` | root/admin 的成员、沙盒、工具、模型、用量、配额和渠道管理 |
144
+ | 通用工具 | `capability` | 能力发现、Schema 查看、参数校验、dry-run 和通用执行 |
145
+ | 通用工具 | `auth` | 按 Host 登录、查看状态及管理同一 Host 的多个账号 |
146
+ | 通用工具 | `config` | 添加、切换、重命名和删除 Host 环境 |
147
+ | 通用工具 | `sync` | 在本地工作区与 Agent 应用之间推送或拉取 Skills 和 MCP |
148
+ | 通用工具 | `model` | 在 Agent 沙盒中查看并切换当前工作区模型 |
149
+ | 通用工具 | `update` | 将 CLI 和 Skills 同步到当前 Host 要求的版本 |
150
+ <!-- root-command-surface:end -->
133
151
 
134
152
  ## Capability Gateway
135
153
 
@@ -150,16 +168,24 @@ ae-cli capability run analysis.report.list --input input.json
150
168
 
151
169
  Gateway 命令遵循 [Capability 命令收录规则](docs/capability-command-admission.md)。常见工作流可以提供精选命令,长尾能力则保持动态发现。
152
170
 
171
+ `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)。
172
+
153
173
  ## 认证与多环境
154
174
 
155
175
  凭证按 Host 独立存储,切换环境不会复用其他 Host 的 token。
156
176
  在终端运行 `ae-cli config`,可以交互式添加、激活、重命名或删除环境。
177
+ 运行 `ae-cli auth` 可以交互式选择当前 Host 的 active 账号;省略 `--account` 的 `ae-cli auth use` 也会打开同一个选择器。
157
178
  脚本和 Agent 应使用非交互子命令:
158
179
 
159
180
  ```bash
160
181
  ae-cli auth login --host https://host-a.example.com
161
182
  ae-cli auth status --host https://host-a.example.com
183
+ # 少量需要同一 Host 多账号的场景
184
+ ae-cli auth login --host https://host-a.example.com --add
185
+ ae-cli auth list --host https://host-a.example.com
186
+ ae-cli auth use --host https://host-a.example.com --account <login-name-or-open-id>
162
187
  ae-cli auth logout --host https://host-a.example.com
188
+ ae-cli auth logout --host https://host-a.example.com --all
163
189
 
164
190
  ae-cli config list
165
191
  ae-cli config current
@@ -171,6 +197,10 @@ ae-cli config remove pre-production --yes
171
197
 
172
198
  `<env>` 可以是完整 URL 或唯一 label。交互管理器和 `config list` 都会明确标识 active 环境。当还存在其他环境时,不允许直接删除 active 环境;应先显式切换。`config set-host` 作为兼容命令继续保留,其语义是添加或更新 Host 并立即激活。
173
199
 
200
+ 普通 `auth login` 保持一个 Host 一个账号的简单语义,并替换该 Host 已保存的账号;仅在需要时使用 `--add` 保留其他账号。`auth status` 只展示 CLI Token 状态;新版后端可同时返回账号和到期时间,旧版后端不支持 `/validate` 时仍按历史行为信任本地 CLI Token,且不会输出含 null 字段的 `account`。
201
+
202
+ 新版 CLI 只持久化 CLI Token,不保存 access token 或 refresh token。多账号保存在加密的 V1 凭据文件中,同时维护旧文件格式的当前账号投影,保证 CLI 自动降级后仍可登录;再次升级时会合并旧 CLI 对投影的登录、切换或退出变更。
203
+
174
204
  登录使用跨平台设备码流程。当前环境无法打开浏览器时,可使用 `--no-browser`。
175
205
  试用引导仅在尚未配置 Host 时出现;已配置环境的正常命令和认证流程不会展示该提示。
176
206
 
@@ -202,23 +232,35 @@ JSON 参数通常支持内联 JSON、`@file`、文件路径或通过 `-` 从 std
202
232
 
203
233
  ```bash
204
234
  ae-cli kb +new --scope company --name engineering-handbook --description "Team docs"
205
- ae-cli kb +add --name engineering-handbook --files '["./docs/guide.md","https://example.com/page"]'
206
- ae-cli kb +schema --name engineering-handbook
207
- ae-cli kb +compile --name engineering-handbook
208
- ae-cli kb +status --name engineering-handbook
235
+ ae-cli kb +import --file ./knowledge-base.zip --name "Imported handbook"
236
+ ae-cli kb +import-status --request-id <requestId>
237
+ ae-cli kb +add --name engineering-handbook --scope company --files '["./docs/guide.md","https://example.com/page"]'
238
+ ae-cli kb +list-sources --name engineering-handbook --scope company
239
+ ae-cli kb +rm-source --name engineering-handbook --scope company --id <source-id>
240
+ # 兼容旧命令:无法取得来源 ID 时仍可使用精确展示名
241
+ ae-cli kb +rm-source --name engineering-handbook --scope company --display-name kb-1780046712-guide.md
242
+ ae-cli kb +schema --name engineering-handbook --scope company --model <model-ref>
243
+ ae-cli kb +compile --name engineering-handbook --scope company --model <model-ref>
244
+ ae-cli kb +status --name engineering-handbook --scope company
209
245
  ae-cli kb +ask -q "如何配置沙盒?"
210
246
  # 仅提交,后续轮询:
211
247
  ae-cli kb +ask -q "另一个问题" --no-wait
212
248
  ae-cli kb +ask-status --execution-id <id>
213
249
  ```
214
250
 
251
+ `kb +list-sources` 返回稳定的来源 `id`。请把精确的 `id` 复制到 `kb +rm-source`,不要根据文件名或 URL 猜测。`--display-name` 仅用于无法取得 ID 时的旧版兼容。
252
+
253
+ 按名称管理知识库的命令都支持可选 `--scope personal|company`;省略时保留 personal 到 company 的旧查找顺序。Schema 与 Compile 优先使用 `ae-cli agent +list-models` 返回的模型记录 `id`;历史 `modelId` 和 `modelId::scope` 仍兼容,`displayName` 不是稳定引用。
254
+
255
+ `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、用量、编译、成员/设置、所有权转移和公司发布。
256
+
215
257
  外部 Agent 可以使用不依赖服务端 LLM 的确定性检索:
216
258
 
217
259
  ```bash
218
260
  ae-cli kb +list
219
261
  ae-cli kb +index --sources '[{"scope":"company","name":"engineering-handbook"}]'
220
262
  ae-cli kb +grep -q "沙盒配置" --sources '[{"scope":"company","name":"engineering-handbook"}]' --paths '["wiki/sandbox.md"]'
221
- ae-cli kb +read --source '{"scope":"company","name":"engineering-handbook"}' --path "wiki/sandbox.md"
263
+ ae-cli kb +read --source '{"scope":"company","name":"engineering-handbook"}' --path "wiki/sandbox.md" --limit 2000 --expand block
222
264
  ```
223
265
 
224
266
  ## Agent 与系统管理
@@ -232,19 +274,32 @@ ae-cli agent +list-mcps
232
274
  ae-cli agent +list-skills
233
275
  ae-cli agent +list-automations
234
276
  ae-cli agent +list-attachments
277
+ ae-cli agent approval-type list
278
+ ae-cli agent approval-request list --status pending
279
+ ae-cli agent approval-task list --status pending
280
+ ae-cli agent approval-effect list --status manual_required
235
281
  ```
236
282
 
237
- `system` 域调用管理接口 `/api/admin/**`,要求当前用户拥有 `root` `agent_admin` 角色:
283
+ 通用审批命令使用 Agent 应用 `/agent` base path 下的版本化 CLI-token REST。提交类型专属的 snake_case payload 前,先用 `approval-type get` 获取契约。Effect 人工重试属于 `high-risk-write`,必须提供可审计理由并显式传入 `--yes`。写命令的 `--dry-run` 仅在本地预览请求,不验证服务端权限、实时状态或未来条件流转。
284
+
285
+ `system` 域调用管理接口 `/api/admin/**` 和版本化渠道接口 `/api/cli/channel/v1/**`,要求当前用户拥有 `root` 或 `agent_admin` 角色:
238
286
 
239
287
  ```bash
240
288
  ae-cli system +list-members --status enabled
241
289
  ae-cli system +list-sandboxes
242
- ae-cli system +get-usage-summary --days 30
290
+ ae-cli system +get-sandbox-config
291
+ ae-cli system +get-usage-summary --days 30 --refresh true
292
+ ae-cli system +export-usage --start-date 2026-07-01 --end-date 2026-07-31 --group-by user --output ./system-usage.csv
243
293
  ae-cli system +list-quota-rules
244
294
  ae-cli system +list-channels
295
+ ae-cli system channel routing get --endpoint-id <endpoint-id>
296
+ ae-cli --dry-run system +bind-feishu-users --channel-id <channel-id> --endpoint-id <endpoint-id> --bindings @bindings.json
297
+ ae-cli system +list-sandbox-tools
245
298
  ```
246
299
 
247
- 最终权限始终由服务端校验。遇到权限错误时不要重试或绕过。
300
+ system 域现有 71 条命令,覆盖成员、沙箱、共享沙箱工具、模型与价格、用量下钻与 CSV 导出、成本控制、配额和渠道。渠道管理覆盖九类渠道、Endpoint 路由、WhatsApp Web 扫码关联,以及 1-100 人飞书批量绑定的逐项结果与公共/逐人默认 Agent 分配。CSV 导出必须显式指定本地路径,采用流式写入,不覆盖已有文件,失败时清理不完整文件。
301
+
302
+ 最终权限、公司隔离和资源归属始终由服务端校验。“没有对应 CLI 命令”不是安全边界:拥有 Bash/网络能力的 Agent 仍可直接构造 HTTP 请求。遇到权限错误时不要重试或绕过,不要调用明确排除的其他系统成员删除或底层沙箱编排接口;所有管理员写操作都应先 dry-run 并取得用户明确确认。Skill、dry-run 和 CLI 确认提示只是防误操作措施,不能替代服务端鉴权;`--yes` 会跳过该提示。
248
303
 
249
304
  ## Agent Skills
250
305
 
@@ -254,13 +309,13 @@ npm 包内包含与公开仓库一致的 `skills/` 目录:
254
309
  |---|---|
255
310
  | `ae-capability` | Capability 发现和通用调用 |
256
311
  | `ae-analysis`、`ae-analysis-global` | 分析、受众、元数据、治理及多集群工作流 |
257
- | `ae-experiment` | Atlas 实验、Feature、指标、流量层和报表工作流 |
258
312
  | `ae-metadata` | 基于 Capability Gateway 的元数据数据表操作 |
259
313
  | `ae-engage` | 运营操作和工作流指南 |
260
314
  | `ae-dataops` | 数仓、任务流、IDE、数据集成和运维 |
261
315
  | `ae-community` | 社区分析和报告 |
262
- | `ae-kb` | 知识库生命周期和检索 |
263
- | `ae-agent`、`ae-system`、`ae-team` | Agent 资源、系统管理和 TeamRun 工作流 |
316
+ | `ae-data-integration` | 本地 CSV/JSON/Excel 数据的检查、映射、转换、上传和可复用交接 |
317
+ | `ae-kb`、`ae-kb-discovery` | 知识库生命周期、问答、确定性检索及只读知识库发现 |
318
+ | `ae-agent`、`ae-system`、`ae-team` | Agent 资源与用户记忆(含 `memory +write-context`)、系统管理和 TeamRun 工作流 |
264
319
  | `ae-generate-tracking-plan`、`ae-generate-tracking-code` | 埋点方案和埋点代码生成 |
265
320
  | `ae-data-integration-helper` | SDK 和 LogBus2 集成指南 |
266
321
 
@@ -292,7 +347,6 @@ npm run dev -- --help
292
347
  src/
293
348
  ├── core/ # 认证、配置、客户端、兼容性和版本同步
294
349
  ├── framework/ # 命令注册、生命周期、输出和错误
295
- ├── api/ # 原始认证 API 访问
296
350
  └── commands/ # 业务域和 CLI 工具
297
351
  skills/ # 随 npm 包发布的 Agent Skills
298
352
  self-check/ # 发布和文档一致性检查
@@ -303,10 +357,13 @@ test/, tests/ # 命令、契约和回归测试
303
357
 
304
358
  ```bash
305
359
  npm run build
360
+ npm test
306
361
  npm run qa-changed
307
362
  npm run self-check
308
363
  npm run check:release
309
364
  npm run verify:experiment-tools
365
+ npm run verify:readme
366
+ npm run verify:auth-credentials
310
367
  npm run verify:update-check
311
368
  npm run verify:version-sync
312
369
  ```