@thinkingai/ae-cli 1.0.22 → 1.0.27

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 (56) hide show
  1. package/README.md +39 -1
  2. package/README.zh.md +40 -1
  3. package/dist/{auth-YM7OI23X.js → auth-TXFJHPXU.js} +3 -2
  4. package/dist/{auth-5S7SPPEJ.js → auth-W2JZ3DKA.js} +11 -4
  5. package/dist/{chunk-MPFTXJFG.js → chunk-2NGWYMLB.js} +14 -2
  6. package/dist/chunk-6T7245YE.js +478 -0
  7. package/dist/{chunk-KM57HI5B.js → chunk-B4UL2VIJ.js} +7 -1
  8. package/dist/{chunk-TMMUBSKW.js → chunk-BI5ZVD6T.js} +8 -1
  9. package/dist/chunk-MNHE6SSI.js +79 -0
  10. package/dist/chunk-MWWYGZ76.js +130 -0
  11. package/dist/{chunk-24ZKQWG2.js → chunk-SRRUNQIM.js} +51 -4
  12. package/dist/chunk-TG64AQV4.js +262 -0
  13. package/dist/{chunk-NBFTPIAH.js → chunk-VT6VC4PA.js} +15 -4
  14. package/dist/{client-7S23DVHH.js → client-IU2E5IOL.js} +6 -3
  15. package/dist/{config-RVUESJRF.js → config-WH3R3IRY.js} +3 -2
  16. package/dist/index.js +195 -20
  17. package/dist/model-CC7U5XOJ.js +131 -0
  18. package/dist/{raw-5SYAUCJQ.js → raw-TUHZQ4UB.js} +5 -4
  19. package/dist/sync-EVEDS7YE.js +383 -0
  20. package/dist/te-agent-FLTDYV3L.js +522 -0
  21. package/dist/{te-analysis-RQST6AT3.js → te-analysis-CMXADIJM.js} +101 -12
  22. package/dist/{te-audience-TJ74UJI3.js → te-audience-LPZFFSXM.js} +4 -3
  23. package/dist/{te-common-W5URM2SH.js → te-common-BXQFKTB3.js} +4 -3
  24. package/dist/{te-community-YRV2VAD4.js → te-community-K5S3VOZY.js} +4 -3
  25. package/dist/{te-dataops-ZPH72BCK.js → te-dataops-567IMCQG.js} +4 -3
  26. package/dist/{te-engage-57UKFV74.js → te-engage-TBUTGW5F.js} +105 -49
  27. package/dist/{te-kb-GD7SJRYB.js → te-kb-XHVBWP5E.js} +227 -38
  28. package/dist/{te-meta-25SLZFXJ.js → te-meta-NQ4U3VJW.js} +25 -4
  29. package/dist/te-team-556APRIU.js +529 -0
  30. package/package.json +6 -1
  31. package/skills/ae-agent/SKILL.md +133 -0
  32. package/skills/ae-analysis/references/create_entity.md +39 -0
  33. package/skills/ae-analysis/references/create_space.md +34 -0
  34. package/skills/ae-analysis/references/drilldown_user_events.md +1 -1
  35. package/skills/ae-analysis/references/drilldown_users.md +2 -2
  36. package/skills/ae-analysis/references/query_adhoc.md +3 -2
  37. package/skills/ae-analysis/references/query_entity_details.md +1 -1
  38. package/skills/ae-engage/SKILL.md +25 -2
  39. package/skills/ae-engage/references/build-task-save-guide.md +283 -0
  40. package/skills/ae-engage/references/save-task.md +304 -0
  41. package/skills/ae-kb/SKILL.md +283 -0
  42. package/skills/ae-team/SKILL.md +164 -0
  43. package/skills/ae-team/references/ai-generate.md +39 -0
  44. package/skills/ae-team/references/create.md +94 -0
  45. package/skills/ae-team/references/delete.md +39 -0
  46. package/skills/ae-team/references/list-projects.md +45 -0
  47. package/skills/ae-team/references/list-templates.md +38 -0
  48. package/skills/ae-team/references/list.md +39 -0
  49. package/skills/ae-team/references/run-artifacts.md +51 -0
  50. package/skills/ae-team/references/run-cancel.md +38 -0
  51. package/skills/ae-team/references/run-chat.md +57 -0
  52. package/skills/ae-team/references/run-reply.md +41 -0
  53. package/skills/ae-team/references/run-result.md +75 -0
  54. package/skills/ae-team/references/run-start.md +73 -0
  55. package/skills/ae-team/references/run-watch.md +82 -0
  56. package/skills/ae-team/references/update.md +47 -0
