Skip to main content
All commands use the kiwifs binary. Run kiwifs --help to list available commands, or kiwifs <command> --help for details on a specific command.

Core commands

Start the KiwiFS HTTP server and serve your knowledge base.
kiwifs serve [flags]
FlagShortDefaultDescription
--root-r./knowledgeKnowledge root directory
--port-p3333HTTP port
--host0.0.0.0Bind address
--searchsqliteSearch engine: sqlite or grep
--versioninggitVersioning strategy: git, cow, or none
--authnoneAuth type: none, apikey, perspace, or oidc
--api-keyAPI key (required if auth=apikey)
--oidc-issuerOIDC issuer URL
--oidc-client-idOIDC client ID
--async-committrueEnable async batched commits
--batch-window200Async commit batch window in milliseconds
--batch-max-size50Max paths per batch
--no-watchfalseDisable fsnotify watcher
Protocol flags
FlagDefaultDescription
--nfsfalseEnable userspace NFSv3 server
--nfs-port2049NFS port
--nfs-allowCIDRs allowed to mount NFS
--s3falseEnable S3-compatible API
--s3-port3334S3 port
--webdavfalseEnable WebDAV server
--webdav-port3335WebDAV port
--spaceRegister additional space (repeatable, format: name=path)
kiwifs serve --root ./my-docs --port 8080
Create a new knowledge directory with an optional template.
kiwifs init [flags]
FlagShortDefaultDescription
--root-r./knowledgeDirectory to initialize
--templateknowledgeTemplate: knowledge, wiki, runbook, research, tasks, or blank
kiwifs init
Templates provide a starter directory structure with sample files. Use blank if you want an empty knowledge base.
Start a Model Context Protocol server over stdio transport. Use this to connect KiwiFS to AI agents and LLM tools.
kiwifs mcp [flags]
FlagDefaultDescription
--rootKnowledge root (in-process mode)
--remoteKiwiFS server URL (proxy mode)
--api-keyAPI key for remote server
--spacedefaultSpace to scope to
--httpfalseEnable Streamable HTTP transport (instead of stdio)
--port8181HTTP port (only with --http)
Run KiwiFS directly within the MCP server process. Best for local development.
kiwifs mcp --root ./knowledge
Mount a remote KiwiFS server as a local filesystem using FUSE.
kiwifs mount <mountpoint> [flags]
FlagDefaultDescription
--remoteRemote KiwiFS server URL (required)
--api-keyAPI key (or KIWIFS_API_KEY env)
--bearerBearer token (or KIWIFS_BEARER env)
--basic-userHTTP Basic auth username
--basic-passHTTP Basic auth password (or KIWIFS_BASIC_PASS env)
--spacedefaultSpace name
kiwifs mount ~/mnt/kiwi --remote https://kiwi.example.com --api-key my-key
FUSE must be installed on your system. On macOS, install macFUSE. On Linux, install fuse3.

Data commands

Import data from databases, files, or third-party services into your knowledge base.
kiwifs import [flags]
FlagShortDefaultDescription
--fromSource type (see list below)
--root-r./knowledgeKnowledge root
--dsnDatabase connection string
--tableTable or collection name
--queryCustom SQL query
--filePath to data file
--prefixPath prefix in KiwiFS
--columnsComma-separated fields to include
--id-columnColumn to use as filename
--limitMax records to import
--dry-runfalsePreview without writing
Supported sources
CategorySources
Databasespostgres, mysql, sqlite, mongodb, firestore, dynamodb, redis, elasticsearch
Filescsv, json, jsonl, yaml, excel
Servicesnotion, airtable, gsheets, obsidian, confluence
kiwifs import --from postgres --dsn "postgres://user:pass@localhost/mydb" \
  --table articles --id-column slug --prefix articles/
Use --dry-run first to preview which files will be created before writing anything.
Export structured data (JSONL, CSV, Parquet) or render markdown into publication formats (PDF, HTML, slides, static site).
kiwifs export [flags]
Data formats
FlagShortDefaultDescription
--root-r./knowledgeKnowledge root
--formatjsonlData format: jsonl, csv, or parquet
--output-ostdoutOutput file
--pathScope to subdirectory
--columnsComma-separated frontmatter fields (CSV)
--include-contentfalseInclude full markdown body
--include-linksfalseInclude outgoing/incoming links
--include-embeddingsfalseInclude vector embeddings
--limit0Max files (0 = unlimited)
Document formats — use --format pdf, html, slides, or site with --path pointing at a file or directory:
FlagDefaultDescription
--themeTheme: paper, modern, minimal, dark, presentation
--self-containedfalseEmbed assets in HTML/PDF output
--bibliographyPath to .bib or .json bibliography
--cslCitation style: apa, ieee, chicago, vancouver, harvard
--crossreffalseEnable figure/table/equation cross-references
--pdf-engineautoPDF engine: typst or xelatex
--slide-formathtmlSlide output: html, pdf, or pptx
--site-nameStatic site title (MkDocs)
--site-urlCanonical site URL
--repo-urlEdit-on-GitHub link for generated site
kiwifs export --format jsonl -o knowledge.jsonl
See Data export and Document export for REST and MCP equivalents.
Run a Dataview Query Language (DQL) query against your knowledge base.
kiwifs query "<query>" [flags]
FlagShortDefaultDescription
--root-r./knowledgeKnowledge root
kiwifs query "TABLE title, status FROM 'concepts' WHERE status = 'draft'"
Run aggregation queries against frontmatter fields.
kiwifs aggregate [flags]
FlagShortDefaultDescription
--root-rKnowledge root
--groupFrontmatter field to group by
--calcAggregation functions: count, avg, sum, min, max (with field, e.g. avg:priority)
kiwifs aggregate --root ./knowledge --group status --calc count --calc avg:priority

