# Pi (https://openknowledge.ai/docs/integrations/pi)

Use OpenKnowledge with Pi.

[Pi](https://pi.dev) is an open-source, minimal terminal coding harness. Instead of MCP, OpenKnowledge plugs into Pi through a bridge extension.

## Install

Run `ok init` in your project (or open the project in the OpenKnowledge desktop app — project setup writes the same files). Two things land in the project's `.pi/` directory:

- **`.pi/extensions/open-knowledge.ts`** — the bridge extension. On session start it launches OpenKnowledge's MCP server with the same resilient launcher every other editor uses, then registers each OpenKnowledge tool as a native Pi tool under an `ok_` prefix (`ok_exec`, `ok_search`, `ok_write`, …). The prefix keeps OpenKnowledge's `edit` / `write` from shadowing Pi's built-in file tools.
- **`.pi/skills/open-knowledge/`** — the OpenKnowledge skill, in the [Agent Skills](https://pi.dev/docs/latest) format Pi reads natively from `.pi/skills/`.

These files are managed by OpenKnowledge. Running `ok init` again refreshes them in place, while `ok deinit` removes them.

## Trust the project

Make sure Pi trusts the project folder. Pi does not load project-local extensions or skills from `.pi/` until the project is trusted. When you first run pi in the project, accept the trust prompt. When you use Pi inside OpenKnowledge, accepting its bridge setup prompt also grants folder trust. See [Pi folder trust](https://openknowledge.ai/docs/reference/what-open-knowledge-writes#pi-folder-trust) for the trust file, `PI_CODING_AGENT_DIR`, and cleanup requirements. See Pi's [project trust documentation](https://pi.dev/docs/latest/security#project-trust) for more details.

## Verify

Run `pi` in the project, and ask:

> List the first 5 documents you come across in this project.

Pi should call the OpenKnowledge `ok_exec` tool and respond with some of your documents.

If the `ok_` tools are missing: make sure you trusted the folder, then `/reload` (or restart `pi`). The first tool call can take a moment on a fresh machine — the launcher may be installing the OpenKnowledge CLI via `npx`. If Pi shows an "Open Knowledge tools unavailable" notice, install [Node.js 24+](https://nodejs.org) or the OpenKnowledge desktop app and reload.