CLI Reference¶
The okf-schema command-line tool provides subcommands for managing OKF bundles.
Global options¶
okf-schema [OPTIONS] COMMAND [ARGS]...
Option |
Description |
|---|---|
|
Show help message and exit. |
|
Show version and exit. |
|
Increase verbosity (up to 3). |
|
Suppress non-error output. |
okf-schema init¶
Create a new OKF bundle directory structure.
okf-schema init NAME
Creates a directory NAME/bundle/ with index.md, log.md, and _schema/_base.schema.yaml.
okf-schema new¶
Create a new OKF concept file with frontmatter template.
okf-schema new --path ROOT --name CONCEPT [--type TYPE] [--title TITLE]
Option |
Required |
Default |
Description |
|---|---|---|---|
|
✅ |
— |
Root directory for the new concept. |
|
✅ |
— |
Relative path of the concept (without |
|
— |
|
Concept type. |
|
— |
(derived from name) |
Concept title. |
okf-schema validate¶
Validate an OKF bundle against its schemas.
okf-schema validate --path BUNDLE [--schema-db DIR] [--strict]
Option |
Required |
Default |
Description |
|---|---|---|---|
|
✅ |
— |
Root directory of the OKF bundle. |
|
— |
|
Override schema directory. |
|
— |
|
Treat warnings as errors. |
okf-schema lint¶
Lint frontmatter: flatten nested lists, convert block-style to inline, and
auto-update links and backlinks fields from markdown body content.
okf-schema lint --path BUNDLE [--check] [--diff] [--links|--no-links]
Option |
Description |
|---|---|
|
Report files that would change without modifying. |
|
Show unified diff without modifying. |
|
Update |
|
Skip updating |
okf-schema list¶
List all concepts in an OKF bundle.
okf-schema list --path BUNDLE
Output format: path type title
okf-schema show¶
Show a single concept’s frontmatter and body.
okf-schema show --path BUNDLE CONCEPT_PATH
okf-schema index¶
Regenerate all index.md files in an OKF bundle.
okf-schema index --path BUNDLE
okf-schema stats¶
Show compact statistics for an OKF bundle.
okf-schema stats --path BUNDLE
okf-schema backlinks¶
List all concepts that link to the given target concept(s).
okf-schema backlinks --path BUNDLE TARGETS...
One line is printed per backlink in the form target ← source.
Multiple target paths may be provided. The .md extension is optional.
okf-schema search¶
Search concepts by title, description, type, or tags.
okf-schema search --path BUNDLE QUERY
Exit codes¶
Code |
Meaning |
|---|---|
|
Success. |
|
Validation or lint failure. |
|
Runtime error (file not found, etc.). |
See also¶
KB Commands — knowledge-base specific commands (
okfkb).Python API — programmatic interface to the same operations.
Getting Started — tutorial using these commands.
Validate in CI — CI examples for
validate --strict.Lint Before Commit — pre-commit hook for
lint.