Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.kiwifs.com/llms.txt

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

KiwiFS can export your entire knowledge base (or a subset of it) as JSONL or CSV. You can export from the CLI or the REST API.

Formats

Each line is a JSON object representing one file. Fields come from frontmatter.
{"path":"concepts/auth.md","title":"Authentication","status":"published","updated":"2026-04-20T10:00:00Z"}
With --include-content, each object includes the full markdown body.
{"path":"concepts/auth.md","title":"Authentication","status":"published","content":"# Authentication\n\nOverview of auth mechanisms.\n"}
With --include-links, each object includes link data.
{"path":"concepts/auth.md","title":"Authentication","outgoing_links":["concepts/oauth.md","concepts/jwt.md"],"incoming_links":["guides/security.md"]}
With --include-embeddings, each object includes a vector embedding array. A .schema.json sidecar file is also written alongside the output file, describing the embedding model and dimensions.
{"path":"concepts/auth.md","title":"Authentication","embedding":[0.0123,-0.0456,0.0789]}

CLI usage

Use the kiwifs export command to export from the command line.
kiwifs export --format jsonl --output knowledge.jsonl

CLI flags

FlagShortDefaultDescription
--root-r./knowledgeKnowledge root directory
--formatjsonlOutput format: jsonl or csv
--output-ostdoutOutput file path
--pathScope export to a subdirectory
--columnsComma-separated frontmatter fields to include
--include-contentfalseInclude the full markdown body
--include-linksfalseInclude outgoing and incoming link arrays
--include-embeddingsfalseInclude vector embeddings
--limit0Max files to export (0 = unlimited)

REST API

Export your knowledge base over HTTP using the /api/kiwi/export endpoint.
curl "http://localhost:3333/api/kiwi/export?format=jsonl&include-content=true" \
  -o knowledge.jsonl

Query parameters

ParameterDefaultDescription
formatjsonlOutput format: jsonl or csv
pathScope to a subdirectory
columnsComma-separated frontmatter fields
include-contentfalseInclude markdown body
include-linksfalseInclude link arrays
include-embeddingsfalseInclude vector embeddings
limit0Max files (0 = unlimited)
The response streams as application/x-ndjson (JSONL) or text/csv (CSV) with chunked transfer encoding. You can pipe the response directly into downstream tools.

Embeddings sidecar

When you export with --include-embeddings, KiwiFS writes a .schema.json sidecar file next to the output file. This file describes the embedding model used and the vector dimensions.
vectors.schema.json
{
  "embedding_model": "text-embedding-3-small",
  "dimensions": 1536,
  "distance_metric": "cosine"
}
Embeddings are only available if you have configured a vector search provider (such as pgvector with an OpenAI API key).

Common recipes

Export frontmatter as JSONL and commit it alongside your knowledge base for a searchable metadata snapshot.
kiwifs export --format jsonl -o .kiwi/metadata.jsonl
cd knowledge && git add .kiwi/metadata.jsonl && git commit -m "Update metadata export"
Export with content and embeddings, then feed the output into your static site search pipeline.
kiwifs export --format jsonl --include-content --include-embeddings -o search-index.jsonl
Export as CSV and load into your warehouse using standard ETL tools.
kiwifs export --format csv --columns title,status,updated,author -o export.csv
# Load into your warehouse
bq load --source_format=CSV mydataset.knowledge export.csv
Pipe JSONL output to jq for ad-hoc filtering and transformation.
# Find all draft documents
kiwifs export --format jsonl | jq 'select(.status == "draft")'

# Extract just titles and paths
kiwifs export --format jsonl | jq '{path, title}'

# Count documents by status
kiwifs export --format jsonl | jq -s 'group_by(.status) | map({status: .[0].status, count: length})'
For large knowledge bases, use --path to scope the export to a subdirectory and --limit to cap the number of files. This keeps export times predictable.
Last modified on May 4, 2026