Kleia CLI
This CLI provides kleia command for a running instance of Kleia. Kleia is a reader for an
Open Knowledge Format (OKF) Knowledge Bundle; this
command lets coding agents and scripts read, search and list the Concepts in a bundle through it.
You need a running instance of Kleia to point it at. This package does not include the server. Find it for free at Kleia's home page.
Requires Python 3.12 or newer.
Install
uv tool install kleia # keeps a kleia command on your PATH
pipx install kleia # or with pipx
uvx kleia --help # or try it without installing
This CLI is designed to be agent-native. In fact, it assumes that CLI's such as this one have agents as their primary audience, and not people. To accomplish this it has been built according to the principles of an Agent eXperience Interface (AXI).
Output is compact TOON by default; commands take --json for the complete
envelope.
Connect
Save your Kleia address once, then use any command:
kleia configure https://kleia.example.com
kleia status
Use the address you open Kleia at in the browser, with https:// (or http://). kleia status shows the bundle,
the index and the Kleia version. To point a single command or a CI job at a Kleia without saving it, set KLEIA_URL.
Sign in
If your Kleia asks for sign-in, run kleia login. It opens your browser on Kleia's sign-in page and stores the
sign-in for the profile in your system keyring; it is never printed. kleia logout removes it. A Kleia in public mode
needs no sign-in, and kleia login tells you so.
The sign-in only travels over https://, or over http:// to a Kleia on the same machine. Signing in to a Kleia on
another machine over plain http:// is refused: use its https:// address.
Use it from an agent
A coding agent that runs shell commands can use the kleia command directly. Agents that speak MCP can skip the CLI
and use the instance's /mcp address instead.
Commands
| Command |
What it does |
kleia status |
Compact Source Status of the connected Kleia, with its version |
kleia list |
List the Concepts in the bundle; --kind all adds directory indexes and update logs |
kleia read [DOCUMENT] |
Read a document by Concept ID or path; no argument reads the bundle root |
kleia search "<query>" |
Search the bundle |
kleia relationships DOCUMENT |
Incoming and outgoing links for one document |
kleia wait-until-fresh |
Block until the index is fresh |
kleia configure URL |
Check a Kleia address and save it as a profile |
kleia login / kleia logout |
Sign in through the browser, or remove the sign-in |
kleia profiles |
Manage saved profiles |
Run kleia <command> --help for options. Exit codes: 0 success, 1 a timeout or an internal error, 2 a usage
error or nothing found, 3 Kleia unavailable, 130 interrupted.
License
MIT.