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 import rows from relational and document databases, converting each record into a markdown page with structured frontmatter.

PostgreSQL

kiwifs import --from postgres \
  --dsn "postgres://user:pass@localhost:5432/mydb" \
  --table users \
  --prefix people/ \
  --root ./knowledge

Options

FlagDescription
--dsnPostgreSQL connection string (required)
--tableTable name
--queryCustom SQL query (overrides --table)
--columnsComma-separated fields to include
--prefixPath prefix in KiwiFS (default: table name)
--limitMax rows to import
--dry-runPreview without writing
kiwifs import --from postgres \
  --dsn "postgres://user:pass@localhost/mydb" \
  --query "SELECT id, name, email FROM users WHERE active = true" \
  --prefix active-users/

MySQL

kiwifs import --from mysql \
  --dsn "user:pass@tcp(localhost:3306)/mydb" \
  --table articles \
  --prefix articles/
Same flags as PostgreSQL. The DSN format follows Go’s mysql driver convention.

SQLite

kiwifs import --from sqlite \
  --db ./data.db \
  --table entries \
  --prefix entries/
FlagDescription
--dbPath to SQLite database file (required)
--tableTable name
--queryCustom SQL query (overrides --table)

MongoDB

kiwifs import --from mongodb \
  --uri "mongodb://localhost:27017" \
  --database myapp \
  --collection articles \
  --prefix articles/
FlagDescription
--uriMongoDB connection URI (required)
--databaseDatabase name (required)
--collectionCollection name (required)

Firestore

kiwifs import --from firestore \
  --project my-gcp-project \
  --collection users \
  --prefix users/
FlagDescription
--projectGCP project ID (required)
--collectionFirestore collection name (required)
Firestore requires Google Cloud credentials. Set GOOGLE_APPLICATION_CREDENTIALS or run within a GCP environment.

MCP usage

All database imports are also available via the kiwi_import MCP tool:
{
  "tool": "kiwi_import",
  "arguments": {
    "from": "postgres",
    "dsn": "postgres://user:pass@localhost/mydb",
    "table": "users",
    "prefix": "people/",
    "dry_run": true
  }
}
Use dry_run: true to preview what would be imported before writing any files.

Output format

Each imported record becomes a markdown file:
---
_imported_at: "2026-04-25T18:46:15Z"
_source: users
_source_id: pg:users:42
name: Jane Doe
email: jane@example.com
role: admin
---

# Jane Doe

> Auto-imported from users (row pg:users:42)
Re-importing the same data is idempotent — KiwiFS compares _source_id and field values, skipping unchanged records.
Last modified on May 4, 2026