{"slug": "the-cli-your-ai-agent-drives-to-manage-your-knowledge-graph", "title": "The CLI your AI agent drives to manage your knowledge graph", "summary": "Okf v0.2.0, a Go CLI toolkit for the Open Knowledge Format, is now available as a vendor-neutral alternative to Google's Python/Gemini-locked reference implementation, verified against every reference bundle in Google's knowledge-catalog repository with zero errors. The tool implements the OKF v0.2 spec end to end, including provenance, trust, lifecycle, and attested computations, and outputs JSON for AI agents to branch on. It is built test-first with 88 tests, Go stdlib-only, and Apache 2.0 licensed, with commands like `okf list`, `okf show`, `okf validate`, and `okf schema` providing structured JSON output by default.", "body_md": "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.\n\nokf v0.2.0 implements the new OKF v0.2 spec end to end: provenance, trust, lifecycle, and attested computations, all parsed, validated, and surfaced as JSON your agent can branch on. Verified against every reference bundle in Google's knowledge-catalog repository with zero errors.\n\n`verified`\n\nevents: `unverified`\n\n, `machine-confirmed`\n\n, or `human-reviewed`\n\n. `okf list`\n\nand `okf show`\n\nexpose it, so an agent can decide what to trust before it acts.`sources`\n\nwith per-source credibility signals: author, usage count, last modified. Body footnotes join into source ids for per-claim attribution, and `okf validate`\n\nchecks the join both ways.`status`\n\n(draft, stable, deprecated) and `stale_after`\n\nmake freshness a plain date comparison. Validation flags a stale concept the day it expires; nothing silently rots.`runtime`\n\n, typed `parameters`\n\n, an `executor`\n\n, and a deterministic `attester`\n\n. okf validates the full contract, including that every contract path actually exists in the bundle.\n\n``` bash\n# Trust and lifecycle, surfaced as JSON\n$ okf list ./bundles/finance\n{\n\"concepts\": [\n    {\"id\":\"computations/revenue\", \"type\":\"Attested Computation\", \"status\":\"stable\", \"trust_tier\":\"human-reviewed\"},\n    {\"id\":\"metrics/margin-legacy\", \"type\":\"Metric\", \"status\":\"deprecated\", \"trust_tier\":\"machine-confirmed\"}\n  ]\n}\n# v0.1 bundles still work: legacy fields fall back, with migration warnings\n$ okf validate ./old-bundle\n{\n\"valid\": true,\n  \"warnings\": 1,\n  \"findings\": [{\"severity\":\"WARN\", \"message\":\"frontmatter: legacy 'timestamp' is superseded by 'generated.at' in OKF v0.2 (§13.1)\"}]\n}\n```\n\nGoogle's reference OKF implementation is Python + Gemini + BigQuery, vendor-locked to Google's cloud. `okf`\n\nis 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.\n\n`--help`\n\ntext, 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`\n\nonce: a JSON manifest of every command, its args, output format, and exit codes. Drive the CLI from that spec. Branch on `.error.kind`\n\n. JSON is the default, not an opt-in flag.Built test-first (88 tests), Go stdlib-only, Apache 2.0. Every command outputs structured JSON on stdout by default. No `--json`\n\nflag, no screen-scraping.\n\nEmits 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.\n\nPrints version info as JSON. Agents can check compatibility before driving the rest of the CLI.\n\nScaffolds a new empty OKF bundle with standard subdirectories (tables, datasets, playbooks), a root `index.md`\n\n, and a `.gitignore`\n\n. The starting point for an AI-driven documentation pipeline.\n\nGenerates `index.md`\n\nfiles into every directory for progressive disclosure per OKF spec §8, preserving the bundle's `okf_version`\n\ndeclaration. Agents navigate level by level instead of loading the entire bundle.\n\nChecks every concept against OKF v0.2: required frontmatter, cross-links, the provenance, trust, and lifecycle families, attested-computation contracts, and legacy v0.1 constructs. Exits 1 if any errors are found. The CI quality gate.\n\nSame checks as validate but only emits warnings. Errors are suppressed, so it exits 0 even with warnings. Use it to flag missing recommended fields without failing a build.\n\nLists every concept document with its ID, type, title, lifecycle status, and trust tier as JSON. The inventory query: what's in this bundle, and how much should I trust it?\n\nFilters concepts by `--tag`\n\n, `--type`\n\n, or `--text`\n\n. Find stale concepts, filter by category, or locate everything tagged `auth`\n\n, all as structured JSON.\n\nReturns a single concept's full content: frontmatter, markdown body, trust tier, staleness, provenance sources, and the attested-computation contract when present, all as JSON. The deep-read command.\n\nBuilds the directed cross-link graph from markdown links plus v0.2 derivation edges (sources, computations, executors, attesters) and prints nodes, edges, density, and summary statistics. Find orphan concepts and verify structure.\n\nLists every concept that links to a given concept: reverse-link lookup. Answer \"who depends on this?\" without grepping the entire bundle.\n\n\"Agentic first\" means an external AI can discover and drive the CLI via `okf schema`\n\n, not that the CLI calls an LLM internally. Everything an agent needs is built into the binary itself.\n\n``` bash\n// 1. Discover: load the schema manifest\n$ okf schema\n{\n\"name\": \"okf\",\n  \"description\": \"Go CLI toolkit for the Open Knowledge Format (OKF)\",\n  \"commands\": [\n    {\"name\":\"schema\", \"stdout\":\"json\", \"exit_codes\":[0,4]},\n    {\"name\":\"validate\", \"stdout\":\"json\", \"exit_codes\":[0,1,2,4]},\n    {\"name\":\"graph\", \"stdout\":\"json\", \"exit_codes\":[0,2,4]}\n    // ...8 more\n  ]\n}\n// 2. Drive: JSON on stdout, diagnostics on stderr\n$ okf graph ./my-bundle\n{\n\"command\": \"graph\",\n  \"node_count\": 3,\n  \"edge_count\": 3,\n  \"density_pct\": 50,\n  \"isolated\": 0,\n  \"nodes\": [{\"id\":\"tables/events_\",\"type\":\"BigQuery Table\"}],\n  \"edges\": [{\"from\":\"datasets/ga4\",\"to\":\"tables/events_\"}]\n}\n// 3. Recover: typed error envelopes, not English sentences\n$ okf validate ./broken-bundle\n{\n\"error\": {\n    \"kind\": \"validation\",\n    \"code\": 400,\n    \"reason\": \"validationError\",\n    \"message\": \"broken link: [Users] -> users.md (concept tables/users not found)\"\n  }\n}\n// exit code: 1 -> agent parses findings, fixes, re-validates\n// 4. Branch: exit codes map 1:1 to error kinds\n```\n\n| Code | Kind | Agent Strategy |\n|---|---|---|\n| 0 | success | Parse stdout JSON, continue |\n| 1 | validation | Parse findings, fix the bundle, re-run |\n| 2 | io | Check filesystem / paths, surface to caller |\n| 3 | internal | Escalate to user, unexpected error |\n| 4 | usage | Fix flags/args from schema, retry |\n\nv0.2.0 released, cosign-signed, SBOM-included. One binary, no runtime dependencies.\n\n`brew install okfcli/okf/okf`\n\n`go install github.com/okfcli/okf/cmd/okf@latest`\n\n```\ngit clone https://github.com/okfcli/okf.git\ncd okf && make build\n./okf --help\n```\n\nThen scaffold a bundle, add concepts, and validate:\n\n``` bash\n# Create a new bundle\n$ okf init ./my-bundle\n{\"command\":\"init\",\"bundle\":\"./my-bundle\",\"created\":true}\n# Write concept .md files into tables/, datasets/, playbooks/ ...\n# Validate the bundle against the OKF spec\n$ okf validate ./my-bundle\n{\"bundle\":\"./my-bundle\",\"command\":\"validate\",\"valid\":true,\"errors\":0,\"warnings\":0,\"findings\":[]}\n# Generate index.md files for progressive disclosure\n$ okf index ./my-bundle\n\n# Emit the knowledge graph as JSON\n$ okf graph ./my-bundle\n\n# Search by tag, type, or text\n$ okf search ./my-bundle --type Table --tag revenue\n```\n\nSchema-discoverable. JSON-native. Vendor-neutral. One Go binary.", "url": "https://wpnews.pro/news/the-cli-your-ai-agent-drives-to-manage-your-knowledge-graph", "canonical_source": "https://useokf.com/", "published_at": "2026-08-17 00:32:08+00:00", "updated_at": "2026-08-17 01:10:43.329430+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "ai-infrastructure"], "entities": ["okf", "Open Knowledge Format", "Google", "Gemini", "BigQuery", "Apache 2.0"], "alternates": {"html": "https://wpnews.pro/news/the-cli-your-ai-agent-drives-to-manage-your-knowledge-graph", "markdown": "https://wpnews.pro/news/the-cli-your-ai-agent-drives-to-manage-your-knowledge-graph.md", "text": "https://wpnews.pro/news/the-cli-your-ai-agent-drives-to-manage-your-knowledge-graph.txt", "jsonld": "https://wpnews.pro/news/the-cli-your-ai-agent-drives-to-manage-your-knowledge-graph.jsonld"}}