Public Draft LKP-SDK

LKP-SDK (Command Line Interface)

Version 0.2.2 | Published: July 8, 2026 | Updated: July 9, 2026

Introduction

The Living Knowledge Protocol Software Development Kit (LKP-SDK) provides command-line tools for developers to validate LKP compliance locally and integrate it into automated workflows. This version focuses on a Python-based CLI for basic validation of LKP meta tags, lkp.json manifests, and JSON-LD structures, and is designed to be safely used in CI/CD pipelines.

Installation

Prerequisites

  • Python 3.8 or higher
  • pip (Python package installer)

Steps

  1. Download the SDK: Download the lkp_cli.py and requirements.txt files from the Downloads page.
  2. Make it Executable: Open your terminal and navigate to the directory where you saved lkp_cli.py. Then, run the following command:
    chmod +x lkp_cli.py
  3. Install Dependencies: Install the required Python libraries using the provided requirements.txt, which pins tested versions:
    pip install -r requirements.txt

Usage

To validate a web page or a local file, use the lkp_cli.py script followed by the URL or file path.

Validating a URL

./lkp_cli.py https://livingknowledgeprotocol.org

Validating a Local HTML File

./lkp_cli.py /path/to/your/document.html

Validating a Local lkp.json File (via HTML file in same directory)

If your lkp.json is in the same directory as your HTML file, the CLI will automatically attempt to find and validate it.

./lkp_cli.py /path/to/your/index.html

Note on lkp.json lookup

When validating a URL, the CLI looks for lkp.json at the root of the domain (e.g. https://example.com/lkp.json), regardless of the path of the page being validated. When validating a local file, the CLI looks for lkp.json in the same directory as the HTML file. This asymmetry is intentional: LKP requires a single, canonical lkp.json per domain.

Using the CLI in CI/CD pipelines

The CLI exits with status code 0 if all checks pass, and 1 if any check fails, so it can be used directly as a pipeline gate:

./lkp_cli.py https://example.com || exit 1

The CLI also identifies itself with a dedicated User-Agent header (LKP-Validator/0.1.0) when fetching remote pages, so it is not mistaken for an anonymous bot and blocked by servers that filter default HTTP client user agents.

Output

The CLI will provide a detailed report, indicating the presence and validity of:

  • LKP-specific meta tags
  • lkp.json manifest (including basic structure and version)
  • LKP LivingDocument JSON-LD schema

Example Output:

--- LKP Validation Report for: https://livingknowledgeprotocol.org ---
Source Type: URL

--- Meta Tags LKP ---
  lkp-version: 1.0.0
  lkp-status: Public Draft
  lkp-living-site: true
  lkp-modified: 2026-08-17
  LKP meta tags found. (PASS)

--- lkp.json Manifest ---
  lkp.json found at https://livingknowledgeprotocol.org/lkp.json (PASS)
  lkp.json has all required fields. (PASS)
    Protocol Version: 1.0.0
    Implementation Status: Public Draft / Reference

--- JSON-LD Metadata ---
  LKP LivingDocument JSON-LD found. (PASS)
    Document Name: Living Knowledge Protocol (LKP) | Open Protocol for Living Knowledge
    Date Modified: 2026-08-17T00:00:00Z
    Compliance Level: 1

--- Validation Complete ---
Result: All checks PASSED.

Note: the example above reflects a fully compliant reference page currently at Public Draft status. Ensure the lkp-status, dates, and version shown here stay in sync with the actual values published on the homepage and in the Registry.

Changelog

  • 0.2.2 (July 9, 2026): Legacy namespace tolerance (ns/1.0) is now time-bound: reported as WARN until December 31, 2026, then as FAIL. See LKP-0003 3.1.
  • 0.2.1 (July 9, 2026): The CLI now recognizes the legacy ns/1.0 JSON-LD namespace (see LKP-0003 3.1) and reports it as a compliant WARN with a migration hint, instead of a hard FAIL.
  • 0.2.0 (July 9, 2026): Added non-zero exit code for CI/CD integration, request timeouts, custom User-Agent header, packaged requirements.txt, clarified lkp.json lookup behavior for URL vs. local file validation.
  • 0.1.0 (July 8, 2026): Initial public release.

Contributing

This SDK is open-source. Contributions are welcome. Please refer to the Governance document for guidelines on proposing changes or improvements.