Knowledge Commands
Thekdx knowledge command manages attachments on knowledge items. Attachments are useful when a knowledge item needs supporting files such as example documents, reference datasets, prompt examples, diagrams, Markdown assets, or evaluation material.
Available Commands
| Command | Description |
|---|---|
attach | Upload a file or zipped folder to a knowledge item |
download | Download the attachment from a knowledge item |
Attach a File
--id is omitted, the CLI creates an attachment ID from the filename. When --id is supplied, the output includes the Markdown attachment reference.
Attach a Folder
Download an Attachment
Use Cases
| Use case | Command |
|---|---|
| Attach a Markdown reference file | kdx knowledge attach item-slug --file ./reference.md |
| Attach examples as one bundle | kdx knowledge attach item-slug --folder ./examples --id examples |
| Pull a bundle for local review | kdx knowledge download item-slug -o examples.zip |
| Update an image used in Markdown | kdx knowledge attach item-slug --file ./diagram.png --id process-diagram |
Troubleshooting
| Symptom | What to check |
|---|---|
either --file or --folder must be specified | Pass one attachment source. |
only one of --file or --folder can be specified | Upload either a single file or a folder bundle, not both. |
| Folder upload fails because it is empty | Confirm the folder contains files; empty folders are not uploaded. |
| Markdown image does not render | Confirm the attachment ID matches the attachment://... reference. |
