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 enrich generates frontmatter, type, timestamps, and index files.

Quickstart

uv sync
uv run okf example              # output → bundled/
cat bundled/index.md
cat bundled/tables/orders.md

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.0.tar.gz (17.3 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.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for okf_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 79514f78fbdb5300615c56f25859fd368051ce2d68fe458f13ff69002264a8ec
MD5 cf93c943b56998c5b574820dfaa48429
BLAKE2b-256 23036c5d106436cbba6cd092a293804cb80164e328f47d6a7f5d5921bf56ebbb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: okf_cli-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8cd2594734389f2f52383a3066a8cd21a955f5846fc0550c6872dcbe3e5f1ed4
MD5 0e66c70534cb1c4a2af6a17a3841caee
BLAKE2b-256 a775d83a3cec98f1f949be07298712c195c841a4330fe39a2671886dbe16a04d

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