Open Knowledge CLI Documentation
Frontmatter5 fields
type
Command Documentation
title
openknowledge connect
description
Register a local or remote knowledge base under a stable key.
timestamp

openknowledge connect

Add a local or remote bundle to the registry. Other commands can then use the assigned key instead of a path or URL.

Usage

okn connect <source>
okn connect <source> --as <key>
okn connect ./Wiki --access write
okn connect <git-url> --git-ref <ref> --git-subdir <path>
OptionDefaultDescription
sourcerequiredLocal directory, registry key, manifest URL, tar URL, or Git URL.
--as <key>bundle/folder nameExplicit registry key.
--access readwriteread
--git-ref <ref>remote defaultBranch, tag, or commit for Git sources.
--git-subdir <path>repository rootBundle root inside a Git repository.
--no-validateoffOmit validation status from success output.

A key starts with an ASCII letter or digit. It can contain letters, numbers, dots, underscores, and dashes. An implicit collision adds a numeric suffix. An explicit collision stops the command.

Source resolution

SourceBehavior
Local directoryRegister the resolved directory directly.
Website URLTry openknowledge.json at the path, then /.well-known/.
ManifestVerify its strict v1 contract, archive digest, and declared OKF spec.
.tar, .tar.gz, .tgz URLDownload and safely extract the archive.
Other HTTP(S) or Git URLPerform a shallow Git materialization.

The command stages remote materializations in the Open Knowledge cache. It publishes them atomically after validation.

Before registration, the command validates archive paths, symlinks, extraction sizes, Git selectors, and bundle boundaries. Cache provenance records final URLs, selectors, tree digest, and fetch time. It also records an archive digest or Git commit.

The normalized source and Git selectors define the cache identity. The registry key does not define it. A repeated connection can reuse its validated materialization.

connect does not inspect a reused cache for remote updates. Run okn registry refresh to get a new generation.

Access and validation

Local read connections hide editor links and block maintenance rule writes. write enables these CLI authoring functions. This setting does not change operating system permissions. It does not constrain other tools. A managed remote is always read-only.

Validation reports valid, warnings, invalid, or unknown. Validation does not prevent a connection. Root okf_bundle_* metadata can supply the default key, display title, purpose, and named entrypoints.

Powered by OpenKnowledge.sh