Skip to main content
You can embed KiwiFS directly in any Go application using the pkg/kiwi package. This gives you a fully functional markdown filesystem server without running a separate process.

Installation

Quick start

Create a KiwiFS server, configure it with options, and start serving.

Options

Configure KiwiFS behavior by passing option functions to kiwi.New.

Methods

The kiwi.Server type provides these methods.

Mount alongside an existing server

Use srv.Handler() to mount KiwiFS as a route within your existing HTTP application.
When mounting under a subpath, use http.StripPrefix so KiwiFS receives paths relative to its root.

Programmatic file operations

Use srv.Pipeline() to read and write files without going through HTTP.
The pipeline respects the same versioning and indexing rules as the HTTP API. Writes trigger git commits (if versioning is enabled) and update the search index automatically.

Graceful shutdown

Handle OS signals to shut down KiwiFS cleanly. This flushes pending async commits and releases file locks.
Always call srv.Close() or srv.Shutdown(ctx) before your program exits. Skipping this can leave stale git lock files or incomplete search indexes.
Last modified on May 8, 2026