Skip to main content
Everything ships in one kiwifs binary. Run kiwifs --help to list commands, kiwifs <command> --help for details, and kiwifs --version to print the version. Most commands that work on a knowledge base take --root (-r), which defaults to ./knowledge.

Server and agents

serve

Start the HTTP server: REST API, web UI, and Streamable HTTP MCP at /mcp. Optional protocol servers (NFS, S3, WebDAV) run alongside.

init

Create a knowledge directory from a template.
Terminal
See Templates for what each one contains.

mcp

Start the MCP server. It opens a directory in-process (--root) or proxies to a running server (--remote), over stdio or Streamable HTTP.
Exactly one of --root or --remote is required. kiwifs serve already exposes MCP at /mcp, so you only need kiwifs mcp --http for a standalone MCP server. See MCP for client setup and the tool list.

mount

Mount a remote KiwiFS server as a local filesystem with FUSE. Not available on Windows.
Terminal
Install macFUSE on macOS or fuse3 on Linux first.

lsp

A language server on stdin and stdout. When your editor renames or moves markdown files, it answers with the link edits that keep every link pointing at them, computed by the same planner as kiwifs refactor. Point your editor’s generic LSP client at it.
Terminal

Restructuring

refactor

Move, merge, split, and edit pages from a manifest without breaking links. Each apply is one commit that you can revert. See Restructuring for the manifest format.
Terminal
If a KiwiFS server is serving --root, apply and revert send the change to that server so its index and live readers stay consistent.

Data

import

Import records from databases, files, or services. Each record becomes a markdown page with frontmatter.
See Import for per-source setup.

export

Export structured data (JSONL, CSV, Parquet) or render markdown to PDF, HTML, slides, or a static site.
See Data export and Document export.

query

Run a DQL query against the index. Run kiwifs reindex first if the index is empty.
Terminal

aggregate

Group pages by a frontmatter field and compute aggregates.
Terminal

view

Manage computed view pages (kiwi-view: true in frontmatter), whose body is generated from the DQL in kiwi-query.
Terminal

Quality and maintenance

check

CI-friendly scan: janitor hygiene checks, plus sequence gaps in <!-- seq:N --> markers when [sequences] is configured. Exits 0 when clean, 1 when issues are found, 2 when the scan fails.
Terminal

lint

Validate a knowledge directory against its SCHEMA.md: orphans referenced by the schema, broken wiki links, empty files, and a missing schema. Exits 1 if any issues are found.
Terminal

janitor

Scan for hygiene issues: stale, orphan, duplicate titles, contradictions, missing owner or status, empty pages, broken links, missing review dates, decisions in meeting notes, expired memory, and stale runbooks. Exits 1 on error-severity issues.
Terminal
Runbook staleness is opt-in through [janitor.execution_staleness] in .kiwi/config.toml. See Configuration.

analytics

Summarize knowledge health, coverage, and engagement (page views and failed searches).
Terminal

eval

Measure retrieval quality (Hit Rate, MRR, Precision@K, nDCG@K) for full-text and, when configured, vector search against a golden set in .kiwi/eval/ (<name>.qrels in TREC format and <name>.topics). Exits non-zero when a threshold is not met, so it can gate CI.
Terminal
See Search.

reindex

Rebuild the full-text index from the markdown files on disk. When vector search is configured, also rebuilds the vector index unless --fts-only is set.
Terminal

widgets

Inspect widget fences and find blocks that could use them.
Terminal

Agent setup

rules

View and export .kiwi/rules.md, the plain-markdown rules that steer agents across harnesses.
Terminal

token

Create, list, and revoke scoped API tokens in .kiwi/config.toml. The plaintext key is shown once on create.
Terminal
token revoke <key-prefix> takes the first 12 characters of the key. See Auth tokens.

memory report

List episodic files and whether any page cites them under merged-from, for consolidation pipelines.
Terminal

clip

Fetch a web page, extract the article, and save it as markdown with frontmatter.
Terminal

model download

Download ONNX embedding model and tokenizer files from Hugging Face for offline vector search. Models: all-minilm-l6-v2 (default, English, 384 dimensions) and multilingual-e5-small (multilingual and CJK, 384 dimensions).
Terminal
Then configure vector search with provider = "onnx" and the printed paths.

Backup and tooling

backup

Push the knowledge repo to a git remote. By default it fetches and rebases onto the backup branch first.
Terminal
See Backup sync.

restore

Clone a knowledge base from a git remote.
Terminal

bench

Benchmark single writes, bulk writes, reads, search, and storage overhead in a temporary directory with an in-process stack. Prints a markdown table.
Terminal

update

Download the latest kiwifs release from GitHub and replace the running binary in place. No flags.
Terminal
Other commands check for a newer version in the background, at most once every 24 hours.

KiwiFS Cloud

These commands work with hosted workspaces. See KiwiFS Cloud.

login

Sign in with the OAuth device flow: the CLI shows a code, you confirm it in your browser, and the session is stored in ~/.kiwifs/credentials.json.
Terminal

logout

Remove the stored credentials.
Terminal

whoami

Show the signed-in user.
Terminal

connect

Print or write MCP client config for a workspace, with your API key embedded.

Configuration

Settings in .kiwi/config.toml that the CLI reads.

MCP

Connect agents and browse the 78 tools.

Restructuring

The manifest format behind kiwifs refactor.

REST API

HTTP equivalents for most commands.
Last modified on October 19, 2026