Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/fff-bun/test/multi-session.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ function startSession(
const events = new Map<string, EventHandler>();
const tools = new Map<string, RegisteredTool>();
const notifications: Array<{ message: string; level?: string }> = [];
let activeTools: string[] = [];

const flags: Record<string, unknown> = {
"fff-frecency-db": dbs.frecencyDbPath,
Expand All @@ -165,6 +166,10 @@ function startSession(
registerCommand: () => undefined,
registerFlag: () => undefined,
registerTool: (tool: RegisteredTool) => tools.set(tool.name, tool),
getActiveTools: () => activeTools,
setActiveTools: (names: string[]) => {
activeTools = names;
},
appendEntry: () => undefined,
};

Expand Down
6 changes: 4 additions & 2 deletions packages/pi-fff/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,22 @@ Parameters:

- `/fff-health` — show FFF status (indexed files, git info, frecency/history DB status)
- `/fff-rescan` — trigger a file rescan
- `/fff-mode <mode>` — switch mode (tool name change requires restart)
- `/fff-mode <mode>` — switch mode (tool name changes require `/reload`)

## Modes

- `tools-and-ui` (default): registers `fffind`, `ffgrep`, `fff-multi-grep` as additional tools + FFF-backed `@` autocomplete
- `tools-only`: additional tools only; keep pi's default `@` autocomplete
- `override`: replaces pi's built-in `find`, `grep` and adds `multi_grep` + FFF-backed `@` autocomplete

Mode precedence:
Startup mode precedence:
1. `--fff-mode <mode>` CLI flag
2. `PI_FFF_MODE=<mode>` environment variable
3. `mode` in the global config file
4. default (`tools-and-ui`)

When a session resumes, its most recent `/fff-mode` selection takes precedence over the startup resolution above. Switching to or from `override` takes effect after `/reload`, when the tools are registered again.

## Configuration

For persistent global configuration, create `pi-fff.json` in pi's agent directory (`~/.pi/agent/pi-fff.json` by default; `PI_CODING_AGENT_DIR` is respected):
Expand Down
Loading
Loading