Skip to main content

Documentation Index

Fetch the complete documentation index at: https://developer.kodexa.ai/llms.txt

Use this file to discover all available pages before exploring further.

Knowledge Commands

The kdx 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

CommandDescription
attachUpload a file or zipped folder to a knowledge item
downloadDownload the attachment from a knowledge item

Attach a File

kdx knowledge attach <knowledge-item-ref> --file <path> [--id <attachment-id>]
The knowledge item reference can be a UUID or slug. Examples:
kdx knowledge attach invoice-rules --file ./rules.md
kdx knowledge attach invoice-rules --file ./logo.png --id invoice-logo
When --id is omitted, the CLI creates an attachment ID from the filename. When --id is supplied, the output includes the Markdown attachment reference.
Uploading attachment to knowledge item 'invoice-rules'...
Attached: logo.png (hash: sha256:...)
Markdown reference: ![](attachment://invoice-logo)

Attach a Folder

kdx knowledge attach <knowledge-item-ref> --folder <path> [--id <attachment-id>]
The CLI zips the folder contents before upload. Example:
kdx knowledge attach invoice-rules --folder ./examples --id invoice-examples
Use folder attachments when the knowledge item needs a collection of files that should move together.

Download an Attachment

kdx knowledge download <knowledge-item-ref> [-o <path>]
Examples:
# Download using the original attachment filename
kdx knowledge download invoice-rules

# Download to a specific location
kdx knowledge download invoice-rules -o ./downloads/invoice-rules.zip
If no output path is supplied, the CLI asks the platform for attachment metadata and uses the original filename when available.

Use Cases

Use caseCommand
Attach a Markdown reference filekdx knowledge attach item-slug --file ./reference.md
Attach examples as one bundlekdx knowledge attach item-slug --folder ./examples --id examples
Pull a bundle for local reviewkdx knowledge download item-slug -o examples.zip
Update an image used in Markdownkdx knowledge attach item-slug --file ./diagram.png --id process-diagram

Troubleshooting

SymptomWhat to check
either --file or --folder must be specifiedPass one attachment source.
only one of --file or --folder can be specifiedUpload either a single file or a folder bundle, not both.
Folder upload fails because it is emptyConfirm the folder contains files; empty folders are not uploaded.
Markdown image does not renderConfirm the attachment ID matches the attachment://... reference.