Context documents

Use the khotan CLI to operate Khotan context documents. Add --json for machine-readable output; results go to stdout, diagnostics to stderr.

Commands

khotan context create

Usage: khotan context create --title <string> --kind <string> --content <string> [--slug <string>] [--description <string>] [--tags <a,b>] [--properties <json>] [--folder-id <string>]

Create a markdown context document.

Arguments & options:

khotan context delete

Usage: khotan context delete <slug>

Soft-delete a context document.

Arguments & options:

Safety: destructive — prompts for confirmation in a terminal and refuses in non-interactive sessions unless you pass --yes.

khotan context folders create

Usage: khotan context folders create --name <string> [--parent-id <string>]

Create a folder under an optional parent (omit parentId for the organization root).

Arguments & options:

khotan context folders delete

Usage: khotan context folders delete <id> [--recursive]

Soft-delete a folder. A non-empty folder requires --recursive, which also soft-deletes its subfolders and documents.

Arguments & options:

Safety: destructive — prompts for confirmation in a terminal and refuses in non-interactive sessions unless you pass --yes.

khotan context folders list

Usage: khotan context folders list

List the organization's context folders as a flat list, each carrying parentId, path, depth, and its direct active-document count.

khotan context folders update

Usage: khotan context folders update <id> [--name <string>] [--parent-id <string>]

Rename a folder (name) and/or move it under a new parent (parentId).

Arguments & options:

khotan context get

Usage: khotan context get <slug>

Get a context document including its markdown content, properties, and links, in a JSON envelope.

Arguments & options:

Usage: khotan context links list <slug>

List the projects and resources a document links to, each with its current name. A deleted target shows removed: true.

Arguments & options:

Usage: khotan context links set <slug> --links <json>

Replace a document's complete link set. Links not listed are removed, and every new target must be live in the organization.

Arguments & options:

khotan context list

Usage: khotan context list [--kind <string>] [--q <string>]

List the context document manifest (metadata only, never content).

Arguments & options:

khotan context raw

Usage: khotan context raw <slug>

Get exactly the document's markdown text, with no JSON envelope.

Arguments & options:

khotan context revisions get

Usage: khotan context revisions get <slug> <revision>

Get a single captured revision including its markdown snapshot and properties.

Arguments & options:

khotan context revisions list

Usage: khotan context revisions list <slug>

List a document's revision history, newest first (metadata only, never snapshot content).

Arguments & options:

khotan context revisions restore

Usage: khotan context revisions restore <slug> <revision>

Restore a document to an earlier revision by writing a new forward revision matching that snapshot (history is never rewritten).

Arguments & options:

Usage: khotan context search --q <string> [--k <number>] [--kind <string>]

Hybrid semantic + full-text search; returns ranked passages with their source slug.

Arguments & options:

khotan context update

Usage: khotan context update <slug> --expected-revision <number> [--title <string>] [--kind <string>] [--content <string>] [--description <string>] [--tags <a,b>] [--properties <json>] [--folder-id <string>] [--change-summary <string>]

Update a context document with compare-and-swap on expectedRevision.

Arguments & options: