ae-kb

AE/TE knowledge base CLI manual for creating, importing read-only compiled snapshots, querying, LLM-powered ask, listing accessible knowledge bases and their sources, deterministic index/grep/read retrieval, checking status, ZIP source upload and directory management, raw child-file reading, revisio

By thinkingaiagenticengine · 506 installs

npx skills add thinkingaiagenticengine/ae-cli --skill ae-kb

Source repository · Upstream listing

ae kb AE CLI ( ae cli ) knowledge base commands are invoked through: Global Rules Use this skill for TE/AE knowledge base tasks: create, import a compiled snapshot, query, ask with LLM, list accessible knowledge bases and their sources, inspect indexes, grep pages, read pages, check status, upload sources, add URL sources, generate schema, compile, remove source files, and delete knowledge bases. Searching a knowledge base for an answer is the most common task. If that is what you are doing, go straight to [Explore Knowledge Base Pages]( explore knowledge base pages) and read [ references/query workflow.md ](references/query workflow.md) first — it is the retrieval procedure. The other commands below are for managing knowledge bases, not answering from them. 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. Prefer dry run before destructive or broad writes when the user has not already validated the target. Do not invent knowledge base names, scopes, source IDs, source display names, or JSON payloads. Ask the user or query known context when values are missing. When building a sources ref (or +read source ), copy the exact scope and name from +list output — run ae cli kb +list first when the scope of a named knowledge base is unknown. JSON flags must be valid JSON strings, usually wrapped in single quotes in shell commands. Successful commands return JSON by default. Use format table only when a table is easier for a human to scan. Envelope may include optional notice.host compat . host <url overrides the active AE host. It is available on every command and may be placed after the subcommand, e.g. ae cli kb +<command host <url . CRITICAL — Host compat (do this first): After each ae cli run, check stderr and notice.host compat . If either is present, open the user reply with a short ⚠️ version warning and quote the npm i g / npx skills add (or update cluster) lines verbatim , then present the business result. Soft tip; ok: true can still carry the notice. Retrieval ( +index / +grep / +read ) is deterministic and server side LLM free; use it for simple factual lookups. Use +ask when the question requires synthesizing across multiple pages or multi hop reasoning. Commands Command Risk Purpose : +ask read LLM powered Q&A over knowledge bases; for multi page synthesis or multi hop questions. +ask status read Query the current status of an ask execution by execution id without polling. +list read List accessible knowledge bases filtered by buildStatus (default: compiled). +list sources read List source metadata for one knowledge base so exact source identifiers can be discovered safely. +index read List accessible knowledge bases and their index.md navigation maps. +grep read Keyword search knowledge base pages; returns a page level results array (hitCount / pageKind / sections previews). +read read Read a full knowledge base page, a line window, or (with outline ) only the page heading tree. +new write Create a new personal or company knowledge base. +import write Import a compiled Markdown ZIP as a personal or company read only snapshot; scope defaults to personal . +import status read Query one snapshot import task by request id without polling; output includes the persisted scope . +add write Upload local files (including ZIP directory sources), a non recursive directory, or HTTP(S) pages converted to markdown. +url write Upload a URL source directly with optional display name and parsing instruction. +schema write Generate the compile schema for a knowledge base. +compile write Compile a knowledge base in incremental or full mode. +status read Query the current status of a knowledge base. +rm source high risk write Delete one source from a knowledge base by stable ID; exact display name is legacy compatibility only. +remove write Delete an entire knowledge base. Published Version History Use the nine version commands described in [ references/versions.md ](references/versions.md) to inspect immutable published history, compare source changes, and explicitly roll back an earlier version as a new publication. These commands manage history; +index/+grep/+read/+ask continue to use current published content. Command Risk Purpose +versions read List published versions and latestVersionId. +version show read Show one version summary. +version sources read Discover historical source IDs. +version diff read Compare two versions. +version tree read List a historical ZIP/URL source directory. +version read read Preview a historical directory child file. +version download read Save one ordinary historical file source; no directory download. +rollback high risk write Restore an earlier version and create a new version. +rollback status read Query a persisted rollback Operation without polling. ZIP Directory Sources Use +add files '["./sources.zip"]' to upload one ZIP as one editable parent source, preserving its internal hierarchy. Archive validation and limits are enforced by the server. This is different from +import , which creates a read only compiled snapshot. Passing a local directory to +add still uploads only its immediate supported files; it does not recursively package that directory. Discover the exact parent ID with +list sources . ZIP rows include fileCount , sizeBytes , contentRevision , and updateStatus . Command Risk Purpose +source ls read List one directory page with revision, current children and deleted paths relative to the successful baseline. +source read read Read a child source file as UTF 8/base64, or save original bytes. +source put write Add one local file or explicitly replace the exact ZIP relative path. +source rm high risk write Delete one child file or recursively delete a child directory. Copy the source ID, paths and revision from current discovery. Names resolve personal then company, following the existing External API; no scope override is available on these commands. path is relative to the ZIP root, not a local filesystem or raw/zip/... path. Root listing uses an empty path. Nonempty paths cannot be absolute or contain empty, dot, parent or backslash segments. Listing returns one page; continue using nextCursor and the same path. On a revision change, restart discovery before writing. +source read reads source bytes; +read reads compiled Wiki pages. Default UTF 8 output fails on invalid UTF 8. Base64 preserves binary data. output creates a new local file and refuses to overwrite an existing file. +source put accepts one file up to 50 MB. Default action add rejects an existing path; action replace explicitly authorizes overwriting an existing child. There is no silent upsert. Dry run shows metadata and redacts file content. expected revision is mandatory for writes. A 409 conflict is returned with its server error code; the command never refreshes and retries the write automatically. +source rm keeps the parent source. Nonempty directory removal requires recursive ; deletion follows the CLI confirmation gate. Use yes only when automated deletion of the exact target is already authorized. +rm source id deletes the entire parent. A mutation marks the parent changed but does not start compilation or regenerate Schema. Run incremental compilation explicitly; wait for successful publication before the next test stage. +status is the existing aggregate status query; it is not a per run event or ZIP Diff reader. Do not interpret its compilation submission response as successful publication. No Gateway equivalent is registered in the current KB implementation. These commands reuse the typed External source APIs. Transition status: transitional Owning module: te claude External Knowledge Base Sources API Current transport: authenticated External REST via kbApi and multipart kbUpload . Gateway target: TBD (ZIP source directory and raw file capabilities) Review after: 2026 12 06 Exit condition: migrate when equivalent typed Gateway file, directory and revision aware mutation capabilities exist; retain CLI file handling and explicit mutation semantics. Common Workflows Create a Knowledge Base Use +new with name. scope is optional and defaults to company ; valid scopes are personal and company . Optional fields: scope : scope, defaults to company . description : description, up to 200 characters. tags : JSON array, max 2 tags, each up to 15 characters. project id : optional project ID to bind. project name : optional project display name. Import a Compiled Snapshot Use +import only for a ZIP whose root contains index.md and at least one wiki/ / .md page. The server validates all archive paths, limits, UTF 8 text, and Wiki links. The result is always a personal read only snapshot; there is no scope , force , or replace option. Imported snapshots support list, Index/Wiki reading, grep/read, Ask, and deletion. They do not expose source, Schema, usage, compile, member, settings, ownership transfer, or company publish operations. The ZIP is limited to 50 MB and supports Markdown text only. Local images, attachments, other binaries, broken Wiki links, and ambiguous Wiki links are rejected by the server. Submission returns {requestId, status: "queued"} immediately. It does not wait for ZIP validation or publication. +import status returns one of queued , running , succeeded , or failed ; success includes knowledgeBaseId , and failure includes a stable error code/message. If a requestId was returned, query it before retrying. If no request ID was received, run ae cli kb +list before retrying the same name. A repeated same name import is rejected. Transition status: transitional Owning module: te claude External Knowledge Base Import API Current transport: authenticated KB external REST through kbUpload for submission and kbApi for status lookup. Gateway target: TBD ( kb.snapshot.import proposed) Review after: 2026 12 01 Exit condition: migrate to a typed Gateway capability when the equivalent multipart import capability is available, or remove this command if dynamic Gateway execution provides the same file handling and output contract. Upload Files or Directories Use +add when sources are local files, local directories, or pages that should be fetched and converted to markdown before upload. Input rules: files must be a JSON array of strings. Local directory reading is non recursive. URL entries must start with http:// or https:// . 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. Duplicate filenames are automatically suffixed as name 1.ext , name 2.ext , etc. Add a URL Source Use +url when adding one URL source and optionally passing a display name or parsing instruction. url must be http(s) . The server detects the platform from the URL automatically: URLs on a .feishu.cn or .larksuite.com subdomain are parsed with the Feishu pipeline (including sub documents, using the server's own Feishu parsing instruction — parse instruction is ignored for them); all other URLs are fetched as regular web pages. Generate Schema and Compile Generate the schema first when the knowledge base needs a c