@@ -0,0 +1,304 @@
1
+ # ae-engage `+save_task`
2
+
3
+ Create or update a Hermes task draft.
4
+
5
+ Mapped command: `ae-cli engage +save_task`
6
+
7
+ This command is the final write step. Do not use it as the first step in task construction.
8
+
9
+ Recommended workflow:
10
+
11
+ 1. `ae-cli engage +channel_list --project_id <projectId>`
12
+ 2. `ae-cli engage +build_task_save_guide --project_id <projectId> --req '{...}'`
13
+ 3. If the guide indicates QP-derived fields are needed, call:
14
+
15
+ ```bash
16
+ ae-cli analysis_audience +get_cluster_definition_schema --cluster_type condition
17
+ ```
18
+
19
+ 4. Build the final grouped `req`
20
+ 5. `ae-cli engage +save_task --project_id <projectId> --req '{...}'`
21
+
22
+ The audience schema query is not a fixed preflight step. Call it only when the guide indicates that you must construct:
23
+
24
+ - `targetConfig.qp`
25
+ - `triggerConfig.triggerRule`
26
+ - `clientConfig.clientQp`
27
+ - `completionIndicatorDef.event`
28
+
29
+ For the full guide contract, request format, return sections, and handoff usage, read:
30
+
31
+ - `references/build-task-save-guide.md`
32
+
33
+ ---
34
+
35
+ ## 1. General Principles
36
+
37
+ `+save_task` accepts only the final grouped draft-save payload that Hermes can validate and persist.
38
+
39
+ The command supports two modes:
40
+
41
+ - create mode: omit `req.taskId`
42
+ - update mode: include `req.taskId` for an existing draft task
43
+
44
+ Regardless of mode, this tool only saves a draft:
45
+
46
+ - it does not submit approval
47
+ - it does not start sending
48
+ - it does not register or start trigger execution
49
+
50
+ The CLI call shape is:
51
+
52
+ ```bash
53
+ ae-cli engage +save_task --project_id <projectId> --req '<req-json>'
54
+ ```
55
+
56
+ Notes:
57
+
58
+ - `projectId` is injected into top-level `req` by the CLI
59
+ - if the caller also passes `req.projectId`, the outer `--project_id` wins
60
+ - the whole `req` must be a JSON object, not a stringified JSON string
61
+ - for update mode, Hermes only allows modifying draft tasks
62
+ - in update mode, omitted fields are backfilled from the existing draft before validation, so partial draft updates are allowed
63
+
64
+ ---
65
+
66
+ ## 2. Required Workflow
67
+
68
+ ### 2.1 Query Real Channels First
69
+
70
+ Run:
71
+
72
+ ```bash
73
+ ae-cli engage +channel_list --project_id <projectId>
74
+ ```
75
+
76
+ Purpose:
77
+
78
+ - get the real project channel list
79
+ - resolve the real `channelId`
80
+ - confirm the final `channelType`
81
+
82
+ Never invent a `channelId`.
83
+
84
+ ### 2.2 Build the Scenario Guide
85
+
86
+ Run:
87
+
88
+ ```bash
89
+ ae-cli engage +build_task_save_guide --project_id <projectId> --req '{...}'
90
+ ```
91
+
92
+ Use the guide to determine:
93
+
94
+ - required grouped blocks
95
+ - required fields for the current trigger and audience mode
96
+ - unsupported combinations
97
+ - correct content schema
98
+ - current handoff template
99
+ - whether the current payload is already close to submit-ready
100
+
101
+ ### 2.3 Query Audience Condition Schema Only When Needed
102
+
103
+ If the guide indicates that QP-derived fields are needed, run:
104
+
105
+ ```bash
106
+ ae-cli analysis_audience +get_cluster_definition_schema --cluster_type condition
107
+ ```
108
+
109
+ Use the returned schema to build:
110
+
111
+ - `targetConfig.qp`
112
+ - `triggerConfig.triggerRule`
113
+ - `clientConfig.clientQp`
114
+ - `completionIndicatorDef.event`
115
+
116
+ Do not call this command by default for every task. It is conditional, not mandatory.
117
+
118
+ ### 2.4 Build Final `req` and Save
119
+
120
+ Only after the above steps should you construct the final grouped `req` and submit it with `+save_task`.
121
+
122
+ ---
123
+
124
+ ## 3. Final `req` Shape
125
+
126
+ The final object passed to `--req` should have this grouped shape:
127
+
128
+ ```json
129
+ {
130
+ "taskId": "<string, optional>",
131
+ "baseInfo": {},
132
+ "channelConfig": {},
133
+ "targetConfig": {},
134
+ "triggerConfig": {},
135
+ "controlConfig": {},
136
+ "expConfig": {},
137
+ "activityConfig": {},
138
+ "clientConfig": {}
139
+ }
140
+ ```
141
+
142
+ Top-level notes:
143
+
144
+ - `taskId` is used only in update mode
145
+ - `baseInfo` / `channelConfig` / `targetConfig` / `triggerConfig` / `controlConfig` are the main blocks
146
+ - optional blocks should usually be omitted rather than filled with invented values
147
+ - use `build_task_save_guide` output as the source of truth for the current scenario
148
+
149
+ ---
150
+
151
+ ## 4. How To Build Major Blocks
152
+
153
+ ### 4.1 `taskId`
154
+
155
+ Use `taskId` only when you are updating an existing draft task.
156
+
157
+ - create mode: omit `taskId`
158
+ - update mode: include `taskId`
159
+ - update mode can send only the fields that need changing
160
+ - update mode still fails if the referenced task is not in draft status
161
+
162
+ ### 4.2 `channelConfig`
163
+
164
+ Core fields:
165
+
166
+ - `channelType`
167
+ - `channelId`
168
+ - `groupContentList`
169
+ - optional `channelTemplateId`
170
+
171
+ Rules:
172
+
173
+ - derive `channelType` and `channelId` from real channel metadata
174
+ - do not guess template IDs
175
+ - `groupContentList` maximum size is `5`
176
+ - `occasionKeys` are parsed from content automatically and are not accepted as input
177
+
178
+ Content guidance:
179
+
180
+ - do not invent channel-specific payload structures from memory
181
+ - use `fieldRules.channelContentSchema` from `build_task_save_guide`
182
+ - take valid keys, expected item shape, and examples from the guide
183
+ - when schema fields include `paramType`, copy it exactly
184
+ - do not use free-form content items such as `{"text":"..."}` as the primary pattern
185
+
186
+ ### 4.3 `targetConfig`
187
+
188
+ Use the guide to decide which audience shape applies:
189
+
190
+ - `targetClusterType=1`: custom audience, requires `qp`
191
+ - `targetClusterType=2`: existing cluster, requires `clusterKey`
192
+ - `targetClusterType=3`: all users, forbids both `qp` and `clusterKey`
193
+
194
+ If `qp` is required, construct it from:
195
+
196
+ ```bash
197
+ ae-cli analysis_audience +get_cluster_definition_schema --cluster_type condition
198
+ ```
199
+
200
+ ### 4.4 `triggerConfig`
201
+
202
+ Use the guide to determine the current trigger rule set:
203
+
204
+ - `triggerType=0`: requires `triggerTime`
205
+ - `triggerType=1`: requires `startDate`, `endDate`, `triggerCrontab`
206
+ - `triggerType=2`: manual, no `triggerRule`
207
+ - `triggerType=3/4/5`: requires `triggerRule`
208
+
209
+ Rules:
210
+
211
+ - `triggerType=6` is not supported
212
+ - use the guide for cron format and wrong-example checks
213
+ - if `triggerRule` is needed, build it from:
214
+
215
+ ```bash
216
+ ae-cli analysis_audience +get_cluster_definition_schema --cluster_type condition
217
+ ```
218
+
219
+ ### 4.5 `controlConfig`
220
+
221
+ Minimum required field:
222
+
223
+ - `completionIndicatorDef`
224
+
225
+ When the guide points to event-based completion or experiment-driven main-goal rules, use:
226
+
227
+ ```bash
228
+ ae-cli analysis_audience +get_cluster_definition_schema --cluster_type condition
229
+ ```
230
+
231
+ to build `completionIndicatorDef.event`.
232
+
233
+ Important constraints that still apply:
234
+
235
+ - `doNotDisturb.enableDoNotDisturb=true` requires `startTime` and `endTime` in `HH:mm`
236
+ - `pushDelay.enablePushDelay=true` requires valid `delayType`, and its dependent fields must match the selected mode
237
+ - `pushDelay.delayType=1` is only valid for `client_push`
238
+ - `pushDelay.delayUnit` must stay within `week`, `day`, `hour`, `minute`, `second`
239
+ - `timeoutControl.enableTimeoutControl=true` requires valid `time` and `unit`
240
+ - `timeoutControl.unit` must stay within `day`, `hour`, `minute`
241
+
242
+ ### 4.6 `clientConfig`
243
+
244
+ Use this block only when client-side conditions are needed.
245
+
246
+ If `clientConfig.clientQp` is required, build it from:
247
+
248
+ ```bash
249
+ ae-cli analysis_audience +get_cluster_definition_schema --cluster_type condition
250
+ ```
251
+
252
+ Only call that schema query when the guide explicitly shows that the field is needed.
253
+
254
+ ---
255
+
256
+ ## 5. Final Self-Check Before `+save_task`
257
+
258
+ Before submission, verify:
259
+
260
+ 1. `channelId` comes from a real channel query.
261
+ 2. `build_task_save_guide` has already been called for the current scenario or partial draft.
262
+ 3. `fieldRules.channelContentSchema` was used as the source of truth for content structure.
263
+ 4. Any required QP-derived fields were built from `ae-cli analysis_audience +get_cluster_definition_schema --cluster_type condition`.
264
+ 5. `targetClusterType` matches the presence or absence of `clusterKey` / `qp`.
265
+ 6. `triggerType` matches the provided scheduling or event fields.
266
+ 7. `completionIndicatorDef` is present and structurally valid for the current scenario.
267
+ 8. `taskId` is omitted for create mode and present only for updating a draft.
268
+ 9. No unsupported `triggerType=6` is used.
269
+ 10. No placeholder IDs or fabricated resource names remain in the request.
270
+
271
+ ---
272
+
273
+ ## 6. Standard Example Flow
274
+
275
+ Use this style of workflow, rather than jumping directly to `+save_task`:
276
+
277
+ ```bash
278
+ ae-cli engage +channel_list --project_id 1
279
+ ae-cli engage +build_task_save_guide --project_id 1 --req '{"context":{"triggerType":2,"channelId":"channel_123"}}'
280
+ ae-cli engage +save_task --project_id 1 --req '{...final grouped req...}'
281
+ ```
282
+
283
+ If the guide indicates QP-derived fields are needed, insert:
284
+
285
+ ```bash
286
+ ae-cli analysis_audience +get_cluster_definition_schema --cluster_type condition
287
+ ```
288
+
289
+ before building the final `req`.
290
+
291
+ ---
292
+
293
+ ## 7. Safety Constraints
294
+
295
+ This command is a write operation.
296
+
297
+ - Do not treat `save_task` as “submit and launch task”
298
+ - Do not bypass `build_task_save_guide`
299
+ - Do not pass the whole `req` as a JSON string
300
+ - Do not use `triggerType=6`
301
+ - Do not invent `channelId`, `clusterKey`, audience definitions, or content keys
302
+ - Do not use `taskId` for a non-draft task
303
+ - Do not pass `occasionKeys`; Hermes derives them from content
304
+ - Do not call the audience schema query as a reflex; call it only when guide output says QP-derived fields are needed
@@ -0,0 +1,283 @@
1
+ ---
2
+ name: ae-kb
3
+ version: 1.0.0
4
+ description: "AE/TE knowledge base CLI manual for creating, querying, deterministic index/grep/read retrieval, checking status, uploading, compiling, schema generation, URL sources, source deletion, and knowledge base deletion. Use when the user asks to manage TE/AE/ThinkingEngine knowledge bases, upload documents or URLs to a knowledge base, query knowledge, inspect knowledge base indexes, search knowledge base pages, read a specific knowledge base page, check knowledge base status, generate schemas, compile knowledge, remove sources, or delete a knowledge base. Must use ae-cli kb commands and must not guess knowledge base names, scopes, page paths, source display names, JSON payload shapes, or URL formats."
5
+ ---
6
+
7
+ # ae-kb
8
+
9
+ AE CLI (`ae-cli`) knowledge base commands are invoked through:
10
+
11
+ ```bash
12
+ ae-cli kb +<command> [options]
13
+ ```
14
+
15
+ ## Global Rules
16
+
17
+ - Use this skill for TE/AE knowledge base tasks: create, query, inspect indexes, grep pages, read pages, check status, upload sources, add URL sources, generate schema, compile, remove source files, and delete knowledge bases.
18
+ - Read operations can run directly after required inputs are known. Write operations require explicit user intent and normally keep the confirmation prompt unless the user asks to bypass it.
19
+ - Prefer `--dry-run` before destructive or broad writes when the user has not already validated the target.
20
+ - Do not invent knowledge base names, scopes, source display names, or JSON payloads. Ask the user or query known context when values are missing.
21
+ - JSON flags must be valid JSON strings, usually wrapped in single quotes in shell commands.
22
+ - Successful commands return JSON by default. Use `--format table` only when a table is easier for a human to scan.
23
+ - For external-agent retrieval, prefer the deterministic flow `+index` -> `+grep` -> `+read`: inspect navigation, locate candidate pages, then open the exact page or line window.
24
+
25
+ ## Commands
26
+
27
+ | Command | Risk | Purpose |
28
+ |---|---:|---|
29
+ | `+query` | read | Query one or more knowledge bases with a natural-language question. |
30
+ | `+index` | read | List accessible knowledge bases and their `index.md` navigation maps. |
31
+ | `+grep` | read | Keyword-search knowledge base pages and return matched lines with context. |
32
+ | `+read` | read | Read a full knowledge base page or a line window. |
33
+ | `+new` | write | Create a new personal or company knowledge base. |
34
+ | `+add` | write | Upload local files, a non-recursive directory, or HTTP(S) pages converted to markdown. |
35
+ | `+url` | write | Upload a URL source directly with optional display name and parsing instruction. |
36
+ | `+schema` | write | Generate the compile schema for a knowledge base. |
37
+ | `+compile` | write | Compile a knowledge base in incremental or full mode. |
38
+ | `+status` | read | Query the current status of a knowledge base. |
39
+ | `+rm-source` | write | Delete one source file from a knowledge base by display name. |
40
+ | `+remove` | write | Delete an entire knowledge base. |
41
+
42
+ ## Common Workflows
43
+
44
+ ### Create a Knowledge Base
45
+
46
+ Use `+new` with name. `--scope` is optional and defaults to `company`; valid scopes are `personal` and `company`.
47
+
48
+ ```bash
49
+ ae-cli kb +new \
50
+ --scope company \
51
+ --name engineering-handbook \
52
+ --description "Engineering handbook" \
53
+ --tags '["engineering","handbook"]'
54
+ ```
55
+
56
+ Optional fields:
57
+
58
+ - `--scope`: scope, defaults to `company`.
59
+ - `--description`: description, up to 200 characters.
60
+ - `--tags`: JSON array, max 2 tags, each up to 15 characters.
61
+ - `--project-id`: optional project ID to bind.
62
+ - `--project-name`: optional project display name.
63
+
64
+ ### Upload Files or Directories
65
+
66
+ Use `+add` when sources are local files, local directories, or pages that should be fetched and converted to markdown before upload.
67
+
68
+ ```bash
69
+ ae-cli kb +add \
70
+ --name engineering-handbook \
71
+ --files '["./README.md","./docs","https://example.com/guide"]'
72
+ ```
73
+
74
+ Input rules:
75
+
76
+ - `--files` must be a JSON array of strings.
77
+ - Local directory reading is non-recursive.
78
+ - URL entries must start with `http://` or `https://`.
79
+ - Supported extensions include markdown/text, office documents, PDFs, spreadsheets, presentations, and common images. Local files are uploaded as multipart file blobs; HTTP(S) pages are fetched and converted to markdown before upload.
80
+ - Duplicate filenames are automatically suffixed as `name-1.ext`, `name-2.ext`, etc.
81
+
82
+ ### Add a URL Source
83
+
84
+ Use `+url` when adding one URL source and optionally passing a display name or parsing instruction.
85
+
86
+ ```bash
87
+ ae-cli kb +url \
88
+ --name engineering-handbook \
89
+ --url https://example.com/guide \
90
+ --display-name guide \
91
+ --parse-instruction "Keep headings and code blocks"
92
+ ```
93
+
94
+ `--url` must be `http(s)`.
95
+
96
+ ### Generate Schema and Compile
97
+
98
+ Generate the schema first when the knowledge base needs a compile schema.
99
+
100
+ ```bash
101
+ ae-cli kb +schema --name engineering-handbook
102
+ ```
103
+
104
+ Use `--force` only to recover a stuck `generating` status. Use `--model` only when the user provides the model display name.
105
+
106
+ Compile after sources and schema are ready:
107
+
108
+ ```bash
109
+ ae-cli kb +compile --name engineering-handbook --mode incremental
110
+ ```
111
+
112
+ Valid compile modes are `incremental` and `full`; default is `incremental`.
113
+
114
+ ### Check Knowledge Base Status
115
+
116
+ Use `+status` to inspect the current status of a knowledge base.
117
+
118
+ ```bash
119
+ ae-cli kb +status --name engineering-handbook
120
+ ```
121
+
122
+ ### Query Knowledge
123
+
124
+ Use `+query` with a natural-language question and a JSON array of source refs.
125
+
126
+ ```bash
127
+ ae-cli kb +query \
128
+ --query "How do we release a dashboard?" \
129
+ --sources '[{"scope":"company","name":"engineering-handbook"}]'
130
+ ```
131
+
132
+ `--sources` entries require:
133
+
134
+ - `scope`: knowledge base scope such as `personal` or `company`.
135
+ - `name`: knowledge base name.
136
+
137
+ ### Explore Knowledge Base Pages
138
+
139
+ Use the deterministic retrieval primitives when an agent needs to explore knowledge base content like a code repository. These endpoints do not call an LLM on the server side.
140
+
141
+ Start with `+index` to see accessible knowledge bases and navigation maps:
142
+
143
+ ```bash
144
+ ae-cli kb +index \
145
+ --sources '[{"scope":"company","name":"engineering-handbook"}]'
146
+ ```
147
+
148
+ Then use `+grep` to locate likely pages and line numbers:
149
+
150
+ ```bash
151
+ ae-cli kb +grep \
152
+ --query "sandbox configuration" \
153
+ --sources '[{"scope":"company","name":"engineering-handbook"}]' \
154
+ --top-k 10
155
+ ```
156
+
157
+ Finally use `+read` to open the exact page, optionally with a line window:
158
+
159
+ ```bash
160
+ ae-cli kb +read \
161
+ --source '{"scope":"company","name":"engineering-handbook"}' \
162
+ --path "wiki/sandbox.md" \
163
+ --offset 1 \
164
+ --limit 200
165
+ ```
166
+
167
+ Retrieval rules:
168
+
169
+ - `+index` accepts optional `--sources` and `--locale`; omit `--sources` to list all accessible knowledge bases.
170
+ - `+grep` requires `--query` / `-q`; optional `--sources`, `--top-k` (1-50, default 10), and `--locale`.
171
+ - `+read` requires `--source` pointing to exactly one knowledge base and `--path` relative to the knowledge base root; optional `--offset`, `--limit` (1-2000), and `--locale`.
172
+ - Do not guess a `--path`; get it from `+index` or `+grep` results.
173
+
174
+ ### Remove One Source
175
+
176
+ Use `+rm-source` only when the source display name is known exactly.
177
+
178
+ ```bash
179
+ ae-cli kb +rm-source \
180
+ --name engineering-handbook \
181
+ --display-name kb-1780046712-guide.md
182
+ ```
183
+
184
+ If the user only gives a loose source name, do not guess. Ask for the exact uploaded display name.
185
+
186
+ ### Delete a Knowledge Base
187
+
188
+ Use `+remove` for deleting the entire knowledge base. Confirm the target name with the user if there is any ambiguity.
189
+
190
+ ```bash
191
+ ae-cli kb +remove --name engineering-handbook
192
+ ```
193
+
194
+ ## Command Reference
195
+
196
+ ### `+query`
197
+
198
+ ```bash
199
+ ae-cli kb +query --query "<question>" --sources '[{"scope":"company","name":"kb-name"}]'
200
+ ```
201
+
202
+ - `--query`, alias `-q`: required natural-language question.
203
+ - `--sources`: required JSON array of knowledge base refs.
204
+
205
+ ### `+index`
206
+
207
+ ```bash
208
+ ae-cli kb +index [--sources '[{"scope":"company","name":"kb-name"}]'] [--locale zh|en|ja|ko]
209
+ ```
210
+
211
+ - `--sources`: optional JSON array of knowledge base refs. Omit to list all accessible knowledge bases.
212
+ - `--locale`: optional locale: `zh`, `en`, `ja`, or `ko`.
213
+
214
+ ### `+grep`
215
+
216
+ ```bash
217
+ ae-cli kb +grep --query "<keywords>" [--sources '[{"scope":"company","name":"kb-name"}]'] [--top-k 10] [--locale zh|en|ja|ko]
218
+ ```
219
+
220
+ - `--query`, alias `-q`: required keywords to search across knowledge bases.
221
+ - `--sources`: optional JSON array of knowledge base refs. Omit to search all accessible knowledge bases.
222
+ - `--top-k`: optional max number of hits, 1-50, default 10.
223
+ - `--locale`: optional locale: `zh`, `en`, `ja`, or `ko`.
224
+
225
+ ### `+read`
226
+
227
+ ```bash
228
+ ae-cli kb +read --source '{"scope":"company","name":"kb-name"}' --path "index.md" [--offset 1] [--limit 200] [--locale zh|en|ja|ko]
229
+ ```
230
+
231
+ - `--source`: required JSON object pointing to exactly one knowledge base.
232
+ - `--path`: required page path relative to the knowledge base root, such as `index.md` or `wiki/concepts/data-model.md`.
233
+ - `--offset`: optional 1-based start line.
234
+ - `--limit`: optional max line count, 1-2000.
235
+ - `--locale`: optional locale: `zh`, `en`, `ja`, or `ko`.
236
+
237
+ ### `+new`
238
+
239
+ ```bash
240
+ ae-cli kb +new --name "<name>" [--scope personal|company] [--description "..."] [--tags '["t1","t2"]'] [--project-id "..."] [--project-name "..."]
241
+ ```
242
+
243
+ ### `+add`
244
+
245
+ ```bash
246
+ ae-cli kb +add --name "<name>" --files '["./a.md","./docs","https://example.com/page"]'
247
+ ```
248
+
249
+ ### `+url`
250
+
251
+ ```bash
252
+ ae-cli kb +url --name "<name>" --url "https://example.com/page" [--display-name "..."] [--parse-instruction "..."]
253
+ ```
254
+
255
+ ### `+schema`
256
+
257
+ ```bash
258
+ ae-cli kb +schema --name "<name>" [--force] [--model "<model displayName>"]
259
+ ```
260
+
261
+ ### `+compile`
262
+
263
+ ```bash
264
+ ae-cli kb +compile --name "<name>" [--mode incremental|full]
265
+ ```
266
+
267
+ ### `+status`
268
+
269
+ ```bash
270
+ ae-cli kb +status --name "<name>"
271
+ ```
272
+
273
+ ### `+rm-source`
274
+
275
+ ```bash
276
+ ae-cli kb +rm-source --name "<name>" --display-name "<uploaded source display name>"
277
+ ```
278
+
279
+ ### `+remove`
280
+
281
+ ```bash
282
+ ae-cli kb +remove --name "<name>"
283
+ ```