Install the kb launcher¶
Each knowledge base carries its own copy of the kb tool, in its own
.venv. Inside a knowledge base, uv run kb … and the
tasks, uv run poe …, always work and need
nothing but uv. The launcher is an optional global kb command that
finds the right knowledge base and runs its tool, so you can type kb
from any directory. It runs kb commands only, not tasks, but most tasks
have a kb equivalent: kb search … for uv run poe search …,
kb rename-bundle NEW for uv run poe rename-bundle NEW.
Install¶
The launcher needs uv on your PATH.
Upgrade it later with:
The launcher does not change which version of the tooling a knowledge base uses. That version comes from the knowledge base itself; see Update from the template.
Use it¶
Every argument after the options goes to the knowledge base's own kb:
cd ~/notes-kb/notes-kb/ai # a folder inside the knowledge-base folder
kb find --type Concept # the knowledge base that contains this directory
kb -C ~/notes-kb check # an explicit path
kb -C work report # a registered name (see below)
The launcher picks the knowledge base in this order:
-C PATH|NAMEor--kb PATH|NAME;- the
KB_DIRenvironment variable, also a path or a registered name; - the nearest parent of the current directory that contains
schema/vocabulary.yamlandpyproject.toml(a knowledge base root); - the
defaultentry of the configuration file.
A path may be any directory inside a knowledge base; the launcher walks up to its root.
It then runs uv run --project <root> --quiet kb <args> with
KB_REPO_ROOT=<root> set. The current directory stays the same, so file
arguments relative to where you are keep working.
Register knowledge bases by name¶
Create ~/.config/okf-kb/config.toml (or $XDG_CONFIG_HOME/okf-kb/config.toml):
default = "work"
[knowledge-bases]
work = "~/work-kb"
notes = "~/notes-kb" # relative paths are relative to this file
Check the configuration:
kb --list # registered names and paths; * marks the default
kb --which # the knowledge base root a command would use from here
kb -C notes --which
A path that is not a knowledge base is marked (missing).
The launcher reads the configuration file only when it needs it: for a
registered name, for the default, and for --list. A path in -C or
KB_DIR, or a current directory inside a knowledge base, works even when
the file is broken. When it is needed, a broken file stops the launcher
with a message that names the file and the problem.
kb -h and kb <command> -h show the help of the knowledge base's own
tool; kb --help-launcher shows the launcher's.
Do not export KB_REPO_ROOT
The kb tool treats KB_REPO_ROOT as the knowledge base root. If you
export it in your shell profile, every call, including uv run kb inside
another knowledge base, goes to that one. The launcher sets it for each
call only. To choose a default, use default in the configuration file
or KB_DIR.