Maintenance commands

Display a dashboard summarizing knowledge health, coverage, and engagement metrics (page views and failed searches).
kiwifs analytics [flags]
FlagShortDefaultDescription
--root-r./knowledgeKnowledge root
--scopePath prefix to limit results
--stale-threshold30Days before a page counts as stale
--formattextOutput format: text or json
kiwifs analytics --root ./knowledge
Check your knowledge base for issues such as broken links, missing frontmatter, or invalid YAML.
kiwifs lint [flags]
FlagShortDefaultDescription
--root-rKnowledge root
kiwifs lint --root ./knowledge
Scan for stale pages, orphans, broken links, duplicate titles, and other hygiene issues. Exits with code 1 when error-severity issues are found.
kiwifs janitor [flags]
FlagShortDefaultDescription
--root-r./knowledgeKnowledge root
--stale-days90Days before a page is considered stale
--jsonfalseEmit JSON instead of a human summary
kiwifs janitor --root ./knowledge --stale-days 60 --json
Rebuild the SQLite FTS5 index from markdown files on disk. When vector search is configured, also rebuilds the vector index unless --fts-only is set.
kiwifs reindex [flags]
FlagShortDefaultDescription
--root-r./knowledgeKnowledge root
--vectorfalseForce vector index rebuild (requires [search.vector] config)
--fts-onlyfalseSkip vector index even when configured
kiwifs reindex --root ./knowledge
Reindexing locks writes briefly. Run this during low-traffic periods on production servers.
Create and regenerate computed view files (kiwi-view: true in frontmatter).
kiwifs view [subcommand] [flags]
SubcommandPurpose
refresh <path>Regenerate a view file from its kiwi-query
listList all computed views
createCreate a new view file and regenerate it
FlagShortDefaultDescription
--root-r./knowledgeKnowledge root
--queryDQL query (create only, required)
--nameView title and filename (create only, required)
--pathDirectory for the new file (create only)
kiwifs view list --root ./knowledge

Rules, tokens, benchmarks, clipping, and memory

View or export the markdown rules file that steers agents across harnesses.
kiwifs rules
kiwifs rules edit
kiwifs rules export --format cursor
kiwifs rules sync --format cursor --output .cursor/rules/kiwi.md
SubcommandPurpose
(default)Print rules.md (local) or fetch from --remote.
editOpen the file in $EDITOR.
exportEmit Cursor, Claude, AGENTS, or OpenClaw formatted snippets.
syncExport and write to --output.
Remote operations accept --remote and --api-key like other commands.
Create scoped keys (read/write/admin) for automation or per-space access.
kiwifs token create --root ./knowledge --space docs --scope read --actor ci-reader
kiwifs token list --root ./knowledge
kiwifs token revoke kiwi_ro_abc1deadbeef
Tokens append to .kiwi/config.toml; the plaintext key is shown once on create.
Runs in a temporary directory with an in-process stack to benchmark writes, bulk writes, reads, and search.
kiwifs bench --files 200 --bulk 120 --search-files 5000 --search-queries 100
Outputs a markdown table suitable for issues or release notes.
kiwifs clip https://example.com/article --root ./knowledge --folder clips/ --tags research,web
Flags: --title, --tags, --folder, --actor (defaults to clipper).
kiwifs memory report --root ./knowledge --json
kiwifs memory report --episodes-prefix agent-runs/ --json
Summarizes episodic files vs merged pages for merge pipelines (no LLM consolidation).
FlagDefaultDescription
--root./knowledgeKnowledge root
--jsonfalseEmit JSON instead of text
--episodes-prefixfrom configOverride [memory] episodes_path_prefix

KiwiFS Cloud commands

Log in via OAuth device flow. Credentials are stored in ~/.kiwifs/credentials.json.
kiwifs login
kiwifs login --host https://app.kiwifs.com
FlagDefaultDescription
--hosthttps://app.kiwifs.comKiwiFS Cloud host
--client-idautoWorkOS client ID (optional override)
kiwifs logout
Removes ~/.kiwifs/credentials.json.
kiwifs whoami
Prints the email and display name for the stored Cloud session.
Generate MCP server configuration for connecting an agent to a KiwiFS Cloud workspace.
kiwifs connect <workspace-slug> [flags]
FlagDefaultDescription
--key$KIWI_API_KEYAPI key (optional after kiwifs login)
--writeWrite config to a client: cursor, claude-code, windsurf, claude-desktop, or auto
--hosthttps://api.kiwifs.comKiwiFS Cloud API host
--projectfalseWrite project-level config instead of global
kiwifs connect my-workspace --key kiwi_sk_abc123
Download and install the latest kiwifs binary from GitHub Releases.
kiwifs update
Replaces the currently running binary in place.

Backup and restore

Push your knowledge base to a git remote for backup.
kiwifs backup [flags]
FlagShortDefaultDescription
--root-rKnowledge root
--remoteGit remote URL (overrides config)
--branchBranch to push
--rebase-before-pushtrueFetch and rebase onto the backup branch before pushing
kiwifs backup --root ./knowledge --remote git@github.com:org/knowledge.git
By default, kiwifs backup fetches and rebases onto the backup branch before pushing. See Backup sync for configuration, opt-outs, and conflict handling.
Clone a knowledge base from a git remote.
kiwifs restore [flags]
FlagDefaultDescription
--fromGit remote URL (required)
--toLocal directory (required)
--branchBranch to check out
kiwifs restore --from git@github.com:org/knowledge.git --to ./knowledge
Last modified on May 31, 2026