Open Knowledge Format tooling
Project description
okf-cli — Open Knowledge Format tooling
Converts plain markdown into OKF-conformant knowledge bundles. Domain experts write # Title then > description — okf bundle generates frontmatter, type, timestamps, and index files.
Install
uv tool install okf-cli
Then run:
okf bundle example # output → bundled/
cat bundled/index.md
cat bundled/tables/orders.md
Dev quickstart
uv sync
uv run okf example
Usage
okf <input-dir> [output-dir] [--default-type <name>]
| Argument | Description |
|---|---|
input-dir |
Directory of plain .md files |
output-dir |
Target directory (default: bundled) |
--default-type |
Type for root-level files (skip root files if omitted) |
Writing input files
Every .md file must start with:
# Title
> Description
> Second optional description line.
Everything after the description block is free-form — preserved unchanged.
Rules:
| Rule | Why |
|---|---|
First line must be # Title |
Tool reads title here |
Followed by > Description |
Tool reads description here |
| Folder name = concept type | tables/orders.md → type: "tables" |
Only .md files processed |
Non-.md files ignored |
Reserved names skipped: index.md, log.md, README.md |
OKF spec reserves these |
Violations:
| Condition | Behavior |
|---|---|
Line 1 not # Title |
Error, stop |
| Empty title | Error, stop |
No > description block |
Error, stop |
Root-level file without --default-type |
Skip file, warn, continue |
Root files need --default-type. Otherwise put files in named folders.
See the example/ directory for a sample of how to structure files.
How it works
- Walk
input-dirfor.mdfiles (skip reserved names) - Extract
titlefrom#,descriptionfrom> - Set
typefrom parent dir name,timestampfrom file mtime - Write concept files with YAML frontmatter
- Generate
index.mdper directory —# Contentsfor files,# Directoriesfor subdirs (recursive)
Output
Each concept becomes a markdown file with YAML frontmatter:
---
type: "tables"
title: "Customer Orders"
description: "One row per completed customer order across all channels."
timestamp: "2026-07-04T15:06:51+00:00"
---
Original body preserved as-is.
Every directory gets its own index.md:
# Contents
* [Customer Orders](orders.md) - One row per completed customer order across all channels.
# Directories
* [partitions](partitions/)
OKF Conformance
Generated bundles conform to OKF v0.1 (§9):
- Every non-reserved
.mdhas parseable YAML frontmatter with non-emptytype✓ - Reserved filenames follow spec structure ✓
- Consumers MUST tolerate missing optional fields, unknown types, broken links ✓
Project layout
okf-cli
├── OKF_SPEC.md # OKF specification
├── pyproject.toml # uv-managed Python project
├── src/okf/cli.py # Single-file CLI
├── tests/test_cli.py # Tests
└── example/ # Sample input markdown
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file okf_cli-0.1.1.tar.gz.
File metadata
- Download URL: okf_cli-0.1.1.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dae19a9942481f1592560ab5f20e940a01c42033713cda6bd158b8557f7fbde6
|
|
| MD5 |
9181fda937e5c46253b2c1f6d0d4f39f
|
|
| BLAKE2b-256 |
cba7dcdc5551d52bdf20b4156562d88b828a37beb01653af217f4069ac28962c
|
File details
Details for the file okf_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: okf_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79008ae90c98f9c8d6ed18235e2b3be894f681ef9755ddec86de5cc8cbab5b3d
|
|
| MD5 |
618a3ab0b7c1d1e44d80811fdbb2824d
|
|
| BLAKE2b-256 |
1e5d786baac35004bc567c9a4414a50dbf5125d43d16c9fe2bfdb401aff575dc
|