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.
Core flags
Core flags
Protocol flags
Protocol flags
init
Create a knowledge directory from a template.Terminal
Flags
Flags
mcp
Start the MCP server. It opens a directory in-process (--root) or proxies to a running server (--remote), over stdio or Streamable HTTP.
Flags
Flags
--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
Flags
Flags
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 askiwifs refactor. Point your editor’s generic LSP client at it.
Terminal
Flags
Flags
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
--root, apply and revert send the change to that server so its index and live readers stay consistent.
Flags for plan, apply, and revert
Flags for plan, apply, and revert
Extra flags for apply and revert
Extra flags for apply and revert
Data
import
Import records from databases, files, or services. Each record becomes a markdown page with frontmatter.Common flags
Common flags
Source-specific flags
Source-specific flags
export
Export structured data (JSONL, CSV, Parquet) or render markdown to PDF, HTML, slides, or a static site.Data flags
Data flags
Document flags
Document flags
query
Run a DQL query against the index. Runkiwifs reindex first if the index is empty.
Terminal
Flags
Flags
aggregate
Group pages by a frontmatter field and compute aggregates.Terminal
Flags
Flags
view
Manage computed view pages (kiwi-view: true in frontmatter), whose body is generated from the DQL in kiwi-query.
Terminal
Flags
Flags
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
Flags
Flags
lint
Validate a knowledge directory against itsSCHEMA.md: orphans referenced by the schema, broken wiki links, empty files, and a missing schema. Exits 1 if any issues are found.
Terminal
Flags
Flags
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. Exits1 on error-severity issues.
Terminal
Flags
Flags
[janitor.execution_staleness] in .kiwi/config.toml. See Configuration.
analytics
Summarize knowledge health, coverage, and engagement (page views and failed searches).Terminal
Flags
Flags
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
Flags
Flags
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
Flags
Flags
widgets
Inspect widget fences and find blocks that could use them.Terminal
Flags
Flags
Agent setup
rules
View and export.kiwi/rules.md, the plain-markdown rules that steer agents across harnesses.
Terminal
Flags
Flags
token
Create, list, and revoke scoped API tokens in.kiwi/config.toml. The plaintext key is shown once on create.
Terminal
Flags
Flags
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 undermerged-from, for consolidation pipelines.
Terminal
Flags
Flags
clip
Fetch a web page, extract the article, and save it as markdown with frontmatter.Terminal
Flags
Flags
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
Flags
Flags
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
Flags
Flags
restore
Clone a knowledge base from a git remote.Terminal
Flags
Flags
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
Flags
Flags
update
Download the latestkiwifs release from GitHub and replace the running binary in place. No flags.
Terminal
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
Flags
Flags
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.Flags
Flags
Related
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.