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 --diagnostic-mode |
| pnpm | pnpm exec kibi status |
pnpm exec kibi-mcp --diagnostic-mode |
| Yarn | yarn exec kibi status |
yarn exec kibi-mcp --diagnostic-mode |
| Bun | bunx --no-install kibi status |
bunx --no-install kibi-mcp --diagnostic-mode |
Common environment check: npm exec -- kibi doctor.
Validation command: npm exec -- kibi check.
Avoid auto-install or hot-load commands for MCP startup (npx -y, pnpm dlx /
pnx, yarn dlx, or bunx without --no-install) 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", "--diagnostic-mode"],
"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", "--diagnostic-mode"],
"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", "--diagnostic-mode"]
}
}
}If you use pnpm, replace "command": "npx" and "args" with:
{
"servers": {
"kibi": {
"type": "stdio",
"command": "pnpm",
"args": ["exec", "kibi-mcp", "--diagnostic-mode"]
}
}
}kibi-opencode is an optional OpenCode plugin. It injects Kibi guidance,
provides the /init-kibi convenience command when the host supports it, and runs
background sync/check maintenance. It 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 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.
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