okf is a Go CLI toolkit for the Open Knowledge Format β agentic-first, JSON-native, vendor-neutral. A single binary alternative to Google's Python/Gemini-locked reference implementation.
Google's reference OKF implementation is Python + Gemini + BigQuery β vendor-locked to Google's cloud. okf is the vendor-neutral alternative: a single Go binary that works anywhere, speaks JSON natively, and is designed to be driven by any AI agent β not just Gemini.
--help text, guess at flags, screen-scrape stdout. Errors are English sentences you can't reliably branch on. Every agent integration is bespoke prompt engineering.okf schema once β a JSON manifest of every command, its args, output format, and exit codes. Drive the CLI from that spec. Branch on .error.kind. JSON is the default, not an opt-in flag.Built test-first (35 tests), Go stdlib-only, Apache 2.0. Every command outputs structured JSON on stdout by default β no --json flag, no screen-scraping.
Emits a complete JSON manifest of every command β name, description, flags, args, stdout format, exit codes. One call and an agent knows the full CLI surface. This is the moat.
Prints version info as JSON. Agents can check compatibility before driving the rest of the CLI.
Scaffolds a new empty OKF bundle with standard subdirectories (tables, datasets, playbooks), a root index.md, and a .gitignore. The starting point for an AI-driven documentation pipeline.
Generates index.md files into every directory β progressive disclosure per OKF spec Β§6. Agents navigate level by level instead of loading the entire bundle.
Checks every concept for required frontmatter (type), recommended fields (title, description, tags), non-empty body, and valid cross-links. Exits 1 if any errors are found. The CI quality gate.
Same checks as validate but only emits warnings β errors are suppressed. Exits 0 even with warnings. Use it to flag missing recommended fields without failing a build.
Lists every concept document with its ID, type, and title as JSON. The inventory query β what's in this bundle?
Filters concepts by --tag, --type, or --text. Find stale concepts, filter by category, or locate everything tagged auth β all as structured JSON.
Returns a single concept's full content β ID, file path, frontmatter (type, title, description, resource, tags), and markdown body β as JSON. The deep-read command.
Builds the directed cross-link graph from concept markdown links and prints nodes, edges, density, and summary statistics. Find orphan concepts and verify cross-link structure.
Lists every concept that links to a given concept β reverse-link lookup. Answer "who depends on this?" without grepping the entire bundle.
"Agentic first" means an external AI can discover and drive the CLI via okf schema β not that the CLI calls an LLM internally. Everything an agent needs is built into the binary itself.
| Code | Kind | Agent Strategy |
|---|---|---|
| 0 | success | Parse stdout JSON, continue |
| 1 | validation | Parse findings, fix the bundle, re-run |
| 2 | io | Check filesystem / paths, surface to caller |
| 3 | internal | Escalate to user β unexpected error |
| 4 | usage | Fix flags/args from schema, retry |
okf is pre-v1 β no release tarballs or Homebrew yet. Install via Go or build from source. One binary, no runtime dependencies.
go install github.com/okfcli/okf/cmd/okf@latest
git clone https://github.com/okfcli/okf.git
cd okf && make build
./okf --help
Then scaffold a bundle, add concepts, and validate:
Schema-discoverable. JSON-native. Vendor-neutral. One Go binary.