knowledge-base-cli
This crate provides the knowledge-base executable for validating, reading, querying, and updating a file-based knowledge base.
Installation
Install the executable from crates.io:
Every executable command reads the knowledge-base root from KNOWLEDGE_BASE_PATH:
--help and --version do not require KNOWLEDGE_BASE_PATH.
Commands
Validate the complete knowledge base:
Read stored resources by their typed identifiers:
Query entities using one or more typed property-value filters:
Multiple filters must all match. Results are deterministic YAML and default to 100 items from offset 0.
Inspect direct incoming, outgoing, and self-referential relationships:
Preview and apply a YAML statement manifest:
An example manifest is:
statements:
- entity: Q1
property: P1
value:
references:
The CLI assigns statement identifiers. Each item must contain entity, property, value, and at least one reference. A batch is applied completely or not at all.
Output and exit status
Read commands write stored files to standard output exactly as written. Query and mutation commands produce deterministic YAML. Validation diagnostics and command errors are written to standard error.
Commands exit unsuccessfully when configuration is missing, input is invalid, a resource cannot be read, validation diagnostics are found, or a mutation cannot be applied.