This document provides detailed installation instructions for kibi.
Kibi depends on SWI-Prolog 9.0+. You must have swipl installed and available in your PATH before installing kibi.
The official SWI-Prolog project provides a Personal Package Archive (PPA) for Ubuntu that stays current with every release. This is the recommended installation method for Ubuntu users.
sudo apt-get install software-properties-common
sudo apt-add-repository ppa:swi-prolog/stable
sudo apt-get update
sudo apt-get install swi-prologOfficial Linux distribution packages are often outdated. For other Linux distributions, please refer to the official SWI-Prolog documentation:
- Unix/Linux installation guide - Comprehensive instructions for building from source or using other methods
- Stable downloads page - Source archives and binaries
- Flatpak - Available for most Linux distributions
After installation, verify that swipl is available:
swipl --versionYou should see output like SWI-Prolog version 10.x.x.
For a reproducible, CI-friendly workflow, install kibi as project-level dev dependencies. Use your project's package manager; npm is shown as the Node baseline:
npm install --save-dev kibi-cli kibi-mcp kibi-coreEquivalent project-local installs:
pnpm add -D kibi-cli kibi-mcp kibi-core
yarn add -D kibi-cli kibi-mcp kibi-core
bun add -d kibi-cli kibi-mcp kibi-corekibi-mcp depends on compatible kibi-cli and kibi-core versions, but
installing all three explicitly makes version pinning and lockfile review clear.
After installation, verify the tools from the local project using your package manager's local binary runner:
npm exec -- kibi --version
npx --no-install kibi-mcp --helpFor other package managers, use the same local-runner pattern:
| Package manager | CLI example | MCP example |
|---|---|---|
| npm | npm exec -- kibi status |
npx --no-install kibi-mcp |
| pnpm | pnpm exec kibi status |
pnpm exec kibi-mcp |
| Yarn | yarn exec kibi status |
yarn exec kibi-mcp |
Common environment check: npm exec -- kibi doctor (optional troubleshooting after initialization).
Validation command: npm exec -- kibi check.
The CLI and MCP server are peer agent-operation surfaces. MCP-capable hosts can call the public kb_* contracts directly; agents in trusted project-local shells can invoke the equivalent CLI JSON routes with kibi <route> --input <file|->. Neither path requires direct access to .kb/** files.
After installing the packages, use this short path:
- Run
kibi initto create repository infrastructure and Git hooks. - Ask your coding agent to “Bootstrap Kibi for this repository.” The agent calls the read-only
kb_plan_bootstrapplanner, asks only questions returned by aneeds_contextresult, and shows the exact plan for approval. - After approval, the agent passes the unchanged returned plan to
kb_apply_plan, then runskb_checkandkb_status. - Continue normal work with the seeded Kibi context. Use
kibi doctoronly when typed status says infrastructure is degraded.
Avoid auto-install or hot-load commands for MCP startup (npx -y, pnpm dlx /
pnx, or yarn dlx) unless you intentionally
want the client to fetch a package outside the project lockfile.
For OpenCode, add a local MCP server in opencode.json. OpenCode uses a token-array command field. This npm example is local-only and does not download packages at startup:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"kibi": {
"type": "local",
"command": ["npx", "--no-install", "kibi-mcp"],
"enabled": true
}
}
}If your project uses another package manager, keep the same MCP shape and use that manager's local binary runner. For example, pnpm projects can use:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"kibi": {
"type": "local",
"command": ["pnpm", "exec", "kibi-mcp"],
"enabled": true
}
}
}For VS Code, create .vscode/mcp.json. VS Code uses a command string with a separate args array:
{
"servers": {
"kibi": {
"type": "stdio",
"command": "npx",
"args": ["--no-install", "kibi-mcp"]
}
}
}If you use pnpm, replace "command": "npx" and "args" with:
{
"servers": {
"kibi": {
"type": "stdio",
"command": "pnpm",
"args": ["exec", "kibi-mcp"]
}
}
}kibi-opencode is an optional OpenCode plugin. It injects Kibi guidance,
provides the /kibi-bootstrap convenience command when the host supports it, and runs
background sync/check maintenance. Canonical bootstrap behavior lives in the
bundled kibi-bootstrap skill (kb_plan_bootstrap, preview, apply via the approved plan).
Generic MCP agents should start from
generic-agent onboarding. The plugin does not
ship a replacement kibi or kibi-mcp binary, so keep the base kibi-cli,
kibi-mcp, and kibi-core packages installed and keep the mcp.kibi server
configured separately.
npm install --save-dev kibi-opencode{
"plugin": ["kibi-opencode"]
}The OpenCode plugin auto-updates itself by default on OpenCode startup. This
only refreshes OpenCode's cached kibi-opencode package; it does not update
your project-local kibi-cli, kibi-mcp, or kibi-core dependencies. To lock
the plugin, use an exact semver entry in the plugin array:
{
"plugin": ["kibi-opencode@0.18.1"]
}Set autoUpdate: false in .opencode/kibi.json or
~/.config/opencode/kibi.json to disable the startup updater entirely.
The plugin's internal maintenance expects a kibi CLI command to be available
from the project context or PATH; the canonical setup above satisfies that by
installing kibi-cli project-locally.
kibi-codex is an optional adapter that gives Codex users prepackaged Kibi skills,
hooks, and MCP configuration. It builds on kibi-core, kibi-cli, and kibi-mcp and does not replace them.
Install through the repo-scoped Kibi marketplace:
codex plugin marketplace add Looted/kibi
codexThen run /plugins, choose Kibi Plugins, and install kibi-codex.
The marketplace lives at .agents/plugins/marketplace.json and points Codex at
./packages/codex, where the plugin manifest, skills, hooks, and MCP config are
stored. Codex resolves that path relative to the marketplace root.
The plugin's .mcp.json deliberately leaves cwd unset. Codex then launches
npx --no-install kibi-mcp from the active task workspace, so the MCP server
comes from the consumer project's local dependencies. Do not change this to
cwd: ".": that would run from the installed plugin cache instead. The manual
project-level MCP configuration below remains an independent fallback.
For local development or npm package smoke testing, you can also install the adapter package with your project-local dependencies:
npm install --save-dev kibi-codexThe official OpenAI Plugin Directory does not currently provide self-serve public plugin publishing. Use the repo marketplace or a local plugin fixture while developing/testing.
The installed plugin package contributes:
.codex-plugin/plugin.jsonmanifest.mcp.jsonMCP config pointing to your localkibi-mcpand inheriting the active task cwdhooks/hooks.jsonlifecycle hooksskills/*/SKILL.mdKibi workflow guidance
Review hook trust policy before enabling automatic trust:
- confirm the plugin source and hook paths are expected in your environment
- review local trust settings if your Codex host requires explicit plugin trust
- prefer warning-only behavior and disable automatic trust for unvetted sources
Manual MCP fallback (no plugin install required): keep base dependencies and configure your Codex MCP client directly:
[mcp_servers.kibi]
command = "npx"
args = ["--no-install", "kibi-mcp"]This fallback is supported for teams that do not use the adapter package.
kibi-cursor is an optional adapter that gives Cursor users prepackaged Kibi rules,
skills, commands, MCP configuration, and advisory editor hooks. It builds on
kibi-core, kibi-cli, and kibi-mcp and does not replace them.
Install from the repo marketplace at .cursor-plugin/marketplace.json, which points
at ./plugins/kibi-cursor. For local development, copy the built plugin into
Cursor's user-plugins directory (symlinks are rejected on WSL):
./scripts/sync-cursor-plugin-local.shOn WSL workspaces, Cursor reads ~/.cursor/plugins/local in your Linux home.
Restart Cursor or run Developer: Reload Window, then check Plugins → User.
You can also install the npm package for smoke testing:
npm install --save-dev kibi-cursorThe installed plugin package contributes:
.cursor-plugin/plugin.jsonmanifestmcp.jsonMCP config with a launcher that resolves and starts thekibi-mcpinstalled in the opened projecthooks/hooks.jsonadvisory lifecycle hooksrules/*.mdcworkflow and traceability guidanceskills/*/SKILL.mdKibi workflow skillscommands/kibi-bootstrap.mdbootstrap command guidance
The plugin launcher runs the consumer project's kibi-mcp with the opened
workspace as its current directory and with KIBI_WORKSPACE set to that root.
It does not download, bundle, or use a global Kibi runtime. Install the base
packages in each project before enabling the plugin MCP server.
Manual MCP fallback (no plugin install required):
{
"mcpServers": {
"kibi": {
"command": "npx",
"args": ["--no-install", "kibi-mcp"]
}
}
}See Cursor Plugins and packages/cursor/README.md
for hook behavior and local testing details.
Global install is convenient for interactive use across projects, but local install is preferred for reproducibility.
npm install -g kibi-cli kibi-mcp kibi-coreOptional Bun alternative:
bun add -g kibi-cli kibi-mcp kibi-coreIf you see "command not found" after installing kibi globally, you may need to adjust your PATH:
-
Check global npm/bin location:
npm config get prefix
The output shows where npm installs global packages.
-
Add to PATH (if needed): Add the global bin directory to your shell configuration:
# For bash (in ~/.bashrc or ~/.bash_profile): export PATH="$PATH:/usr/local/bin" # For zsh (in ~/.zshrc): export PATH="$PATH:/home/$USER/.npm-global/bin"
-
Reload your shell configuration:
source ~/.bashrc # or source ~/.zshrc
When a workspace is intentionally configured to run Kibi from a local checkout,
invoke that checkout's wrapper or binary directly. Do not use pnpm exec kibi-mcp in an application repository unless you intend to run that
repository's installed node_modules version. After changing package versions
or local package wiring in a checkout used by another workspace, rebuild before
testing or using OpenCode with those local artifacts:
bun run buildIf you encounter problems with SWI-Prolog:
- Refer to the SWI-Prolog build documentation for platform-specific guidance
- Check the SWI-Prolog FAQ
- Report issues on the SWI-Prolog forum
After installing kibi and verifying SWI-Prolog:
- Verify your environment:
npm exec -- kibi doctor - Initialize your project:
npm exec -- kibi init(installs hooks by default and adds.kb/to.gitignore) - Import documentation:
npm exec -- kibi sync - Explore the KB:
npm exec -- kibi search <query> - Inspect branch freshness:
npm exec -- kibi status - Validate integrity:
npm exec -- kibi check
See Entity Schema for details on entity types and when to use each. Example:
npm exec -- kibi doctor
npm exec -- kibi init
npm exec -- kibi sync
npm exec -- kibi search auth
npm exec -- kibi status
npm exec -- kibi checkFor more details, see:
- Quick Start - Brief getting started guide
- CLI Reference - Complete command documentation
- Troubleshooting - Recovery procedures