Skip to main content

okf-cli — Open Knowledge Format tooling

Convert plain markdown directories into OKF-conformant knowledge bundles. okf bundle generates YAML frontmatter, concept types, provenance, and per-directory index.md files; okf validate, okf list, and okf read consume the resulting bundle.

Install

uv tool install okf-cli

Dev quickstart

uv sync
uv run okf --help
uv run okf --version

Commands

Command Purpose
okf bundle <input-dir> [output-dir] Convert markdown into an OKF bundle
okf validate <directory> Check OKF v0.2 §11 conformance
okf list <directory> List concepts (ID, type, title, description)
okf read <directory> <concept-id> Print a concept by ID
okf serve-mcp <directory> Serve a conformant bundle over MCP HTTP

Run okf <command> --help for options such as --default-type, --force, --strict, and --dry-run.

MCP server

Install the optional MCP dependency, then serve a conformant bundle over Streamable HTTP:

uv sync --extra mcp
uv run okf serve-mcp example_knowledge_base

The server binds to 127.0.0.1:8000 by default and listens at http://127.0.0.1:8000/mcp. Use --host and --port to change the bind address; --host 0.0.0.0 listens on all IPv4 interfaces. The server exposes read-only list_concepts and read_concept tools. Add --token <secret> to require the matching Authorization: Bearer <secret> header on MCP requests; without it, requests are unauthenticated. For example:

uv run okf serve-mcp example_knowledge_base --token "$OKF_MCP_TOKEN"

Use HTTPS (typically through a TLS-terminating proxy) when serving beyond localhost. The token is a command-line argument and may be visible in shell history or process listings; use this option only on a trusted network, and do not treat it as a replacement for TLS.

HTTPS with Caddy

When Caddy runs on the same machine, leave the MCP server bound to its default 127.0.0.1 address and let Caddy handle public HTTPS:

mcp.example.com {
    reverse_proxy 127.0.0.1:8000
}

Start the MCP server with authentication enabled:

uv run okf serve-mcp example_knowledge_base --token "$OKF_MCP_TOKEN"

Clients connect to https://mcp.example.com/mcp and send Authorization: Bearer <token>. Keep port 8000 private; Caddy should be the public entry point. Caddy can provision HTTPS automatically when the domain points to the server and is reachable on the required ports.

Quick example

uv run okf bundle example --default-type reference --force
uv run okf validate example_knowledge_base
uv run okf list example_knowledge_base
uv run okf read example_knowledge_base tables/customers

Documentation

Metadata

Release files for okf-cli 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for okf-cli 0.8.1
File Size Uploaded Provenance Actions
okf_cli-0.8.1.tar.gz 144.4 kB Without provenance Details for okf_cli-0.8.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for okf-cli 0.8.1
File Interpreter ABI Platform Actions
okf_cli-0.8.1-py3-none-any.whl Python 3 none any Details for okf_cli-0.8.1-py3-none-any.whl

Total release size: 163.3 kB

Release files / okf_cli-0.8.1.tar.gz

Download URL okf_cli-0.8.1.tar.gz
Size 144.4 kB
Tags Source
SHA-256 checksum
How to use checksums
acebc1e449af8b5e1eaaee242f718bb6584f7aeb922da66e5f51b3ed488a6e13
BLAKE2b-256 checksum
How to use checksums
39d8dfa1821cf72204c012ed292c77c67462fd2918b767e5fb407b907af4f7a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / okf_cli-0.8.1-py3-none-any.whl

Download URL okf_cli-0.8.1-py3-none-any.whl
Size 18.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6ba02904a56de6480d471d31344544abe8e054feff3db65809f56d359e8af6f
BLAKE2b-256 checksum
How to use checksums
73ca144ffb2b3fde9875997aa1d577be67586e43e846d7c3f69422606a781f34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for okf-cli 0.8.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page