Skip to main content

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 > descriptionokf 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.mdtype: "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

  1. Walk input-dir for .md files (skip reserved names)
  2. Extract title from #, description from >
  3. Set type from parent dir name, timestamp from file mtime
  4. Write concept files with YAML frontmatter
  5. Generate index.md per directory — # Contents for files, # Directories for 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 .md has parseable YAML frontmatter with non-empty type
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

okf_cli-0.1.2.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

okf_cli-0.1.2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file okf_cli-0.1.2.tar.gz.

File metadata

  • Download URL: okf_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 17.4 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

Hashes for okf_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b90eaf364e1322e1f6cef6ef8f67e14bae5fa70d8578e307e8322de749c097a0
MD5 0154c8da6d7aab707c2e8fbcdc86a6fc
BLAKE2b-256 92d3ad2682d04ded84dcf3461c858e0817f31dd2c4ba6b525b88753def8dfa25

See more details on using hashes here.

File details

Details for the file okf_cli-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: okf_cli-0.1.2-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

Hashes for okf_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 01959f2936029c50ffe7f3e9a9c26dc6c37938c8a28a2009d8aff3c5e282601a
MD5 8fa9b3e66db9cd5e55db027cbb9ee6b1
BLAKE2b-256 d16fc22564322a0f2371b8f46dff700a38efd73fe25c3011815bb66f3c67b7c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page