# pi-palette

Pi package that adds a searchable slash-command palette for commands, prompt templates, and skills.

## Why

When you remember part of a command or its description, but not the exact slash command name, `pi-palette` gives you a quick way to search the commands Pi already knows about in the current session.

It searches across:
- extension commands
- prompt templates
- skills

Search matches both:
- command name
- command description
- command source

Selecting a result prefills the editor with that slash command so you can keep editing before sending it.

## Usage

Install with pi:

```bash
pi install npm:@javimolina/pi-palette
```

Or with the installer:

```bash
npx @javimolina/pi-palette
```

If pi is already running, use:

```text
/reload
```

Then type:

```text
/p review
/p github pr diff
/p code review
/palette worktree
```

## Commands

- `/p [query]`
  - search commands, prompts, and skills by name or description
  - if no query is given, opens an input prompt
  - selecting a result prefills the editor with that slash command
- `/palette [query]`
  - alias for `/p`

## Local development

If you want to load this repo directly while developing it:

```bash
pi -e ~/pi-palette
```

Or add the repo path to `~/.pi/agent/settings.json` and run `/reload`.

## Notes

- Results are ranked with a small built-in token scorer; no extra fuzzy-search dependency is needed.
- The extension uses `pi.getCommands()`, so it searches the current session's available extension commands, prompts, and skills.
- Selecting an item prefills the editor instead of sending it immediately.
